- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- HP COBOL ACCEPT with a masking character
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2009 01:56 PM
08-10-2009 01:56 PM
HP COBOL ACCEPT with a masking character
I'm looking for a way to accept a field no echo, but display a character mask like "*" or periods, etc. Does HP COBOL have this ability, or does someone have a routine they can share?
Thanks,
John
john dot farmer at genworth dot com
HP COBOL V2.9, OpenVMS 8.3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-10-2009 07:55 PM
08-10-2009 07:55 PM
Re: HP COBOL ACCEPT with a masking character
Not in Cobol.
The terminal driver has a 'item'
TRM$_ALTECHSTR which you can used for IO$_READVBLK | IO$M_EXTEND when you also specify TRM$_EDITMODE -> TRM$K_EM_RDVERIFY and
TRM$_MODIFIERS -> TRM$M_TM_NOECHO.
But IMHO that's a nasty piece of work. Hard to program! It's TRM$_PICSTRNG mig help restrict to valid passowrd charcters IF you can describe that with the 5 bits available.
There is an SMG call SMG$_READ_VERIFY which make this a tad easier, but not much.
I'd be tempted to do a plain single character IO reads with no-echo and do your own echo of a "*" for every character received.
Sorry, no example handy.
I can Email a somewhat working QIO_EXTEND example, but it is not good enough for publication.
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-11-2009 05:41 AM
08-11-2009 05:41 AM
Re: HP COBOL ACCEPT with a masking character
I have a program (alas written in fortran) the does shat you want. Maybe you can convert it to cobol. I attached the code
If you have any questions let me know.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-12-2009 01:12 AM
08-12-2009 01:12 AM
Re: HP COBOL ACCEPT with a masking character
COBOL has the ACCEPT WITH NO ECHO but won't display your "*" as you type. I'd stick with that, or FMS if you've got it.
In the mean time, as Hein suggested, there's smg$ (I've attached a time format example). And below is snippets from a $qio read verify program.
Please note that both are in upper-case and use hyphens which would date them at 20+ years old. But FWIW. . .
Cheers Richard Maher
*+
* Read Verify Working Storage
*-
01 READ-VERIFY-ITEM-LIST GLOBAL.
03 ITEM-EDITMODE.
05 PIC 9(4) COMP.
05 PIC 9(4) COMP VALUE EXTERNAL TRM$_EDITMODE.
05 PIC 9(9) COMP VALUE EXTERNAL TRM$K_EM_RDVERIFY.
05 PIC 9(9) COMP.
03 ITEM-MODIFIERS.
05 PIC 9(4) COMP.
05 PIC 9(4) COMP VALUE EXTERNAL TRM$_MODIFIERS.
05 RV-MODS PIC 9(9) COMP.
05 PIC 9(9) COMP.
03 ITEM-ESCBUFF.
05 PIC 9(4) COMP.
05 PIC 9(4) COMP VALUE EXTERNAL TRM$_ESCTRMOVR.
05 PIC 9(9) COMP VALUE 4.
05 PIC 9(9) COMP.
03 ITEM-INISTRNG.
05 PIC 9(4) COMP VALUE 1.
05 PIC 9(4) COMP VALUE EXTERNAL TRM$_INISTRNG.
05 POINTER VALUE REFERENCE I-STRING.
05 PIC 9(9) COMP.
03 ITEM-PICSTRNG.
05 PIC 9(4) COMP VALUE 1.
05 PIC 9(4) COMP VALUE EXTERNAL TRM$_PICSTRNG.
05 POINTER VALUE REFERENCE P-STRING.
05 PIC 9(9) COMP.
03 ITEM-PROMPT.
05 PIC 9(4) COMP VALUE 15.
05 PIC 9(4) COMP VALUE EXTERNAL TRM$_PROMPT.
05 POINTER VALUE REFERENCE RV-PROMPT.
05 PIC 9(9) COMP.
*
01 ITEMLIST-LEN PIC 9(4) COMP GLOBAL VALUE 72.
*
01 RV-PROMPT GLOBAL.
03 PIC X VALUE ESC.
03 PIC X VALUE "[".
03 RV-ROW PIC 9(4).
03 PIC X VALUE ";".
03 RV-COL PIC 9(4).
03 PIC X VALUE "f".
03 PIC X VALUE ESC.
03 PIC XX VALUE "[m".
*
/
01 IN-STRING GLOBAL.
03 PIC XX.
03 IN-CODE PIC XXX.
88 GOLD-KEY VALUE "OP".
88 HELP-LOV VALUES "[28", "OQ".
88 NEXT-CHOICE VALUE "[B".
88 PREV-CHOICE VALUES "[A", "[24".
88 NEXT-PAGE VALUE "[6~".
88 PREV-PAGE VALUE "[5~".
88 SLCT-CHOICE VALUES "[4~", "On", "[29", "OM".
88 EXIT-LOV VALUE "[21".
88 CNCL-LOV VALUES "[19", "[23".
*
01 I-STRING PIC X.
01 P-NUMBER PIC 9(4) COMP VALUE EXTERNAL TRM$M_CV_ANY.
01 P-STRING REDEFINES P-NUMBER.
03 PIC X.
*-
01 IOSB GLOBAL.
03 IOSB-STATUS PIC 9(4) COMP.
03 PIC XX.
03 PIC X(4).
01 IO$_READVBLK PIC 9(9) COMP GLOBAL VALUE EXTERNAL IO$_READVBLK.
01 IO$M_EXTEND PIC 9(9) COMP GLOBAL VALUE EXTERNAL IO$M_EXTEND.
01 TRM$M_TM_NORECALL PIC 9(9) COMP GLOBAL VALUE EXTERNAL TRM$M_TM_NORECALL.
01 TRM$M_TM_NOECHO PIC 9(9) COMP GLOBAL VALUE EXTERNAL TRM$M_TM_NOECHO.
01 TRM$M_TM_TRMNOECHO PIC 9(9) COMP GLOBAL VALUE EXTERNAL TRM$M_TM_TRMNOECHO.
01 TRM$M_TM_ESCAPE PIC 9(9) COMP GLOBAL VALUE EXTERNAL TRM$M_TM_ESCAPE.
01 TRM$M_TM_NOFILTR PIC 9(9) COMP GLOBAL VALUE EXTERNAL TRM$M_TM_NOFILTR.
ADD TRM$M_TM_NORECALL,
TRM$M_TM_TRMNOECHO,
TRM$M_TM_ESCAPE,
TRM$M_TM_NOFILTR,
TRM$M_TM_NOECHO GIVING RV-MODS.
ADD IO$_READVBLK,
IO$M_EXTEND GIVING IO-READ.
PERFORM WITH TEST AFTER UNTIL RETURN-STATUS NOT = SS$_OPINCOMPL AND SS$_DATAOVERUN
CALL "SYS$QIOW" USING BY VALUE 0, CTX-TERM-CHAN, IO-READ
BY REFERENCE IOSB
BY VALUE 0,0
BY REFERENCE IN-STRING
BY VALUE 5, 0, 0
BY REFERENCE READ-VERIFY-ITEM-LIST
BY VALUE ITEMLIST-LEN
GIVING RETURN-STATUS
IF RETURN-STATUS = SS$_NORMAL MOVE IOSB-STATUS TO RETURN-STATUS END-IF
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
08-13-2009 01:51 PM
08-13-2009 01:51 PM
Re: HP COBOL ACCEPT with a masking character
Thanks for the direction...
John