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
 
what happen when move garbage value to numeric field

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

New User


Joined: 23 Aug 2006
Posts: 5

PostPosted: Fri Aug 25, 2006 12:13 pm    Post subject: what happen when move garbage value to numeric field
Reply with quote

Can anyone tell me what will happen when we move a garbage value to a numeric field? Will it abend?
Back to top
View user's profile Send private message

annujp

New User


Joined: 31 Aug 2005
Posts: 39
Location: St Paul,MN

PostPosted: Fri Aug 25, 2006 12:39 pm    Post subject:
Reply with quote

It wont abend until u use the numeric field for some calculations. Like a compute,ADD or something like that.
A simple move will not cause an abend
Back to top
View user's profile Send private message
vaibhav7

New User


Joined: 23 Aug 2006
Posts: 5

PostPosted: Fri Aug 25, 2006 2:06 pm    Post subject:
Reply with quote

Many thanks annujp.

I am bit confused as what can be be there in garbage fields as I was not able to try it out.

Can it be variables which are not initilised or any other? Please can you specify?
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Fri Aug 25, 2006 4:41 pm    Post subject:
Reply with quote

Hi,

Cobol accepts values which are not compatible. i.e a variable declared as

PIC 9(5)

can accept ABCDE .

When we try to do some computation with respect to variable it abends.

Also the COMP3 variables will behave in the different way.

There may even be a error message like. Variable type mismatch.

Regards,

Diwakar

---------------------------------------------------------

Nobody is perfect . I am Nobody
Back to top
View user's profile Send private message
vaibhav7

New User


Joined: 23 Aug 2006
Posts: 5

PostPosted: Fri Aug 25, 2006 6:33 pm    Post subject: Re: SOC7
Reply with quote

thans diwakar
Back to top
View user's profile Send private message
vaibhav7

New User


Joined: 23 Aug 2006
Posts: 5

PostPosted: Fri Aug 25, 2006 6:34 pm    Post subject: Re: SOC7
Reply with quote

thanks diwakar
Back to top
View user's profile Send private message
cobolunni

Active User


Joined: 07 Aug 2006
Posts: 128
Location: kerala,india

PostPosted: Mon Aug 28, 2006 12:07 am    Post subject:
Reply with quote

But in the case of array declared in the file record when we are giving non numeric value to numeric field why we are getting an error
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Mon Aug 28, 2006 8:15 am    Post subject:
Reply with quote

Here's a situation where a move will abend w/an 0C7:
Code:

05  alphas   pic  x(003) value 'XYZ'.
05  comp-3-s redefines
    alphas   pic S9(005) comp-3.
05  comp-3-r pic S9(005) comp-3.


move comp-3-s to comp-3-r



Because the MOVE stmt generates a ZAP (zero and add packed) assembler language instruction, which is an arithmetic insruction, an 0C7 occurs when the "garbage" (XYZ) is encountered executing the ZAP.
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Mon Aug 28, 2006 12:37 pm    Post subject:
Reply with quote

Hi mmwife,

Thanks for coming up with an example.

Regards,
Diwakar

--------------------------------------------------------------

Nobody is perfect. I am nobody
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 How to include a particular field val... sakrat DFSORT/ICETOOL 8 Fri Apr 06, 2018 8:27 pm
No new posts Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am
No new posts Extract the records with a PD field's... sudhakar84 DFSORT/ICETOOL 11 Mon Apr 02, 2018 7:26 pm
No new posts Searching a table for the field name? socker_dad COBOL Programming 8 Sat Mar 31, 2018 2:57 am
No new posts RMM Cannot move a volume from SHELF l... tspr52 IBM Tools 0 Thu Mar 01, 2018 3:48 pm

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