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

Passing Parms to a control card


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 2358
Location: Israel

PostPosted: Tue Jan 08, 2008 12:41 pm
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
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: 2358
Location: Israel

PostPosted: Tue Jan 08, 2008 2:45 pm
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
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: 2358
Location: Israel

PostPosted: Tue Jan 08, 2008 3:09 pm
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: 1353
Location: Israel

PostPosted: Tue Jan 08, 2008 9:22 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Using Dynamic file handler in the Fil... COBOL Programming 2
No new posts Passing Parameters to Programs Invoke... PL/I & Assembler 5
No new posts Passing SYSPRINT to Invoked Program PL/I & Assembler 9
No new posts Generate output lines (SYSIN card for... DFSORT/ICETOOL 4
Search our Forums:

Back to Top