Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups 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 Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm
No new posts Alter &DATENS field in HEADER1 Angad DFSORT/ICETOOL 4 Mon Apr 24, 2017 11:49 am
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us