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

Excluding all header records except the first


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
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 Join multiple records using splice DFSORT/ICETOOL 5
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top