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

Pass data from COBOL to JCL


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rahulbose

New User


Joined: 21 Feb 2005
Posts: 3

PostPosted: Mon Feb 21, 2005 12:40 pm
Reply with quote

how can i pass data from cobol to jcl.
Back to top
View user's profile Send private message
ovreddy

Active User


Joined: 06 Dec 2004
Posts: 211
Location: Keane Inc., Minneapolis USA.

PostPosted: Wed Feb 23, 2005 5:07 pm
Reply with quote

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
View user's profile Send private message
lnvrn

New User


Joined: 24 Feb 2005
Posts: 8
Location: Mumbai

PostPosted: Fri Mar 04, 2005 1:54 pm
Reply with quote

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
View user's profile Send private message
mcmillan

Site Admin


Joined: 18 May 2003
Posts: 1210
Location: India

PostPosted: Fri Mar 04, 2005 7:15 pm
Reply with quote

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
View user's profile Send private message
kingofmf

New User


Joined: 02 Mar 2005
Posts: 13
Location: Bangalore

PostPosted: Sun Mar 13, 2005 12:36 pm
Reply with quote

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
View user's profile Send private message
Abhilasha

New User


Joined: 09 Mar 2006
Posts: 7
Location: India

PostPosted: Thu Mar 09, 2006 4:21 pm
Reply with quote

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
View user's profile Send private message
superk

Global Moderator


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

PostPosted: Thu Mar 09, 2006 4:32 pm
Reply with quote

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
View user's profile Send private message
martin9

Active User


Joined: 01 Mar 2006
Posts: 290
Location: Basel, Switzerland

PostPosted: Thu Mar 09, 2006 7:59 pm
Reply with quote

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
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 -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts How to save SYSLOG as text data via P... All Other Mainframe Topics 4
No new posts Store the data for fixed length COBOL Programming 1
No new posts Replace each space in cobol string wi... COBOL Programming 3
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