Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm
No new posts Merging 2 records at multiple rows wi... Bijesh DFSORT/ICETOOL 2 Wed Dec 06, 2017 1:50 am
No new posts Increment number for every group of r... srajendran2 DFSORT/ICETOOL 7 Thu Nov 09, 2017 10:31 pm
No new posts Matching and unmatched records!! Vignesh Sid SYNCSORT 3 Thu Nov 09, 2017 11:22 am
No new posts Formatting multiple records to a sing... Vignesh Sid SYNCSORT 3 Tue Nov 07, 2017 12:22 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us