IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to pass more than one parameters from JCL to program?


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
dejunzhu

Active User


Joined: 08 May 2008
Posts: 390
Location: China

PostPosted: Sat Jul 06, 2013 12:47 pm
Reply with quote

gcicchet wrote:
Hi,

You cannot use symbolic parameters in instream data



Gerry

Thanks for your reply.
What if I need to passing symbolic parameters into a program that accesses DB2? Can you please advise?
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 06, 2013 12:59 pm
Reply with quote

Well, goodness me, they have updated the manual. Robert's quote is from the Enterprise Cobol Version 5 Release 1 Programming Guide, which has been available for about three weeks.

Not only have they updated the manual, but they've included an example which is basically how I code it rather than using "reference-modification" :-)

There we go. And you don't have to wait for V5.1 to use it. It would work from OS/VS COBOL onwards, and it is not the COBOL that provides the limit, it is when OS appeared (and they decided to allow a PARM in the JCL). The ODO for a variable-length field worked in 1964 at least, the earliest I can track it down to through documentation...
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 06, 2013 1:15 pm
Reply with quote

One way to do it is to not use the PARM directly. Have a new, not very big, program which takes the PARM and writes it to a file. Read that file in your DB2 program, instead of trying to use the PARM.

You could also look to "generate" the Control Cards to execute your program, allowing for the symbol-substitution to take place and then be included in the generated cards.

You may also want to investigate the Language Environment route, from the piece which Robert posted. I'm not sure what "TSO" is going to do with options it doesn't recognise.

It is not, at any current release of z/OS, going to work how you have coded it.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Sat Jul 06, 2013 1:33 pm
Reply with quote

Hi,

you can try this
Code:


//         SET PAR='ABC'                                               
//SORT0001 EXEC PGM=SORT,                                             
//             PARM='JP1"&PAR",LIST'                                   
//SORTOUT  DD DSN=&&PARMS,                                             
//            DISP=(,PASS,DELETE),                                     
//            UNIT=SYSDA,                                             
//            SPACE=(TRK,(1))                                         
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                       
 SORT FIELDS=COPY                                                     
 OUTFIL FILES=OUT,REMOVECC,NODETAIL,                                   
        HEADER1=(' PARMS(',X'7D',JP1,C',0004',X'7D',C')')             
//SORTIN    DD *                                                       
/*                                                                     
//RUNPRG  EXEC PGM=IKJEFT01,DYNAMNBR=20                               
//SYSTSPRT DD SYSOUT=*                                                 
//SYSTSIN DD *                                                         
 DSN SYSTEM(DB11)                                                     
 RUN PROGRAM(TST00000) PLAN(TESTPLAN) -                               
//         DD DSN=&&PARMS,                                             
//            DISP=(OLD,DELETE)                                       
//SYSPRINT DD SYSOUT=*                                                 



Gerry
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Sat Jul 06, 2013 1:47 pm
Reply with quote

And you can easily adapt Gerry's example to write the parameter to a file.

You can "maximise" the potential length of the parameter, but if you need more than 69/71 characters, you'll need to find out how to divide-and-continue the parameter.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2455
Location: Hampshire, UK

PostPosted: Sat Jul 06, 2013 4:00 pm
Reply with quote

Thanks Robert and Thanks Bill for confirming that it is a new bit of writing!
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts Using API Gateway from CICS program CICS 0
No new posts DB2 Event passed to the Application P... DB2 1
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Dynamically pass table name to a sele... DB2 2
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
Search our Forums:

Back to Top