Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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: 4650
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 IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us