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
 

 

Replacing some fields of File1 with records from File2

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Replacing some fields of File1 with records from File2
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    Post subject: Reply to: Replacing some fields of File1 with records from F
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 Moderator


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

PostPosted: Wed Dec 05, 2007 3:38 am    Post subject:
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    Post subject: Reply to: Replacing some fields of File1 with records from F
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 Moderator


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

PostPosted: Wed Dec 05, 2007 4:28 am    Post subject:
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    Post subject: Reply to: Replacing some fields of File1 with records from F
Reply with quote

Frank,

You are amazing. Thanks.

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

DFSORT Moderator


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

PostPosted: Wed Dec 05, 2007 6:45 am    Post subject:
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    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 Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Access SQLCA fields inside a stored p... gangapd DB2 4 Thu Oct 27, 2016 10:20 am


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