MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Count of spaces in a file using SORT

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Tue Mar 13, 2018 2:55 pm    Post subject: Count of spaces in a file using SORT Reply with quote

Hi,

I want to get a count of spaces in a mainframe file stored in TAPE and it has about 400 million records. Can SORT JCL be used to get this count?
Please let me know. Thanks.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Tue Mar 13, 2018 3:49 pm    Post subject: Re: Count of spaces in a file using SORT JCL Reply with quote

manu wrote:
Hi,

I want to get a count of spaces in a mainframe file stored in TAPE and it has about 400 million records. Can SORT JCL be used to get this count?
Please let me know. Thanks.


Depends. What is the LRECL and RECFM of the input file?

What exactly are you planning to achieve in here? If your data is compressed then you really do not have any spaces, but when you read it then it is uncompressed and presented it you in its original format.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Wed Mar 14, 2018 8:39 am    Post subject: Reply with quote

Hi Kolusu,

Thanks for the reply. The file is FB and LRECL is 310.This file has multiple record type and the record type count can varies for each entity. This file is FTPied and it is parsed by a Java process and it is taking lot of time. We are working on restructuring this file and wanted to get an rough idea on how much data vs. spaces. Some of the record type has only few bytes and rest of them are fillers. There are find commands in ISPF like find P'=",P'¬' ALL etc which gives the count. I wanted to know whether similar thing can be achieved on a bigger file by SORT JCL.I hope it makes sense. Thanks.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Wed Mar 14, 2018 3:54 pm    Post subject: Reply with quote

manu wrote:
Hi Kolusu,

Thanks for the reply. The file is FB and LRECL is 310.This file has multiple record type and the record type count can varies for each entity. This file is FTPied and it is parsed by a Java process and it is taking lot of time.


Looks like the JAVA process is written poorly. Irrespective of the language, the parsing shouldn't take that long. Also with FTP you can use the MODE C aka COMpress the data ( data transfer type must be EBCDIC.)

manu wrote:

We are working on restructuring this file and wanted to get an rough idea on how much data vs. spaces. Some of the record type has only few bytes and rest of them are fillers. There are find commands in ISPF like find P'=",P'¬' ALL etc which gives the count. I wanted to know whether similar thing can be achieved on a bigger file by SORT JCL.I hope it makes sense. Thanks.


manu,

You can count the number of spaces using DFSORT, however it involves in 2 passes of data. The first step is to SQZ and remove the embedded spaces and then convert the file to VB with VLTRIM and this will give you the true length of the record in the RDW. However there are a few issues that needs to handle like if the record is ALL spaces.

So a simple program (less than 100 lines even in cobol) will be able to read and count the number of spaces in a single pass and much easier to maintain.
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
manu
Beginner


Joined: 26 Dec 2002
Posts: 47
Topics: 19

PostPosted: Fri Mar 16, 2018 9:50 am    Post subject: Reply with quote

ok, Thanks Kolusu for your inputs. I will try the suggested options.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group