3,740 pts.
 convert password like ‘******’ in RPGLE
how do i show the password field as some symbols like(*****)..i tried it...but it shows only blank....

Software/Hardware used:
as400 v4r5
ASKED: November 28, 2011  6:08 AM
UPDATED: February 28, 2012  3:11 PM

Answer Wiki:
It's just as Splat said, not often done but possible. this took a while to find... http://www.as400pro.com/tipView.php?cat=RPG&key=215 Placing a 1 character input field with the keyword CHECK(ER) returns processing to the program after each character is enterd. An ouput Field of 10A could display '*'' when the first character is entered into the input field and one more '*' as each new character is entered. Phil
Last Wiki Answer Submitted:  November 28, 2011  6:08 pm  by  philpl1jb   44,070 pts.
All Answer Wiki Contributors:  philpl1jb   44,070 pts.
To see all answers submitted to the Answer Wiki: View Answer History.


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


 

Unless IBM’s added new functionality to DDS since the last time I looked, there’s not an easy way to do it.

In an earlier discussion I recall Tom Liotta suggesting that on each key stroke an asterisk could be echoed back to the display, but the coding would be rather extensive for the benefit derived.

In those times I’ve needed to protect entered data I just use DSPATR(ND) and let the user have at it.

 5,670 pts.

 

can i use XLATE operation to convert character to asterisk…. is this possible or not?????

 3,740 pts.

 

can i use XLATE operation to convert character to asterisk….

Yes, but it doesn’t help in this question. Run this in debug and see the results:

     DAlpha            c                   'ABCDEFGHIJLKMNOPQRSTUVWXYZ'
     DAstrx            c                   '**************************'
     DRes_tmp          s             15    inz
     DGen              s             15    inz( 'ABCDEFGHI' )

     C     Alpha:Astrx   xlate     Gen           Res_tmp
     c                   eval      Res_tmp = %xlate( Alpha : Astrx : Gen )

     c                   return

It should only take a minute or two to realize that it doesn’t affect input on the screen.

Tom

 107,735 pts.

 

i want convert my password as asterisk, when i login…..

 3,740 pts.

 

when i login…..

If you haven’t logged in yet, how are you planning to run your programming to mask your password?

Tom

 107,735 pts.

 

LOGIN, you didn’t say LOGIN
.. this won’t work for login
.. Don’ ned no stinkin login..
Sorry, there is a limited range of things that can be done with the AS/400 login screen and this isn’t amoung them.

The masking process that I mentioned was intended for other hidden values such as application passwords.
Phil
Phil

 44,070 pts.

 

i didn’t say about AS400 login screen…. i have built my own project… it have login screen.. here i want to do like that…. this s my point..

 3,740 pts.

 

i want to do like that….

In that case, the only real choice you have is to input each character one at a time. As each character is entered, output a field of asterisks back out to the screen. Add one more asterisk each time.

That’s the only choice you have. It’s due to the technology used in workstation terminal output — ‘block mode’.

In short, you have to write it all yourself. (That’s one reason none of us ever use such a technique.)

Tom

 107,735 pts.

 

You sure threw us a curve when you said login.

It would be nice if IBM had a display file keyword that would show an * for each charerter typed but it doesn’t.

Here, again, is the link to the code that will do what you want.
http://www.as400pro.com/tipView.php?cat=RPG&key=215

Could this code use the XLATE command, yes.
Does this code need to use the XLATE command, no.

If you’re having difficulty implmenting it please ask for further clarification.

Phil

 44,070 pts.

 

Mr. Phil, i used your link… but i can’t get correct answer… the link program make some error… as well as i used the xlate function, it also gave me incorrect answer… if u have another tips, share me….

 3,740 pts.

 

Show us your code, the display file and program and the error.
We will teach you how to debug it.
The XLATE isn’t necessary to solve this problem, you just seemed attached to it.
Phil

 44,070 pts.