1
votes

I'm having basically the same issue as the following post:Proc Data sets argument error- Error 22-322 expecting a name

But the answer didn't solve my problem.

%let _EFIERR_ = 0; /* set the ERROR detection macro variable */

libname indata "E:\el30053_54_55\el30053-postprocessor\output\files";

/* Format HYPO1001 variables */

PROC datasets library=INDATA;

MODIFY INDATA.hypo1001

/* Format section. */

format HYPOR1;


/* Should not need to edit anything below. */
run;
quit;`

Essentially, I have several datasets in the library INDATA. One of them is called hypo1001. Bottom line, I need to rename some of the variables in the dataset, but the rename statement isn't working because there are a few variables with invalid formats. So now I'm trying to fix the formats, but it doesn't seem to be working. From what I can tell, my syntax is correct, but I have very limited experience with SAS that doesn't usually extend much beyond just converting xpt files to SAS format.

I'm getting the following errors in the log:

ERROR 22-322: Expecting a name.

ERROR 201-322: The option is not recognized and will be ignored.

1
Expecting a name errors are very, very often missing semicolons. You have a modify statement that does not end in a semicolon.Joe
Thanks, I missed that, but I'm still getting the same error message with the semicolon added.JoJo
INDATA. is the libref and not part of the member name.Tom

1 Answers

3
votes

The libref you used to define the library should not be included in the member name that you use in the MODIFY statement. Try this example:

data class; set sashelp.class; run;
proc datasets nolist lib=work;
  modify class ;
    format name ;
  run;
quit;