MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Getting back the previous value

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Mon Jul 09, 2007 3:25 am    Post subject: Getting back the previous value Reply with quote

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
View user's profile Send private message
CICS Guy
Intermediate


Joined: 30 Apr 2007
Posts: 292
Topics: 3

PostPosted: Mon Jul 09, 2007 3:44 am    Post subject: Reply with quote

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
View user's profile Send private message
Martin
Beginner


Joined: 20 Mar 2006
Posts: 133
Topics: 58

PostPosted: Mon Jul 09, 2007 3:50 am    Post subject: Reply with quote

CICS Guy,

I just gave an example there. The value of WS-EMP-IDEN changes.. and cannot be hardcoded.

-Mt
Back to top
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Jul 09, 2007 3:50 am    Post subject: Reply with quote

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
View user's profile Send private message
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Mon Jul 09, 2007 3:52 am    Post subject: Reply with quote

Code:
WS-EMP-IDEN =12356
That is hard coding
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group