Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using SuperC under TSO-REXX

326 views
Skip to first unread message

Sevetson, Phil

unread,
May 7, 2015, 4:25:04 PM5/7/15
to
Mainframers,

I've been assigned a variant of something I was discussing earlier.

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?

--Phil Sevetson
psev...@fisa.nyc.gov<mailto:psev...@fisa.nyc.gov>
City of New York / Financial Info Svcs Agcy
New York, NY USA 10001


----------------------------------------------------------------------
For TSO-REXX subscribe / signoff / archive access instructions,
send email to LIST...@VM.MARIST.EDU with the message: INFO TSO-REXX

Sevetson, Phil

unread,
May 7, 2015, 4:32:50 PM5/7/15
to
I may have found something. Will experiment and get back to you-all.
http://ibmmainframes.com/about38892.html


--Phil Sevetson
psev...@fisa.nyc.gov<mailto:psev...@fisa.nyc.gov>
City of New York / Financial Info Svcs Agcy
New York, NY USA 10001

Garrett, Robert

unread,
May 7, 2015, 4:41:05 PM5/7/15
to
Yes, quite a few ways actually. The TSO CALL command or the REXX LINKMVS or ATTCHMVS command environments for starters. I tend to like ATTCHMVS because it runs the target program as an operating system subtask, which means that if the called program happens to be a 'bad citizen' and doesn't free all the storage it acquires before terminating, the operating system subtask termination process will take care of that thus helping to prevent 'memory leaks'.

Robert Garrett


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Sevetson, Phil
Sent: Thursday, May 07, 2015 3:24 PM
To: TSO-...@VM.MARIST.EDU

Paul Gilmartin

unread,
May 7, 2015, 4:49:45 PM5/7/15
to
On 2015-05-07 14:24, Sevetson, Phil wrote:
>
> 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).
>
How many members do you have?

SuperC may be overkill. Read each member, in sequence, into a compound
symbol with EXECIO. Inspect lines for JCLLIB and EXEC. If found, do
nothing. If not, write the preceding lines + JCLLIB with EXECIO, then
write the following lines.

For an enormous number of members, the ALLOCATE; OPEN; CLOSE; FREE
overhead may be prohibitive.

-- gil

richard rozentals

unread,
May 7, 2015, 4:50:42 PM5/7/15
to
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

retired mainframer

unread,
May 7, 2015, 5:16:34 PM5/7/15
to
SUPERC finding the word JCLLIB is not sufficient. You somehow need to
confirm that it is not an operand or label or comment or anything else but
the operation that specifies this is a JCL library statement.

> -----Original Message-----
> From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf
> Of Sevetson, Phil
> Sent: Thursday, May 07, 2015 1:24 PM
> To: TSO-...@VM.MARIST.EDU
> Subject: Using SuperC under TSO-REXX
>

Sevetson, Phil

unread,
May 7, 2015, 5:29:15 PM5/7/15
to
gil,

We are, indeed, converting several thousand JCL members. It is necessary to change the JOB name on a customized basis (we have a table in DB2 which tells us what the mapping is, and which candidates in the source library will be converted). We also have to ensure that the object we're looking at (member name was a Job Name exported from CA-SCHEDULER) is actualy z/OS JCL, as some of what is exported is command files for CA-SCHEDULER to use when running jobs on Unix platform. We don't convert those by this method.

That part's up and running.

The "why", in case anyone was wondering...
I have to insert a PROCLIB in the converted JCLLIB if it doesn't have one already. (If it has one already, we have rules for converting that but we use FileAid for it.) We have several target environments in the TEST LPAR and another which we use for more production-like testing, so we need a separate PROCLIB for each target environment; we can't rely on the LLA for this as we do in the PROD LPAR because it can't be switched around to meet our needs for multiple environments. So, explicit JCLLIB ORDER cards for all JCL members.

We have been doing the more primitive conversion of the JOBNAME with ALLOC/EXECIO/FREE to read the source and write the target members. We're not in so much of a hurry that this is a problem -- I get results within about five minutes for a couple of thousand members. I'm about ready to go ahead and, as you've said, inspect for JCLLIB and EXEC and stick the line in where called for, because the SUPERC SRCHFOR under REXX just dead-ends and I have to close the session with ATTN. I've made what seem to be the obvious changes to get it to conclude, with no result.

Also, the more I think about it, the more I think that running the SUPERC would be redundant even if successful -- if I know the JCLLIB isn't there, I still have to inspect for the first EXEC in order to locate the JCLLIB without disrupting any of the other control statements. I only save time if it's faster to SUPERC SRCHFOR than it is to inspect a few lines, already in memory, for the JCLLIB string. So, maybe not.

--Phil Sevetson
psev...@fisa.nyc.gov
City of New York / Financial Info Svcs Agcy
New York, NY USA 10001


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Paul Gilmartin
Sent: Thursday, May 07, 2015 4:49 PM
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Using SuperC under TSO-REXX

Sevetson, Phil

unread,
May 7, 2015, 5:32:09 PM5/7/15
to
True. I'll be checking for '//' and not '//*' -- anyone see any problem with that? But you're right, it does pretty much eliminate the usefulness of SUPERC, as I'd have to find and inspect the card anyway.

--Phil Sevetson
psev...@fisa.nyc.gov
City of New York / Financial Info Svcs Agcy
New York, NY USA 10001


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of retired mainframer
Sent: Thursday, May 07, 2015 5:16 PM
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Using SuperC under TSO-REXX

Pedro Vera

unread,
May 7, 2015, 5:41:29 PM5/7/15
to
I think you should run SUPERC to identify the members, then only process
those members with your editing program.

