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

Hello,

 

I have many files (file1, file2, ...) in my work directory and I executed this command to remove the labels from all the files:

 

proc datasets library=work memtype=data; modify file: ; attrib _all_ label=""; quit;

 

but I got an error:

ERROR 22-322: Syntax error, expecting one of the following: ;, (, /.

ERROR 200-322: The symbol is not recognized and will be ignored.

 

So is there a  way to remove the labels from all the files of the library with 1 line of code ?

 

(the command works for one file though)

1 ACCEPTED SOLUTION

Accepted Solutions
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You need slightly more:

data have1;
  set sashelp.class;
run;
data have2;
  set sashelp.cars;
run;

data _null_;
  set sashelp.vtable (where=(libname="WORK"));
  call execute('proc datasets library=work nolist; modify '||strip(memname)||"; attrib _all_ label=''; run;");
run;

View solution in original post

2 REPLIES 2
RW9
Diamond | Level 26 RW9
Diamond | Level 26

You need slightly more:

data have1;
  set sashelp.class;
run;
data have2;
  set sashelp.cars;
run;

data _null_;
  set sashelp.vtable (where=(libname="WORK"));
  call execute('proc datasets library=work nolist; modify '||strip(memname)||"; attrib _all_ label=''; run;");
run;
ballardw
Super User

Post code and the error message from the log into a code box opened with the forum {I} menu icon.

The error message you show would have an underscore _ character under the position with the error such as:

 

97   proc datasets library=work memtype=data;
NOTE: Writing HTML Body file: sashtml1.htm
98      modify file: ;
                   -
                   22
                   200
NOTE: Enter RUN; to continue or QUIT; to end the procedure.
ERROR 22-322: Syntax error, expecting one of the following: ;, (, /.
ERROR 200-322: The symbol is not recognized and will be ignored.
99      attrib _all_ label="";
100  quit;

The main message windows will reformat text and you would not be able to tell that the : character is not allowed in that position.

 

 

 

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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.

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 2 replies
  • 3285 views
  • 3 likes
  • 3 in conversation