View previous topic :: View next topic
|
Author |
Message |
sudhakar_lendave
New User
Joined: 21 Nov 2006 Posts: 48 Location: mumbai
|
|
|
|
Hi,
i have a file with multiple record layout in it(multiple 01 levels) and it is having VB format.
These multiple levels are differentiated by 5th character in the file.
if 5th character is ' '(space) then i have to copy that record to the output file.
for other value in 5th character, i don't want that record.
Please tell me, if it is possible using SORT. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Sudhakar,
Yes, that is possible with the INCLUDE condition. As it is a VB, do add 4 bytes for the RDW. So mention '9'th byte instead of '5' in the INCLUDE condition. |
|
Back to top |
|
|
sudhakar_lendave
New User
Joined: 21 Nov 2006 Posts: 48 Location: mumbai
|
|
|
|
Aaru, can you give me SORT SYNTAX, please. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Use the foll SORT Card.
Code: |
SORT FIELDS=COPY
INCLUDE COND=(9,1,CH,EQ,C' ')
|
Please refer to the sort manuals. |
|
Back to top |
|
|
sudhakar_lendave
New User
Joined: 21 Nov 2006 Posts: 48 Location: mumbai
|
|
|
|
aaru, will it matter if my input file is VB format? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Quote: |
aaru, will it matter if my input file is VB format? |
The above sort card is for your requirement (VB file). In a VB file the actual data starts from the 5th byte as the first 4 bytes are for RDW.
Refer to the available sort manuals. Post if you have still got any queries. |
|
Back to top |
|
|
sudhakar_lendave
New User
Joined: 21 Nov 2006 Posts: 48 Location: mumbai
|
|
|
|
So what will be first four bytes in the output file if the RECFM of o/p file is FB? |
|
Back to top |
|
|
murmohk1
Senior Member
Joined: 29 Jun 2006 Posts: 1436 Location: Bangalore,India
|
|
|
|
Sudhakar,
Quote: |
what will be first four bytes in the output file if the RECFM of o/p file is FB? |
If your IP and OP differ in file formats..... the sort card Aaru is not helpful. You need something more than that.
Search DFSORT forum for file format conversions. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Quote: |
what will be first four bytes in the output file if the RECFM of o/p file is FB? |
The first 4 bytes in a FB file will have the first 4 bytes of data. please post your requirement clearly.
Do you want the output file to be FB? If yes, then use the VTOF in your sortcard.
Else as suggested, search in the forum. |
|
Back to top |
|
|
sudhakar_lendave
New User
Joined: 21 Nov 2006 Posts: 48 Location: mumbai
|
|
|
|
please suggest me links, if such kind of topic is already discussed..
thanks in advance. |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
sudhakar,
All of the DFSORT books are available online from:
Use [URL] BBCode for External Links
Quote: |
please suggest me links, if such kind of topic is already discussed. |
You haven't clearly defined your requirement, so how can you expect anybody to point you to a previous discussion of the requirement. Aaru showed you how to INCLUDE VB input records with a blank in the 5th data position. Then you threw in a vague comment about FB output records, but didn't respond when asked if you wanted to convert the VB input records to FB output records. If you want help here, you need to state your requirement clearly.
What is the LRECL of your VB input file? Do you want the output file to be VB or FB? If you want it to be FB, what do you want the LRECL to be?
As an example, if you wanted to include the records and convert them from an input file with RECFM=VB and LRECL=84 to an output file with RECFM=FB and LRECL=80, you could use the following DFSORT job:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (VB/84)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
INCLUDE COND=(9,1,CH,EQ,C' ')
OUTFIL VTOF,BUILD=(5,80)
/*
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. |
|
Back to top |
|
|
|