decimal data error
175 pts.
0
Q:
decimal data error
i mean how to trap decimal data error in cobol\400.as we do monmsg command in cl ,is there any same way in cobol\400
ASKED: Dec 22 2008  1:38 PM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
285 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
you could set the data type on the field to D this means only digts 0-9 can be entered

Michael Dratwa wrote:
Have the numeric field redefined as alphanumeric (or move the field to a test alphanumeric fld) and use the test for numeric's.


01 ws-data-record.
05 ws-data-fld1 pic 9(5).
05 ws-data-fld1x redefines ws-data-fld1 pic x(5).
05 ...

if ws-data-fld1x not numeric
(do error routine)
else
....
end-if.
Last Answered: Dec 24 2008  3:32 PM GMT by MDratwa   285 pts.
Latest Contributors: Markpg   155 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Kapiltiwari   175 pts.  |   Dec 24 2008  7:30AM GMT

Can u clear it more. write a simple line of code

 

NullFields   395 pts.  |   Dec 24 2008  4:01PM GMT

You can write an error handler that can be invoked by the cobol program similar to how MONMSG works in CL. Look at Chapter 6 of the COBOL USERS GUIDE.

Also, depending on the verb used when the data decimal occured, you might be able to capture in with the verbs ON SIZE syntax. You can also learn more about that in the COBOL USER GUIDE.

The guide mentioned above is for the OPM Cobol. If you are actually and ILE/COBOL instead of COBOL/400, this is the link. (Chapter 16).

 

Supriyob2   65 pts.  |   Sep 9 2009  7:27AM GMT

if Variable (var) is alpahanumeric :

If var is numeric

move var to num-var

else
….

if ur cobol pgm gets called from CLP then and a numeric value is being passed from CLP to a numeric field in cobol :
make the numeric varibale in cobol as comp-3.

Supriyo

 
0