Page 1 of 1

Counting and capturing the keystrokes using REXX.

Posted: Sat Oct 17, 2015 1:48 pm
by Atharvc
Is it possible to count and capture a keystroke on the mainframe using REXX?

One possibility is that I can pull for a response from the user but what I want to do is to get a keystroke within a loop while an EXEC is actually doing something. Is this possible by any mwans or am I expecting to make REXX into something it's not supposed to do? Thanks.

Re: Counting and cpturing the keystrokes using REXX.

Posted: Sat Oct 17, 2015 2:16 pm
by William Collins
You're expecting anything on a Mainframe to do what it is not supposed to do. The Mainframe does not know about screens or keyboards.

Re: Counting and cpturing the keystrokes using REXX.

Posted: Sat Oct 17, 2015 5:48 pm
by nicc
Why not read through the language reference manual for the z/OS implementation of Rexx?

Re: Counting and cpturing the keystrokes using REXX.

Posted: Mon Oct 19, 2015 3:39 pm
by Atharvc
William Collins wrote:You're expecting anything on a Mainframe to do what it is not supposed to do. The Mainframe does not know about screens or keyboards.
Then what it knows about?

I think somehow we can do it. I'll try some more search.

Re: Counting and cpturing the keystrokes using REXX.

Posted: Mon Oct 19, 2015 3:40 pm
by Atharvc
nicc wrote:Why not read through the language reference manual for the z/OS implementation of Rexx?
THat's what I am doing but so far I am not much successful to find the answer.

Re: Counting and cpturing the keystrokes using REXX.

Posted: Mon Oct 19, 2015 4:24 pm
by enrico-sorichetti
the mvs I/O model is record oriented
so the rexx script will be aware of the input data only and only when the enter key is pressed

Re: Counting and cpturing the keystrokes using REXX.

Posted: Mon Oct 19, 2015 6:12 pm
by William Collins
Imagine that you have a program, language irrelevant, that runs on your machine and creates html on a server which is accessed by a user in Gnome, Alaska, to look at and enter data on. Now, in your program, on your machine, count the keystrokes, or know any "anykey" is pressed.

Now, pretend that your Mainframe is your machine, and the person in Alaska has a 3270-emulator. Same problem.

With the web-page, the user clicks a button and your program gets the data. With the 3270-emulator, the use presses Enter, or a function key and you get the data. There's also "Program Attention Keys", which you can know have been pressed, but where you won't get any data.

Feel free to try, it is good to convince yourself.

Re: Counting and capturing the keystrokes using REXX.

Posted: Mon Oct 19, 2015 11:46 pm
by zprogrammer
Curious to know what is the objective

Re: Counting and capturing the keystrokes using REXX.

Posted: Tue Oct 20, 2015 12:08 am
by enrico-sorichetti
I think somehow we can do it. I'll try some more search.
good luck :mrgreen:

Re: Counting and capturing the keystrokes using REXX.

Posted: Tue Oct 20, 2015 3:41 am
by Robert Sample
I think somehow we can do it. I'll try some more search.
Search all you want. A PC basically handles the keyboard by allowing the CPU to examine each keystroke as it is typed. A mainframe basically handles the keyboard by allowing all the typing desired and not examining the keyboard buffer until a special character (ENTER, PF key, PA key, etc.) is typed. So if you expect to count keystrokes and do something in a loop in REXX, that loop will behave DRASTICALLY differently on a mainframe than it will on a PC. Mainframes do not process individual keystrokes but only screens of data.