Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

copying selective records using sort.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sudhakar_lendave

New User


Joined: 21 Nov 2006
Posts: 48
Location: mumbai

PostPosted: Thu Oct 11, 2007 10:53 am    Post subject: copying selective records using sort.
Reply with quote

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
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 11:01 am    Post subject: Reply to: copying selective records using sort.
Reply with quote

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
View user's profile Send private message
sudhakar_lendave

New User


Joined: 21 Nov 2006
Posts: 48
Location: mumbai

PostPosted: Thu Oct 11, 2007 11:02 am    Post subject:
Reply with quote

Aaru, can you give me SORT SYNTAX, please.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 11:13 am    Post subject: Reply to: copying selective records using sort.
Reply with quote

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
View user's profile Send private message
sudhakar_lendave

New User


Joined: 21 Nov 2006
Posts: 48
Location: mumbai

PostPosted: Thu Oct 11, 2007 11:27 am    Post subject:
Reply with quote

aaru, will it matter if my input file is VB format?
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 11:35 am    Post subject: Reply to: copying selective records using sort.
Reply with quote

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
View user's profile Send private message
sudhakar_lendave

New User


Joined: 21 Nov 2006
Posts: 48
Location: mumbai

PostPosted: Thu Oct 11, 2007 12:05 pm    Post subject:
Reply with quote

So what will be first four bytes in the output file if the RECFM of o/p file is FB?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Thu Oct 11, 2007 12:07 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 12:13 pm    Post subject: Reply to: copying selective records using sort.
Reply with quote

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
View user's profile Send private message
sudhakar_lendave

New User


Joined: 21 Nov 2006
Posts: 48
Location: mumbai

PostPosted: Thu Oct 11, 2007 12:23 pm    Post subject:
Reply with quote

please suggest me links, if such kind of topic is already discussed..
thanks in advance.
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 2:53 pm    Post subject: Reply to: copying selective records using sort.
Reply with quote

The manuals are available in the following link.

http://ibmmainframes.com/manuals.php

Check the link named "DFSORT getting started" under DFSORT.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Oct 11, 2007 9:02 pm    Post subject:
Reply with quote

sudhakar,

All of the DFSORT books are available online from:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. SORT trick needed bshkris SYNCSORT 6 Tue May 02, 2017 4:35 am
No new posts SORT JSON type of data maxsubrat DFSORT/ICETOOL 8 Wed Apr 19, 2017 6:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us