BookmarkSubscribeRSS Feed
Ronein
Meteorite | Level 14

Hello

What is the reason that I get error?

The task is tom list memebers of agefmt format

27 select agefmt.;
_______
22
201
ERROR 22-322: Syntax error, expecting one of the following: a name, $, @.

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

 

 

5 REPLIES 5
Ronein
Meteorite | Level 14

NOTE: Writing TAGSETS.SASREPORT13(EGSR) Body file: EGSR
24
25 GOPTIONS ACCESSIBLE;


26 proc format;
27 value agefmt
28 0-18='0-18'
29 18-high='18+'
30 ;
NOTE: Format AGEFMT is already on the library WORK.FORMATS.
NOTE: Format AGEFMT has been output.
31 run;

NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 99.31k
OS Memory 22948.00k
Timestamp 08/16/2020 10:57:29 AM
Step Count 33 Switch Count 0
Page Faults 0
Page Reclaims 9
Page Swaps 0
Voluntary Context Switches 4
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0

32
33 proc format library=work.formats fmtlib;
34 select agefmt.;
_______
2 The SAS System 07:21 Sunday, August 16, 2020

22
201
ERROR 22-322: Syntax error, expecting one of the following: a name, $, @.

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

NOTE: The previous statement has been deleted.
35 run;

NOTE: PROCEDURE FORMAT used (Total process time):
real time 0.00 seconds
user cpu time 0.00 seconds
system cpu time 0.00 seconds
memory 136.34k
OS Memory 22948.00k
Timestamp 08/16/2020 10:57:29 AM
Step Count 34 Switch Count 0
Page Faults 0
Page Reclaims 42
Page Swaps 0
Voluntary Context Switches 1
Involuntary Context Switches 0
Block Input Operations 0
Block Output Operations 0

NOTE: No formats found that match SELECT statement.
NOTE: The SAS System stopped processing this step because of errors.
36
37
38 GOPTIONS NOACCESSIBLE;
39 %LET _CLIENTTASKLABEL=;
40 %LET _CLIENTPROCESSFLOWNAME=;
41 %LET _CLIENTPROJECTPATH=;
42 %LET _CLIENTPROJECTPATHHOST=;
43 %LET _CLIENTPROJECTNAME=;
44 %LET _SASPROGRAMFILE=;
45 %LET _SASPROGRAMFILEHOST=;
46
47 ;*';*";*/;quit;run;
48 ODS _ALL_ CLOSE;
49
50
51 QUIT; RUN;
52

Shmuel
Garnet | Level 18

Use next code to list a format or formats:

proc format lib=work;   /* or any other library */
   select agefmt;  /* enter one or more format names separated by space */
run;

In case of char type format name is preceded by $.

Tom
Super User Tom
Super User

The SELECT statement just wants the NAMES of the formats to select. It does not what you to enter a full format specification. Remove the period.

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
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
  • 5 replies
  • 488 views
  • 0 likes
  • 4 in conversation