Dynamically set VMS "environment" settings from a program? - VMS

This is a discussion on Dynamically set VMS "environment" settings from a program? - VMS ; Ah HAH! I have at last figured out something that will be elementary to you folks, but has annoyed the living daylights out of me for a week now. Take a typical (green screen) program, it puts up a header ...

+ Reply to Thread
Results 1 to 6 of 6

Thread: Dynamically set VMS "environment" settings from a program?

  1. Dynamically set VMS "environment" settings from a program?

    Ah HAH! I have at last figured out something that will be elementary to you
    folks, but has annoyed the living daylights out of me for a week now.

    Take a typical (green screen) program, it puts up a header at the top of the
    screen, body text, a function key line and a message line at the bottom.
    Okay, this is more IBM that perhaps VMS green screen programs are normally
    setup to be, but hey- I have not SEEN any VMS green screen programs other
    than the editors, and *they* can use function keys!

    I even figured out how to get into "USER-MODE" and stay there, but for the
    life of me, function keys insist on doing weird and strange things - like
    causing an interrupt when I hit F6 for example.

    But I finally found the magic incantation that takes care of *that*
    problem... one need only perform a set term/NOLINE_EDITING and voila! The
    doggone function keys work as expected. (From Putty, with VT400 keys set,
    and using /DEVICE_TYPE=VT400_SERIES in the set term command...)

    Problem is, it actually does turn off terminal editing, and I *LIKE*
    terminal editing! So I would like to dynamically turn this feature OFF when
    a program starts, and then turn it back ON when the program exits.

    How might I go about doing this? In particular from COBOL?

    Thanks
    -Paul

    P.S. It is okay to refer me to the correct manual; I have searched all
    through the COBOL manuals and I suspect I did not recognize what I am
    looking for. -Paul


  2. Re: Dynamically set VMS "environment" settings from a program?

    Paul Raulerson wrote:
    >
    > Ah HAH! I have at last figured out something that will be elementary to you
    > folks, but has annoyed the living daylights out of me for a week now.
    >
    > Take a typical (green screen) program, it puts up a header at the top of the
    > screen, body text, a function key line and a message line at the bottom.
    > Okay, this is more IBM that perhaps VMS green screen programs are normally
    > setup to be, but hey- I have not SEEN any VMS green screen programs other
    > than the editors, and *they* can use function keys!
    >
    > I even figured out how to get into "USER-MODE" and stay there, but for the
    > life of me, function keys insist on doing weird and strange things - like
    > causing an interrupt when I hit F6 for example.
    >
    > But I finally found the magic incantation that takes care of *that*
    > problem... one need only perform a set term/NOLINE_EDITING and voila! The
    > doggone function keys work as expected. (From Putty, with VT400 keys set,
    > and using /DEVICE_TYPE=VT400_SERIES in the set term command...)
    >
    > Problem is, it actually does turn off terminal editing, and I *LIKE*
    > terminal editing! So I would like to dynamically turn this feature OFF when
    > a program starts, and then turn it back ON when the program exits.
    >
    > How might I go about doing this? In particular from COBOL?
    >
    > Thanks
    > -Paul
    >
    > P.S. It is okay to refer me to the correct manual; I have searched all
    > through the COBOL manuals and I suspect I did not recognize what I am
    > looking for. -Paul


    I believe a cruise through the documentation of the SMG$ RTL routines may be
    helpful. Otherwise, you may need to figure out how to invoke $QIO with the
    proper parameters/flags to make the change(s). Dunno fer sure...

    --
    David J Dachtera
    dba DJE Systems
    http://www.djesys.com/

    Unofficial OpenVMS Marketing Home Page
    http://www.djesys.com/vms/market/

    Unofficial Affordable OpenVMS Home Page:
    http://www.djesys.com/vms/soho/

    Unofficial OpenVMS-IA32 Home Page:
    http://www.djesys.com/vms/ia32/

    Unofficial OpenVMS Hobbyist Support Page:
    http://www.djesys.com/vms/support/

  3. Re: Dynamically set VMS "environment" settings from a program?

    On Jul 25, 12:12 pm, "Paul Raulerson" wrote:
    > Ah HAH! I have at last figured out something that will be elementary to you
    > folks, but has annoyed the living daylights out of me for a week now.
    >
    > Take a typical (green screen) program, it puts up a header at the top of the
    > screen, body text, a function key line and a message line at the bottom.
    > Okay, this is more IBM that perhaps VMS green screen programs are normally
    > setup to be, but hey- I have not SEEN any VMS green screen programs other
    > than the editors, and *they* can use function keys!
    >
    > I even figured out how to get into "USER-MODE" and stay there, but for the
    > life of me, function keys insist on doing weird and strange things - like
    > causing an interrupt when I hit F6 for example.
    >
    > But I finally found the magic incantation that takes care of *that*
    > problem... one need only perform a set term/NOLINE_EDITING and voila! The
    > doggone function keys work as expected. (From Putty, with VT400 keys set,
    > and using /DEVICE_TYPE=VT400_SERIES in the set term command...)
    >
    > Problem is, it actually does turn off terminal editing, and I *LIKE*
    > terminal editing! So I would like to dynamically turn this feature OFF when
    > a program starts, and then turn it back ON when the program exits.
    >
    > How might I go about doing this? In particular from COBOL?
    >
    > Thanks
    > -Paul
    >
    > P.S. It is okay to refer me to the correct manual; I have searched all
    > through the COBOL manuals and I suspect I did not recognize what I am
    > looking for. -Paul


    Paul,

    Calling LIB$DO_COMMAND from Cobol seems like an easy option.

    Ian


  4. Re: Dynamically set VMS "environment" settings from a program?

    Hi Paul,

    Can't you just use DCL to turn it off before running the image and turn it
    back on when DCL is returned to?

    Otherwise I imagine someone (other than me :-) knows the bit to set in the
    terminal driver. See the I/O Reference Manual. (Pretty usefull book all
    round)

    Cheers Richard Maher.

    PS. If it makes you feel better Firefox and Internet Explorer have
    completely different ideas as to which keys should be trapped by the browser
    and which should be made available to your JavaScript.

    If you look at the enter() function in my t3$examples:queue_lookup.html
    example you will see what you have to do not to echo non-numeric characters
    in a numeric field and to stop IE from using as Firefox
    allows you to trap a whole lot more function keys than IE does.

    "David J Dachtera" wrote in message
    news:46A6B3EC.334B9B2F@spam.comcast.net...
    > Paul Raulerson wrote:
    > >
    > > Ah HAH! I have at last figured out something that will be elementary to

    you
    > > folks, but has annoyed the living daylights out of me for a week now.
    > >
    > > Take a typical (green screen) program, it puts up a header at the top of

    the
    > > screen, body text, a function key line and a message line at the bottom.
    > > Okay, this is more IBM that perhaps VMS green screen programs are

    normally
    > > setup to be, but hey- I have not SEEN any VMS green screen programs

    other
    > > than the editors, and *they* can use function keys!
    > >
    > > I even figured out how to get into "USER-MODE" and stay there, but for

    the
    > > life of me, function keys insist on doing weird and strange things -

    like
    > > causing an interrupt when I hit F6 for example.
    > >
    > > But I finally found the magic incantation that takes care of *that*
    > > problem... one need only perform a set term/NOLINE_EDITING and voila!

    The
    > > doggone function keys work as expected. (From Putty, with VT400 keys

    set,
    > > and using /DEVICE_TYPE=VT400_SERIES in the set term command...)
    > >
    > > Problem is, it actually does turn off terminal editing, and I *LIKE*
    > > terminal editing! So I would like to dynamically turn this feature OFF

    when
    > > a program starts, and then turn it back ON when the program exits.
    > >
    > > How might I go about doing this? In particular from COBOL?
    > >
    > > Thanks
    > > -Paul
    > >
    > > P.S. It is okay to refer me to the correct manual; I have searched all
    > > through the COBOL manuals and I suspect I did not recognize what I am
    > > looking for. -Paul

    >
    > I believe a cruise through the documentation of the SMG$ RTL routines may

    be
    > helpful. Otherwise, you may need to figure out how to invoke $QIO with the
    > proper parameters/flags to make the change(s). Dunno fer sure...
    >
    > --
    > David J Dachtera
    > dba DJE Systems
    > http://www.djesys.com/
    >
    > Unofficial OpenVMS Marketing Home Page
    > http://www.djesys.com/vms/market/
    >
    > Unofficial Affordable OpenVMS Home Page:
    > http://www.djesys.com/vms/soho/
    >
    > Unofficial OpenVMS-IA32 Home Page:
    > http://www.djesys.com/vms/ia32/
    >
    > Unofficial OpenVMS Hobbyist Support Page:
    > http://www.djesys.com/vms/support/




  5. Re: Dynamically set VMS "environment" settings from a program?

    Paul Raulerson wrote:
    > Take a typical (green screen) program, it puts up a header at the top of the
    > screen, body text, a function key line and a message line at the bottom.
    > Okay, this is more IBM that perhaps VMS green screen programs are normally
    > setup to be, but hey- I have not SEEN any VMS green screen programs other
    > than the editors, and *they* can use function keys!



    You mentioned COBOL. Cobol has a screen generator. If you look at the
    cobol documentation, you can design a screen in the working storage
    section (with line and column values for each piece of text) and then if
    I recall, use the ACCEPT statement to get the information.

    Or, you can use old packages such as FMS which provide more full screen
    display control and PF keys etc. But FMS still requires some additional
    licence.

    There are lower level routines others have alluded to (SMG$ routines)
    which are used by the higher level software such as COBOL, FMS etc.

    If you are looking for something like TSO/SPF (ISPF or whatever it is
    called this week), then ALLIN1 (office server) gives you this type of
    funtionality. (It is based on FMS but gives you a high level interface
    to menus, displays, access to indexed files etc).

  6. Re: Dynamically set VMS "environment" settings from a program?

    Paul Raulerson wrote:
    > [snip]
    >
    > But I finally found the magic incantation that takes care of *that*
    > problem... one need only perform a set term/NOLINE_EDITING and voila! The
    > doggone function keys work as expected. (From Putty, with VT400 keys set,
    > and using /DEVICE_TYPE=VT400_SERIES in the set term command...)
    >
    > Problem is, it actually does turn off terminal editing, and I *LIKE*
    > terminal editing! So I would like to dynamically turn this feature OFF when
    > a program starts, and then turn it back ON when the program exits.
    >
    > How might I go about doing this? In particular from COBOL?
    >
    > [snip]


    Erk, COBOL.

    Note that the magic bit is TT2$V_EDITING, not TT2$V_EDIT as other
    posters have mentioned. Here you go.

    IDENTIFICATION DIVISION.
    PROGRAM-ID. TEDIT.

    ENVIRONMENT DIVISION.

    DATA DIVISION.
    WORKING-STORAGE SECTION.
    01 IOSB.
    02 IOSB-STATUS PIC S9(4) COMP.
    02 IOSB-COUNT PIC S9(4) COMP.
    02 IOSB-DEV-INFO PIC S9(4) COMP.
    01 R0-STATUS PIC S9(9) COMP.
    01 SAVE-BASIC-CHARS PIC S9(9) COMP.
    01 SAVE-EXTENDED-CHARS PIC S9(9) COMP.
    01 EFN PIC S9(9) COMP.
    01 NONE PIC S9(9) COMP VALUE 0.
    01 ONE PIC S9(9) COMP VALUE 1.
    01 IO$_SENSEMODE PIC S9(9) COMP VALUE EXTERNAL IO$_SENSEMODE.
    01 IO$_SETMODE PIC S9(9) COMP VALUE EXTERNAL IO$_SETMODE.
    01 TT2$V_EDITING PIC S9(9) COMP VALUE EXTERNAL TT2$V_EDITING.

    01 CHARS.
    02 CHARS-CLASS PIC X.
    02 CHARS-TYPE PIC X.
    02 CHARS-BUFSIZE PIC S9(4) COMP.
    02 CHARS-BASIC PIC S9(9) COMP.
    02 CHARS-EXTENDED PIC S9(9) COMP.

    01 CHANNEL PIC S9(4) COMP.

    PROCEDURE DIVISION.
    EOFF SECTION.
    EOFF-BEGIN.
    CALL "LIB$GET_EF" USING BY REFERENCE EFN
    GIVING R0-STATUS.
    IF R0-STATUS IS FAILURE
    CALL "LIB$SIGNAL" USING BY VALUE R0-STATUS
    END-IF.

    CALL "SYS$ASSIGN" USING BY DESCRIPTOR "TT:",
    BY REFERENCE CHANNEL,
    OMITTED,
    OMITTED,
    OMITTED
    GIVING R0-STATUS.
    IF R0-STATUS IS FAILURE
    CALL "LIB$SIGNAL" USING BY VALUE R0-STATUS
    END-IF.

    DISPLAY "Switching off line editting... " WITH NO ADVANCING.
    CALL "SYS$QIOW" USING BY VALUE EFN,
    BY VALUE CHANNEL,
    BY VALUE IO$_SENSEMODE,
    BY REFERENCE IOSB,
    OMITTED,
    OMITTED,
    BY REFERENCE CHARS,
    BY VALUE 12,
    OMITTED,
    OMITTED,
    OMITTED,
    OMITTED
    GIVING R0-STATUS.
    IF R0-STATUS IS FAILURE
    CALL "LIB$SIGNAL" USING BY VALUE R0-STATUS
    END-IF.
    IF IOSB-STATUS IS FAILURE
    CALL "LIB$SIGNAL" USING BY VALUE IOSB-STATUS
    END-IF.

    * Save terminal characteristics before we change them. This is not
    * really needed, as we are going to do a set mode function on the
    * terminal that only changes the characteristics on a temporary basis.
    * When the program exits, the terminal driver will automatically reset
    * the characteristics for us...
    MOVE CHARS-BASIC TO SAVE-BASIC-CHARS.
    MOVE CHARS-EXTENDED TO SAVE-EXTENDED-CHARS.

    * Clear the appropriate bit...
    CALL "LIB$INSV" USING BY REFERENCE NONE,
    BY REFERENCE TT2$V_EDITING,
    BY REFERENCE ONE,
    BY REFERENCE CHARS-EXTENDED.

    * Actually do the deed...
    CALL "SYS$QIOW" USING BY VALUE EFN,
    BY VALUE CHANNEL,
    BY VALUE IO$_SETMODE,
    BY REFERENCE IOSB,
    OMITTED,
    OMITTED,
    BY REFERENCE CHARS,
    BY VALUE 12,
    OMITTED,
    OMITTED,
    OMITTED,
    OMITTED
    GIVING R0-STATUS.
    IF R0-STATUS IS FAILURE
    CALL "LIB$SIGNAL" USING BY VALUE R0-STATUS
    END-IF.
    IF IOSB-STATUS IS FAILURE
    CALL "LIB$SIGNAL" USING BY VALUE IOSB-STATUS
    END-IF.

    DISPLAY "done!"

    CALL "SYS$DASSGN" USING BY VALUE CHANNEL
    GIVING R0-STATUS.
    IF R0-STATUS IS FAILURE
    CALL "LIB$SIGNAL" USING BY VALUE R0-STATUS
    END-IF.

    CALL "LIB$FREE_EF" USING BY REFERENCE EFN
    GIVING R0-STATUS.
    IF R0-STATUS IS FAILURE
    CALL "LIB$SIGNAL" USING BY VALUE R0-STATUS
    END-IF.

    END PROGRAM TEDIT.

    --
    www.eight-cubed.com

+ Reply to Thread