BookmarkSubscribeRSS Feed
AJ17
Fluorite | Level 6

I am attempting to run the CCS Code to assess for ICD-9 diagnoses, running on SAS EG. However, I am getting an error code that I cannot seem to correct. I've tried to change the syntax of the '%LET CORE=' code to remove the double quotations, remove the ~, remove each '/', remove both '//', added the 'sas7bdat' extension, but I keep getting the syntax message. 

 

I attempted to simplify the path names. Does this code & log snip help? Any responses are appreciated as I've been trying to fix this for over a week. 

CODE USED IN SAS ENTERPRISE GUIDE TO LOAD CCS DIAGNOSTIC TOOL:
FILENAME INRAW1 "~//…/CCS/ICD_9/ccs_multi_dx_tool_2015.csv" RECL=300;  
FILENAME INRAW2 "~//…/CCS/ICD_9/ccs_multi_pr_tool_2015.csv"	LRECL=300;
 
LIBNAME  IN1    "~//…/Example_Analysis/";  * Location of input discharge data;
LIBNAME  OUT1    "~//…OUT_Analysis";    * Location of output data;

TITLE1 'CREATE CCS MULTI-LEVEL TOOL CATEGORIES';
TITLE2 'USE WITH DISCHARGE ADMINISTRATIVE DATA THAT HAS DIAGNOSIS OR PROCECDURE CODES';

/******************************************************************/
/*  Macro Variables that must be set to define the characteristics*/
/*  of your SAS discharge data. Change these values to match the  */
/*  number of diagnoses and procedures on your dataset. Change    */
/*  CORE to match the name of your dataset.                       */
/******************************************************************/
* Maximum number of DXs on any record;   %LET DXS=6;
* Maximum number of PRs on any record;   %LET PRS=6;
* Input SAS file member name;            %LET CORE="~//…/EXAM_long";

LOG WITH ERROR:
NOTE: Line generated by the macro variable "CORE".
223         IN1."~//…EXAM_long”
            ____
            22
            201

ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, ;, CUROBS, END, INDSNAME, KEY, KEYRESET, KEYS, 
              NOBS, OPEN, POINT, _DATA_, _LAST_, _NULL_.  

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

  

5 REPLIES 5
PaigeMiller
Diamond | Level 26

Show us the code you are using.

 

Also, its always a good idea if you are using macros or macro variables to turn on the macro debugging options:

 

options mprint symbolgen;

 

 

So execute the above command, run your code again, and show us the log again. 

--
Paige Miller
AJ17
Fluorite | Level 6

It was because the %LET CORE = statement had the path + file name, when it just required the file name. Thanks for all who responded!

ballardw
Super User

Sure looks like your macro expects to be the name of a dataset in the library In1.

"~//PATH/officerlong" looks to be the name of a FOLDER not a DATASET.

 

 

Stu_SAS
SAS Employee

The DATA Step here is trying to load a SAS dataset:

 

DATA OUT1.NEW_MULTI_CCS (DROP = i);
    SET IN1.&CORE;
    ...
RUN;

&CORE is defined as "~//PATH/officerlong", which is not a valid SAS dataset name. This looks like it is a path to a SAS dataset, which the library IN1 already is pointing to. You need to specify an unquoted SAS dataset name that is within the library IN1.

 

For example, suppose your SAS dataset was called officerlong and it is within the IN1 library. You should make the following change to the program:

%LET CORE = officerlong;

 

Quentin
Super User

Without seeing the code  that defines the macro CORE, this is just a wild guess.

 

Assuming you have an input dataset named Exam_long.sas7bdat in the directory ~//…/Example_Analysis/

 

You could change the line:

* Input SAS file member name;            %LET CORE="~//…/EXAM_long";

To:

* Input SAS file member name;            %LET CORE=EXAM_long;

But that's just a wild guess. 

Personally, I think it's a bit dangerous for programmers to be asked to use macros, without being given an explanation of how the macro works, at least documenting the inputs and outputs.  I would recommend you review the macro definition, perhaps with the original macro programmer or another colleague, to understand how it works.

The Boston Area SAS Users Group is hosting free webinars!
Next up: SAS Trivia Quiz hosted by SAS on Wednesday May 21.
Register now at https://www.basug.org/events.

sas-innovate-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 5 replies
  • 766 views
  • 0 likes
  • 5 in conversation