Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Numeric field containing spaces

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Thu Mar 31, 2005 5:35 pm    Post subject: Numeric field containing spaces
Reply with quote

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

knd_r
Currently Banned

New User


Joined: 18 Mar 2005
Posts: 48

PostPosted: Thu Mar 31, 2005 6:56 pm    Post subject: Re: Numeric field containing spaces
Reply with quote

hi,

i think numeric data items cannot hold spaces

regards,
sudarsan
Back to top
View user's profile Send private message
kanak

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Thu Mar 31, 2005 6:59 pm    Post subject:
Reply with quote

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

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Fri Apr 01, 2005 5:31 am    Post subject:
Reply with quote

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

Moderator


Joined: 12 Mar 2005
Posts: 252
Location: India

PostPosted: Fri Apr 01, 2005 10:03 am    Post subject:
Reply with quote

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

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Apr 02, 2005 8:20 am    Post subject:
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts Partial color change of a field in CI... waseem0424 CICS 5 Fri Sep 29, 2017 7:56 pm
No new posts File Aid tool to compare numeric data balaji81_k Compuware & Other Tools 2 Tue Sep 26, 2017 3:35 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am
No new posts JES2 job size field matching Windows ... SRICOBSAS All Other Mainframe Topics 4 Tue Sep 05, 2017 5:49 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us