Code all programs with careful consideration to potential runtime errors. The errors most frequently encountered involve improper handling of data. These errors are attempts to assign a value that is of an inappropriate data type, format, or size to a column or field. You can test the values thoroughly and manipulate them before making an assignment using the comprehensive set of functions in the CA Ideal Procedure Definition Language (PDL).
The following are simple examples of functions that ensure that the data assigned to a column conforms to the column attributes:
The $ROUND function assigns a numeric value with two decimal positions to the field OPEN$:
SET OPEN$ = $ROUND(value,FACTOR = .01)
SET STATE = $SUBSTR(value,START = 1,LENGTH = 2)
IF $VERIFY(value,AGAINST = (UCALPHA,NUMERIC))
SET CUSTID = value
ELSE
DO BADVALUE
ENDIF
SET ACTDT = $DATE('YYMMDD',DATE = $TODAY)
For more information about CA Ideal functions, see the Programming Reference Guide.
|
Copyright © 2015 CA Technologies.
All rights reserved.
|
|