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

Parm parameter


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 12, 2007 12:47 pm
Reply with quote

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

Code:

PARM : 


Thanks,
Arun
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 12, 2007 12:51 pm
Reply with quote

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
View user's profile Send private message
ousep143

New User


Joined: 06 Oct 2007
Posts: 32
Location: India

PostPosted: Wed Dec 12, 2007 1:08 pm
Reply with quote

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

Code:

PARM : 


Thanks,
Arun
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 12, 2007 1:17 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 12, 2007 1:28 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 12, 2007 1:34 pm
Reply with quote

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
View user's profile Send private message
ousep143

New User


Joined: 06 Oct 2007
Posts: 32
Location: India

PostPosted: Wed Dec 12, 2007 2:02 pm
Reply with quote

Hi enrico-sorichetti,

I am really sorry about to send TOP POST.
icon_sad.gif
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 12, 2007 2:06 pm
Reply with quote

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
View user's profile Send private message
ousep143

New User


Joined: 06 Oct 2007
Posts: 32
Location: India

PostPosted: Wed Dec 12, 2007 2:07 pm
Reply with quote

Hi arcvns,
I think it is not possible.Because IKJEFT01 utility is Terminal Monitor Program Utility mainly used for running TSO commands.

Regards
icon_smile.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Dec 12, 2007 2:17 pm
Reply with quote

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
View user's profile Send private message
Gijz

New User


Joined: 27 Nov 2007
Posts: 9
Location: The Netherlands

PostPosted: Wed Dec 12, 2007 5:51 pm
Reply with quote

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

Code:

PARM : 


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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 12, 2007 5:57 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Wed Dec 12, 2007 6:57 pm
Reply with quote

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
View user's profile Send private message
Gijz

New User


Joined: 27 Nov 2007
Posts: 9
Location: The Netherlands

PostPosted: Wed Dec 12, 2007 7:19 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Wed Dec 12, 2007 7:26 pm
Reply with quote

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
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Dec 13, 2007 12:37 pm
Reply with quote

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
View user's profile Send private message
ousep143

New User


Joined: 06 Oct 2007
Posts: 32
Location: India

PostPosted: Thu Dec 13, 2007 1:07 pm
Reply with quote

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
icon_smile.gif
Back to top
View user's profile Send private message
rpuhlman

New User


Joined: 11 Jun 2007
Posts: 80
Location: Columbus, Ohio

PostPosted: Thu Dec 13, 2007 4:21 pm
Reply with quote

It should be PARM('01') ... not PARMS ...
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Dec 13, 2007 6:53 pm
Reply with quote

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
View user's profile Send private message
rpuhlman

New User


Joined: 11 Jun 2007
Posts: 80
Location: Columbus, Ohio

PostPosted: Thu Dec 13, 2007 8:32 pm
Reply with quote

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
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Thu Dec 13, 2007 8:49 pm
Reply with quote

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
View user's profile Send private message
rpuhlman

New User


Joined: 11 Jun 2007
Posts: 80
Location: Columbus, Ohio

PostPosted: Thu Dec 13, 2007 10:38 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts JCL EXEC PARM data in C Java & MQSeries 2
No new posts Need to specify PARM='POSIX(ON) Java & MQSeries 4
No new posts How to pass the PARM value to my targ... COBOL Programming 8
No new posts Using the Jobname parameter in a Qual... ABENDS & Debugging 1
No new posts Demand with DEADLINE TIME parameter CA Products 4
Search our Forums:

Back to Top