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

Subset of a File


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Tue Jun 02, 2009 11:35 am
Reply with quote

I have a dataset which is FB and Lrecl is 20. The input datasets looks as below

ZZS1234567890
0987654321000
0102030405060
1111111111111
2222222222222
ZZL1234567890
0000000000000
1111111111111
...
...
...

My requirement is to select all the records after ZZS (including ZZS) till ZZL encounters.

The ZZS or ZZL present in first three position and is not present in that position thru out the dataset again.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jun 02, 2009 8:50 pm
Reply with quote

suzeet,

Using the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008) you can easily get the desired results like this:

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                 
ZZS1234567890                                                   
0987654321000                                                   
0102030405060                                                   
1111111111111                                                   
2222222222222                                                   
ZZL1234567890                                                   
0000000000000                                                   
1111111111111                                                   
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                               
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'ZZ'),PUSH=(21:1,3))
  OUTFIL BUILD=(1,20),INCLUDE=(21,3,CH,EQ,C'ZZS')               
/*


If you don't have the July, 2008 PTF installed, ask your System Programmer to install it (it's free).

For complete details on the new WHEN=GROUP and the other new functions available with PTF UK90013, see:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
suzeet

New User


Joined: 16 May 2005
Posts: 54

PostPosted: Wed Jun 03, 2009 10:06 am
Reply with quote

Yes we have the latest ptf installed!!!and it works like charm...Thanks...
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 8
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top