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 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 Garbage on output file Hervey Martinez SYNCSORT 4 Wed Sep 27, 2017 12:50 am
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

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