Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Change PROC symbolic to Override 2

Status
Not open for further replies.

Pnut123

Programmer
Oct 5, 2010
4
0
0
US
I am trying to convert a Proc Symbolic to the Proc Override. For example:
the Proc contains: SYS=PP2
I store these values in my REXX as:

Symbolic = 'SYS'
Override = 'PP2'

The JCL contains:
DSN=&SYS..&CYCL&STMT&STRM.240.CDF.SORTED&GENOUT
My objective is to write a change command that will execute as:
CHANGE '&SYS.' 'PP2'
So that the statement reads:
DSN=PP2.&CYCL&STMT&STRM.240.CDF.SORTED&GENOUT

Below is an extract of code that does not work but, I hope, can convey what I'm trying to accomplish:
/*****REXX*****************
TRACE I
ISREDIT MACRO
OVRD = 'SYS'
SUBX = 'PP2'
'ISREDIT C .&'OVRD'.' SUBX
***************************
A trace seems to inicate that the ISREDIT command evaluates to:
"ISREDIT C .&SYS. PP2"
The actual effect in the edited proc is change a period '.' to PP2.

Thanks in advance for any assistance.
 
Remove the period - you do not seem to have a .&SYS. in your sample input.

Change your edit to: c 'SYS' 'PP2'

Why use variables? If you have a generic loop then I see the point but to get the thing to work try without to start with.



Nic
 
Thanks for getting back to me so quickly.
This is intended to be a generic loop that will handle a list of symbolics and overrides. So, I need to be able to build a change command that will include an ampersand+the variable symbolic+a period (&+OVRD+.). In the example shown above, the OVRD would evaluate to 'SYS' resulting in '&SYS.'. I believe a big part of my problem is that, no matter what I do, the & is not being interpreted as a literal part of the change string.
So, I am trying to Change 'DSN=&SYS.' to 'DSN=PP2' where OVRD='SYS' and SUBX='PP2'
 
I knew it - & has a special meaning - keep the command on the command line after execution. This means that you have to quote your strings.


Nic
 
I am new at REXX and, as such, I may be trying to solve the problem in an un-rexx like fashion. However, I have tried quoting, double quoting, multiple ampersands, ampersands followed and preceeded by periods, and a number of other approaches that probably make no logical sense at all.
Shown below are 2 tries that seemed to come close.

'ISREDIT C ''&&OVRD..'' ''&SUBX'''
/*CHANGED SYS. TO PP2 but did not include the Preceeding ampersand. */
'ISREDIT C ''&'||'&&OVRD..'' ''&SUBX'''
/*Displays the COMMAND IN ERROR . : Panel with the command shown as : C '&SYS.' 'PP2' FIRST STRING NULL. This command, as shown, is perfect except that REXX doesn't like it.*/
 
Success. I was unable to build a CHANGE command that REXX would interpret correctly by using a combination of variables and literals in the CHANGE command. However, by building the FROM literal outside of the CHANGE command, REXX would let me use it as is. Below is the code that worked.
/*****REXX************************/
ISREDIT MACRO
TEMPX = 'SYS'
OVRD = '&'||TEMPX||'.'
SUBX = 'PP2'
'ISREDIT C "&&OVRD" "&SUBX"' ALL

Thanks for your assistance.
 
Yes, my experiments showed that but the forum was unavailable last night for me to post. Why one has to do it this way is not clear to me but if you have a string &subx the processor takes that to be a variable and so if you init tke variable before use then it will be happy. This may be something to do with the fact that CLIST variables begin with & and the processor is getting itself muddled.


Nic
 
Pnut123, I thought I'd pass along a few bits of advice. You really shouldn't try to make things harder than they need to be. Two things you could've done:

1. Use the IPOUPDTE program instead for it's intended purpose (i.e. mass JCL updates):

//STEPXXXX EXEC PGM=IPOUPDTE,PARM='UPDATE'
//STEPLIB DD DISP=SHR,DSN=...
//@LIB1 DD DISP=SHR,DSN=YOUR.JCL.PDS(MEMBER)
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
&SYS.<PP2<
/*

2. Used a straight EDIT, either directly in a batch job or from within a REXX exec. I'll show the latter:

/* REXX */
Parse Upper Arg dataset_2_edit .
Queue "TOP"
Queue "C * 999999 /&SYS./PP2/"
Queue "END SAVE"
"EDIT '"dataset_2_edit"' OLD NOSCAN CNTL NONUM"
Exit 0
 
Although this might be regarded as cheating, it works...
Code:
/* rexx */

trace i

'ISREDIT MACRO'

symbolic = c2x('&SYS.')
override = c2x('PP2')

"ISREDIT CHANGE X'" || symbolic || "' X'" || override || "' ALL"

Steve

[small]"Every program can be reduced by one instruction, and every program has at least one bug. Therefore, any program can be reduced to one instruction which doesn't work." (Object::perlDesignPatterns)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top