Learning SAS? Welcome to the exclusive online community for all SAS learners.

I'd like to modify the sasv9.cfg file - possible ?

Reply
Contributor
Posts: 39

I'd like to modify the sasv9.cfg file - possible ?

Hi to all

I'm having a problem with my SAS university Edition.

In fact, I had a first problem identical to the one exposed here :

the option ENDODING=WLATIN1 added to an INFILE statement solved the problem.


now, all the files I'm using are encoded with wlatin1 (since I'm French...) - I'd like to use the global option ENCODING=WLATIN1 but that option can only be specified in the sasv9.cfg file.

the log is telling me that the file is located here :

/opt/sasinside/SASHome/SASFoundation/9.4/nls/u8/sasv9.cfg

How can I access to that file ? Can I modify this file ?

best regards

Sébastien

Super User
Posts: 6,938

Re: I'd like to modify the sasv9.cfg file - possible ?

You would either need to log on to the VM with ssh (or any other communications method that gets you a shell) or define a virtual path in the VM configuration that lets you get to the /opt/sasinside/SASHome/SASFoundation/9.4/nls/u8 location.

I doubt that either is possible.

---------------------------------------------------------------------------------------------
Maxims of Maximally Efficient SAS Programmers
Valued Guide
Posts: 3,208

Re: I'd like to modify the sasv9.cfg file - possible ?

They (SAS intstitute) have decided to lock you out and offering the utf8 approach.
Within the same installation there is likely to be a /opt/sasinside/SASHome/SASFoundation/9.4/nls/en/sasv9.cfg and a location to have the latin1 version being run. No modifictions are needed all is there already.

The only thing the connection to that other setup altohough there is not configured wiht a SASAPP approach. It is this product: SAS Studio
A second workspaceserver is mentioned as approach SAS(R) Studio 3.3: Administrator's Guide. It is not the old classic SAS  anymore what most people still are thinking.  Sorry chaning times

---->-- ja karman --<-----
Super User
Posts: 17,831

Re: I'd like to modify the sasv9.cfg file - possible ?

I'd contact SASAnalyticsU@sas.com to have the issue logged and see if there's a workaround.

Contributor
Posts: 39

Re: I'd like to modify the sasv9.cfg file - possible ?

well.. since I was looking at a very simple solution, I convert all the TXT files I'm using as examples in UTF-8

Valued Guide
Posts: 2,175

Re: I'd like to modify the sasv9.cfg file - possible ?

Have a look at http://support.sas.com/documentation/cdl/en/hostunx/63053/HTML/default/viewer.htm#p13flc1vsrqwr8n1vu...

although just the order of precedence for finding config files, it gives a great insight to the variety of ways you might set a system option at start-up

Valued Guide
Posts: 3,208

Re: I'd like to modify the sasv9.cfg file - possible ?

Peter, That part is the old classic DMS only approach. SAS Studio is set up with the part of EIP (SAS integration technologies).

In that area you have a lot more, shocking more. SAS(R) 9.4 Intelligence Platform: System Administration Guide, Third Edition  Reference: Configuration Files for SAS Servers.
SF_FR is probably needing an utf8 session for the more modern IT-technology (using a Multi Byte Character Set MBCS) and a classic latin-1 more like the single byte characterset (850 Windows FR) for the old approaches.

We are in a migration era of SBCS to MBCS (utf8) most new interfaces web xml etc are doing utf8. Some oldies still going in sbcs Hollerith approach.

An IT department supporting both should configure 2 appservers for that according to some SAS papers.  

---->-- ja karman --<-----
Contributor
Posts: 39

Re: I'd like to modify the sasv9.cfg file - possible ?

well... I certainly need to understand things about the new technology...

have fun with this program :

data clint;

input titre_us $20. +2 titre_fra $21. year ;

cards;

Flags of Our Fathers  Mémoires de nos pères 2006

;

proc print;run;

run this program with a "regular" SAS - it works

run this program with SAS UE and you'll see that the result is not the same (and, to me, this is problematic... I contacted the support about it)

the log:

NOTE: Invalid data for year in line 46 44-45.

REGLE : ----+----1----+----2----+----3----+----4----+----5----+----6----+----7----+----8----+----9----+----0 

46 Flags of Our Fathers Mémoires de nos pères 2006

titre_us=Flags of Our Fathers titre_fra=Mémoires de nos pèr year=. _ERROR_=1 _N_=1

position 45 : there is a 2 but it seems that SAS UE is considering that in the 45th column, there is a "e"

Super User
Super User
Posts: 6,500

Re: I'd like to modify the sasv9.cfg file - possible ?

