Is it possible to hide user typed input in REXX program

雨燕双飞 提交于 2019-12-11 21:24:04

问题


I need to PULL a password that a user will type, but don't want the characters to display on the screen. Could you help me to achieve this in REXX.


回答1:


Since you are running in ISPF, you can define a panel to reside in the ISPPLIB concatenation with a password field that is non-display.




回答2:


As @cshneid, use an ISPF Panel (and place it in the ISPPLIB). Here is an example panel containing a password field (see $ attribute) taken from ISPF Manual.

)ATTR
  * TYPE(TEXT)   INTENS(HIGH) COLOR(WHITE) CAPS(OFF)
  # TYPE(TEXT)   INTENS(HIGH) COLOR(BLUE)  CAPS(OFF)
  @ TYPE(TEXT)   INTENS(LOW)  COLOR(BLUE)  HILITE(REVERSE)
  ? TYPE(TEXT)   INTENS(LOW)  COLOR(TURQ)  CAPS(OFF)
  _ TYPE(INPUT)  INTENS(HIGH) COLOR(YELLOW)
  $ TYPE(INPUT)  INTENS(NON)
  ø TYPE(OUTPUT) INTENS(LOW)  COLOR(TURQ)  CAPS(OFF)
)BODY
* --------------------------@EMPLOYEE RECORD*--------------------------
# SERIAL NO.*===>_SERNUM  +&rbl                                          %
#
#
#   NAME:?&LAST, &FIRST
#
#   ADDRESS:øADDR1                      + 
#           øADDR2                      + 
#           øADDR3                      + 
#           øADDR4                      + 
#
#   POSITION:øPOSIT                     + 
#
#   YEARS EXPERIENCE:øYRS+ 
#
#   SALARY:øSALARY +       # PASSWORD*===>$PSW   + 
#                              (Password is required for salary)
#
#
* Enter#END*command to terminate application.
#
)PROC
   VER(&SERNUM,NB,NUM)
   .ATTR(.CURSOR) = 'COLOR(RED) HILITE(BLINK)'
)END

Please note I do not have a mainframe available to check so the following so there may be some syntax errors:

Rexx command to display a panel:

Address ispexec display panel(panelName)

If you need to add a DSN to the ISPPLIB

"ispexec libdef ispplib dataset id(panel-dsn)" 

Background information

ISPF uses a series of files (ispplib, ispmlib, isptlib etc) to store the details it uses. You can add extra PDS (on a temporary basis) to ISPF using the LIBDEF function in a rexx/clist programs. Historically these PDS's where RECFM=FB and had a LRECL of 80. This has changed. You should check the attributes of the existing ispplib PDS's and use similar attributes.

To display a panel it needs to be stored in the ISPPLIB (or a PDS allocated to ispplib using LIBDEF).

if you store the panel in pds my.panels(test) and allocate my.panels to ISPPLIB, the rexx is:

   /* rexx */
    address ispexec 'display panel(test)'
    say rc        /* show return code, will indicate possible errors */

if you use LIBDEF then the rexx is

  /* rexx */

    address ispexec "libdef ispplib dataset id(panel-dsn)" 
    say rc

    address ispexec 'display panel(test)'
    say rc        /* show return code, will indicate possible errors */

The Edit Macro guide has a list of services (and there return-codes)

If you allocate the panel to the panel library, you can also us the ispf test mode (ispf 7.1 ??? its been a while since I used the Mainframe) to test it



来源:https://stackoverflow.com/questions/18084599/is-it-possible-to-hide-user-typed-input-in-rexx-program

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!