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
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1208

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: 2792
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 COBOL-DB2 COBOL Programming 1
No new posts IDCAMS listcat service using cobol JCL & VSAM 1
No new posts how to convert and use 1 bit hex-numb... COBOL Programming 10
No new posts VB file copy COBOL program gives erro... COBOL Programming 3
No new posts Cobol program to determine the sequen... COBOL Programming 2
Search our Forums:

Back to Top