View previous topic :: View next topic
|
Author |
Message |
CJT
New User
Joined: 02 Aug 2007 Posts: 83 Location: Here
|
|
|
|
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 |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
CJT
New User
Joined: 02 Aug 2007 Posts: 83 Location: Here
|
|
|
|
Hi Ofer,
I did not quite catch you. Can you explain a little more? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
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 |
|
|
CJT
New User
Joined: 02 Aug 2007 Posts: 83 Location: Here
|
|
|
|
But How will i be able to pass the User ID to this temp dataset? |
|
Back to top |
|
|
ofer71
Global Moderator
Joined: 27 Dec 2005 Posts: 2358 Location: Israel
|
|
|
|
in the PARM, or using MVS data areas.
O. |
|
Back to top |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
|