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
 
Pass value from JCL and use in COBOL Array

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

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Fri Nov 27, 2009 2:00 pm    Post subject: Pass value from JCL and use in COBOL Array
Reply with quote

Hi,

I want to pass value from a PARM to COBOL pgm. Could I use the parm value in Array?

02 X-TAB-05 OCCURS 1 TO PARM1-REC TIMES
DEPENDING ON X-05
INDEXED BY X-IND-05.
Back to top
View user's profile Send private message

expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8631
Location: Back in jolly old England

PostPosted: Fri Nov 27, 2009 2:56 pm    Post subject:
Reply with quote

Have you searched the forum / manuals for reading values from PARM.
Once you have read the value you can use it however you want.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Fri Nov 27, 2009 6:45 pm    Post subject:
Reply with quote

you can even redefine the parm value as a COBOL Internal table in linkage section.

but, maybe that is too much information.
Back to top
View user's profile Send private message
priyanka.msharma
Warnings : 1

New User


Joined: 28 Jan 2009
Posts: 12
Location: India

PostPosted: Mon Nov 30, 2009 11:53 am    Post subject:
Reply with quote

02 X-TAB-05 OCCURS 1 TO PARM1-REC TIMES
DEPENDING ON X-05
INDEXED BY X-IND-05.

question is..can I use PARM1-REC in occurs clause??
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6970
Location: porcelain throne

PostPosted: Mon Nov 30, 2009 12:43 pm    Post subject:
Reply with quote

well maximum size of PARM can only be 100.

and did you check the syntax of the occurs clause?
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8214
Location: Dubuque, Iowa, USA

PostPosted: Mon Nov 30, 2009 5:31 pm    Post subject:
Reply with quote

Quote:
question is..can I use PARM1-REC in occurs clause??
Did you check the manual (link at the top of the page)? The COBOL Language Reference clearly states that OCCURS integer-1 TO integer-2 TIMES is the syntax. I'm sure if you search enough you will discover that COBOL means integer numbers only when it says integer-2 -- NOT VARIABLES. Per the manual, I believe the answer to your question is no, you cannot use PARM1-REC in the OCCURS clause.
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 KSDS and Index file in cobol deepak14450 COBOL Programming 9 Fri Dec 22, 2017 9:36 am
This topic is locked: you cannot edit posts or make replies. Cobol to fetch the content by using s... arunc55 COBOL Programming 4 Fri Nov 17, 2017 1:25 pm
No new posts VBS and VB, COBOL syntax is the same ... natt.sut COBOL Programming 3 Sun Nov 12, 2017 6:36 am
This topic is locked: you cannot edit posts or make replies. Need help how to pass the ESP variabl... Venkichaitu JCL & VSAM 12 Thu Nov 02, 2017 3:53 am
No new posts COBOL - EXIT statement weird behavior anthony.pangestu COBOL Programming 0 Fri Oct 27, 2017 9:57 am

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