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

Replacing some fields of File1 with records from File2


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

New User


Joined: 08 Sep 2003
Posts: 32
Location: Toronto <-> Bangalore

PostPosted: Wed Dec 05, 2007 2:14 am
Reply with quote

Hi,

I have FILEA with following JCL statements itself as records of the file.

//CATLOG12 PROC
//SXEDSPLT EXEC PGM=ICETOOL
//INDD DD DSN=XED#DD.B.DBUNLOAD.SXEDUNLD,DISP=SHR
//XXXXXXXX DD DSN=XED#DD.B.DBUNLOAD.XXXXXXXX,
// DISP=(NEW,CATLG,DELETE),SPACE=(16933,(500,500),RLSE),
// DCB=(RECFM=FB,LRECL=16933)

and FILEB with records as below:
REPORT01
REPORT02
REPORT03

I want all "XXXXXXXX" from FileA to be replaced with records from FileB. i.e.
//REPORT01 DD DSN=XED#DD.B.DBUNLOAD.REPORT01,

Last 3 JCL statements in FileA should be repeated for all the records available on FileB. I' am expecting the output file as below.
//CATLOG12 PROC
//SXEDSPLT EXEC PGM=ICETOOL
//INDD DD DSN=XED#DD.B.DBUNLOAD.SXEDUNLD,DISP=SHR
//REPORT01 DD DSN=XED#DD.B.DBUNLOAD.REPORT01,
// DISP=(NEW,CATLG,DELETE),SPACE=(16933,(500,500),RLSE),
// DCB=(RECFM=FB,LRECL=16933)
//REPORT02 DD DSN=XED#DD.B.DBUNLOAD.REPORT02,
// DISP=(NEW,CATLG,DELETE),SPACE=(16933,(500,500),RLSE),
// DCB=(RECFM=FB,LRECL=16933)
//REPORT03 DD DSN=XED#DD.B.DBUNLOAD.REPORT03,
// DISP=(NEW,CATLG,DELETE),SPACE=(16933,(500,500),RLSE),
// DCB=(RECFM=FB,LRECL=16933)

Your help is appreciated.

Thanks,
Karthik.
Back to top
View user's profile Send private message
karthikbabudh

New User


Joined: 08 Sep 2003
Posts: 32
Location: Toronto <-> Bangalore

PostPosted: Wed Dec 05, 2007 3:15 am
Reply with quote

Hi,

Came back to add one more point, Number of records on File B is not known. It may be 3 or 5 or 10 or so.

Thanks,
Karthik.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Dec 05, 2007 3:38 am
Reply with quote

Does FileA always look exactly as you've shown? If not, what can change in terms of the number of records and what's in the records?
Back to top
View user's profile Send private message
karthikbabudh

New User


Joined: 08 Sep 2003
Posts: 32
Location: Toronto <-> Bangalore

PostPosted: Wed Dec 05, 2007 3:47 am
Reply with quote

Frank,

There will not be any change in File A in terms of number of records and contents.

Thanks,
Karthik.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Dec 05, 2007 4:28 am
Reply with quote

In that case, I'd suggest keeping it simple with a DFSORT job like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN...  input fileB
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL REMOVECC,
    HEADER1=('//CATLOG12  PROC',/,
     '//SXEDSPLT EXEC PGM=ICETOOL',/,
     '//INDD DD DSN=XED#DD.B.DBUNLOAD.SXEDUNLD,DISP=SHR'),
    BUILD=(C'//',1,8,C' DD DSN=XED#DD.B.DBUNLOAD.',1,8,C',',80:X,/,
     C'// DISP=(NEW,CATLG,DELETE),SPACE=(16933,(500,500),RLSE),',/,
     C'// DCB=(RECFM=FB,LRECL=16933)')
/*
Back to top
View user's profile Send private message
karthikbabudh

New User


Joined: 08 Sep 2003
Posts: 32
Location: Toronto <-> Bangalore

PostPosted: Wed Dec 05, 2007 6:13 am
Reply with quote

Frank,

You are amazing. Thanks.

Karthik
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Dec 05, 2007 6:45 am
Reply with quote

Glad I could help.
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 EZT program to build a flat file with... All Other Mainframe Topics 9
No new posts JCL sortcard to print only the records DFSORT/ICETOOL 11
Search our Forums:

Back to Top