I've got a copy of the 3270 Data Stream Programmers Reference, and a couple
of good examples, so I think I can see what needs to be done. What I'm
having trouble with is the row/column address's for the SBA order. The
manual just says that the address is a 16 bit field, but doesn't seem to
explain what the values are.
The examples I've got say
DC X'11' SET BUFFER ADDRESS ORDER
DC X'40C1' ROW 1, COLUMN 2
and
DC X'11'
DC X'C1C4' ROW 1 COLUMN 70
and I can see no obvious correlation between the hex number and the
row/column numbers.
I remember seeing, many years ago,a pocket reference sized book full of
tables of the row/column number, and corresponding data for SBA. But I
can't find it on the IBM web site by searching on obvious things like
'3270'.
Can anyone remember the books number, or suggest other references?
Thanks,
Richard.
---------------------------------------------------------------------
The contents of this e-mail are confidential.
If you have received this communication by mistake,
please advise the sender immediately and delete the message and
any attachments.
The views expressed in this e-mail are not necessarily the views of
Westpac Banking Corporation.
Westpac Banking Corporation is incorporated in New South Wales, Australia.
---------------------------------------------------------------------
----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to list...@bama.ua.edu with the message: GET IBM-MAIN INFO
Search the archives at http://bama.ua.edu/archives/ibm-main.html
Here's a snippet from one of my USS tables. If you specify the SBA
addresses as you see them here, you don't need to do an explicit conversion
to a hex relative byte number yourself, and it's much easier to check for
errors:
DS 0F
MSG00 DC AL2(BUF00E-BUF00S)
BUF00S DC X'F5C7' COMMAND + WCC
DC X'11',AL2(((01-1)*80)+(02-1)) SBA R01 C02
DC X'2902C0F842F5' SFE HI,SKIP,TURQUOISE
DC C'--> USSMSG0:'
DC X'2902C0F842F4' SFE HI,SKIP,GREEN
DC C'COMMAND ACCEPTED by VTAM for processing'
DC X'11',AL2(((03-1)*80)+(06-1)) SBA R03 C06
DC X'2902C0F042F1' SFE HI,SKIP,BLUE
DC C'VTAM Logical Unit Name: '
DC X'2902C0F842F7' SFE HI,SKIP,WHITE
DC C'@@LUNAME'
DC X'11',AL2(((04-1)*80)+(06-1)) SBA R04 C06
DC X'2902C0F042F1' SFE HI,SKIP,BLUE
DC C'Client''s IP Addr && Port: '
DC X'2902C0F842F7' SFE HI,SKIP,WHITE
DC C'@@@@@@@@@IPADDR : @@PRT'
BUF00E EQU *
If a copy of the whole USS table would help, contact me off-list and I'll
send it to you.
--
»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«
Gerry Palmer Direct Dial: (678) 819-5033
gpa...@medibase.com Switchboard: (770) 422-4287 x309
The Medibase Group, Inc. Toll Free: (800) 499-6781
777 Franklin Rd. SE Fax (office): (770) 422-9142
Marietta, GA 30067-7818 Fax (home): (815) 333-0784
»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«»«
> I've got a copy of the 3270 Data Stream Programmers Reference, and a couple
> of good examples, so I think I can see what needs to be done. What I'm
> having trouble with is the row/column address's for the SBA order. The
> manual just says that the address is a 16 bit field, but doesn't seem to
> explain what the values are.
> The examples I've got say
> DC X'11' SET BUFFER ADDRESS ORDER
> DC X'40C1' ROW 1, COLUMN 2
> and
> DC X'11'
> DC X'C1C4' ROW 1 COLUMN 70
> and I can see no obvious correlation between the hex number and the
> row/column numbers.
The DSPR describes it, just not completely. For 3270 12-bit addresses,
you need to just look at the low order 6 bits of each byte. Ignoring the
top two bits of each set you get:
40 C1
0100 0000 1100 0001 in hex
xx00 0000 xx00 0001 ignore top 2 bits of each byte
000000000001 12 bit address, starting from 0 = row 1, col 2
C1 C4
1100 0001 1100 0100 in hex
xx00 0001 xx00 0100 ignore
000001000100
044 hex = 68 which should be row 1, col 69. Maybe your doc had a typo.
The top two bits can be either 01 or 11 and the choice depends on whether
the result would be a valid EBCDIC character. My reference for this is
SNA/MATE which I have no idea is still being published but I found to
be extremely useful when I was doing VTAM coding.
To translate from 0 to 63 (0 to 3F hex for all possible 6-bit patterns),
make a table of the following:
40
C1-C9
4A-50
D1-D9
5A-61
E2-E9
6A-6F
F0-F9
7A-7F
Convert row, col to offset (and that depends on the size of the screen)
treating offset as 12 bit number, separate into two 6 bit numbers and
translate each to an EBCDIC character using the above table.
If Gerry's method doesn't do it for you, I've got a Rexx program that
generates the row/column codes for whatever screen size you request.
Or, somewhere I've got the output of said program for the standard
24x80 size. Just email me off-list.
-jcf
--- Richard Crook <Richar...@WESTPACTRUST.CO.NZ> wrote:
<snip>
> I remember seeing, many years ago,a pocket reference sized book full
> of
> tables of the row/column number, and corresponding data for SBA.
=====
-jcf
NOTE: Yahoo! randomly delays emails *FROM* listserv by minutes, hours, days.
Therefore: 1) email or cc: me directly if you want me to respond quickly, and
2) I may act like I don't read all posts, because I havn't received them yet!
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/
But it's very easy (although tedious) to calculate buffer addresses. 3270
addressing works on screen offset, offset 0 being the top left corner of the
screen. The offset is a simple matter of the number of rows times the screen
width, plus the column.
Originally, 3270 protocol required that only EBCDIC alphanumeric and symbol
characters were transmitted between buffers, so the top two bits of each
value were reserved so that they could be altered to provide a valid EBCDIC
code (these days however, especially with PC-based emulators, you may well
find that the 'raw' values are accepted quite happily, although null bytes
will still probably be ignored). So only 6 bits of the SBA values
participate in screen addressing, allowing a maximum value of 63. You
therefore need to convert your offset into a two-byte base 64 value.
In general, EBCDIC characters and numbers end in x'1'-x'9' and symbols end
in x'A'-x'F' (one notable exception being x'E1'). So to convert to EBCDIC,
add x'40' (64 dec). Then, if the value ends in 1-9 add x'80' (128 dec)
unless this would give you x'E1', in which case leave it alone.
The following Rexx illustrates:
/* Rexx */
parse arg Row Col Wid .
Offset = Wid*(Row-1)+(Col-1)
Sba1 = Offset % 64 + 64 ; Sba2 = Offset // 64 + 64
if Sba1 ャ= 97 then Sba1 = Sba1 + 128 * (((Sba1 // 16) - 1) < 9)
if Sba2 ャ= 97 then Sba2 = Sba2 + 128 * (((Sba2 // 16) - 1) < 9)
say X"'11"RIGHT(D2X(Sba1),2,"0")||RIGHT(D2X(Sba2),2,"0")||"'"
Cheers
Brian
This message is confidential. Its contents do not constitute a
commitment by TNS Switchtran except where provided for in a written agreement between you and TNS Switchtran.
Any unauthorised disclosure, use or dissemination, either whole or partial,i
s prohibited. If you are not the intended recipient of the message,
please notify the sender immediately.
:>Through not being able to dodge fast enough, I've got myself the job of
:>making a VTAM USS table for non-SNA devices.
:>
:>I've got a copy of the 3270 Data Stream Programmers Reference, and a couple
:>of good examples, so I think I can see what needs to be done. What I'm
:>having trouble with is the row/column address's for the SBA order. The
:>manual just says that the address is a 16 bit field, but doesn't seem to
:>explain what the values are.
:>The examples I've got say
:> DC X'11' SET BUFFER ADDRESS ORDER
:> DC X'40C1' ROW 1, COLUMN 2
:>
:>and
:> DC X'11'
:> DC X'C1C4' ROW 1 COLUMN 70
:>
:>and I can see no obvious correlation between the hex number and the
:>row/column numbers.
:>
:>I remember seeing, many years ago,a pocket reference sized book full of
:>tables of the row/column number, and corresponding data for SBA. But I
:>can't find it on the IBM web site by searching on obvious things like
:>'3270'.
It is logical, but you have to understand the logic.
Use the following 64 character table:
X'40C1C2C3C4C5C6C7C8C94A4B4C4D4E4F'
X'50D1D2D3D4D5D6D7D8D95A5B5C5D5E5F'
X'6061E2E3E4E5E6E7E8E96A6B6C6D6E6F'
X'F0F1F2F3F4F5F6F7F8F97A7B7C7D7E7F'
Calculate the screen offset ((row-1)*number_of_columns+column)
Divide by 64.
The SBA is the character at the quotient offset concatenated with the
character at the remainder offset.
--
Binyamin Dissen <bdi...@dissensoftware.com>
Binyamin Dissen <bdi...@netvision.net.il>
http://www.dissensoftware.com
Director, Dissen Software, Bar & Grill - Israel
Look in Appendix C.
> The examples I've got say
> DC X'11' SET BUFFER ADDRESS ORDER
> DC X'40C1' ROW 1, COLUMN 2
>
> and
> DC X'11'
> DC X'C1C4' ROW 1 COLUMN 70
>
> and I can see no obvious correlation between the hex number and the
> row/column numbers.
That's because there isn't any. ;-)
Well, actually there is, but it's not row/column oriented; rather, it's
buffer position oriented. Again, see Appendix C of the 3270 Datastream
Programmer's Reference. You'll be using "12-bit addressing" in the majority
of cases, so the "coordinates" for the first 16 columns of row 1 will be
(all hex) (40,40), (40,C1), (40,C2), ... (40,C9), (40,4A), (40,4B), ...
(40,4F). (You can see a pattern emerging....) Row 1 col 17 would be
(40,50), next would be (40,D1), and so on. After using the 64 six-bit
column values, increment the row value by one and "start over" on the column
values. You should be able to see now that the second example snippet you
cited above is actually row 1 column 69, not column 70. ;-)
> I remember seeing, many years ago,a pocket reference sized book full of
> tables of the row/column number, and corresponding data for SBA. But I
> can't find it on the IBM web site by searching on obvious things like
> '3270'.
>
> Can anyone remember the books number, or suggest other references?
Appendix C of "3270 Data Stream Programmer's Reference".
-jc-
Shmuel (Seymour J.) Metz
> -----Original Message-----
> From: Richard Crook [SMTP:Richar...@WESTPACTRUST.CO.NZ]
> Sent: Sunday, May 20, 2001 6:11 PM
>
> Through not being able to dodge fast enough, I've got myself the job of
> making a VTAM USS table for non-SNA devices.
>
> I've got a copy of the 3270 Data Stream Programmers Reference, and a
> couple
> of good examples, so I think I can see what needs to be done. What I'm
> having trouble with is the row/column address's for the SBA order. The
> manual just says that the address is a 16 bit field, but doesn't seem to
> explain what the values are.
----------------------------------------------------------------------
:> Through not being able to dodge fast enough, I've got
:> myself the job of making a VTAM USS table for non-SNA
:> devices.
If you are familiar with ISPF panel programming, you can
prototype your new USS screen in ISPF and then use my
DA$SPF2D program to convert it to 3270 datastream. This
program is available from here:
http://www.planetmvs.com/freeware/dasrc.html
You might need to hand tweak some trailing blanks. The
program generates a full program that can be assembled
and then executed on TSO. It presents the full screen
via a TPUT. It's best (IMHO) to try for the lowest
common denominator and generate a USS for a 24x80 screen.