Hi, I am new to SAS and I keep getting errors when I try to run the below code. I do not know why it will not run. I am using SAS EG
Data membership2;
Infile Inovalon dlm=','X;
Input memberid memberkey membername $ "Bucketed Line of Business" $ "Date of Enrollment Segment";
run;
I get the following error
24
25 GOPTIONS ACCESSIBLE;
26 Data membership2;
27 Infile Inovalon dlm=','X;
28 Input memberid memberkey membername $ "Bucketed Line of Business" $ "Date of Enrollment Segment";
___________________________
22
200
ERROR 22-322: Syntax error, expecting one of the following: a name, an integer constant, arrayname, #, &, (, +, /, //, :, ;, ?, @,
@@, ~.
ERROR 200-322: The symbol is not recognized and will be ignored.
29 run;
I don't believe that X is an acceptable parameter as you are using it:
Infile Inovalon dlm=','X;
Try
Infile Inovalon dlm=',';
If you borrowed from code with something like dlm='09'x then that indicates the hexadecimal value of the TAB character since tabs are very hard to actually see/ use in code.
If you want to use variable names with ugly spaces then they require an N after them all the time to indicate "name literal".
Input memberid memberkey membername $ "Bucketed Line of Business"n $
"Date of Enrollment Segment"n;
I would suggest thinking very carefully about using those names as you also have to have the option VALIDVARNAME=any in effect.
If you are using those in an attempt to have pretty output consider assigning labels, which can be much longer. For example:
Data membership2; Infile Inovalon dlm=','; Input memberid memberkey membername $ LOB $ DateEnr; label LOB = "Bucketed Line of Business" DateEnr = "Date of Enrollment Segment" ; run;
It helps to paste code and log results into a code box opened using the forum's {I} or "running man" icon to preserve formatting.
If you look at your error message the ______ is not under the location it was in the log you copied from.
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!
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.