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

Pass value from jcl to cobol through sysin


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

New User


Joined: 27 Aug 2006
Posts: 5

PostPosted: Tue Sep 26, 2006 8:04 pm
Reply with quote

Hi,
if we pass the value from jcl to cobol through sysin dd *,how the passing values accept in cobol program.
let me know ......
Back to top
View user's profile Send private message
Kevin

Active User


Joined: 25 Aug 2005
Posts: 234

PostPosted: Tue Sep 26, 2006 8:12 pm
Reply with quote

The COBOL program would use the ACCEPT statement to accept the data from the SYSIN DD to a section of WORKING-STORAGE.

Ex.
Code:

       IDENTIFICATION DIVISION.                       
       PROGRAM-ID. MYPROG.     
       ENVIRONMENT DIVISION.                           
       INPUT-OUTPUT SECTION.           
       ...
                                                         
       WORKING-STORAGE SECTION.                           
       01 INPUT-PARAMETER PIC X(254).
       ...
       PROCEDURE DIVISION.
       ACCEPT INPUT-PARAMETER FROM SYSIN.
       ...
Back to top
View user's profile Send private message
shreevamsi

Active User


Joined: 23 Feb 2006
Posts: 305
Location: Hyderabad,India

PostPosted: Wed Sep 27, 2006 10:42 am
Reply with quote

just to add..

when you pass data thru SYSIN....u can handle the data thru ACCEPT statement in the Cobol code.

If you pass data as PARM, the parm data can be handled using the linkage declaretion.

~Vamsi
Back to top
View user's profile Send private message
babu kota

New User


Joined: 20 Sep 2006
Posts: 1

PostPosted: Wed Sep 27, 2006 12:42 pm
Reply with quote

can you post the JCL syntax for passing values to cobol
Back to top
View user's profile Send private message
gayathrieka

New User


Joined: 27 Sep 2006
Posts: 1

PostPosted: Wed Sep 27, 2006 3:58 pm
Reply with quote

in cobol, if u have statements like below,

ACCEPT A.
ACCEPT B.

then in jcl, the values are passed as

//SYSIN DD *
12
15
/*
//
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 COBOL -Linkage Section-Case Sensitive COBOL Programming 1
No new posts COBOL ZOS Web Enablement Toolkit HTTP... COBOL Programming 0
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
Search our Forums:

Back to Top