View previous topic :: View next topic
|
Author |
Message |
rahulbose
New User
Joined: 21 Feb 2005 Posts: 3
|
|
|
|
how can i pass data from cobol to jcl. |
|
Back to top |
|
|
ovreddy
Active User
Joined: 06 Dec 2004 Posts: 211 Location: Keane Inc., Minneapolis USA.
|
|
|
|
Hi Rahul,
You can pass the data from COBOL to JCL using RETURN-CODE. This is a global variable which can be accessed by JCL and COBOL. But this is used to hold return code of program.
MOVE 04 TO RETURN-CODE.
You can also open a file in cobol and write to it. This can be used in JCL subsequent steps.
Bye,
Reddy. |
|
Back to top |
|
|
lnvrn
New User
Joined: 24 Feb 2005 Posts: 8 Location: Mumbai
|
|
|
|
Hi,
Can u give the description how we have to declare in cobol,u said that it is global variable,is it required to define with comp variable please let me know the steps.
Regards |
|
Back to top |
|
|
mcmillan
Site Admin
Joined: 18 May 2003 Posts: 1210 Location: India
|
|
|
|
Dear invrn,
Quote: |
it required to define with comp |
RETURN-CODE is a Register available in COBOL like DATE, DAY, TALLY etc.
So there is no need to declare it yourself as COMP. |
|
Back to top |
|
|
kingofmf
New User
Joined: 02 Mar 2005 Posts: 13 Location: Bangalore
|
|
|
|
there is a tricky methode to pass data from COBOL to JCL ,
First define one symbolic parameter in your JCL without giving any value
like VAR=
now pass the reference to COBOL by parm loke this PARM='&VAR'
now set any value in your linkage section variable,it will be automatically reflected in you jcl VAR.
try this,
ciao! |
|
Back to top |
|
|
Abhilasha
New User
Joined: 09 Mar 2006 Posts: 7 Location: India
|
|
|
|
As suggested by kingofmf i tried this. JCl runs successfully but the parm is not returned to JCL as required. i want it to be passed to the ikjeft to send a message to another user Id. i am confused my jcl is given below.
//AC8141AA JOB (3000,XXXX,10,10),'ABHILASHA',MSGCLASS=E,
// NOTIFY=&SYSUID
//*SETTING VARIABLE FOR RECIEVING MAIL-ID FROM PGM
// SET VAR='XX1111'
//JOBLIB DD DSN=AC8141.STUDY.GREET,DISP=SHR
//*
//STEP1 EXEC PGM=DATCOB00,PARM='&VAR'
//STEPLIB DD DSN=CMN.CRIS.STGI.#006724.LOD,DISP=SHR
//*MAILDD DD SYSOUT=(*,INTRDR)
//*INPUT
//EMPREC DD DSN=AC8141.STUDY.GREET(EMPREC),DISP=SHR
//SYSOUT DD SYSOUT=*
//*SENDING MAIL
//*
//STEP2 EXEC PGM=IKJEFT01,COND=(5,GT,STEP1)
//SYSTSPRT DD SYSOUT=*
//SYSTSIN DD *
SEND 'CONGRATULATIONS' USER(&var) LOGON
----is the above line correct?---- |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
When you submit the job, how is the data
SEND 'CONGRATULATIONS' USER(&var) LOGON
resolved? You can tell from your JESJCL output, since it will show you the resolution of all the JCL variables at run time. |
|
Back to top |
|
|
martin9
Active User
Joined: 01 Mar 2006 Posts: 290 Location: Basel, Switzerland
|
|
|
|
note:
the jes parser will not subtsitute jcl vars
in a instream dataset (ie. dd *),
therefore you cannot change any vars
on run time. after the job is substituted
and running.
only jcl-statements are substituited if used
with variables and this before any step is running.
you must use a job scheduling system like opc,
this will parse the entire job before jes, but
also not on run time...
martin9 |
|
Back to top |
|
|
|