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
 

 

How to pass a value from JCL to Cobol-Db2 program.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DB2
View previous topic :: :: View next topic  
Author Message
ganna_f16

New User


Joined: 07 Mar 2005
Posts: 17
Location: India

PostPosted: Fri Jan 19, 2007 5:40 pm    Post subject: How to pass a value from JCL to Cobol-Db2 program.
Reply with quote

Hi,
Can any body explain me how to pass a value from JCL to Cobol-Db2 Program.

Thanks
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Fri Jan 19, 2007 5:42 pm    Post subject:
Reply with quote

Usually done via the parm, have you looked?
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Fri Jan 19, 2007 5:53 pm    Post subject: Re: How to pass a value from JCL to Cobol-Db2 program.
Reply with quote

I'm not an expert, but I thought that COBOL-DB2 programs had to be run unde the Terminal Monitor Program (TMP) thus:

Code:

//STEP0100 EXEC PGM=IKJEFT01
//SYSOUT   DD SYSOUT=*                 
//SYSPRINT DD SYSOUT=*                 
//SYSTSPRT DD SYSOUT=*                 
//SYSTSIN  DD *                         
 DSN SYSTEM(XXXX)                       
 RUN PROGRAM(pgmname)            -     
     PLAN(planname)              -     
     LIB('your.loadlib.pds')     -     
     PARMS('2005-08-08/')               
 END
/*


and aren't allowed to receive parameters via the JCL, but instead must receive them within the SYSTSIN datastream.
Back to top
View user's profile Send private message
ganna_f16

New User


Joined: 07 Mar 2005
Posts: 17
Location: India

PostPosted: Fri Jan 19, 2007 5:57 pm    Post subject:
Reply with quote

In my JCL I am passing it through SYSTSIN in the JCL. In my program I am using Linkage section as in Normal Batch JCL. But when I am Displaying the passed value. I am not able to see any thing there.
JCL is:

//SYSTSIN DD *
DSN SYSTEM(DSN)
RUN -
PROGRAM(INQUIRY1) PLAN(CUSTPLAN) -
LIB('****') -
PARM(400001)

Cobol-Db2:

LINKAGE SECTION.
01 PARM-REC.
05 PARM-SIZE PIC S9(4) COMP.
05 PARM-CUST-NO PIC X(6).
PROCEDURE DIVISION USING PARM-REC.

Is this correct way of passing the PARM value in the DB2-Cobol Program.
Back to top
View user's profile Send private message
prav_06
Warnings : 1

Active User


Joined: 13 Dec 2005
Posts: 154
Location: The Netherlands

PostPosted: Mon Jan 22, 2007 2:45 pm    Post subject:
Reply with quote

H frnd,
Instead of using
//SYSTSIN DD *
DSN SYSTEM(DSN)
RUN -
PROGRAM(INQUIRY1) PLAN(CUSTPLAN) -
LIB('****') -
PARM(400001)

try coding a sysin dd * statement in your run jcl
//SYSTSIN DD *
DSN SYSTEM(DSN)
RUN -
PROGRAM(INQUIRY1) PLAN(CUSTPLAN) -
LIB('****')
/*
//sysin dd *
400001
/*
This would also serve the same purpose , no need to break your head with linkage section and the length of the data passed.

Cheer's
Thamilzan.
Back to top
View user's profile Send private message
hikaps14

Active User


Joined: 02 Sep 2005
Posts: 189
Location: Noida

PostPosted: Mon Jan 22, 2007 4:26 pm    Post subject: Re: How to pass a value from JCL to Cobol-Db2 program.
Reply with quote

Hi,

I guess there is another way to pass the values.
ie. UTILITYF.
I usually pass values through this DD statement and code corrsponding parm variables in Linkage section of Prog.

But I hardly c any difference in passing the variable via SYSIN or UITLITYF.
Can any body let me know wats the exact difference.

Thanks,
-Kapil.
Back to top
View user's profile Send private message
chandracdac

New User


Joined: 15 Jun 2007
Posts: 92
Location: bangalore

PostPosted: Wed Aug 29, 2007 5:14 pm    Post subject: Reply to: How to pass a value from JCL to Cobol-Db2 program.
Reply with quote

we can pass the data in two ways from our jcll to cobol program .

one is using parm parameter ,but one restriction in this is we can send max of 100 characters only by using this parm parameter.


anothr way is by using instream data in jcl we can pass the data from our jcl to cobol program . there is no restriction in this we can send much data.
Back to top
View user's profile Send private message
Help-Me-Out

New User


Joined: 09 Dec 2006
Posts: 56
Location: Pune

PostPosted: Mon Sep 10, 2007 5:25 pm    Post subject: Reply to: How to pass a value from JCL to Cobol-Db2 program.
Reply with quote

Hi chandracdac,

Can you explain the second way by giving example/JCL. icon_question.gif
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 -> DB2 All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


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