MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Problem deleting lines with an edit macro

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF
View previous topic :: View next topic  
Author Message
Nork1
Beginner


Joined: 22 Jan 2004
Posts: 4
Topics: 2

PostPosted: Sun Jan 25, 2004 6:52 am    Post subject: Problem deleting lines with an edit macro Reply with quote

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
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Sun Jan 25, 2004 7:24 am    Post subject: Reply with quote

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
View user's profile Send private message
ofer71
Intermediate


Joined: 12 Feb 2003
Posts: 358
Topics: 4
Location: Israel

PostPosted: Sun Jan 25, 2004 1:28 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Nork1
Beginner


Joined: 22 Jan 2004
Posts: 4
Topics: 2

PostPosted: Sun Jan 25, 2004 2:54 pm    Post subject: Reply with quote

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
View user's profile Send private message
Mervyn
Moderator


Joined: 02 Dec 2002
Posts: 415
Topics: 6
Location: Hove, England

PostPosted: Sun Jan 25, 2004 3:10 pm    Post subject: Reply with quote

You're welcome, Nork1.

I've added the 'do' and 'end' in my post. Rolling Eyes
_________________
The day you stop learning the dinosaur becomes extinct
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> TSO and ISPF All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group