View previous topic :: View next topic |
Author |
Message |
manu Beginner
Joined: 26 Dec 2002 Posts: 47 Topics: 19
|
Posted: Tue Mar 13, 2018 2:55 pm Post subject: Count of spaces in a file using SORT |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Mar 13, 2018 3:49 pm Post subject: Re: Count of spaces in a file using SORT JCL |
|
|
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 |
|
 |
manu Beginner
Joined: 26 Dec 2002 Posts: 47 Topics: 19
|
Posted: Wed Mar 14, 2018 8:39 am Post subject: |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Wed Mar 14, 2018 3:54 pm Post subject: |
|
|
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 |
|
 |
manu Beginner
Joined: 26 Dec 2002 Posts: 47 Topics: 19
|
Posted: Fri Mar 16, 2018 9:50 am Post subject: |
|
|
ok, Thanks Kolusu for your inputs. I will try the suggested options. |
|
Back to top |
|
 |
|
|