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

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


IBM Mainframe Forums -> DB2
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

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

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

Global Moderator


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

PostPosted: Fri Jan 19, 2007 5:53 pm
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DB2

 


Similar Topics
Topic Forum Replies
No new posts Replace each space in cobol string wi... COBOL Programming 3
No new posts Using API Gateway from CICS program CICS 0
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top