IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

getting problem with variable initialization.


IBM Mainframe Forums -> CICS
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pravin madoori

New User


Joined: 29 Jan 2007
Posts: 25
Location: Hyderabad

PostPosted: Tue Sep 18, 2007 12:45 pm
Reply with quote

I have a varible used in a program C00, which is not initialized but declared like below:
03 BACK-CTR PIC S9(4) COMP-5 SYNC. This is a cobol stmt.

One strange thig is this varible is not initialized but used in program. It's working Fine is Test system. This BACK-CTR is also used in Called program by moving it to BACK-CNT, BACK-CNT is declared like below.
03 BACK-CNT PIC X(4) value '0000'.

Call to the program is like below:
EXEC CICS LINK PROGRAM('C03') COMMAREA(BACKL-AREA)
END-EXEC .
BACKL-AREA contains BACK-CNT as a field.
In C03 program , back-count is coming as a wrong value in production but working in Test system. What can be the reason for it. We had an environment changed[ some patch was applied] in production but not in test system. is this can be the problem?
Back to top
View user's profile Send private message
kgumraj2

New User


Joined: 01 Aug 2007
Posts: 42
Location: Hyderabad

PostPosted: Tue Sep 18, 2007 1:51 pm
Reply with quote

Hi,
the reason difference between 2 regions are
1. version incompactability
2. data issue.

In your case it might be a data issue do check that and let us know thanks.
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Sep 18, 2007 1:59 pm
Reply with quote

First, the value defined in the called program is not looked at or used since the calling program overlays the called program's definition with its own values.
The two byte binary to four byte character is bad, though with the sync clause, the difference may be only one byte.....
The test vs prod values can arise from uninitialized storage where prod storage might be "dirty" and the less active test might still be "clean"....
Back to top
View user's profile Send private message
pravin madoori

New User


Joined: 29 Jan 2007
Posts: 25
Location: Hyderabad

PostPosted: Tue Sep 18, 2007 9:04 pm
Reply with quote

Is the below declaration correct.

03 BACK-CTR PIC S9(4) COMP-5 SYNC VALUE ZERO.

In COBOL manual i have seen below stmt. it says for Group entries we can't used Value clause if sync is used. As above stmt is not a Group entry, i assume it's a correct stmt. Can any one confirm the same pls.


From COBOL manual:For group entries, the VALUE clause must not be specified if the entry
also contains any of the following clauses: JUSTIFIED, SYNCHRONIZED, or
USAGE (other than USAGE DISPLAY).
Back to top
View user's profile Send private message
CICS Guy

Senior Member


Joined: 18 Jul 2007
Posts: 2146
Location: At my coffee table

PostPosted: Tue Sep 18, 2007 11:35 pm
Reply with quote

03 BACK-CTR PIC S9(4) COMP-5 SYNC VALUE ZERO.
Is not a group entry, it is an elementary entry......
Back to top
View user's profile Send private message
Earl

Active User


Joined: 17 Jun 2007
Posts: 148
Location: oklahoma

PostPosted: Wed Sep 19, 2007 12:24 am
Reply with quote

please give example of BACKL-AREA in BOTH programs.



You will need to change 1 or both programs to have same field description.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Wed Sep 26, 2007 3:23 pm
Reply with quote

COMP-5 fields are binary, which means they can have any value between LOW-VALUES and HIGH-VALUES.
If the field is not initialized and contains garbage, for example, "0C3A", the COBOL program will still interpret this as a valid COMP-5 number (3130 in decimal).
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> CICS

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Variable Output file name DFSORT/ICETOOL 8
No new posts Moving Or setting POINTER to another ... COBOL Programming 2
No new posts parsing variable length/position data... DFSORT/ICETOOL 5
Search our Forums:

Back to Top