Hi, I'm trying to run JCL where a 4 character variable &DLC is passed to it (along with others) but I just want to use the first 3 characters, I've tried to run the following creating a new variable SID with the first 3 characters of &DLC and then pass to the SEND step but it doesn't work, any help would be greatly appreciated, thanks
//*%OPC SCAN
//*%OPC SETVAR SID=SUBSTR(&DLC,1,3)
//*
//SEND EXEC PGM=DF080A00
//STEPLIB DD DSN=xxx.xxx.xxx,DISP=SHR
//SYSPRINT DD SYSOUT=*
//STATIONS DD DSN=xxx.xxx.xxx,DISP=SHR
//SYSIN DD *,SYMBOLS=JCLONLY
SID=&SID.,DSNOLD=&OFDSN.,
DSN=&VFN.
/*
SETVAR SUBSTR issue
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: SETVAR SUBSTR issue
Say 'it doesn't work' is not particular useful, what excactly happens?
Seems you are mixing OPC variables and JCL variables.
I would suggest removing the ',SYMBOLS=JCLONLY ' from the SYSIN DD and maybe test it with an IEBGENER step.
Seems you are mixing OPC variables and JCL variables.
I would suggest removing the ',SYMBOLS=JCLONLY ' from the SYSIN DD and maybe test it with an IEBGENER step.
-
- Posts: 5
- Joined: Tue Mar 19, 2019 4:11 pm
- Skillset: Mainframe Network Systems Programmer
- Referer: Google
Re: SETVAR SUBSTR issue
The variable SID is not resolved, thanks.
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: SETVAR SUBSTR issue
Could you add another line :
SID=&DLC.,DSNOLD=&OFDSN.,
and verify that it expands correctly?
Please post the results.
SID=&DLC.,DSNOLD=&OFDSN.,
and verify that it expands correctly?
Please post the results.
-
- Posts: 5
- Joined: Tue Mar 19, 2019 4:11 pm
- Skillset: Mainframe Network Systems Programmer
- Referer: Google
Re: SETVAR SUBSTR issue
Thanks, I removed ,SYMBOLS=JCLONLY & run again & the output shows
SID=&SID.,DSNOLD=&OFDSN.,
DSN=SDARMAOW
ERROR: ERROR NEAR PARAMETER: SID
ACTION: ** REQUEST NOT ACCEPTED **
I guess DSNOLD doesn't resolve as SID fails but DSN does resolve ok
SID=&SID.,DSNOLD=&OFDSN.,
DSN=SDARMAOW
ERROR: ERROR NEAR PARAMETER: SID
ACTION: ** REQUEST NOT ACCEPTED **
I guess DSNOLD doesn't resolve as SID fails but DSN does resolve ok
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: SETVAR SUBSTR issue
How about an IEBGENER like this?
Code: Select all
//SEND EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSUT2 DD SYSOUT=*
//SYSUT1 DD *
DLC=&DLC
SID=&SID
DSNOLD=&OFDSN
DSN=&VFN
-
- Posts: 5
- Joined: Tue Mar 19, 2019 4:11 pm
- Skillset: Mainframe Network Systems Programmer
- Referer: Google
Re: SETVAR SUBSTR issue
The job doesn't output anything
1DATA SET UTILITY - GENERATE
SYNCSORT COPY FEATURE CALLED - RC = 0
DLC=&DLC
SID=&SID
DSNOLD=&OFDSN
DSN=&VFN
1DATA SET UTILITY - GENERATE
SYNCSORT COPY FEATURE CALLED - RC = 0
DLC=&DLC
SID=&SID
DSNOLD=&OFDSN
DSN=&VFN
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: SETVAR SUBSTR issue
Well, it did output something, it clearly showed that the OPC, sorry TWS, variables were not resolved.
You did keep the '//*%OPC ' statements, right?
As there is no JOB statement, I assume that you look at the generated JCL through TWS?
You did keep the '//*%OPC ' statements, right?
As there is no JOB statement, I assume that you look at the generated JCL through TWS?
-
- Posts: 5
- Joined: Tue Mar 19, 2019 4:11 pm
- Skillset: Mainframe Network Systems Programmer
- Referer: Google
Re: SETVAR SUBSTR issue
Yep, kept the OPC statements in.
-
- Posts: 474
- Joined: Thu Mar 10, 2016 5:03 pm
- Skillset: assembler rexx zOS ispf racf smf
- Referer: saw it in the experts foprum thought I could help here
Re: SETVAR SUBSTR issue
So my earlier conclusion stays, none of the variables were resolved, thus not a problem with SUBSTR.
I'm no TWS expert, just used it from time to time, so I'm afraid that I can't help you.
I'm no TWS expert, just used it from time to time, so I'm afraid that I can't help you.
-
- Similar Topics
- Replies
- Views
- Last post
-
- 3
- 5116
-
by jrcox
View the latest post
Wed Jul 29, 2020 7:52 pm
-
- 1
- 1349
-
by jcdm
View the latest post
Mon Oct 24, 2022 6:10 pm
-
-
Code conversion issue while reading JCL using REXX
by vsgurunath » Fri Jun 19, 2020 10:19 pm » in CLIST & REXX - 11
- 4344
-
by vsgurunath
View the latest post
Thu Jun 25, 2020 4:08 pm
-
-
- 2
- 2282
-
by Terry Heinze
View the latest post
Tue Feb 15, 2022 9:13 pm
-
-
Issue Create/delete ALIAS IDC3013I and then IDC3012I
by jcdm » Thu Dec 05, 2024 9:26 pm » in VSAM/SMS - 1
- 1716
-
by willy jensen
View the latest post
Fri Dec 06, 2024 12:04 am
-