Using [] in z/OS ISPF & emulators

J

John

Was curious if anyone codes C on a mainframe in TSO/ISPF and, if so, what
they've done to get brackets ( [] ) recognized by both their terminal
emulator and ISPF itself.

I'm using Attachmate Extra & even though I've mapped my keyboard for
brackets, they end up translated to strange characters in ISPF. I'm able to
type a bracket & it shows up as such on the screen, but once I hit enter, it
gets translated into some strange character.

I guess this is more of a mainframe hardware question, but there aren't any
active mainframe groups that I could find...
 
D

Dann Corbit

John said:
Was curious if anyone codes C on a mainframe in TSO/ISPF and, if so, what
they've done to get brackets ( [] ) recognized by both their terminal
emulator and ISPF itself.

I do most of my editing on the PC side of the fence and then transfer the
files.
Frequently, I build on the PC too, with the SAS/C cross compiler.
I'm using Attachmate Extra & even though I've mapped my keyboard for
brackets, they end up translated to strange characters in ISPF. I'm able
to type a bracket & it shows up as such on the screen, but once I hit
enter, it gets translated into some strange character.

I guess this is more of a mainframe hardware question, but there aren't
any active mainframe groups that I could find...

news:bit.listserv.ibm-main
 
K

Keith Thompson

John said:
Was curious if anyone codes C on a mainframe in TSO/ISPF and, if so, what
they've done to get brackets ( [] ) recognized by both their terminal
emulator and ISPF itself.

One workaround is to use trigraphs. ??( is translated to [, and ??)
is translated to ]. This happens in an early translation phase, so
the translation occurs even in character constants and string
literals. The drawback of trigraphs is that they're ugly (and their
mother dresses them funny). You might need a compiler option to tell
your compiler to recognize them.

Or you can use digraphs. <: is equivalent to [, and :> is equivalent
to ], assuming your compiler supports them. (Trigraphs were added in
the 1989 ANSI C standard; I think digraphs were added in an amendment
in 1995). They're slightly (but only slightly) less ugly than
trigraphs, and they're handled in a later translation phase, so the
string literal "<:" still consists of two characters, '<' and ':'.

Or you can use some system-specific solution that I know nothing
about. (Dann Corbit suggested asking in bit.listserv.ibm-main.)
 
R

Richard Heathfield

John said:
Was curious if anyone codes C on a mainframe in TSO/ISPF and, if so, what
they've done to get brackets ( [] ) recognized by both their terminal
emulator and ISPF itself.

Not saying it's the best solution, but when I faced this problem (about a
million years ago now, but never mind that) I found out that EBCDIC did
have a couple of characters that do the job, but unfortunately they're not
the "right" ones, in that they are not the characters that an ASCII-EBCDIC
conversion program replaces [] with. So I mucked around a bit with some
test programs, and discovered the values of characters which, when
translated into EBCDIC, would get translated into the "right" [ and ].

I then wrote another program, which would simply copy its input to its
output, except that whenever it saw a [ or a ], it would instead write out
the appropriate magic value such that, when the program was copied up to
the mainframe and translated into EBCDIC, the conversion would result in a
useful translation.

Sorry I can't remember the codes involved, but if takes you as much as an
hour to write the necessary test programs, I'd be surprised.
 
D

David Wade

John said:
Was curious if anyone codes C on a mainframe in TSO/ISPF and, if so, what
they've done to get brackets ( [] ) recognized by both their terminal
emulator and ISPF itself.

This can be tricky.
I'm using Attachmate Extra & even though I've mapped my keyboard for
brackets, they end up translated to strange characters in ISPF. I'm able to
type a bracket & it shows up as such on the screen, but once I hit enter, it
gets translated into some strange character.

The original IBM screens did not have "[" or "]" keys. There are two places
in the EBCDIC code table where these can occur.
0xAD/0xBD or 0xA0/0xB if I recall properly. Usually you can set a choice of
code pages in 3270 emulators. I found that in IBM PC COmms I needed to use
code page 1047....
I guess this is more of a mainframe hardware question, but there aren't any
active mainframe groups that I could find...

NO, but there are e-mail lists which get gated to USENET....
 
R

Richard Heathfield

David Wade said:

The original IBM screens did not have "[" or "]" keys. There are two
places in the EBCDIC code table where these can occur.
0xAD/0xBD

Dem's der bunnies! I'd know 'em anywhere!
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top