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
 

 

Repeat the header records in the detail records

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

Active User


Joined: 30 Jul 2005
Posts: 182
Location: hyderabad

PostPosted: Wed Apr 16, 2008 6:05 pm    Post subject: Repeat the header records in the detail records
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: 2150
Location: At my coffee table

PostPosted: Wed Apr 16, 2008 8:23 pm    Post subject:
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    Post subject:
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    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 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
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm
No new posts To Merge mutliple records into a sing... anandgbe DFSORT/ICETOOL 6 Wed Feb 22, 2017 8:49 am


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