View previous topic :: View next topic |
Author |
Message |
Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Mon Jul 09, 2007 3:25 am Post subject: Getting back the previous value |
|
|
Hi,
I Have a variable WS-EMP-IDEN which is used in a COBOL program. This value gets changed in diff paras( example mentioned below). I want to store the different values that this var holds in different paras so that the same can be populated back for every record processed. Below is an example.
Para :1
WS-EMP-IDEN =10
Para : 2
WS-EMP-IDEN =10012
Para : 3
WS-EMP-IDEN =1123
.....
.......
Para : 122
WS-EMP-IDEN =12356
As mentioned above there are more than 122 paras in my program and I do not want to declare seperate var for storing this variable.Is there a way this can be achieved using POINTERS? If so can any one provide the code for this ?
-Mt |
|
Back to top |
|
 |
CICS Guy Intermediate
Joined: 30 Apr 2007 Posts: 292 Topics: 3
|
Posted: Mon Jul 09, 2007 3:44 am Post subject: |
|
|
Not with pointers, but with an indexed array.
What is the problem with hardcoding it in the paragraph other than it makes it hard to update the empnos? |
|
Back to top |
|
 |
Martin Beginner

Joined: 20 Mar 2006 Posts: 133 Topics: 58
|
Posted: Mon Jul 09, 2007 3:50 am Post subject: |
|
|
CICS Guy,
I just gave an example there. The value of WS-EMP-IDEN changes.. and cannot be hardcoded.
-Mt |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Jul 09, 2007 3:50 am Post subject: |
|
|
Is this IBM Enterprise-COBOL or IBM-other-COBOL?
Using POINTERs is not going to solve your problem of multiple values for one field when you do not want to declare a separate Working-Storage data area (or dynamically allocated memory) to store the different values. You need to have discrete data areas to hold more than one value.
Without elaborating and explaining "what are you doing?", suggestions for storing values without declaring separate variables (which can't be done in COBOL - or any other programming language!) are going to be hard to provide. _________________ Dick Brenholtz
American living in Varel, Germany
Last edited by dbzTHEdinosauer on Mon Jul 09, 2007 5:24 am; edited 1 time in total |
|
Back to top |
|
 |
dbzTHEdinosauer Supermod
Joined: 20 Oct 2006 Posts: 1411 Topics: 26 Location: germany
|
Posted: Mon Jul 09, 2007 3:52 am Post subject: |
|
|
That is hard coding _________________ Dick Brenholtz
American living in Varel, Germany |
|
Back to top |
|
 |
|
|