350 pts.
 decimal data error
i mean how to trap decimal data error in cobol400.as we do monmsg command in cl ,is there any same way in cobol400

Software/Hardware used:
ASKED: December 22, 2008  1:38 PM
UPDATED: September 9, 2009  7:27 AM

Answer Wiki:
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 Wiki Answer Submitted:  December 24, 2008  3:32 pm  by  Markpg   155 pts.
All Answer Wiki Contributors:  Markpg   155 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


Discuss This Question:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _


 

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

 350 pts.

 

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).

 880 pts.

 

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

 165 pts.