View previous topic :: View next topic
|
Author |
Message |
gorman Currently Banned New User
Joined: 23 Sep 2008 Posts: 10 Location: Chennai
|
|
|
|
Hi,
I am trying below file-aid batch job to replace multiple entries with multiple options but not able to succeed.
Code: |
//STEP01 EXEC PGM=FILEAID
//SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//SYSTOTAL DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//DD01 DD *
1234ABCD
2345BCDE
//DD01O DD SYSOUT=*
//SYSIN DD *
$$DD01 COPY REPL=(5,EQ,C'A',C'1')
$$DD01 COPY REPL=(5,EQ,C'B',C'2')
/*
|
Would you please tell me how to achieve it?
Thanks. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
try this
Code: |
$$DD01 COPY IF=(5,EQ,C'A'),
REPL=(5,C'1'),
IF=(5,EQ,C'B'),
REPL=(5,C'2')
|
if I interpreted your request correctly.
Gerry |
|
Back to top |
|
|
gorman Currently Banned New User
Joined: 23 Sep 2008 Posts: 10 Location: Chennai
|
|
|
|
Gerry, though I get correct results with the solution you've suggested, the job ends with MAXCC=4 and below info was shown in SYSOUT:
Quote: |
CONTROL CARD DOES NOT BEGIN WITH $$DD
.....SKIPPING TO NEXT $$DD CARD
|
May I know how to copy the unchanged records also to output along with changed ones?
Thanks. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
I'm not sure why you are getting a MAXCC=4, you may need to post your entire job output and code.
In the meantime you can try this in order to copy unchanged records as well
Code: |
$$DD01 COPYALL IF=(5,EQ,C'A'),
REPL=(5,C'1'),
IF=(5,EQ,C'B'),
REPL=(5,C'2')
|
Gerry |
|
Back to top |
|
|
gorman Currently Banned New User
Joined: 23 Sep 2008 Posts: 10 Location: Chennai
|
|
|
|
Gerry, thank you very much.............
Now, I am able to copy all records (changed + unchanged). Job ends with MAXCC=0.
The problem was I had a blank line after the code in the SYSIN
Thanks. |
|
Back to top |
|
|
|