DATA Step, Macro, Functions and more

Needed: code to display host OS and SAS system encoding settings

Reply
Frequent Contributor
Posts: 106

Needed: code to display host OS and SAS system encoding settings

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:
[pre]
z/OS base encoding: EBCDIC1141
z/OS OE encoding: IBM-1047
SAS locale option: LOCALE=DE_DE
SAS encoding option: ENCODING=OPEN_ED-1141
[/pre]
For the last three elements I use the following code
[pre]
filename unixcmd pipe "locale charmap" ;
data _null_;
infile unixcmd; input;
call symput('OE_LOCALE',_infile_);
run ;
%put z/OS OE encoding : &OE_LOCALE ;
%put SAS locale option : %sysfunc(getoption(locale,keyword));
%put SAS encoding option : %sysfunc(getoption(encoding,keyword));
[/pre]
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.)

Any ideas?

(*1) REXX function sysvar(sysplang)/sysvar(sysslang) does not provide the encoding value but rather the language chosen for TSO/E.
Respected Advisor
Posts: 3,887

Re: Needed: code to display host OS and SAS system encoding settings

Not 100% sure if I understand your question, but with:

proc options;
run;

or more specific:
PROC Options group = LanguageControl;
run;

You'll get how SAS is configured.

HTH
Patrick
Frequent Contributor
Posts: 106

Re: Needed: code to display host OS and SAS system encoding settings

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.
SAS Super FREQ
Posts: 8,742

Re: Needed: code to display host OS and SAS system encoding settings

Hi:
This is an interesting document on the subject, but it doesn't show how to find the operating system's base encoding:
http://support.sas.com/techsup/technote/ts758.pdf

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.

cynthia
N/A
Posts: 0

Re: Needed: code to display host OS and SAS system encoding settings

Looking in dictionary.tables and/or dictionary.columns might be helpful.
Frequent Contributor
Posts: 106

Re: Needed: code to display host OS and SAS system encoding settings

Thanks for your input Frank,

I'm leaving for the weekend and won't have SAS available until Tuesday.
Yet I wonder, how I would/should find the operating system's enconding there.

Can you enlighten me?
N/A
Posts: 0

Re: Needed: code to display host OS and SAS system encoding settings

Running in Windows XP (9.1.3 SP4), I see, in dictionary.tables:
variable ENCODING: us-ascii ASCII (ANSI)
variable DATAREPNAME: WINDOWS_32

Using your GETOPTION code:
ENCODING=WLATIN1
LOCALE=EN_U

The encoding Option value is different from the ENCODING variable in TABLES. Does this help?
Frequent Contributor
Posts: 106

Re: Needed: code to display host OS and SAS system encoding settings

Thanks for the detailed reply Frank. I'll check your suggestion on Tuesday when I'll be back at the customer site.

Robert
Frequent Contributor
Posts: 106

Re: Needed: code to display host OS and SAS system encoding settings

Here are the results:
[pre]
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
[/pre]
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
[pre]
filename unixcmd pipe "ls -l *[xs]*.gif" ;
[/pre]
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
[pre]
filename unixcmd pipe ". /u/bardos/ls.sh" ;
[/pre]
The command within the script file looks(*1) like this
[pre]
ls -l *Ýxs¨*.gif
[/pre]
(*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.

Thanks all
Robert
Super Contributor
Super Contributor
Posts: 3,174

Re: Needed: code to display host OS and SAS system encoding settings

Check the OMVS locale command (see doc @ "man locale", such as:

locale -k code_set_name

which returns:

$ locale -k code_set_name
code_set_name="IBM-1047"


Scott Barry
SBBWorks, Inc.
Frequent Contributor
Posts: 106

Re: Needed: code to display host OS and SAS system encoding settings

Thanks Scott,

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.
Valued Guide
Posts: 2,174

Re: Needed: code to display host OS and SAS system encoding settings

Robert

you have my sympathy

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 ;-) )
peterC
Ask a Question
Discussion stats
  • 11 replies
  • 337 views
  • 0 likes
  • 6 in conversation