Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Two ways to pass a parameter to Cobol Program

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe Interview Questions
View previous topic :: :: View next topic  
Author Message
sudheer_kumar

New User


Joined: 27 Dec 2005
Posts: 16

PostPosted: Tue Mar 28, 2006 5:50 pm    Post subject: Two ways to pass a parameter to Cobol Program
Reply with quote

Using PARM keyword
*****************
The above method is known.

//step1 EXEC PGM=pgm1,PARM='custno'

Using Sysin
**********
//SYSIN DD DATA
123333
//*

In cobol program, ACCEPT varname FROM SYSIN.

Regards,
Sudheer
Back to top
View user's profile Send private message

vikasc4

New User


Joined: 11 Dec 2005
Posts: 32

PostPosted: Wed Mar 29, 2006 11:58 am    Post subject:
Reply with quote

Hi Sudheer,

I don't understand you want to ask or tell.
Back to top
View user's profile Send private message
Gautam512

Active User


Joined: 05 Oct 2005
Posts: 309
Location: Vizag / US

PostPosted: Wed Mar 29, 2006 5:38 pm    Post subject: Re: Two ways to pass a parameter to Cobol Program
Reply with quote

HI,

I think sudheer wants to explain how we can send values to the program.
Back to top
View user's profile Send private message
superk

Moderator Team Head


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

PostPosted: Sat Apr 01, 2006 1:25 am    Post subject: Re: Two ways to pass a parameter to Cobol Program
Reply with quote

If this is accepted to be true, then should these two statements not return the same result?

1.
Code:

//MYPROC PROC RUNDATE=030106
//*
//PS01 EXEC PGM=MYPROG,PARM='&RUNDATE'


2.
Code:

//MYPROC PROC RUNDATE=030106
//*
//PS01 EXEC PGM=MYPROG
//SYSIN DD *
&RUNDATE
/*


I disagree with the concept that there is any more than one way - using the PARM parameter.
Back to top
View user's profile Send private message
martin9

Active User


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

PostPosted: Sat Apr 01, 2006 5:50 pm    Post subject:
Reply with quote

hy sudheer_kumar,

with ACCEPT you will access a file in jcl,
SYSIN is the default.

with the PARM keyword in the EXEC-card,
you receive the data directly into the linkage section.

LINKAGE SECTION.
01 PARM.
05 PARM-length PIC S9(04) COMP. from 1 to 255 bytes possible.
05 PARM-value PIC X(?). depending what you expect.

PROCEDURE DIVISION USING PARM.

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 -> Mainframe Interview Questions All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts IEW2456E error when link-editing a C ... Senthilraj JCL & VSAM 0 Fri Oct 13, 2017 3:12 pm
No new posts How to write Rexx program to size and... sreejeshcs CLIST & REXX 14 Thu Oct 12, 2017 7:26 am
No new posts Accessing CICS tran with map from JCL... navdeepaggarwal CICS 5 Tue Oct 03, 2017 6:15 pm
No new posts Assembler Macro Copybook converted to... Ziquilix PL/I & Assembler 4 Tue Sep 26, 2017 3:07 am
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us