I think this was the best suggestion. A combination of the macro that
runs through members and the macro that has conditional logic.
http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.f54em00/sedmac3.htm
http://www-01.ibm.com/support/knowledgecenter/SSLTBW_2.1.0/com.ibm.zos.v2r1.f54em00/simcxtzs.htm?lang=en
In article <
289078500.2231416.14310...@mail.yahoo.com> you wrote:
> Hi,
> ISPF EDIT MACRO is the best option here. Basically you do a find for the string and if you don't find it(rc > 0) then you insert the line.
> or example:
> ADDRESS ISREDIT;"MACRO"
> "F ' JCLLIB ORDER='? FIRST"?IF RC>0 THENDO? ? line ="//name JCLLIB ORDER=target.proclib "?
> ??? /*insert after line 5 the value of the variable line*/
> ? ? "LINE_AFTER 5 = (LINE)"? END
> the above works on 1 member. in the IBM manual they have a sample to run a macro against all members.
> For what you're doing this is the best way.
> Richard Rozentals
>
> From: "Sevetson, Phil" <
PSev...@FISA.NYC.GOV>
> To:
TSO-...@VM.MARIST.EDU
> Sent: Thursday, May 7, 2015 4:32 PM
> Subject: Re: [TSO-REXX] Using SuperC under TSO-REXX
>
> I may have found something.? Will experiment and get back to you-all.
> While I modify JCL and write out the modified version to a new library (converting prod-standard JCL for a particular test environment), one of the things I now need to do is to determine whether a "//name JCLLIB ORDER=target.proclib " card exists in the library, and insert one (drawn from an external source) if it does not.? The inserting part is easy, as I'm feeding the individual lines through a loop that builds an output stem variable of the desired changed JCL cards.
> The searching part may not be so easy.? I've got a possible logic for it: Examine the second and third words parsed from the input line for the string JCLLIB.? If you find EXEC instead, then you've gone past where a JCLLIB could occur and you need to insert the new card(s).
> But my initial thought was that SuperC SRCHFOR was the right test to use for this; if it returned FALSE from searching for JCLLIB, insert the card when you detect the first EXEC card.? However, I have no experience at executing a program within a REXX script, when my familiarity with it is strictly from batch.? (I don't see that it would work to fire off a batch job to examine a dataset which I'm going to be editing, and then somehow expecting REXX to recognize and parse the output.)? Is there a way to run SUPERC within an EXEC and examine the return code?
Don Poitras - SAS Development - SAS Institute Inc. - SAS Campus Drive
sas...@sas.com (919) 531-5637 Cary, NC 27513