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
 

 

Pass values b/w JCL and Cobol

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Sun Oct 22, 2006 5:03 pm    Post subject: Pass values b/w JCL and Cobol
Reply with quote

Hi all,

I need to pass a set of values from JCL to cobol.
ie in my JCL i will pass the values using SYSIN Parameter.

//SYSIN DD *
0459
0763
1020
/*

Now my cobol programs needs to read these 3 values and needs to do processing.

The number of parameters varies each time. how can we do this ? Can you explain me with an example.

Any suggestions. Or by using files can we improve the performance.

Thanks,
Diwakar .D
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Sun Oct 22, 2006 6:52 pm    Post subject: Re: Pass values b/w JCL and Cobol
Reply with quote

Diwakar,

just treat it as any other file. that is all it is. code a SELECT and FD statements, OPEN/READ/CLOSE. The reference name in the SELECT statement is SYSIN.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sun Oct 22, 2006 10:56 pm    Post subject:
Reply with quote

Or, if you want to use ACCEPT, code an EOF rec in the input stream. You can use "END" or any other char(s) that you're sure won't appear as valid IP. Then check for it after every ACCEPT to stop the loop.

In this case you you don't need OPEN/CLOSE.

There are bennies/ouches that come w/each. It's your choice.
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Mon Oct 23, 2006 7:56 am    Post subject:
Reply with quote

Hi Jack,

Could you please give me an example for the first scenario. How accept parameter reads multiple parameters from JCL.

Thanks,
Diwakar.D

---------------------------------------------
Nobody is perfect. I am Nobody
Back to top
View user's profile Send private message
amalraj_ece

New User


Joined: 16 Jul 2006
Posts: 21
Location: delhi

PostPosted: Wed Oct 25, 2006 7:16 pm    Post subject: use ACCEPT
Reply with quote

use ACCEPT V1,V2,V3 in procedure division.


Where v1,V2&V3-are variables.
Back to top
View user's profile Send private message
sridevi2005

New User


Joined: 15 Sep 2005
Posts: 42

PostPosted: Thu Oct 26, 2006 4:16 pm    Post subject: Re: Pass values b/w JCL and Cobol
Reply with quote

Hi,

In the define 3 variables in Working storage section as below.

01 ws-v1 pic 9(4).
01 ws-v2 pic 9(4).
01 ws-v3 pic 9(4).

Code the below in the procedure division.

Accept ws-v1,ws-v2,ws-v3.

Thanks,
Sridevi
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 -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Replace values in the input data Vikas Maharnawar DFSORT/ICETOOL 10 Thu May 11, 2017 2:18 pm
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm


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