MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to splice header file records with detail records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
nguyenh
Beginner


Joined: 09 Mar 2004
Posts: 52
Topics: 6

PostPosted: Mon Feb 27, 2006 4:48 pm    Post subject: How to splice header file records with detail records Reply with quote

Hi Frank and all,
I am looking for a way to splice the Header file records with the Detail file records (See HEADER FILE & DETAIL FILE) so that the output file also contains member name in header file that is missing the detail records (leading with blank, See EXPECTED OUTPUT)

HEADER FILE
Code:

************************FILE01*****************
************************FILE02*****************
************************FILE03*****************
************************FILE04*****************
************************FILE05*****************
************************FILE06*****************
************************FILE07*****************
************************FILE08*****************


DEATAIL FILE:
Code:

P03K6099J               D5550000020020D3 FILE02
P03K6099J               D5550000020020D3 FILE02
P03K6099J               D5550000020020D3 FILE02
P03K6099J               D5550000020020D3 FILE03
P03K6099J               D5550000020020D3 FILE05
P03K6099J               D5550000020020D3 FILE05
P03K6099J               D5550000020020D3 FILE06
P03K6099J               D5550000020020D3 FILE07


EXPECTED OUTPUT:
Code:

                                         FILE01
P03K6099J               D5550000020020D3 FILE02
P03K6099J               D5550000020020D3 FILE02
P03K6099J               D5550000020020D3 FILE02
P03K6099J               D5550000020020D3 FILE03
                                         FILE04
P03K6099J               D5550000020020D3 FILE05
P03K6099J               D5550000020020D3 FILE05
P03K6099J               D5550000020020D3 FILE06
P03K6099J               D5550000020020D3 FILE07
                                         FILE08


Thank you very very much for your helps!
Nguyenh
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Feb 27, 2006 6:07 pm    Post subject: Reply with quote

Nguyehn,

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input files have RECFM=FB and LRECL=47, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//HDR DD DSN=... header file (FB/47)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//CON DD DSN=*.T1,VOL=REF=*.T1,DISP=(OLD,PASS)
//    DD DSN=... detail file (FB/47)
//OUT DD DSN=... output file (FB/47)
//TOOLIN DD *
COPY FROM(HDR) TO(T1) USING(CTL1)
SPLICE FROM(CON) TO(OUT) ON(42,6,CH) -
  KEEPNODUPS WITHALL WITH(1,47)
/*
//CTL1CNTL DD *
  OUTREC FIELDS=(42:25,6)
/*

_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group