View previous topic :: View next topic |
Author |
Message |
Nork1 Beginner
Joined: 22 Jan 2004 Posts: 4 Topics: 2
|
Posted: Sun Jan 25, 2004 6:52 am Post subject: Problem deleting lines with an edit macro |
|
|
Hi,
I wish to use an edit macro to look through 5000 PDS members and delete 2 lines of JCL:
//STEP010 EXEC PGM=PROG1,PARM='xxxx'
//SYSPRINT DD SYSOUT=*
If the PROG1 line is found, I need to delete the next line, however all I seem to be able to come up with is a macro that deletes the first occurrence of 'SYSPRINT' or the first line of JCL regardless of whether the PROG1 line exists or not.
My edit macro is something along the lines of:
X ALL
F 'PROG1' FIRST
F 'SYSPRINT' NEXT
DEL NX ALL
My question is what is the syntax to check for the existence of PROG1 then, if found, delete the following line?
Any assistance will be much appreciated. Thanks. |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Sun Jan 25, 2004 7:24 am Post subject: |
|
|
Nork1,
This is one way, off the top of my head:
Code: |
address isredit
"MACRO"
"X ALL"
"F 'PGM=PROG1,' FIRST"
if rc = 0 then
do
"F P'=' X"
"DEL NX ALL"
"END"
end
else
"CANCEL"
|
Have a browse through the manual:
http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ISPEDT04/CCONTENTS?DT=20000712131031
You should be able to find several other ways. _________________ The day you stop learning the dinosaur becomes extinct
Last edited by Mervyn on Sun Jan 25, 2004 3:09 pm; edited 1 time in total |
|
Back to top |
|
|
ofer71 Intermediate
Joined: 12 Feb 2003 Posts: 358 Topics: 4 Location: Israel
|
Posted: Sun Jan 25, 2004 1:28 pm Post subject: |
|
|
Another solution:
Code: |
/* REXX */
ADDRESS ISREDIT "MACRO PROCESS"
ADDRESS ISREDIT "FIND 'EXEC PGM=PROG1,PARM' FIRST"
IF RC = 0 THEN DO
ADDRESS ISREDIT "(EXECLINE) = LINE .ZCSR"
NEXTLINE = EXECLINE + 1
ADDRESS ISREDIT "DELETE &NEXTLINE"
END
ELSE
ADDRESS ISREDIT "END"
EXIT
|
O.
________
drug testing kit
Last edited by ofer71 on Sat Feb 05, 2011 11:11 am; edited 1 time in total |
|
Back to top |
|
|
Nork1 Beginner
Joined: 22 Jan 2004 Posts: 4 Topics: 2
|
Posted: Sun Jan 25, 2004 2:54 pm Post subject: |
|
|
Mervyn, ofer71...
thanks for your quick responses, you've helped me achieve what I set out to do. I'll spend tomorrow with my nose in a manual!
Thanks again. |
|
Back to top |
|
|
Mervyn Moderator
Joined: 02 Dec 2002 Posts: 415 Topics: 6 Location: Hove, England
|
Posted: Sun Jan 25, 2004 3:10 pm Post subject: |
|
|
You're welcome, Nork1.
I've added the 'do' and 'end' in my post. _________________ The day you stop learning the dinosaur becomes extinct |
|
Back to top |
|
|
|
|