kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Sun Nov 28, 2004 9:26 pm Post subject: |
|
|
Roger29,
Fileaid can be used to copy the members as well as replace the contents while copying.
basically the following control cards will copy and replace the contents in the output PDS.
Code: |
$$DD01 COPYMEM MEMBERS=*,
EDITALL=(1,0,C'&&AAA',C'2001-07-01'),
EDITALL=(1,0,C'&&BBB',C'2001-09-01')
|
Since your replacing contents are coming a sequential , you need to generate the control cards. The stepo100 will generate the control cards shown above reading your sequential file. Now step0200 will use the generated control cards and produce the desired results.
Code: |
//STEP0100 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//DD01 DD *
20010701 20010901
//DD01O DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN DD *
$$DD01 USER MOVE=(1,80C' '),
MOVE=(1,C'$$DD01 COPYMEM MEMBERS=*,'),
WRITE=DD01O,OUT=1,
MOVE=(1,80C' '),
MOVE=(7,C'EDITALL=(1,0,C'),
MOVE=(+0,C"'&&AAA',C'"),
MOVE=(+0,4,1),
MOVE=(+0,C'-'),
MOVE=(+0,2,5),
MOVE=(+0,C'-'),
MOVE=(+0,2,7),
MOVE=(+0,C"'),"),
WRITE=DD01O,OUT=1,
MOVE=(1,80C' '),
MOVE=(7,C'EDITALL=(1,0,C'),
MOVE=(+0,C"'&&BBB',C'"),
MOVE=(+0,4,10),
MOVE=(+0,C'-'),
MOVE=(+0,2,14),
MOVE=(+0,C'-'),
MOVE=(+0,2,16),
MOVE=(+0,C"')"),
WRITE=DD01O,OUT=1
/*
//STEP0200 EXEC PGM=FILEAID,REGION=4M
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//DD01 DD DSN=USERID.PDS1,
// DISP=SHR
//DD01O DD DSN=USERID.PDS2,
// DISP=SHR
//SYSIN DD DSN=&T1,DISP=OLD
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|