Re: Adventures in JCL: PROCs, symbols and instream data
On Fri, 5 May 2017 09:04:31 +1000, Andrew Rowley wrote: >On 4/05/2017 10:11 PM, Tom Marchant wrote: >> >> Did they say why it isn't supposed to work? >> Is there an undocumented restriction? >I am sure it *is* supposed to work, but it's easier to close a problem >as a user error. I agree that it is supposed to work. That's why they fixed it once. I'll take your reply as, "No, they didn't give a reason for the claim that it isn't supposed to work." I would push back not allow it to be closed. Sometimes it can help to ask them to try to justify their statement. There is no documented restriction. >I am also fairly sure that no-one who would actually know whether it was >supposed to work has looked at the SR at this point. Yes. -- Tom Marchant -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On 4/05/2017 10:11 PM, Tom Marchant wrote: Did they say why it isn't supposed to work? Is there an undocumented restriction? I am sure it *is* supposed to work, but it's easier to close a problem as a user error. I am also fairly sure that no-one who would actually know whether it was supposed to work has looked at the SR at this point. -- Andrew Rowley Black Hill Software +61 413 302 386 -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On Thu, 4 May 2017 10:40:46 +1000, Andrew Rowley wrote: >On 27/04/2017 10:54 PM, Tom Marchant wrote: >> Glad you got it to work, but it should have worked the way you had it. >> I hope you will open a Service Request to get it fixed. >I had forgotten how frustrating it is to open Service Requests. > >IBM has many brilliant people dedicated to improving z/OS. And an army >of support staff trying to prevent them finding out about problems. > >The most recent response is that the JCL in OA47958 (which I had used in >the SR to demonstrate the problem) isn't supposed to work... Did they say why it isn't supposed to work? Is there an undocumented restriction? -- Tom Marchant -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On 27/04/2017 10:54 PM, Tom Marchant wrote: Glad you got it to work, but it should have worked the way you had it. I hope you will open a Service Request to get it fixed. I had forgotten how frustrating it is to open Service Requests. IBM has many brilliant people dedicated to improving z/OS. And an army of support staff trying to prevent them finding out about problems. The most recent response is that the JCL in OA47958 (which I had used in the SR to demonstrate the problem) isn't supposed to work... -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On 2/05/2017 9:03 PM, Jantje. wrote: //JOB1 JOB CLASS=A, // MSGCLASS=H, // NOTIFY=&SYSUID // SET Q= //* //TEST PROC MESSAGE='Hello World' // SET MESSAGE=&Q.&MESSAGE.&Q Nice... I'm not sure that it is any clearer, but very creative! -- Andrew Rowley Black Hill Software +61 413 302 386 -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
Jantje wrote: >Andrew Rowley wrote: >>Does anyone know of a neater way to do this (using JCL only)? Is there any >>way to avoid the need for the triple apostrophes? >// SET Q= >// SET MESSAGE=&Q.&MESSAGE.&Q Hmmm, very interesting dirty, but beautiful little trick! Thanks Jantje! Much appreciated! Groete / Greetings Elardus Engelbrecht -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On Wed, 26 Apr 2017 15:14:27 +1000, Andrew Rowley wrote: > >Does anyone know of a neater way to do this (using JCL only)? Is there >any way to avoid the need for the triple apostrophes? > //JOB1 JOB CLASS=A, // MSGCLASS=H, // NOTIFY=&SYSUID // SET Q= //* //TEST PROC MESSAGE='Hello World' // SET MESSAGE=&Q.&MESSAGE.&Q Cheers, Jantje. -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On 27/04/2017 10:54 PM, Tom Marchant wrote: Glad you got it to work, but it should have worked the way you had it. I hope you will open a Service Request to get it fixed. I will, I am on the z/OS RDP so I had to confirm whether it was possible and the process. I now know how to do it. The information here has been very helpful though. -- Andrew Rowley Black Hill Software +61 413 302 386 -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On Thu, 27 Apr 2017 16:36:12 +1000, Andrew Rowley wrote: >On 27/04/2017 12:46 AM, Tom Marchant wrote: >> or SET MESSAGE=&MESSAGE and change the references to &SYM to &MESSAGE. > >SET MESSAGE=&MESSAGE seems to be the fix... > >This works for all combinations I have thrown at it: Glad you got it to work, but it should have worked the way you had it. I hope you will open a Service Request to get it fixed. -- Tom Marchant -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On 27/04/2017 12:46 AM, Tom Marchant wrote: or SET MESSAGE=&MESSAGE and change the references to &SYM to &MESSAGE. SET MESSAGE=&MESSAGE seems to be the fix... This works for all combinations I have thrown at it: //TEST PROC MESSAGE='''Hello World''' //SYMBOLS EXPORT SYMLIST=(MESSAGE) // SET MESSAGE=&MESSAGE //S1 EXEC PGM=IEBGENER //SYSINDD DUMMY //SYSPRINT DD DUMMY //SYSUT1 DD *,SYMBOLS=JCLONLY &MESSAGE //SYSUT2 DD SYSOUT=* // PEND //* //S1 EXEC TEST //S2 EXEC TEST,MESSAGE='''Hello Again''' //S3 EXEC TEST //S4 EXEC TEST,MESSAGE='''Hello Again''' -- Andrew Rowley Black Hill Software +61 413 302 386 -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On 27/04/2017 12:46 AM, Tom Marchant wrote: This sounds similar to a problem that I had a while back. Do you have OA47958 applied? It is applied, however it is very interesting, including the very similar JCL for testing. Unfortunately, if I take their JCL and add some variation: //PROC1 PROC PPP= // EXPORT SYMLIST=QQQ // SET QQQ=&PPP //PSTEP1EXEC PGM=IEBGENER //SYSPRINT DD DUMMY //SYSUT1DD *,SYMBOLS=JCLONLY SYMBOL QQQ=&QQQ /* //SYSUT2DD SYSOUT=* //SYSIN DD DUMMY // PEND //JSTEP1EXEC PROC1,PPP=VALUE1 //JSTEP2EXEC PROC1,PPP=VALUE2 //JSTEP3EXEC PROC1,PPP=VALUE3 //JSTEP4EXEC PROC1 //JSTEP5EXEC PROC1,PPP=VALUE5 I get the output: SYMBOL QQQ=VALUE1 SYMBOL QQQ=VALUE2 SYMBOL QQQ= SYMBOL QQQ= SYMBOL QQQ=VALUE5 That still looks broken. Where did VALUE3 go? -- Andrew Rowley Black Hill Software +61 413 302 386 -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On Wed, 26 Apr 2017 05:07:39 -0700, Charles Mills wrote: >Move the EXPORT outside of the PROC and into the open JOB? > Is a SET within a PROC elaborated when the PROC is defined or when it is executed? What is the scope of a symbol SET within a PROC? Is an EXPORT within a PROC elaborated when the PROC is defined or when it is executed? Can a formal parameter of a PROC be EXPORTed? Does a set override a formal parameter? Or vice-versa? Does the listing of the expanded JCL make this clearer? Does the JCL Ref. make all this clear? JCL sorely needs HLASM's DOUBLE Bif to avoid the apostrophe catastrophe. Or perhaps CLIST's &STR. Or Rexx's convention for substituting symbols. This has long been a solved problem. Why did the JCL designers feel compelled to reintroduce it? I hate JCL! >-Original Message- >From: Andrew Rowley >Sent: Tuesday, April 25, 2017 10:14 PM > >This almost works: > >//JOB1 JOB CLASS=A, >// MSGCLASS=H, >// NOTIFY=&SYSUID >//* >//TEST PROC MESSAGE='''Hello World''' >//SYMBOLS EXPORT SYMLIST=(SYM) >// SET SYM=&MESSAGE >//S1 EXEC PGM=IEBGENER >//SYSINDD DUMMY >//SYSPRINT DD DUMMY >//SYSUT1 DD *,SYMBOLS=JCLONLY > &SYM >//SYSUT2 DD SYSOUT=* >// PEND >//* >//S1 EXEC TEST >//S2 EXEC TEST,MESSAGE='''Hello Again''' >//*S3 EXEC TEST > >Output is > >Hello World >Hello Again > >but if you uncomment S3 the output is: > >Hello World >Hello World >Hello World > >I think the problem is the placement of the EXPORT statement - the proc can't >EXPORT the parameters used to call it. I used the SET statement to get around >that but it has side effects. > >I can get it to work (I think) with nested procedures: > >//JOB2 JOB CLASS=A, >// MSGCLASS=H, >// NOTIFY=&SYSUID >//* >//TEST PROC MESSAGE='''Hello World''' >//SYMBOLS EXPORT SYMLIST=(MESSAGE) >//INNEREXEC INNER,MESSAGE=&MESSAGE >// PEND >//* >//INNERPROC >//S1 EXEC PGM=IEBGENER >//SYSINDD DUMMY >//SYSPRINT DD DUMMY >//SYSUT1 DD *,SYMBOLS=JCLONLY > &MESSAGE >//SYSUT2 DD SYSOUT=* >// PEND >//* >//S1 EXEC TEST >//S2 EXEC TEST,MESSAGE='''Hello Again''' >//S3 EXEC TEST > >Output is as expected: > >Hello World >Hello Again >Hello World > >but nested PROCs is getting a bit clunky. I suspect it would work if the >caller exported the symbols before calling the proc, but the idea of procs is >to hide that sort of detail. > >Does anyone know of a neater way to do this (using JCL only)? Is there any way >to avoid the need for the triple apostrophes? > Only triple? You're lucky! And there's no solution you need to use the symbol containing the apostrophe both in open code and as an argument to a PROC. -- gil -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On Wed, 26 Apr 2017 07:40:47 -0700, Lizette Koehler wrote: >So to help me understand your term Nested Proc > >I think of a nested proc as a proc calling a proc. Yes, that is what he has. PROC TEST includes EXEC INNER >Next, I agree with @Charles. Move the EXPORT and SET statements >outside of the proc. It shouldn't be necessary to do that. -- Tom Marchant -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
On Wed, 26 Apr 2017 15:14:27 +1000, Andrew Rowley wrote: >I am trying to create some JCL procedures using symbols in instream >data, with the ability to override the symbol using standard procedure >calling conventions. This sounds similar to a problem that I had a while back. Do you have OA47958 applied? >//TEST PROC MESSAGE='''Hello World''' >//SYMBOLS EXPORT SYMLIST=(SYM) >// SET SYM=&MESSAGE What happens if you use EXPORT SYMLIST=* or SET MESSAGE=&MESSAGE and change the references to &SYM to &MESSAGE. If you have OA47958 applied, you might want to open an SR. -- Tom Marchant -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
So to help me understand your term Nested Proc I think of a nested proc as a proc calling a proc. When you have an individual proc executed multiple times, I do not consider that nested. Next, I agree with @Charles. Move the EXPORT and SET statements outside of the proc. Note: When using Nested Procs - PROCA executes PROCB executes PROCC. The symbols are not available at the lower level procs (PROCB and PROCC in this example). So any changes will need to be done within PROCB and PROCC. It is better to invoke procs on a single level so symbols and symbolics are easy to set. Lizette > -Original Message- > From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On > Behalf Of Andrew Rowley > Sent: Tuesday, April 25, 2017 10:14 PM > To: IBM-MAIN@LISTSERV.UA.EDU > Subject: Adventures in JCL: PROCs, symbols and instream data > > I am trying to create some JCL procedures using symbols in instream data, with > the ability to override the symbol using standard procedure calling > conventions. > > This almost works: > > //JOB1 JOB CLASS=A, > // MSGCLASS=H, > // NOTIFY=&SYSUID > //* > //TEST PROC MESSAGE='''Hello World''' > //SYMBOLS EXPORT SYMLIST=(SYM) > // SET SYM=&MESSAGE > //S1 EXEC PGM=IEBGENER > //SYSINDD DUMMY > //SYSPRINT DD DUMMY > //SYSUT1 DD *,SYMBOLS=JCLONLY > &SYM > //SYSUT2 DD SYSOUT=* > // PEND > //* > //S1 EXEC TEST > //S2 EXEC TEST,MESSAGE='''Hello Again''' > //*S3 EXEC TEST > > Output is > > Hello World > Hello Again > > but if you uncomment S3 the output is: > > Hello World > Hello World > Hello World > > I think the problem is the placement of the EXPORT statement - the proc can't > EXPORT the parameters used to call it. I used the SET statement to get around > that but it has side effects. > > I can get it to work (I think) with nested procedures: > > //JOB2 JOB CLASS=A, > // MSGCLASS=H, > // NOTIFY=&SYSUID > //* > //TEST PROC MESSAGE='''Hello World''' > //SYMBOLS EXPORT SYMLIST=(MESSAGE) > //INNEREXEC INNER,MESSAGE=&MESSAGE > // PEND > //* > //INNERPROC > //S1 EXEC PGM=IEBGENER > //SYSINDD DUMMY > //SYSPRINT DD DUMMY > //SYSUT1 DD *,SYMBOLS=JCLONLY > &MESSAGE > //SYSUT2 DD SYSOUT=* > // PEND > //* > //S1 EXEC TEST > //S2 EXEC TEST,MESSAGE='''Hello Again''' > //S3 EXEC TEST > > Output is as expected: > > Hello World > Hello Again > Hello World > > but nested PROCs is getting a bit clunky. I suspect it would work if the > caller exported the symbols before calling the proc, but the idea of procs is > to hide that sort of detail. > > Does anyone know of a neater way to do this (using JCL only)? Is there any way > to avoid the need for the triple apostrophes? > > I'm also interested to know if I am breaking any JCL rules that might be > tightened up later. > > -- > Andrew Rowley > Black Hill Software > +61 3 5331 8201 -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN
Re: Adventures in JCL: PROCs, symbols and instream data
Move the EXPORT outside of the PROC and into the open JOB? Charles -Original Message- From: IBM Mainframe Discussion List [mailto:IBM-MAIN@LISTSERV.UA.EDU] On Behalf Of Andrew Rowley Sent: Tuesday, April 25, 2017 10:14 PM To: IBM-MAIN@LISTSERV.UA.EDU Subject: Adventures in JCL: PROCs, symbols and instream data I am trying to create some JCL procedures using symbols in instream data, with the ability to override the symbol using standard procedure calling conventions. This almost works: //JOB1 JOB CLASS=A, // MSGCLASS=H, // NOTIFY=&SYSUID //* //TEST PROC MESSAGE='''Hello World''' //SYMBOLS EXPORT SYMLIST=(SYM) // SET SYM=&MESSAGE //S1 EXEC PGM=IEBGENER //SYSINDD DUMMY //SYSPRINT DD DUMMY //SYSUT1 DD *,SYMBOLS=JCLONLY &SYM //SYSUT2 DD SYSOUT=* // PEND //* //S1 EXEC TEST //S2 EXEC TEST,MESSAGE='''Hello Again''' //*S3 EXEC TEST Output is Hello World Hello Again but if you uncomment S3 the output is: Hello World Hello World Hello World I think the problem is the placement of the EXPORT statement - the proc can't EXPORT the parameters used to call it. I used the SET statement to get around that but it has side effects. I can get it to work (I think) with nested procedures: //JOB2 JOB CLASS=A, // MSGCLASS=H, // NOTIFY=&SYSUID //* //TEST PROC MESSAGE='''Hello World''' //SYMBOLS EXPORT SYMLIST=(MESSAGE) //INNEREXEC INNER,MESSAGE=&MESSAGE // PEND //* //INNERPROC //S1 EXEC PGM=IEBGENER //SYSINDD DUMMY //SYSPRINT DD DUMMY //SYSUT1 DD *,SYMBOLS=JCLONLY &MESSAGE //SYSUT2 DD SYSOUT=* // PEND //* //S1 EXEC TEST //S2 EXEC TEST,MESSAGE='''Hello Again''' //S3 EXEC TEST Output is as expected: Hello World Hello Again Hello World but nested PROCs is getting a bit clunky. I suspect it would work if the caller exported the symbols before calling the proc, but the idea of procs is to hide that sort of detail. Does anyone know of a neater way to do this (using JCL only)? Is there any way to avoid the need for the triple apostrophes? -- For IBM-MAIN subscribe / signoff / archive access instructions, send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN