Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

cobol working storage

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

New User


Joined: 20 Feb 2006
Posts: 6

PostPosted: Tue Jun 22, 2010 11:40 pm    Post subject: cobol working storage
Reply with quote

I have a working storage field contains the name of another working storage field. How can read the value of second field using the first field.

WS-A PIC X(10).

WS-B PIC X(10).

MOVE 'WS-A' TO WS-B.

Using WS-B how can I get the value of WS-A.
Is there any intrinsic function or value of function?

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

dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Jun 22, 2010 11:55 pm    Post subject:
Reply with quote

COBOL is not visual basic or c or java.

why do you need to do this?
if you would explain what you are trying to do,
someone can provide the cobol to accomplish your task.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Wed Jun 23, 2010 10:35 am    Post subject:
Reply with quote

Can be done with EVALUATE
http://ibmmainframes.com/viewtopic.php?t=48404
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jun 23, 2010 3:39 pm    Post subject:
Reply with quote

I'm afraid and totally bowled out - what are we talking about in this thread? icon_cry.gif
Back to top
View user's profile Send private message
GuyC

Senior Member


Joined: 11 Aug 2009
Posts: 1281
Location: Belgium

PostPosted: Wed Jun 23, 2010 3:45 pm    Post subject:
Reply with quote

about a kind of INTERPRET or Pointers in COBOL
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Wed Jun 23, 2010 3:53 pm    Post subject:
Reply with quote

some pgm-languages allow for the contents of an address to contain an address of which those contents are to be used as data.
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Wed Jun 23, 2010 3:59 pm    Post subject:
Reply with quote

Right, the pointer-concept of language-C? But if that's true - I was not able to infer that from this
Quote:
Using WS-B how can I get the value of WS-A.
..I'll keep silence now.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1228
Location: Israel

PostPosted: Thu Jun 24, 2010 5:03 pm    Post subject: Reply to: cobol working storage
Reply with quote

REXX can do this without blinking:
Code:
ws_a = 5
ws_b = 'ws_a'

interpret "say 'the value is '"ws_b     /* displays the value is 5     */
say 'the value is 'value(ws_b)          /* displays the value is 5 too */

But no such thing in COBOL... icon_sad.gif
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
This topic is locked: you cannot edit posts or make replies. Cobol GUI (like Editor) Kala Mainframe COBOL Programming 14 Wed May 10, 2017 12:30 pm
No new posts IMS T-Pipe queue counts in a COBOL Pr... Siva NKK Kothamasu IMS DB/DC 0 Tue May 09, 2017 6:31 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts COBOL Programming Sandpit? jodrisco COBOL Programming 6 Wed Apr 12, 2017 3:47 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us