To move to UTF-8 encoding your will need to modify how you handle text strings.  Use delimiters or & modifier as below to handle the variable length it takes to store individual characters.

Try this program in both versions of SAS.  Notice that in UTF-8 encoding it takes 2 more bytes to store the French text.

data clint;

length titre_us titre_fra $30 year 8;

input titre_us & titre_fra & year ;

len1=length(titre_us);

len2=length(titre_fra);

list;

cards;

Flags of Our Fathers  Mémoires de nos pères  2006

;

proc print; run;

Valued Guide
Posts: 3,208

Re: I'd like to modify the sasv9.cfg file - possible ?

SR-FR,  You are for sure showing some failures in utf8 support. I got traumatized by all those encodings some 25 years ago. My apologies for sharing them.

When you would input a string at byte position 44 into a variable you will see es 2006. For me maker perfectly sense as é and è are two bytes in utf8 not one.

The question is why this is that badly made visible. (list statement no hex dump of the input).   

---->-- ja karman --<-----
Valued Guide
Posts: 3,208

Re: I'd like to modify the sasv9.cfg file - possible ?

got it you can open your source in Notepad++. It recognizes utf8 but you can switch to ascii (sbcs). It will show:

cards;

Flags of Our Fathers  Mémoires de nos pères 2006

That capital à is hex C3  the space is 20 . you can put your string out in Hex-format and reading 4DC3A96D6F69726573206465206E6F732070C3A872
70=p   C3A8 is the utf8 è 72=r     4-bytes <> 3 chars        You can get out of your mind with that.

---->-- ja karman --<-----
Respected Advisor
Posts: 3,892

Re: I'd like to modify the sasv9.cfg file - possible ?

You can set or change global options in the autoexec as documented here: SAS(R) Studio 3.3: User's Guide

The encoding option can be set/changed in the autoexec SAS(R) 9.4 National Language Support (NLS): Reference Guide, Third Edition and as documented this will changes how SAS reads from and writes to external files. The SAS Session encoding remains UTF-8 this way (which impacts which SAS string functions you can use safely: SAS(R) 9.4 National Language Support (NLS): Reference Guide, Third Editio

(N.B: even in a multi-byte session as long as you're only dealing with UTF-8 single byte encoded characters all single byte only string functions will still work as expected - not sure how the special French characters are encoded).

I haven't used SAS Studio a lot but according to documentation you should have access and also be able to change the session encoding: SAS(R) Studio 3.3: Administrator's Guide

I probably wouldn't try and change the session encoding from UTF-8 multi-byte to single byte (WLATIN1) as this takes a bit more than simply setting an option in the config file.

Correction: Encoding set as option is only valid during SAS invocation. So it must be in the config file. I wouldn't recommend to try this with the University Edition.

Contributor
Posts: 39

Re: I'd like to modify the sasv9.cfg file - possible ?

about the global option ENCODING=, you can't modify its value in the autoexec, that option must be specified in the config file. But it seems that you can't access to the sasv9.cfg file of SAS UE.

Tom, you said :

"Notice that in UTF-8 encoding it takes 2 more bytes to store the French text."

yes, with the UE version, not with a regular SAS 9.4 - IMO, what works with SAS 9.4 (and I never had any problems with accent) should work the same way with SAS UE.

Things are about to be very complicated if you can't save 20 characters in a variable with a length equal to 20 if some accents are among the characters...

To see the kind of problem we are about to have, see this example :

data clint;

input titre_us $20. +2 titre_fra $21. year ;

cards;

Flags of Our Fathers  Mémoires de nos pères 2006

Million Dollar Baby   Million Dollar Baby   2004

;

a perfect column input...

Super User
Super User
Posts: 6,500

Re: I'd like to modify the sasv9.cfg file - possible ?

It takes 2 more bytes for me when running "regular" SAS if I start it with UTF-8 instead of WLATIN1.

Valued Guide
Posts: 3,208

Re: I'd like to modify the sasv9.cfg file - possible ?

As you cannot change the session encoding the problems remains for all the interval vars and using the cards option.
SAS has nice papers for encoding, easy to understand and follow:

- http://support.sas.com/resources/papers/Multilingual_Computing_with_SAS_94.pdf  

- http://support.sas.com/resources/papers/AddingAdditionalSASWorkspaceServerstoSupportMultipleEncoding...

Far beyond the area if an UE educational installation, we are more in the concepts of NLS encodings and transcoding.
Very shocking to have abandon old truth as 1byte=1char. That is the biggest hurdle.

---->-- ja karman --<-----
Ask a Question
Discussion stats
  • 25 replies
  • 1828 views
  • 1 like
  • 9 in conversation