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 How to write Specific Fields from Mul... Padhu SYNCSORT 6 Thu Jul 06, 2017 10:26 am
No new posts replacing junk with hyphen Nitin32 DFSORT/ICETOOL 10 Fri Jun 02, 2017 7:47 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Sum Fields ballaswaroop DFSORT/ICETOOL 4 Tue May 02, 2017 11:07 am


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