Saturday, April 18, 2009

DISCUSSION FORUM - Simple things but take us a long time if we don’t follow rules

A simple rule of a keyword ‘Blink’ in an AS400 display file has made me spend more than 6 hrs. for debug. Whenever a display attribute Blink (DSPATR(BL)) is to be given in a display file, we must necessarily associate it with a COLOR RED failing which the blink will not appear on the screen. I learnt it the hardway hence thought of sharing it with everybody relevant to this field.

Any comments are welcome.

1 comment:

  1. How to get the length of a value in a CL variable.

    It uses a single command, RTVMSG, and it works for character variables up to 512 bytes long

    dcl &myvar *char 256 value('Abcd') /* Can be max *CHAR(512) */
    dcl &l_myvar *dec (5 0)

    rtvmsg msgid(CPF9897) msgf(QCPFMSG) msgdta(&myvar) msglen(&l_myvar)
    And that's all there is to it. Use CPF9897 because it has no message text of its own--the returned length includes only the length of the supplied message data. It's far from perfect because of the length limitation; but for perhaps the majority of cases, it works very well.

    ReplyDelete