Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Passing Parms to a control card

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue Jan 08, 2008 12:16 pm    Post subject: Passing Parms to a control card
Reply with quote

Hi,

I have a Cobol-DB2 program which needs the User ID. but since i am using a control Card for the program, i will have to pass USER ID to the control card.

Does anyone know how the user ID can be passed to the control card.

I know that in a simple cobol program specifying

STEP01 EXEC PGM=TEST,PARM='&SYSUID'

would pass the SYSUID in the program.
Back to top
View user's profile Send private message

ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jan 08, 2008 12:41 pm    Post subject:
Reply with quote

There is no way to imbed symbolic parameters in input cards.

You can, however, add a step and generate the input card on the fly.

O.
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue Jan 08, 2008 2:38 pm    Post subject: Reply to: Passing Parms to a control card
Reply with quote

Hi Ofer,

I did not quite catch you. Can you explain a little more?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jan 08, 2008 2:45 pm    Post subject:
Reply with quote

Instead of hardcoding your input card in the JCL code, use a dataset. For example, instead
Code:
//INPCARD DD *
This is my input data
/*


Use
Code:
//INPCARD DD DSN=&&TEMPDS,DISP=(OLD,DELETE,DELETE)
.

Generate this dataset just before you execute your COBOL program.

O.
Back to top
View user's profile Send private message
CJT

New User


Joined: 02 Aug 2007
Posts: 83
Location: Here

PostPosted: Tue Jan 08, 2008 3:01 pm    Post subject: Reply to: Passing Parms to a control card
Reply with quote

But How will i be able to pass the User ID to this temp dataset?
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2360
Location: Israel

PostPosted: Tue Jan 08, 2008 3:09 pm    Post subject:
Reply with quote

in the PARM, or using MVS data areas.

O.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1232
Location: Israel

PostPosted: Tue Jan 08, 2008 9:22 pm    Post subject:
Reply with quote

As you are in a COBOL/DB2 program, you can try:
Code:
EXEC SQL SET             
    :UserNameArea = USER   
END-EXEC

Of course, it is of no use if you need the userid to connect to DB2, but if you don't that will be the easiest way.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts PA02 - Programmtically control attent... dodithegreat IMS DB/DC 1 Thu Apr 06, 2017 8:33 pm
No new posts Jcl pram vs proc parms ashek15 JCL & VSAM 3 Thu Mar 30, 2017 6:50 pm
No new posts Sort Card to Remove Duplicate records... raj4neo SYNCSORT 2 Wed Jan 25, 2017 4:44 am
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us