BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
xxformat_com
Barite | Level 11

Hi,

 

If I run the following program in one go, it works properly:

 

*--------------------------------------------------------------------;

libname demo xlsx "&xxdemo./reporting/test.xlsx";

data demo.'All Students'n;
    set sashelp.class;
run;

data demo.'Female'n;
    set sashelp.class (where=(sex='F'));
run;

libname demo;

options validmemname=extend;

libname demo xlsx "&xxtraining./reporting/test.xlsx";

title 'DEMO';
proc print data=demo.'ALL STUDENTS'n noobs;
run;

libname demo;

libname demo xlsx "&xxtraining./reporting/test.xlsx";

proc datasets nolist nodetails;
    copy in=demo out=work;
        select 'ALL STUDENTS'n ;  
    run;
quit;

libname demo;

title 'WORK';
proc print data=work.'ALL STUDENTS'n noobs;
run;

However, it I want to run proc datasets in a second run, I get an error:

 

ERROR: The value ALL STUDENTS is not a valid SAS name.
ERROR: File WORK.'ALL STUDENTS'n.DATA has not been saved because copy could not be completed.

 

libname demo xlsx "&xxtraining./reporting/test.xlsx";

proc datasets nolist nodetails;
    copy in=demo out=work;
        select 'ALL STUDENTS'n ;  
    run;
quit;

libname demo;

title 'WORK';
proc print data=work.'ALL STUDENTS'n noobs;
run;

Are you familiar with this issue and do you how to fix it?

 

Best Regards,

Véronique

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
xxformat_com
Barite | Level 11

ok. I see. The option does not remain active after the first run in SAS Studio. Strange.

View solution in original post

12 REPLIES 12
Kurt_Bremser
Super User

To make a name with a blank in it (a practice highly recommended against!) valid, you need to set the option

options validmemname=extend;

You either ran your proc datasets in a different session, or you have code that resets the option to its default.

xxformat_com
Barite | Level 11

The option is already active in the example I gave. I'm working on interactive mode.

xxformat_com
Barite | Level 11

ok. I see. The option does not remain active after the first run in SAS Studio. Strange.

Kurt_Bremser
Super User

You can find a setting in SAS Studio. Settings - Tables (or Data, I only see a German version where it is "Tabellen").

There you set the options vor VALIDVARNAME and VALIDMEMNAME, and code for this is sent before every execution. If you turn on "Show Generated Code in Log" in Settings - Code and Log, you can see the relevant code that is automatically sent in your log.

xxformat_com
Barite | Level 11

Could you share a screenshot; it's not an issue if it is in German.

xxformat_com
Barite | Level 11

Danke schön Herr Bremser.

In meiner Version gibt es diese Möglichkeit leider nicht.

Im General, kann ich nur validvarname ändern aber nicht validmemname.

sasstudio.JPG

xxformat_com
Barite | Level 11

Sehr geehrter Herr Bremser,

jetzt ist bei mir SAS Studio 3.8 installiert.

Vielen Dank

Véronique

sasstudio38.JPG

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 12 replies
  • 1695 views
  • 1 like
  • 2 in conversation