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 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 DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Replacing same string with different ... vickey_dw DFSORT/ICETOOL 6 Wed Feb 22, 2017 10:44 pm


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