IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

copying selective records using sort.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 1287
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 11:01 am
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
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: 1287
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 11:13 am
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
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: 1287
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 11:35 am
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
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: 1436
Location: Bangalore,India

PostPosted: Thu Oct 11, 2007 12:07 pm
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: 1287
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 12:13 pm
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
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: 1287
Location: Chennai, India

PostPosted: Thu Oct 11, 2007 2:53 pm
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 Developer


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

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

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 7
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top