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

Make cobol variable value a variable


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

New User


Joined: 02 Oct 2021
Posts: 2
Location: India

PostPosted: Sat Oct 02, 2021 2:32 pm
Reply with quote

I've a requirement, where I need to use the content of a variable as a variable.

Scenerio is as below:
Variable Parm3 receives a map name(say MAPABC1) from Jcl Parm. I string Parm3 with variable I (value 'I') to generate the map input variable MAPABC1I which I store in say variable map-i.
Now, I need to use content of map-i (i.e MAPABC1I)as a variable.
How can this be achieved?
Back to top
View user's profile Send private message
sergeyken

Senior Member


Joined: 29 Apr 2008
Posts: 2010
Location: USA

PostPosted: Sat Oct 02, 2021 5:21 pm
Reply with quote

In COBOL it is not possible.

In general - it is not wise approach. You need to think better about the algorithm, rather than about COBOL.
Back to top
View user's profile Send private message
S De

New User


Joined: 02 Oct 2021
Posts: 2
Location: India

PostPosted: Sun Oct 03, 2021 4:41 am
Reply with quote

'Thank you' for your opinion
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3048
Location: NYC,USA

PostPosted: Sun Oct 03, 2021 5:39 pm
Reply with quote

You can SET some flag and use the appropriate variable why store and use it.

Also what is the rational behind doing all these , tell us the actual purpose .
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 Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
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