Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Redefining 9(Numeric) to X(Alphanumeric) and again to 9
Goto page Previous  1, 2
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL
Author Message
David P

Active User


Joined: 11 Apr 2005
Posts: 110
Location: Cincinnati Ohio

PostPosted: Thu Apr 14, 2005 2:03 pm    Post subject:
Reply with quote

Hi Anu,
The reason you are not getting data exception is because both the variables data1 and data2 are of alphanumeric data type. (both being group items). If you define data1 as a numeric item and redefine the same by alphanumeric (only 2 variables instead of 4) then the same run would throw a data exception.

please feel free to add your views.
david.
Back to top
View user's profile Send private message
References
kanak

Moderator


Joined: 12 Mar 2005
Posts: 259
Location: India

PostPosted: Thu Apr 14, 2005 3:53 pm    Post subject:
Reply with quote

i think numeric field can contain spaces, but if u define the numeric field field as comp then u will get data exception while executing the program, at the time of compilation it won't show any error. and if the numeric field is defined just as 9(tt)...tt is any numeric value then even at the execution time it won't give abend.Just check this link...probably it will help

http://www.ibmmainframes.com/viewtopic.php?t=1968&highlight=

though example mention here is for comp-3 but it will be same for comp even.
Back to top
View user's profile Send private message
sribks2005

New User


Joined: 04 Apr 2005
Posts: 20
Location: Mysore

PostPosted: Thu Apr 14, 2005 4:34 pm    Post subject:
Reply with quote

Quote:
sribks2005-- Thats a very good try. But i dont know why it is giving data exception over there. Try to keep initialize statement instead of moving spaces to data2. Let us see what happens..

hi Anu,

I tried with initialize statement also.
=================================
initialize data2.
if data4 = spaces
display "numeric item contained spaces"
end-if.
display "alphanumeric data2=" data2.
==================================

but again it ran succesfully with data2 holding spaces.

Thanks,
Saraswathi
Back to top
View user's profile Send private message
raaga21

New User


Joined: 25 Mar 2005
Posts: 3

PostPosted: Fri Apr 15, 2005 1:39 pm    Post subject:
Reply with quote

hi anu,
i think that spaces also of alphanumeric type, while so it produces the same result. Lets check it out.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> Mainframe COBOL All times are GMT + 6 HoursGoto page Previous  1, 2
Page 2 of 2