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
 

 

Excluding all header records except the first

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

New User


Joined: 17 Nov 2006
Posts: 7

PostPosted: Wed Mar 04, 2009 4:31 pm    Post subject: Excluding all header records except the first
Reply with quote

Hi,

I've a cancatenated file which has 20 to 22 header records(record code = 0) follwed by data records(record code = 1). I need to retain the first header record and skip all the header records (i.e. records with first byte value 0) then copy all data records. I think an example will make it clear.

Input:
0XXXXXNJUGAYGSGYD
0XHDGHFDGHHFYEFGH
0KSJHDJSHDUEHREUF
0..............................
(like this around 20 to 22 headers)
1AAAAAAAAAAAAAAA
1BBBBBBBBBBBBBBB
1jdsfhdhfgerurufrufhrug


Output:
0XXXXXNJUGAYGSGYD
1AAAAAAAAAAAAAAA
1BBBBBBBBBBBBBBB
1jdsfhdhfgerurufrufhrug

Can anyone pls suggest the possible sort card for this requirement?

Thanks in advance

Vishwesh
Back to top
View user's profile Send private message

nelson.pandian

Active User


Joined: 09 Apr 2008
Posts: 133
Location: Phoenix, AZ

PostPosted: Wed Mar 04, 2009 7:49 pm    Post subject:
Reply with quote

Hi Vishwesh,

Hope this DFSORT/ICETOOL JCL will give you desire output.

Code:
//STEP1    EXEC PGM=ICETOOL,                                 
//            COND=(0,NE)                                     
//TOOLMSG  DD SYSOUT=*                                       
//DFSMSG   DD SYSOUT=*                                       
//IN1      DD *                                               
0XXXXXNJUGAYGSGYD                                             
0XHDGHFDGHHFYEFGH                                             
0KSJHDJSHDUEHREUF                                             
1AAAAAAAAAAAAAAA                                             
1BBBBBBBBBBBBBBB                                             
1JDSFHDHFGERURUFRUFHRUG                                       
/*                                                           
//T1       DD DSN=&&T1,DISP=(MOD,PASS),SPACE=(CYL,(1,1),RLSE)
//OUT      DD SYSOUT=*                                       
//TOOLIN   DD *                                               
  COPY FROM(IN1) TO(T1) USING(CTL1)                           
  COPY FROM(IN1) TO(T1) USING(CTL2)                           
  COPY FROM(T1) TO(OUT)                                       
/*                                                           
//CTL1CNTL DD *                                               
  OPTION STOPAFT=1             
/*                             
//CTL2CNTL DD *               
  INCLUDE COND=(1,1,CH,EQ,C'1')
/*

OUTPUT
Code:
0XXXXXNJUGAYGSGYD     
1AAAAAAAAAAAAAAA       
1BBBBBBBBBBBBBBB       
1JDSFHDHFGERURUFRUFHRUG
Back to top
View user's profile Send private message
vishweshkrishnadevaram

New User


Joined: 17 Nov 2006
Posts: 7

PostPosted: Wed Mar 04, 2009 8:12 pm    Post subject: Reply to: Excluding all header records except the first
Reply with quote

I checked it and it's working. Thanks alot Nelson.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Mar 04, 2009 10:31 pm    Post subject:
Reply with quote

vishweshkrishnadevaram,

Use the following JCL which will give you the results in just 1 pass. I assumed that your LRECL is 80 and recfm FB

Code:

//STEP0100 EXEC PGM=SORT   
//SYSOUT   DD SYSOUT=*     
//SORTIN   DD *             
0XXXXXNJUGAYGSGYD
0XHDGHFDGHHFYEFGH
0KSJHDJSHDUEHREUF
0..............................
(like this around 20 to 22 headers)
1AAAAAAAAAAAAAAA
1BBBBBBBBBBBBBBB
1jdsfhdhfgerurufrufhrug
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                         
  INREC IFTHEN=(WHEN=(1,1,ZD,EQ,0),OVERLAY=(81:SEQNUM,2,ZD))
  OUTFIL BUILD=(1,80),OMIT=(81,2,ZD,GT,1)
 /*
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 Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Validating file with multiple header/... mohitsaini DFSORT/ICETOOL 6 Thu Apr 13, 2017 1:53 am
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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