View previous topic :: View next topic
|
Author |
Message |
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi,
I am trying to pass a parameter to COBOL using PARM parameter as shown below. But the values are not getting passed. Could anybody tell me the reason.
Code: |
//PS100 EXEC PGM=IKJEFT1B,
// DYNAMNBR=20,
// PARM='01' |
Code: |
LINKAGE SECTION.
01 LS-VARIABLES.
05 LS-LENGTH PIC S9(04) COMP.
05 LS-FUNC PIC X(02).
.....................
PROCEDURE DIVISION USING LS-VARIABLES.
.....................
DISPLAY 'PARM : ' LS-FUNC
|
Output
Thanks,
Arun |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Because...
unless You used for Your program a weird name "IKJEFT1B"
mimicking an alternate entry point of the TSO tmp
You are invoking TSO itself, and the only parm expected on a batch TSO
invokation is the name of a clist and its operands ! |
|
Back to top |
|
|
ousep143
New User
Joined: 06 Oct 2007 Posts: 32 Location: India
|
|
|
|
Hi
You can try within SYSIN DD Statement.
For Example,
//PS100 EXEC PGM=IKJEFT1B,
// DYNAMNBR=20,
// PARM='01' [/code]
//SYSIN DD *
PARMS('01')
/*
Regards
Joseph
arcvns wrote: |
Hi,
I am trying to pass a parameter to COBOL using PARM parameter as shown below. But the values are not getting passed. Could anybody tell me the reason.
Code: |
//PS100 EXEC PGM=IKJEFT1B,
// DYNAMNBR=20,
// PARM='01' |
Code: |
LINKAGE SECTION.
01 LS-VARIABLES.
05 LS-LENGTH PIC S9(04) COMP.
05 LS-FUNC PIC X(02).
.....................
PROCEDURE DIVISION USING LS-VARIABLES.
.....................
DISPLAY 'PARM : ' LS-FUNC
|
Output
Thanks,
Arun |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Please DO NOT TOP POST,
... TOP POSTING means ... put the answer before the quote,
makes difficult to understand the sequence of questions and answers |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi enrico-sorichetti,
But normally in our shop we run our DB2 programs using this utility. SYSIN DD is working fine for me. But I want this thru PARM.
Thanks,
Arun |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
post Your complete jcl...
but still what You want does not agree with what the system will let You do...
the "PARM" content for IKJEFTxx is ( in case of DB2 ) not passed along
Your sample should work by simply
Code: |
//stepname EXEC PGM=Your_program,PARM='your_parm_string' |
|
|
Back to top |
|
|
ousep143
New User
Joined: 06 Oct 2007 Posts: 32 Location: India
|
|
|
|
Hi enrico-sorichetti,
I am really sorry about to send TOP POST.
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Not a problem at all
even if I bolded a few words, the tone was intended to be friendly
and proactive...
If You subscribe to other forums You will see that the advice against
top posting will be given in much stronger words |
|
Back to top |
|
|
ousep143
New User
Joined: 06 Oct 2007 Posts: 32 Location: India
|
|
|
|
Hi arcvns,
I think it is not possible.Because IKJEFT01 utility is Terminal Monitor Program Utility mainly used for running TSO commands.
Regards
|
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
Hi enrico-sorichetti
Here is my RUN JCL,
Code: |
//PS100 EXEC PGM=IKJEFT1B,
// DYNAMNBR=20,
// PARM='01'
//*
//STEPLIB DD DSN=TEST.PGMLIB,
// DISP=SHR
// DD DSN=DSND.DSNLOAD,
// DISP=SHR
//*
//SYSOUT DD SYSOUT=X
//SYSLST DD SYSOUT=X
//SYSPRINT DD SYSOUT=X
//SYSUDUMP DD SYSOUT=X
//SYSDBOUT DD SYSOUT=X
//SYSABOUT DD SYSOUT=X
//SYSTSPRT DD SYSOUT=X
//*
//SYSTSIN DD DSN=DB2D.SYSTSLIB($SYSID),
// DISP=SHR
// DD DSN=DB2D.SYSTSLIB(TEST01),
// DISP=SHR
// DD DSN=DB2D.SYSTSLIB($PGMLIB),
// DISP=SHR
|
|
|
Back to top |
|
|
Gijz
New User
Joined: 27 Nov 2007 Posts: 9 Location: The Netherlands
|
|
|
|
arcvns wrote: |
Hi,
I am trying to pass a parameter to COBOL using PARM parameter as shown below. But the values are not getting passed. Could anybody tell me the reason.
Code: |
//PS100 EXEC PGM=IKJEFT1B,
// DYNAMNBR=20,
// PARM='01' |
Code: |
LINKAGE SECTION.
01 LS-VARIABLES.
05 LS-LENGTH PIC S9(04) COMP.
05 LS-FUNC PIC X(02).
.....................
PROCEDURE DIVISION USING LS-VARIABLES.
.....................
DISPLAY 'PARM : ' LS-FUNC
|
Output
Thanks,
Arun |
Hi Arun,
Just include the parm in your systsin similar like:
//SYSTSIN DD *
PROFILE PREFIX(GB59)
DSN SYSTEM(D1SO) RETRY(0) TEST(0)
RUN PROGRAM(ZS919) PLAN(ZSPL919) -
PARMS('009')
END |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
note for the previous poster
please read carefully before posting unrelated replies :-)
The O/P was asking on how to pass a PARM to a cobol program...
NOT how to run a COBOL/DB2 program..
note for the O/P
we can swing question and answers back and forth and write around the problem for ages,
still in a standard COBOL/DB2 environment You cannot do what You ask for.
the only way to pass data to a program in this environment is thru a dataset |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
enrico-sorichetti wrote: |
note for the previous poster
please read carefully before posting unrelated replies :-)
The O/P was asking on how to pass a PARM to a cobol program...
NOT how to run a COBOL/DB2 program..
note for the O/P
we can swing question and answers back and forth and write around the problem for ages,
still in a standard COBOL/DB2 environment You cannot do what You ask for.
the only way to pass data to a program in this environment is thru a dataset |
RUN PROGRAM(ZS919) PLAN(ZSPL919) -
PARMS('09')
That is how you pass parameters to a COBOL-DB2 program! |
|
Back to top |
|
|
Gijz
New User
Joined: 27 Nov 2007 Posts: 9 Location: The Netherlands
|
|
|
|
Craq Giegerich wrote: |
RUN PROGRAM(ZS919) PLAN(ZSPL919) -
PARMS('09')
That is how you pass parameters to a COBOL-DB2 program! |
Thanks Craq, that's what I meant.
Enrico, here is an extract from the DB2 UDB for z/OS V8 Application Programming and SQL Guide (the important part is in red):
5.1.1.4.3 Running a batch DB2 application in TSO
Most application programs written for the batch environment run under the TSO Terminal Monitor Program (TMP) in background mode. Figure 150 shows the JCL statements that you need in order to start such a job. The list that follows explains each statement.
//jobname JOB USER=MY DB2ID
//GO EXEC PGM=IKJEFT01,DYNAMNBR=20
//STEPLIB DD DSN=prefix.SDSNEXIT,DISP=SHR
// DD DSN=prefix.SDSNLOAD,DISP=SHR
.
.
.
//SYSTSPRT DD SYSOUT=A
//SYSTSIN DD *
DSN SYSTEM (ssid)
RUN PROG (SAMPPGM) -
PLAN (SAMPLAN) -
LIB (SAMPPROJ.SAMPLIB) -
PARMS ('/D01 D02 D03')
END
/*
Figure 150. JCL for running a DB2 application under the TSO terminal
monitor program
The JOB option identifies this as a job card. The USER option specifies the DB2 authorization ID of the user.
The EXEC statement calls the TSO Terminal Monitor Program (TMP).
The STEPLIB statement specifies the library in which the DSN Command Processor load modules and the default application programming defaults module, DSNHDECP, reside. It can also reference the libraries in which user applications, exit routines, and the customized DSNHDECP module reside. The customized DSNHDECP module is created during installation.
Subsequent DD statements define additional files needed by your program.
The DSN command connects the application to a particular DB2 subsystem.
The RUN subcommand specifies the name of the application program to run.
The PLAN keyword specifies plan name.
The LIB keyword specifies the library the application should access.
The PARMS keyword passes parameters to the run-time processor and the application program.
END ends the DSN command processor. |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
Sorry for the misunderstanding...
it' s a long story...
but I am still on a stone age DB2 and that' s not allowed there :-) |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
I tried passing thru SYSTSIN card, still the results are same.
Here s my SYSTSPRT
Code: |
READY
DSN SYSTEM (DB2D)
DSN
RUN PROG (TEST01) PLAN (TEST01) PARMS('01')
DSN
END
READY
END
|
Thanks,
Arun |
|
Back to top |
|
|
ousep143
New User
Joined: 06 Oct 2007 Posts: 32 Location: India
|
|
|
|
Hi arcvns,
In your JCL include one more member.For example
//SYSTSIN DD DSN=DB2D.SYSTSLIB($SYSID),
// DISP=SHR
// DD DSN=DB2D.SYSTSLIB(TEST01),
// DISP=SHR
// DD DSN=DB2D.SYSTSLIB($PGMLIB),
// DISP=SHR
// DD DSN='DB2D.SYSTSLIB(NEWMEM),DISP=SHR
PARMS('01') statements is put into the 'NEWMEM' file.Try it.
Reply me.
Regards
|
|
Back to top |
|
|
rpuhlman
New User
Joined: 11 Jun 2007 Posts: 80 Location: Columbus, Ohio
|
|
|
|
It should be PARM('01') ... not PARMS ... |
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
rpuhlman wrote: |
It should be PARM('01') ... not PARMS ... |
You better tell IBM they think it is PARMS
Code: |
2.57.3 Syntax
________________________________________________________________________
| |
| |
| >>__RUN__ _PROGRAM(program-name)__ _________________ _ ______________> |
| | |_PLAN(plan-name)_| | |
| |_CP__PLAN(plan-name)________________________| |
| |
| >__ _______________________ __ _________________________ ___________>< |
| |_LIBRARY(library-name)_| |_PARMS(parameter-string)_| |
| |
| |
|________________________________________________________________________| |
|
|
Back to top |
|
|
rpuhlman
New User
Joined: 11 Jun 2007 Posts: 80 Location: Columbus, Ohio
|
|
|
|
Hey Craq ... I guess both work ...
Code: |
//STEP10 EXEC BATDSN
//SYSTSIN DD *
DSN SYSTEM(DSN)
RUN PROGRAM(DSNTIAUL) PLAN(DSNTIAUL) PARM('SQL')
/*
//SYSPRINT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//SYSREC00 DD DSN=LCAT.LACPD1S0.SYSREC00,DISP=(,CATLG),
// UNIT=WORK,SPACE=(CYL,(150,75),RLSE)
//SYSPUNCH DD DSN=LCAT.LACPD1S0.TMPPUNCH,DISP=(,CATLG),
// UNIT=WORK,SPACE=(8000,(89,89),RLSE)
//*SYSIN DD DSN=HONDA.TESTPARM(UNLDACPD),DISP=SHR
//SYSIN DD *
SELECT *
FROM LCA.LACPD1
WHERE PROD_UNIT_ID_NO = '1HGCS11878A801534'
; |
Code: |
09.55.41 JOB18443 ---- THURSDAY, 13 DEC 2007 ----
09.55.41 JOB18443 TSS7000I MMT8376 Last-Used 05 Dec 07 08:44 System=PROD Facili
09.55.41 JOB18443 TSS7001I Count=00135 Mode=Fail Locktime=None Name=RICK PUHLMA
09.55.41 JOB18443 $HASP373 MMT8376A STARTED - INIT 61 - CLASS D - SYS PROD
09.55.41 JOB18443 IEF403I MMT8376A - STARTED
09.55.41 JOB18443 *HAMTRT01 --T
09.55.41 JOB18443 *HAMTRT01 JOBNAME STEPNAME PROCSTEP RC EXCP CONN T
09.55.41 JOB18443 *HAMTRT01 MMT8376A STEP00 00 6 4 .
09.55.41 JOB18443 *HAMTRT01 MMT8376A STEP10 DSNTIRU 00 74 12 .
09.55.41 JOB18443 IEF404I MMT8376A - ENDED
09.55.41 JOB18443 *HAMTRT01 MMT8376A ENDED. NAME-UNLD LCA CPD TOTAL TC
09.55.41 JOB18443 $HASP395 MMT8376A ENDED
------ JES2 JOB STATISTICS ------
13 DEC 2007 JOB EXECUTION DATE |
Code: |
DSNT490I SAMPLE DATA UNLOAD PROGRAM
DSNT505I DSNTIAUL OPTIONS USED: SQL
DSNT503I UNLOAD DATA SET SYSPUNCH RECORD LENGTH SET TO
DSNT504I UNLOAD DATA SET SYSPUNCH BLOCK SIZE SET TO 27
DSNT503I UNLOAD DATA SET SYSREC00 RECORD LENGTH SET TO
DSNT504I UNLOAD DATA SET SYSREC00 BLOCK SIZE SET TO 27
DSNT495I SUCCESSFUL UNLOAD 57 ROWS OF TABLE |
|
|
Back to top |
|
|
Craq Giegerich
Senior Member
Joined: 19 May 2007 Posts: 1512 Location: Virginia, USA
|
|
|
|
There are some things you have to type exactly as the book says or it is wrong and some things that can be typed in different ways in different places. I think IBM just does this to make us look at the books. |
|
Back to top |
|
|
rpuhlman
New User
Joined: 11 Jun 2007 Posts: 80 Location: Columbus, Ohio
|
|
|
|
Craq,
You are absolutely right ... and you made me double check too ... nothing wrong with that ... in most cases I end up learning more. Back to work.
Rick |
|
Back to top |
|
|
|