Discussion:
It's TGET not TPUT to get the data: Where do I start?
steve donato
2010-05-25 16:11:18 UTC
Permalink
I think last responder ment TGET to get data and cursor location, TPUT is
for output. And I agree "Insert Cursor" is the IC attribute.


steve
If you send data out, and want it back, you have to turn on the
Modified Data Tag (MDT) bit in the attribute for that field.
Only if the user does not edit that field.. If the user edits the field
the MDT
is set for you.
Right now I am trying to get underlinded fields to work - my first field
starts
underlining but it never stops to the end of the screen
Oh and is '[' Square bracket not a mainframe character? when I try to
place one in RPF I get
a U with an accent of some sort.
It wasn't on the original 3270 keyboard. When I worked in connecting
ASCII terminals to VM where you put it in EBCDIC was always a topic for
debate. Check your code page settings in the Hercules and also those in
your 3270 emulator. I use PCOMMS with code page 1047 and it puts {} on
hex AD & BD which I think is the "modern" (i.e. the one the IBM C
Compiler) expects standard.
Yes, I copied and pasted them all into one local word doc so I
could look at paper while I had my screen up...
Right now I have two fields that accept alpha numeric text
(I have not figgured out how to use them yet -but I have them)
I can tab between them and edit them.
Is there a way to have the cursor resting in one when the user
gets control?
Ron.
Yes, look at the IC command which I believe is x'13'. (Saying
this from memory)
As for the input I know you use the TPUT command and it
returns a buffer string. Again from memory, the TPUT returns the
length of the gotten string, and the buffer contains the location of
where the cursor was at, what attention key was hit, following this
is the input location and the text.
Scott
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
------------------------------------
Yahoo! Groups Links
PeterH
2010-05-25 21:34:11 UTC
Permalink
Post by steve donato
I think last responder ment TGET to get data and cursor location,
TPUT is for output. And I agree "Insert Cursor" is the IC attribute.
Normally, TPUT is text, only, and without any "orders", such as IC,
SF, etcetera, unless it is MODE=FULLSCR.

TGET usually inputs the MODIFIED fields text, only.
Ron Hudson
2010-05-25 21:44:12 UTC
Permalink
Post by PeterH
Post by steve donato
I think last responder ment TGET to get data and cursor location,
TPUT is for output. And I agree "Insert Cursor" is the IC attribute.
Normally, TPUT is text, only, and without any "orders", such as IC,
SF, etcetera, unless it is MODE=FULLSCR.
TGET usually inputs the MODIFIED fields text, only.
I am looking at http://tommysprinkle.com/mvs/P3270/input.htm

Where Tommy says:
When we issue the TGET macro with the ASIS parameter specified, TSO will
issue a "Read Modified" command to the 3270 terminal. The terminal will
respond with (1) an AID or Action ID character that identifies which key
was the cause of input to be accepted (Enter, PKxx, PAx, Clear), (2) the
location of the cursor when the input key was pressed and (3) fields with
the MDT bit set. The fields are returned starting with a x'11' followed by
a two byte encoded buffer address followed by the data from the field. By
scanning for the special code x'11' we can find the start and end of each
data field.

I think this looks like:

Aid/Action ID

Cursor Location

11 [Field Location] Field data

11 [Field Location] Field data

Followed by ??

<for each field with mdt set>
Mike Schwab
2010-05-25 22:03:50 UTC
Permalink
Post by PeterH
Post by steve donato
I think last responder ment TGET to get data and cursor location,
TPUT is for output. And I agree "Insert Cursor" is the IC attribute.
Normally, TPUT is text, only, and without any "orders", such as IC,
SF, etcetera, unless it is MODE=FULLSCR.
TGET usually inputs the MODIFIED fields text, only.
I am looking at  http://tommysprinkle.com/mvs/P3270/input.htm
When we issue the TGET macro with the ASIS parameter specified, TSO will issue a "Read Modified" command to the 3270 terminal.  The terminal will respond with (1) an AID  or Action ID character that identifies which key was the cause of input to be accepted (Enter, PKxx, PAx, Clear), (2) the location of the cursor when the input key was pressed and (3) fields with the MDT bit set.  The fields are returned starting with a x'11' followed by a two byte encoded buffer address followed by the data from the field.  By scanning for the special code x'11' we can find the start and end of each data field.
Aid/Action ID
Cursor Location
11 [Field Location] Field data
You will need to know which field location is what field in your
screen / file layout.
11 [Field Location] Field data
Followed by ??
<for each field with mdt set>
Is there a total input buffer length?
Prefill the buffer with binary zeros and test for that bein the end of screen?
Or send a "Last screen field" with MDT on?

