Question: how do I programmatically display the z/OS base OS encoding?
Scenario: I open a track with SAS support and want to provide installation specific information. Especially I want my SAS code to generate a small block which says:
z/OS base encoding: EBCDIC1141
z/OS OE encoding: IBM-1047
SAS locale option: LOCALE=DE_DE
SAS encoding option: ENCODING=OPEN_ED-1141
For the last three elements I use the following code
filename unixcmd pipe "locale charmap" ;
infile unixcmd; input;
%put z/OS OE encoding : &OE_LOCALE ;
%put SAS locale option : %sysfunc(getoption(locale,keyword));
%put SAS encoding option : %sysfunc(getoption(encoding,keyword));
For the life of me however I can't find any SAS function, REXX function or TSO command that gives me the z/OS base encoding value. (*1)
(Believe me: where I am consulting right now - and I am happily doing so - z/OS base encoding is German, while z/OS Unix System Services aka Open Edition aka OE encoding is US english, SAS locale is DE_DE and SAS encoding is OPEN_ED-1141.)
(*1) REXX function sysvar(sysplang)/sysvar(sysslang) does not provide the encoding value but rather the language chosen for TSO/E.
Thanks, Patrick, but that is all info I do already have available by means of the appropriate getoption functions. It's the operating system's base encoding that I want to display programmatically. Still haven't found any command or tool to get that piece of information.
Perhaps that's something you could find out from the system engineers who do the operating system installs and hot fixes -- they might know of a JCL proc or system equivalent for z/OS that is the equivalent of PROC OPTIONS for SAS.
Here are the results:
sas_autovar_sysscpl = z/OS
sas_function_hotfix = SAS 9.1.3 Service Pack 4
sashelp_datarepname = MVS_32
sashelp_encoding = open_ed-1141 Austria/Germany (OpenEdition)
sas_option_encoding = OPEN_ED-1141
sas_option_locale = GERMAN_GERMANY
sas_option_nlscompatmode = NONLSCOMPATMODE
unix_locale_charmap = IBM-1047
So here I have DATAREPNAME=MVS_32. Still feeling uneasy as I read the "Conclusion" section in the document Cynthia had recommended (and which I had in print two days earlier thanks to Hans-Jürgen Baumann from SAS Heidelberg). The first point of which says: "A SAS9 release should be used with an encoded edition that matches your operating system's encoding." Great, but what if I have two different encodings in two parts of the same system?
To illustrate what it means to have the non-Unix and Unix part in z/OS with a different encoding, consider this:
In order to list all files in a directory having either an 's' or 'x' in their filename I could use
filename unixcmd pipe "ls -l *[xs]*.gif" ;
Alternatively I could put the ls command in a script which resides within the Unix part of z/OS (in a UFS file).
The filename statement could now be
filename unixcmd pipe ". /u/bardos/ls.sh" ;
The command within the script file looks(*1) like this
ls -l *Ýxs¨*.gif
(*1) ISPF BROWSE having the DISPLAY command for quite some time allows to display the file's contents in different encodings. Entering DISPLAY EBCDIC (or DIS CCSID 1047) allows me to see the square brackets (use DIS RESET to cancel the effect). Those sitting in front of a standard EBCDIC session may try DIS CCSID 1141 so they may get a feeling of what it's like to do development in an environment using different encodings in different parts of the same system. (So it "looks" because the emulator is set to codepage 1141).
Sigh. Why can't z/OS (TSO) offer a CHCP or LOCALE command? (Rhetorical question)
I guess I'll leave it at that as the whole thread's purpose was to be able to provide SAS support with upfront information based on technical resources rather than hearsay and/or notes.
as can be seen at the beginning of the thread I'm using "locale charmap" to get the info. According to "man locale"
The operand name can be a category name, keyword name, or the reserved
name charmap. If it is a category name, locale selects the given category
and all keywords within it for output. If name is a keyword name, locale
selects the given keyword and its category for output. If name is charmap,
locale displays the name of the charmap used with the localedef -f option
when the locale was created.
I do not try to get these settings changed here as there are much bigger users of Unix System Services. All I want is to provide reliable information to SAS support and my co-workers here.
It was in such an environment (DB Eschborn) I stopped using square and curly brackets (arrays etc) and pipe marks (for "or" and "concatenation") in sas syntax.
What joy (not) when code updates to the tagsets.excelxp template, needed SAS on z/OS to compile perl regular expressions which use square brackets and other symbols that are OK in 1047, but not in the encoding of my platform.
good luck to you and those you support (a fortunate lot I think ;-) )