BookmarkSubscribeRSS Feed
adent
Calcite | Level 5

I am trying to add formats to existing variables and I keep getting this error. Can anyone let me know why this is?

 

 

ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant,
a datetime constant, a missing value, ;, (, LOW, OTHER.
ERROR 76-322: Syntax error, statement will be ignored.

 

1 REPLY 1
Tom
Super User Tom
Super User

SAS does a good job of pointing you at the problem.

1     proc format library= work.User_Formatsexam;
2
3     value Trial Type
                  ----
                  22
                  76
ERROR 22-322: Syntax error, expecting one of the following: a quoted string, a numeric constant, a datetime constant,
              a missing value, ;, (, LOW, OTHER.
ERROR 76-322: Syntax error, statement will be ignored.
4     S='Single'
5     M= 'Mixed'
6     P= 'Parallel';
NOTE: The previous statement has been deleted.
7
8     run;

Pick a single name for the format.

Are you trying to define a format named TRIAL or one named TYPE?

 

Once you fix that you also need to add a $ to the front of the name to let PROC FORMAT know that you want to create CHARACTER format and not a NUMERIC format.

SAS Innovate 2025: Call for Content

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!

Submit your idea!

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