--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
Ron Hudson
2010-05-25 22:48:06 UTC
Permalink
Post by Ron Hudson
Post by Ron Hudson
Post by PeterH
Post by steve donato
I think last responder ment TGET to get data and cursor location,
TPUT is for output. And I agree "Insert Cursor" is the IC attribute.
Normally, TPUT is text, only, and without any "orders", such as IC,
SF, etcetera, unless it is MODE=FULLSCR.
TGET usually inputs the MODIFIED fields text, only.
I am looking at http://tommysprinkle.com/mvs/P3270/input.htm
When we issue the TGET macro with the ASIS parameter specified, TSO will
issue a "Read Modified" command to the 3270 terminal. The terminal will
respond with (1) an AID or Action ID character that identifies which key
was the cause of input to be accepted (Enter, PKxx, PAx, Clear), (2) the
location of the cursor when the input key was pressed and (3) fields with
the MDT bit set. The fields are returned starting with a x'11' followed by
a two byte encoded buffer address followed by the data from the field. By
scanning for the special code x'11' we can find the start and end of each
data field.
Post by Ron Hudson
Aid/Action ID
Cursor Location
11 [Field Location] Field data
You will need to know which field location is what field in your
screen / file layout.
sure I have all those. for now I just wanna get a look at what TGET
returns..
Post by Ron Hudson
Post by Ron Hudson
11 [Field Location] Field data
Followed by ??
<for each field with mdt set>
Is there a total input buffer length?
Prefill the buffer with binary zeros and test for that bein the end of screen?
Or send a "Last screen field" with MDT on?
Or set MDT on all fields and expect them all returned?
Post by Ron Hudson
--
Mike A Schwab, Springfield IL USA
Where do Forest Rangers go to get away from it all?
Gerhard Postpischil
2010-05-26 00:07:06 UTC
Permalink
Post by Ron Hudson
Or set MDT on all fields and expect them all returned?
The "obvious" way is to look at the length returned from TGET
and use that to stop the scan. No need to waste cycles on
clearing storage or reading unchanged fields.

One thing not mentioned - depending on the model of 3270, or
your emulator, when the user erases a field, the MDT may get
set, and the input stream won't have any text (just the 11 field
start). You'll need to decide whether to reinstate the previous
text or treat it as cleared.

Gerhard Postpischil
Bradford, VT
Ron Hudson
2010-05-26 00:31:04 UTC
Permalink
On Tue, May 25, 2010 at 5:07 PM, Gerhard Postpischil
Post by Gerhard Postpischil
One thing not mentioned - depending on the model of 3270, or
your emulator, when the user erases a field, the MDT may get
set, and the input stream won't have any text (just the 11 field
start). You'll need to decide whether to reinstate the previous
text or treat it as cleared.
And of course that would depend on the application at hand.
For this one, I think I will believe the user and leave that field
in the database blank.
Rick Fochtman
2010-05-25 23:33:16 UTC
Permalink
-------------------------------<snip>--------------------------------
Post by Ron Hudson
I am looking at http://tommysprinkle.com/mvs/P3270/input.htm
<http://tommysprinkle.com/mvs/P3270/input.htm>
When we issue the TGET macro with the ASIS parameter specified, TSO
will issue a "Read Modified" command to the 3270 terminal. The
terminal will respond with (1) an AID or Action ID character that
identifies which key was the cause of input to be accepted (Enter,
PKxx, PAx, Clear), (2) the location of the cursor when the input key
was pressed and (3) fields with the MDT bit set. The fields are
returned starting with a x'11' followed by a two byte encoded buffer
address followed by the data from the field. By scanning for the
special code x'11' we can find the start and end of each data field.
Aid/Action ID
Cursor Location
11 [Field Location] Field data
11 [Field Location] Field data
Followed by ??
<for each field with mdt set>
----------------------------------<unsnip>-------------------------------
That's pretty accurate. TGET will also tell you how many bytes were
read. You can scan the buffer for the X'11' byte with a TRT instruction
pretty handily. Just start it at the byte following the previous X'11'
byte, if any. Or you can zero out the buffer before each TGET using a
MVCL instruction.

Rick
Ron Hudson
2010-05-26 00:22:31 UTC
Permalink
I started to throw together some code to

1) transfer 128 bytes from inbuf to display
2) '#' to bytes 0,1,2,3 to corrispond with Aidkey, ScreenLocation,
first'11', and it's screenlocation
3) search display for x'11''s and c'#' them and the next byte after them.

