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

transfer a variable value to cobol program


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
husj

New User


Joined: 05 Sep 2005
Posts: 12
Location: P.R.C

PostPosted: Fri Jan 06, 2006 3:17 pm
Reply with quote

Hi,

I want to exec one cobol program for many times in a JOB. Everytime, the program will receive a changing value from JOB. How to do ?

thanks®ards

Jerry
Back to top
View user's profile Send private message
rajesh_1183

Active User


Joined: 24 Nov 2005
Posts: 121
Location: Tadepalligudem

PostPosted: Fri Jan 06, 2006 5:06 pm
Reply with quote

Hi jerry,

Try using parm parameter in the jcl...

//step1 exec=pgmname,parm=value-for-the-variable1

next declare this variable in the linkage section of the program..

linkage section

01 abcd.
02 variable-len pic s9(4) comp.
02 variable1 pic x(10).

try this....
correct me if i am wrong.....

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

New User


Joined: 25 May 2005
Posts: 14

PostPosted: Tue Jan 10, 2006 3:50 pm
Reply with quote

1. U should pass value using file from JCL.
2. U open file in I-O mode in prgm.
3. Read ur input record from that file process it and Rewrite the record of it for using next time running same ur prgm.

Ex:-
First time U wants to run ur prgm. With today date, second time tomorrow date,...ect.
In this case read today date from file and using for all process and finally increased by 1 day and rewrite it...!

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

New User


Joined: 11 Jan 2006
Posts: 1

PostPosted: Wed Jan 11, 2006 4:47 pm
Reply with quote

hi

u can pass any parameter through jcl to a cobol program using parm parameter...


in ur linkage section

01 parm

05 parm-length pic s9(4) comp.
05 parm-value pic 9(4).


now u can pass a variable of size 4

jcl:

//parm exec pgm=urpgmname,
// parm='0001'

if u want to add any parameter then u can add and pass the parameter as a concatenated value....

-------------------
Puneet
------------------
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 -> JCL & VSAM

 


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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
Search our Forums:

Back to Top