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: 1226
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: 1280
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: 1226
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 RULES(NOEVENPACK) in cobol jackzhang75 COBOL Programming 5 Wed Mar 29, 2017 12:47 am
No new posts SQL query not working in Cobol program. CuriousMainframer COBOL Programming 14 Wed Feb 22, 2017 5:56 pm
No new posts Execute TSO ACF commands from COBOL-I... supreethi.srid TSO/ISPF 0 Tue Feb 21, 2017 5:19 pm
No new posts Mainframe Interview Questions CICS,CO... akshathan Mainframe Interview Questions 6 Thu Feb 09, 2017 6:38 pm
No new posts Submit job from Cobol with input data abdulrafi COBOL Programming 4 Wed Feb 01, 2017 12:41 pm


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