85 pts.
 edtmsk in AS/400
how to write a password mask program in AS400, in which user can display the character as '****' or '######'

Software/Hardware used:
ASKED: September 23, 2009  6:58 AM
UPDATED: April 13, 2011  6:06 AM

Answer Wiki:
You can set the field with DSPATR(ND) for entering a password. But with a 5250 data stream since the machine does not read the screen until you hit ENTER, you cannot key one character and display anther untile ENTER is depress.
Last Wiki Answer Submitted:  September 23, 2009  12:55 pm  by  CharlieBrowne   33,730 pts.
All Answer Wiki Contributors:  CharlieBrowne   33,730 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

I’m pretty sure that there’s no good way to get this done as long as the standard 5250 interface will be used. I can imagine that the Dynamic Screen Manager (DSM) APIs could be used to construct a process, but it’d take an experienced DSM developer to be sure.

Beyond that, I’ve only seen one potentially useful way to simulate this with “normal” display file processing.

Define two fields for password handling.

One field is a 1-byte input field that is DSPATR(ND) CHECK(ER). This will be the password entry field. Each typed character will cause CHECK(ER) to input the character.

The other field is an output field as big as your passwords are allowed to be. Every time a character is typed into the first field, the program adds a ‘*’ character to the string that gets written back out to this field.

The program loops on input until some F-key signals the loop to end. The password characters are concatenated into an internal field at the same time each ‘*’ is concatenated to the output field.

Pretty ugly, but it can be made to work if absolutely required. (I credit “Murphy” with pointing out this technique in case he runs across this posting.)

 110,175 pts.