View previous topic :: View next topic
|
Author |
Message |
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
hi all,
can a numeric value hold spaces...the declaration of the variable is
03 TWA-NUM1 PIC 9(07).
This is LS variable and it is not being initialized with any value and no value is passes as the program associate with it, which is a CICS program and from CICS region this program is acting as direct function call program.Please give me reply as soon as possible...as while this is being populated into another numeric variable it passes spaces... |
|
Back to top |
|
|
knd_r Currently Banned New User
Joined: 18 Mar 2005 Posts: 48
|
|
|
|
hi,
i think numeric data items cannot hold spaces
regards,
sudarsan |
|
Back to top |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
sorry...as i m getting the situation where it is holding spaces at run time and due to that it is not abending at all.. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
Hi KK,
Yes, the field CAN contain spaces. How they got there is another ques. What is your REAL ques?
P.S. what is an LS Variable? |
|
Back to top |
|
|
kanak
Moderator
Joined: 12 Mar 2005 Posts: 252 Location: India
|
|
|
|
hi MM,
With LS variable i mean to say Linkage Section variable.Sorry for inconvinience...
The question i am getting OC7 due to following peice of code:
IF VAR1 = VAR2
<PERFORM SOME OPERATION>
ELSE
<PERFORM SOME OTHER OPERATION>
END-IF
Now VAR1 and VAR2 both are PIC 9(07). VAR2 is being populated from one LS variable which is also having the same picture clause i.e. PIC 9(07). As the LS variable somehow contains SPACE and it is being passed to VAR2 down the line of execution. As far as i know it should give OC7 while executing the given IF condition, but it is not abending there. Now as the IF cindition satisfy the comparision hence it is performing the operation. Due the performed operation one another variable VAR3 is getting SPACE which is off PIC 9(03) COMP-3.
IF VAR3 GREATER THAN ZEROES -- ABEND Line
and in this line it is giving OC7.
My question is why it is not abended in first IF comparision when both the variable VAR1 and VAR2 are spaces. Is this due the presence of COMP-3 in the declartion of VAR3 which is giving abend. |
|
Back to top |
|
|
mmwife
Super Moderator
Joined: 30 May 2003 Posts: 1592
|
|
|
|
One explanation is that the PIC 9 fields are defined w/o signs. An A/N compare was probably generated and no conversion was attempted. The comp-3 IF will result in data conversion and decimal arith will be generated to do the IF. If the data is not numeric an 0C7 will result.
If I were you I'd display each field, both the comp-3 and the display numeric fields. DISPLAY the dn fields like this:
DISPLAY '>' VAR1(1:) '<'.
This will force the DISPLAY of the field as PIX X not PIC 9. The brackets make it easy to see where the field begins and ends.
You may have to redefine the comp-3s to PIC X and DISPLAY the PIC X field.
Use SDSF to view the displays, but use SE not S. Then enter HEX ON in the cmd line. See what shows up.
Another approach is to re-compile with NOOFF,LIST and see what code is generated for the IF stmts.
HTH |
|
Back to top |
|
|
|