Bu I don't know enough about IBM 370 assembly language. My program (DSP2)
was kit-bashed from
Tommy's "Hello World" version 3 - basically I just put in a lot more stream
stuff. And I copied the loop
from the "Aid1" program

I am really no stranger to the concept of assembler,hand assembled 6502 code
for an apple 1 I never
got around to getting. hand assembled Z80 code for the Polymorphic system
machine I got instead.
Post by Rick Fochtman
-------------------------------<snip>--------------------------------
I am looking at http://tommysprinkle.com/mvs/P3270/input.htm
When we issue the TGET macro with the ASIS parameter specified, TSO will
issue a "Read Modified" command to the 3270 terminal. The terminal will
respond with (1) an AID or Action ID character that identifies which key
was the cause of input to be accepted (Enter, PKxx, PAx, Clear), (2) the
location of the cursor when the input key was pressed and (3) fields with
the MDT bit set. The fields are returned starting with a x'11' followed by
a two byte encoded buffer address followed by the data from the field. By
scanning for the special code x'11' we can find the start and end of each
data field.
Aid/Action ID
Cursor Location
11 [Field Location] Field data
11 [Field Location] Field data
Followed by ??
<for each field with mdt set>
----------------------------------<unsnip>-------------------------------
That's pretty accurate. TGET will also tell you how many bytes were read.
You can scan the buffer for the X'11' byte with a TRT instruction pretty
handily. Just start it at the byte following the previous X'11' byte, if
any. Or you can zero out the buffer before each TGET using a MVCL
instruction.
Rick
Mick P Graley
2010-05-26 10:03:47 UTC
Permalink
Crikey that brings back memories! I used to hand assemble 6502 machine code
for my Commodore VIC20 when I was a kid (~25 years ago). To this day I
cannot get out of my head that LDA# (load accummulator) is decimal 169 or
x'A9' - I used to code that a lot - can't remember the other op codes
though!

Cheers,

Mick.




From: Ron Hudson <***@gmail.com>

To: turnkey-***@yahoogroups.com

Date: 26/05/2010 01:19

Subject: Re: It's TGET not TPUT to get the data: [turnkey-mvs] Where do I start?









I started to throw together some code to

1) transfer 128 bytes from inbuf to display
2) '#' to bytes 0,1,2,3 to corrispond with Aidkey, ScreenLocation,
first'11', and it's screenlocation
3) search display for x'11''s and c'#' them and the next byte after them.

Bu I don't know enough about IBM 370 assembly language. My program (DSP2)
was kit-bashed from
Tommy's "Hello World" version 3 - basically I just put in a lot more stream
stuff. And I copied the loop
from the "Aid1" program

I am really no stranger to the concept of assembler,hand assembled 6502
code for an apple 1 I never
got around to getting. hand assembled Z80 code for the Polymorphic system
machine I got instead.



On Tue, May 25, 2010 at 4:33 PM, Rick Fochtman <***@ync.net> wrote:



-------------------------------<snip>--------------------------------



I am looking at  http://tommysprinkle.com/mvs/P3270/input.htm

Where Tommy says:
When we issue the TGET macro with the ASIS parameter specified,
TSO will issue a "Read Modified" command to the 3270 terminal.
The terminal will respond with (1) an AID  or Action ID
character that identifies which key was the cause of input to
be accepted (Enter, PKxx, PAx, Clear), (2) the location of the
cursor when the input key was pressed and (3) fields with the
MDT bit set.  The fields are returned starting with a x'11'
followed by a two byte encoded buffer address followed by the
data from the field.  By scanning for the special code x'11' we
can find the start and end of each data field.

I think this looks like:

Aid/Action ID

Cursor Location

11 [Field Location] Field data

11 [Field Location] Field data

Followed by ??

<for each field with mdt set>
----------------------------------<unsnip>-------------------------------

That's pretty accurate. TGET will also tell you how many bytes were
read. You can scan the buffer for the X'11' byte with a TRT
instruction pretty handily. Just start it at the byte following the
previous X'11' byte, if any. Or you can zero out the buffer before
each TGET using a MVCL instruction.

Rick

Ron Hudson
2010-05-26 00:32:46 UTC
Permalink
Where does this number of bytes get returned?
...TGET will also tell you how many bytes were read...
Rick Fochtman
2010-05-26 01:24:00 UTC
Permalink
-----------------------------------<snip>--------------------------
Where does this number of bytes get returned?
---------------------------------<unsnip>------------------------
In register 1. I'm sending you a package via private E-Mail, which you
may share with anyone who requests it. DD statement doc from JCL manual
and my $TGET/$TPUT subroutines.

Rick
Loading...