Article View: bit.listserv.asm370
Article #1624Re: Interacting with a TSO user from a program
From: Stephen E. Bacher
Date: Wed, 11 Mar 1992 18:23
Date: Wed, 11 Mar 1992 18:23
39 lines
2466 bytes
2466 bytes
(I posted this to C370-L. ASM370 readers should see it too.)
On Tue, 10 Mar 1992 18:01:09 GMT "Mark R. Ludwig"
<mrl%UAI.COM@ncsuvm.cc.ncsu.edu> wrote:
>I am looking for an easier way to interact with a TSO user from a
>program than using the PUTLINE, GETLINE, PUTGET, TPUT, TGET, or TPG
>MACROs which IBM supplies. My requirement is to be able to issue a
>prompt on a line and have the user enter the response on the same
>line. Does the C environment support the Unix semantics, such that I
>could have code like:
>
> printf("..."); /* No \n at the end of the string */
> gets(...);
>
>to do what I want? Note that the program is fundamentally
>interactive, and there's no way for me to have a CLIST run "before"
>the program to get the information. The program must be able to
>interact directly with the user. Thanks in advance.$$
You can do this as follows:
(1) Use PUTLINE or TPUT with the ASIS option. Its main effect is to
suppress the carriage return at the end of a line. That's what
the CLIST statement WRITENR does.
(2) Use printf() from C without a \n, as you suggest. This works with
the MVS PTF that corresponds to VM PTF UL66364 (APAR PL54700) for
V1R2 - I think the fix has been incorporated into V2, but I'm not
sure. (I can't find the PTF number on MVS that fixes this.)
I do know that it works properly on my system.
(3) *** NEVER, NEVER, NEVER *** use gets()! Use fgets() specifying
stdin instead. Or else your user will clobber your data area
whenever (s)he types more than you expect...
hope(this) { helps; }
- SEB
Technical Details
Message-ID:
<RNETMAIL9203111323028SEB1525@MVS.DRAPER.COM>Path:
arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!auvm!MVS.DRAPER.COM!SEB1525References:
<FDBD655C40208F81@ccfvx3.draper.com>Show Full Headers
Complete Article Headers
X-Google-Language: ENGLISH,ASCII-7-bit X-Google-Thread: fcdcb,934060ecaacc1e87 X-Google-Attributes: gidfcdcb,public X-Google-ArrivalTime: 1992-03-11 10:36:18 PST Comments: Gated by NETNEWS@AUVM.AMERICAN.EDU Path: arc1-ca.pugleaf.net!sparky!uunet!paladin.american.edu!auvm!MVS.DRAPER.COM!SEB1525 References: <FDBD655C40208F81@ccfvx3.draper.com> X-MVS-to: asm370@ohstvma.bitnet X-send-dataset: 'XMAILMSG.SEB1525.XA920311.T1323028.TEXT' Message-ID: <RNETMAIL9203111323028SEB1525@MVS.DRAPER.COM> Newsgroups: bit.listserv.asm370 Date: Wed, 11 Mar 1992 13:23:00 EST Sender: IBM 370 Assembly Programming Discussion List <ASM370@UGA.BITNET> From: "Stephen E. Bacher" <seb1525@MVS.DRAPER.COM> Subject: Re: Interacting with a TSO user from a program Comments: To: asm370%ohstvma.bitnet@surname.draper.com