I do not think performance should be the main consideration here because
you are likely only doing this a few times. Start the job then get some
coffee; it will be done when you get back.

Use a copy of the PDS in case you have problems half way through.



Pedro Vera
DB2 Admin Tool
http://www-01.ibm.com/software/data/db2imstools/db2tools/db2admin/

Ze'ev Atlas

unread,
May 7, 2015, 5:58:37 PM5/7/15
to
Your original method is probably the safest.  You will need tobopen all members in the group anyway and checking thevfirst few lines will give you better control on variations then superc

Rexx is the perfect mainframe tool

Za

Sent from Yahoo Mail on Android

Sevetson, Phil

unread,
May 7, 2015, 6:10:09 PM5/7/15
to
No, I have to process everything on a supplied list. But I only have to add this operation to the conversion if they don't already have a JCLLIB ORDER= statement.

--Phil Sevetson
psev...@fisa.nyc.gov
City of New York / Financial Info Svcs Agcy
New York, NY USA 10001


-----Original Message-----
From: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] On Behalf Of Pedro Vera
Sent: Thursday, May 07, 2015 5:41 PM
To: TSO-...@VM.MARIST.EDU
Subject: Re: [TSO-REXX] Using SuperC under TSO-REXX

Ze'ev Atlas

unread,
May 7, 2015, 6:13:27 PM5/7/15
to
But you have to change the job card on all, or i did not understand you.  If you do, then processing few more lines is not a big deel

Za

Sent from Yahoo Mail on Android

From:"Sevetson, Phil" <PSev...@FISA.NYC.GOV>

Ze'ev Atlas

unread,
May 7, 2015, 6:45:22 PM5/7/15
to

And as an extra benefit you could check the validity of the jcllib and perhaps some possible include statement and other dirty tricks that might befall on you

Za

Sent from Yahoo Mail on Android

From:"Sevetson, Phil" <PSev...@FISA.NYC.GOV>
Date:Thu, May 7, 2015 at 6:10 PM

Lizette Koehler

unread,
May 7, 2015, 6:58:59 PM5/7/15
to
What about creating a simple ISPF Macro and EDIT your member with it. You can use the F JCLLIB ALL command and get counts.

Lizette

Höglund Lars

unread,
May 8, 2015, 2:58:05 AM5/8/15
to
Dont forget to check if it's a "relevant" line

Look for JCLLIB and ORDER as 2 separate words (not together). If found, check if the line starts with //* or /* (then it's not relevant)

when pos('JCLLIB ',line) > 0 &,
pos('ORDER=',line) > 0 then

//Lasse

-----Ursprungligt meddelande-----
Från: TSO REXX Discussion List [mailto:TSO-...@VM.MARIST.EDU] För Lizette Koehler
Skickat: den 8 maj 2015 00:59
Till: TSO-...@VM.MARIST.EDU
Ämne: Re: [TSO-REXX] Using SuperC under TSO-REXX

Andreas Fischer

unread,
May 8, 2015, 3:49:35 AM5/8/15
to
hi phil,

i don't think that superc will be really useful in this case. ii'm using
rexx to modify jcl in many various cases, and in my humble opinion ispf
edit macros will do best in such cases. i don't know how reliable your
input jcl is, but when i dealed with it, a simple search for existence
wasn't sufficient at all. you have to take care of all kinf of
possibilities such as comments, instream data, the statement might not be
seperated by just one blank and so on. i don't think superc would be able
to deal with all kind of circumstances.

regards,
andi


TSO REXX Discussion List <TSO-...@VM.MARIST.EDU> schrieb am 07.05.2015
22:24:08:

Paul Gilmartin

unread,
May 8, 2015, 10:06:47 AM5/8/15
to
On 2015-05-08, at 00:57, Höglund Lars wrote:

> Dont forget to check if it's a "relevant" line
>
> Look for JCLLIB and ORDER as 2 separate words (not together). If found, check if the line starts with //* or /* (then it's not relevant)
>
> when pos('JCLLIB ',line) > 0 &,
> pos('ORDER=',line) > 0 then
>
Or, perhaps, a SET statement with a continued string containing 'JCLLIB'
on the continuation line.

(Twirling Black Team mustache)

-- gil

Don Poitras

unread,
May 8, 2015, 11:37:23 AM5/8/15
to
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.
> http://ibmmainframes.com/about38892.html


> --Phil Sevetson
> psev...@fisa.nyc.gov<mailto:psev...@fisa.nyc.gov>
> City of New York / Financial Info Svcs Agcy
> New York, NY USA 10001



> From: Sevetson, Phil
> Sent: Thursday, May 07, 2015 4:24 PM
> To: TSO-...@VM.MARIST.EDU
> Subject: Using SuperC under TSO-REXX

> Mainframers,

> I've been assigned a variant of something I was discussing earlier.

> 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?

> --Phil Sevetson
> psev...@fisa.nyc.gov<mailto:psev...@fisa.nyc.gov>
> City of New York / Financial Info Svcs Agcy
> New York, NY USA 10001

--
Don Poitras - SAS Development - SAS Institute Inc. - SAS Campus Drive
sas...@sas.com (919) 531-5637 Cary, NC 27513

Mickey

unread,
May 11, 2015, 6:44:21 PM5/11/15
to
Oh, if I had a buck for every JCL, SYSIN, PROC, or program that I have
converted. Always did it the same way, always worked perfectly, always used
an edit macro and a driver like ALLMBRS to run it over the entire PDS.

Mickey
0 new messages