BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
EyalGonen
Lapis Lazuli | Level 10

Hi experts,

 

Using SAS Viya 3.5 and trying to load a SAS dataset created in encoding WHEBREW and copied as-is (via WinSCP) to the SAS Viya server SPRE compute machine. If I use this code below then the load works fine to CAS and I can see the Hebrew text correctly in Viya:

 

/* connect to CAS */
cas; 

/* create a caslib pointing to the sas7bdat file location */
caslib myCaslib datasource=(srctype="path") path="/tmp/sas94/data"; 

/* this sample uploads using a temporary caslib pointing to the sas7bdat file location */
/* the charmultiplier=2 is for Hebrew */
proc casutil; 
	load casdata="score.sas7bdat" incaslib="myCaslib" outcaslib="casuser" casout="score" 
	promote 
	importoptions=(filetype="basesas" charmultiplier=2);
run;quit;

 I would like to achieve the same by loading the dataset directly from the "Manage Data" UI in SAS Viya but that does not work. I get an error that the dataset cannot be transcoded. I cannot find a way to set the "charmultiplier=2" option in the UI when I define a new CASLIB of type "path". I also cannot find a way to set the "charmultiplier=2" in the CASLIB statement when I define it in code. Anyone has any idea about it?

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
BrunoMueller
SAS Super FREQ

I did some testing as well and encountered the same error messages. 

 

I did read through some more doc and found this: https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/casref/p0j7s6opsm8bbdn1edni5ngqdjyu.htm

It says:

Note: You can specify data connector options for all data connectors except SAS Data Connector to PC Files or SAS Data Connector to SAS Data Sets. For these you would instead use IMPORTOPTIONS= to read data and EXPORTOPTIONS= to save data.

 

So this means we can not specify the option while creating a caslib, but need to use it with every load operation.

 

Maybe it is best to convert the SAS data sets to UTF8 and then copy them to the physical location of the caslib.

View solution in original post

8 REPLIES 8
sbxkoenk
SAS Super FREQ

@EyalGonen wrote:

I also cannot find a way to set the "charmultiplier=2" in the CASLIB statement when I define it in code. Anyone has any idea about it?

You need (I think) the

     CVPMULTIPLIER=multiplier

on the LIBNAME statement.

LIBNAME MyCAS cas caslib=ABCXYZ cvpmultiplier=2.5; /* or 2 in your case */

 

But I would first make sure you have everything correctly represented on a V9 library in SAS VIYA 3.5 (that's a directory path and *.sas7bdat file on your Linux / UNIX file system).
If you do not specify any engine on the LIBNAME statement , SAS defaults to the V9 engine.
Then upload in-memory (to CAS). CAS has much more data types than *.sas7bdat and internal conversions may be done in order to save space for example. These conversions should happen automatically.

 

Koen

 
sbxkoenk
SAS Super FREQ

Some more info (on top of previous reply) :

 

SAS® 9.4 and SAS® Viya® 3.5 Programming Documentation | SAS 9.4 / Viya 3.5
Migrating to UTF-8
Migrating Data to UTF-8 for SAS® Viya® 3.5
https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/viyadatamig/titlepage.htm

 

Koen

 
EyalGonen
Lapis Lazuli | Level 10

Hi @sbxkoenk 

 

I want to load the "sas7bdat" file from the Viya UI in the so called "Manage Data" user interface. I want to right click on the "sas7bdat" file and select to Load it to CAS. This does not work for me due to transcoding errors. My question is how to set the "charmultiplier" option on the CASLIB itself (the CASLIB of type PATH that points to the "sas7bdat" files). Is this even possible?

 

 

BrunoMueller
SAS Super FREQ

Have a look here, https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/casref/p0pkl5ltcloc5wn19ly0hohe4s9e.htm#n0... according to the doc it is possible to define the CHARMULTIPLIER in the CASLIB statement.

 

As an alternative: in the Data Explorer (Manage Data) go to the Data Sources tab, display all the files for the given caslib, use the right mouse button on a sas7bdat file and choose "Add to Import". You then go to the Import tab, for a .sas7bdat file you can specify the "Character multiplier"

Bruno_SAS_0-1673339635281.png

 

EyalGonen
Lapis Lazuli | Level 10

Hi @BrunoMueller 

 

I am aware of the import option but I want to avoid it. I want to be able to right click on a "sas7bdat" file and select "Load" and it will automatically apply the "charmultiplier=2" to the load action. I need to test your suggestion about adding the charmultiplier to the caslib definition - I guess this should do what I want, right?

 

Do you know if it is possible to add the "charmultiplier" option to the CASLIB definition in the UI? I was unable to find any such option that worked...

 

Eyal

EyalGonen
Lapis Lazuli | Level 10

Hi @BrunoMueller 

 

I tried your suggestion and it seems like the CASLIB statement does not allow the "charmultiplier" option:

:

 

EyalGonen_0-1673342439641.png

 

BrunoMueller
SAS Super FREQ

I did some testing as well and encountered the same error messages. 

 

I did read through some more doc and found this: https://go.documentation.sas.com/doc/en/pgmsascdc/9.4_3.5/casref/p0j7s6opsm8bbdn1edni5ngqdjyu.htm

It says:

Note: You can specify data connector options for all data connectors except SAS Data Connector to PC Files or SAS Data Connector to SAS Data Sets. For these you would instead use IMPORTOPTIONS= to read data and EXPORTOPTIONS= to save data.

 

So this means we can not specify the option while creating a caslib, but need to use it with every load operation.

 

Maybe it is best to convert the SAS data sets to UTF8 and then copy them to the physical location of the caslib.

EyalGonen
Lapis Lazuli | Level 10

I would suggest to add a new feature to allow specifying the CHARMULTIPLIER option for Base SAS datasets connector in CASLIB. I think it would be very useful.

Thanks all for the help!

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

Discussion stats
  • 8 replies
  • 1892 views
  • 2 likes
  • 3 in conversation