BookmarkSubscribeRSS Feed
Jesusismygrace
Obsidian | Level 7

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;

1 REPLY 1
ballardw
Super User

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.

 

 

Catch up on SAS Innovate 2026

Dive into keynotes, announcements and breakthroughs on demand.

Explore 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
  • 1 reply
  • 1176 views
  • 4 likes
  • 2 in conversation