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

Repeat the header records in the detail records


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

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Wed Apr 16, 2008 6:05 pm
Reply with quote

Hi,
I am having a FB file with lrecl of 80.The i/p is like below.

Input :
Code:

NEW:                           ABCDEFGH
N-         123
N-         234
N-         456
K-         345
K-         345

NEW:                           ABCDXXXX
N-         123
N-         234
N-         456
K-         345



I want to create the o/p file with header record in the start position.

Output Required :
Code:

NEW:                           ABCDEFGH
ABCDEFG N-         123
ABCDEFG N-         234
ABCDEFG N-         456
ABCDEFG K-         345
ABCDEFG K-         345

NEW:                           ABCDXXXX
ABCDXXXX N-         123
ABCDXXXX N-         234
ABCDXXXX N-         456
ABCDXXXX K-         345


The header(s) are at column 36 of length 8.

Thanks
Krishy
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Wed Apr 16, 2008 8:23 pm
Reply with quote

Have you looked at Extract certain output from LISTDS or better yet PRINTDS - I struggle with this one..?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Apr 17, 2008 10:47 pm
Reply with quote

sril.kirshy,

The following DFSORT/ICETOOL JCL will give you the desired results

Code:

//STEP0100 EXEC PGM=ICETOOL                             
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN       DD *                                         
NEW:                               ABCDEFGH             
N-         123                                           
N-         234                                           
N-         456                                           
K-         345                                           
K-         345                                           
NEW:                               ABCDXXXX             
N-         123                                           
N-         234                                           
N-         456                                           
K-         345                                           
//OUT      DD SYSOUT=*                                   
//TOOLIN   DD *                                         
  SPLICE FROM(IN) TO(OUT) ON(81,8,CH)         -         
  WITHALL WITH(1,80) KEEPBASE USING(CTL1)               
//CTL1CNTL DD *                                         
  INREC IFTHEN=(WHEN=INIT,                               
       OVERLAY=(81:SEQNUM,8,ZD)),                       
        IFTHEN=(WHEN=(1,4,CH,EQ,C'NEW:'),               
       OVERLAY=(81:SEQNUM,8,ZD,36,8)),                   
        IFTHEN=(WHEN=NONE,                               
       OVERLAY=(89:SEQNUM,8,ZD,                         
                81:81,8,ZD,SUB,89,8,ZD,M11,LENGTH=8))   
                                                         
  SORT FIELDS=COPY                                       
  OUTFIL FNAMES=OUT,                                     
  IFTHEN=(WHEN=(1,4,CH,EQ,C'NEW:'),BUILD=(01,80)),       
  IFTHEN=(WHEN=NONE,BUILD=(89,8,X,1,71))                 
/*
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 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 Build a record in output file and rep... DFSORT/ICETOOL 11
No new posts EZT program to build a flat file with... All Other Mainframe Topics 9
Search our Forums:

Back to Top