Gokul Senthil
Gokul Senthil

Reputation: 13

as400 dds function to restrict the exact given value

i am new to as400 dds. can anyone tell me the function to get the exact given value. For example, zipcode consists of 6 digits. if the user doesn't enter the value less than 6, it must show an error. thanks in advance

Upvotes: 0

Views: 625

Answers (3)

Montana
Montana

Reputation: 81

You also need the DSPATR(MDT) keyword. From the DDS manual for the ME option of the CHECK keyword:

This code specifies that at least 1 character of data (a blank is valid) must be typed into the field. Note that when no field currently on the display has been changed, the display station does not enforce mandatory enter. To enforce mandatory enter, specify DSPATR(MDT) for at least one field in each record on the display. For all other fields in the record, CHECK(ME) is then enforced. However, because the device cannot determine if the user has typed data to a field with both DSPATR(MDT) and CHECK(ME), you should also specify DSPATR(ND) so that this field is not displayed.

Upvotes: 1

CRPence
CRPence

Reputation: 1259

Either of the following two example field definitions might help to effect whatever was attempted to be expressed. In either case a value can be entered\appear on the screen to have fewer than six digits, but the result for the program will always be six digits [right-justified, zero-filled to the left]:

     A            ZIPD           6D00B  9  9CHECK( ME MF    FE )
     A            ZIPDRZ         6D00B 13  9CHECK( ME    RZ FE )

Although the Right-Adjust Zero-Fill CHECK-specification (RZ) is optional, that specification ensures the reformatting of the number is visible from the zero-fill when Field Exit is used [but of course the Field Exit CHECK-specification (FE) is also optional, yet encouraging its use makes the effect of right\zero more conspicuous]. FWiW the Must-Fill CHECK-specification (MF) seems to have no effect [for the numeric input field; none that was obvious in my tests].

Upvotes: 0

user2338816
user2338816

Reputation: 2163

Try something like this:

A            ZIP            6Y 0I 17  4CHECK( ME MF )

If it's not what you need, edit your question and add details.

Upvotes: 0

Related Questions