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: 6966
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: 1224
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: 1278
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: 6966
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: 1224
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
No new posts Executing OO COBOL program invoking J... Virendra Shambharkar COBOL Programming 2 Tue Jan 10, 2017 6:37 pm
No new posts OO COBOL compile error Virendra Shambharkar COBOL Programming 3 Tue Jan 10, 2017 6:05 pm
No new posts Need Suggestion on COBOL program vickey_dw COBOL Programming 5 Thu Jan 05, 2017 10:55 pm
This topic is locked: you cannot edit posts or make replies. RANDOM Function in COBOL swapnil781 COBOL Programming 2 Tue Nov 15, 2016 6:17 pm
No new posts Regarding COBOL Stored Procedure opti... selvamsrinivasan85 DB2 4 Fri Nov 04, 2016 8:57 pm


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