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 data from COBOL to JCL

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

New User


Joined: 21 Feb 2005
Posts: 4

PostPosted: Mon Feb 21, 2005 12:40 pm    Post subject: Pass data from COBOL to JCL
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    Post subject: Re: how can i pass data from cobol to jcl
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    Post subject:
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: 1203
Location: India

PostPosted: Fri Mar 04, 2005 7:15 pm    Post subject: Re
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    Post subject:
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    Post subject: Re: how can i pass data from cobol to jcl
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

Moderator Team Head


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

PostPosted: Thu Mar 09, 2006 4:32 pm    Post subject: Re: how can i pass data from cobol to jcl
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: 287
Location: Basel, Switzerland

PostPosted: Thu Mar 09, 2006 7:59 pm    Post subject:
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    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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts Data replication from multiple Db2 ta... kishpra DB2 5 Mon Mar 27, 2017 9:58 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am


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