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
 

 

populating value into a variable - REG

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CICS
View previous topic :: :: View next topic  
Author Message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon Sep 27, 2010 10:05 pm    Post subject: populating value into a variable - REG
Reply with quote

hi all,

look at the code below,

Code:
IF SUB6 < 10                                 
    MOVE '01' TO RAR-RATE-ERROR-SW           
    ADD +1 TO SUB6                           
    MOVE '1030' TO RAC-RATE-ERROR-CODE (SUB6)
    GO TO Y100-RETURN-CNTL.                 


Declaration of SUB6 is,

Code:

01  WS-INDEXES.                                               
    05  FLD-MAP-INDEX              PIC S9(4) COMP VALUE ZEROS.
    05  DATE-INDEX                 PIC S9(4) COMP VALUE ZEROS.
    05  CHAR-IX                    PIC S9(4) COMP VALUE ZEROS.
    05  MONTH-IX                   PIC S9(4) COMP VALUE ZEROS.
    05  SUB1                       PIC S9(4) COMP VALUE ZEROS.
    05  SUB2                       PIC S9(4) COMP VALUE ZEROS.
    05  SUB3                       PIC S9(4) COMP VALUE ZEROS.
    05  SUB4                       PIC S9(4) COMP VALUE ZEROS.
    05  SUB5                       PIC S9(4) COMP VALUE ZEROS.
    05  SUB6                       PIC S9(4) COMP VALUE ZEROS.
    05  SEC-IX                     PIC S9(4) COMP VALUE ZEROS.
    05  WS-FIELD-HOLD-LENGTH       PIC S9(4) COMP VALUE ZEROS.


sub6/ws-indexes is not initialized anywhere in the program.
no value is moved.

it is not passed through commarea also.

is there any other way to populated/put value into sub6?
This is my production module written in 1988.

Please help.
Back to top
View user's profile Send private message

Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Sep 27, 2010 10:14 pm    Post subject: Reply to: populating value into a variable - REG
Reply with quote

Because all data-fields under group WS-INDEXES are COMP, you can substitute all the VALUE clauses with the following single MOVE statement at program-start -
Code:

MOVE LOW-VALUES TO WS-INDEXES.

Is this what you need resolved?

Keep in mind, if this program was originally OS/VS COBOL, many programmers were lazy, in that they didn't initialize fields.

However, when VS/COBOL II was introduced, IBM added a run-time option named WSCLEAR to initialize the storage.

Bill
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon Sep 27, 2010 10:26 pm    Post subject:
Reply with quote

Thanks for the reply Bill.
I am not asking how to put value into the variable.
What I am asking is,

No move statement is used in the program which means there is no value in sub6(variable).
But still they are checking if it is less than 10.
if less than 10 they are throwing an error.

I dont know from where the value is loaded into the variable. I am trying to figure out from where the value is loaded.
1) no value is moved to sub6 or to ws-indexes.
2) This variable is not passed from previous program's commarea.
3)This variable is not passed to any other program via commarea from the current program.

In this case, from where do you think the value is loaded into the variable(sub6).

Please ask me if my explanation is not understandable.
Back to top
View user's profile Send private message
Earl Haigh

Active User


Joined: 25 Jul 2006
Posts: 475

PostPosted: Mon Sep 27, 2010 10:44 pm    Post subject:
Reply with quote

Quote:
I dont know from where the value is loaded into the variable. I am trying to figure out from where the value is loaded.



If production program 1988, are you saying it doesn't work anymore ?

too little information in your request, without seeing the whole source program, how do you expect this forum to perform BASIC DEBUGGING for you ?[/url]
Back to top
View user's profile Send private message
Bill O'Boyle

CICS Moderator


Joined: 14 Jan 2008
Posts: 2502
Location: Atlanta, Georgia, USA

PostPosted: Mon Sep 27, 2010 10:53 pm    Post subject: Reply to: populating value into a variable - REG
Reply with quote

The program's listing should show you all the places where SUB6 is being referenced.

I'm assuming this is a CICS program, because you talk about a commarea?

When VS/COBOL II was introduced, WS was allocated via a CICS GETMAIN (without an INITIMG keyword), so without any type of initialization, SUB6 could contain any value. OS/VS COBOL WS was allocated via an MVS GETMAIN and it was pre-initialized.

But, the VALUE clause associated with SUB6, should clear this field to X'0000'.

If there wasn't a VALUE clause, then (for example) SUB6 could contain X'4040' (spaces), which is decimal 16448.

Once a CICS task is terminated, WS field-values which had been altered are no longer valid. This is also true for sub-programs which had been accessed via a LINK-API after returning back to the LINKER.

Bill
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon Sep 27, 2010 10:56 pm    Post subject:
Reply with quote

Earl,
It is in production which means it is still working.
code runs for thousands of lines. do you want me to copy it?

What I am asking is,
Is there some other way to put value into the variable other than a move and commarea?
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Sep 27, 2010 10:56 pm    Post subject:
Reply with quote

Hello,

SUB6 starts at zero.

The code increments by 1. . .

I suspect that after some times thru (maybe 10) the value will the next time be > 10. . .

Why is this a problem. . . icon_confused.gif

Obviously, i am missing something. . .
Back to top
View user's profile Send private message
shankarm

Active User


Joined: 17 May 2010
Posts: 175
Location: India

PostPosted: Mon Sep 27, 2010 11:01 pm    Post subject:
Reply with quote

Thanks for the effort Bill & dick.
I will look into it. I will post if i find what it is.
thanks again.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Sep 27, 2010 11:32 pm    Post subject:
Reply with quote

Hello,

Quote:
Is there some other way to put value into the variable other than a move and commarea?
Sure - unless the compute is being considered a "move".

No, it is not a good idea to try to post thousands of lines of code.

I guess i still don't understand the problem icon_confused.gif
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


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

PostPosted: Tue Sep 28, 2010 12:44 am    Post subject:
Reply with quote

Shan,
go to the REFERENCE NAME cross-reference portion of the compile output,
if you don't have it,
VIEW the program (with all procedural copybooks expanded) and on command line:
x all;f all sub6

that will tell you which statements reference the sub6 variable.
Back to top
View user's profile Send private message
Craq Giegerich

Senior Member


Joined: 19 May 2007
Posts: 1512
Location: Virginia, USA

PostPosted: Tue Sep 28, 2010 12:59 am    Post subject:
Reply with quote

Is the code in question even being executed?
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 -> CICS All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm
No new posts Variable for cursor names ravikumar15 DB2 5 Sun Jul 17, 2016 7:08 am
No new posts OPC JCL Variable passion_sujesh IBM Tools 5 Fri Jul 01, 2016 4:21 am
No new posts JOINKEYs and Variable files migusd SYNCSORT 8 Fri Jun 17, 2016 3:16 am
No new posts File Manager with Variable Length File ahabib IBM Tools 10 Thu Mar 31, 2016 11:00 pm


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