SAS Programming

DATA Step, Macro, Functions and more
BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
CathyVI
Pyrite | Level 9

Hi,

I have always encounter this slight issue when coding. I want to drop or keep a variable and also use the compress statement. How do I code this correctly?.

For example:

data monthly_06 (drop=hospice) (compress=yes);
set a.monthly_06;

run;

/****Error log page*****/

73 Data monthly_06 (drop= hospice) (compress=yes);
                                                           _
                                                          22
                                                          76
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, /, ;, _DATA_, _LAST_, _NULL_.
ERROR 76-322: Syntax error, statement will be ignored.
1 ACCEPTED SOLUTION

Accepted Solutions
Reeza
Super User
data want(drop=make origin compress=yes);
 set sashelp.cars;
 run;

@CathyVI wrote:

Hi,

I have always encounter this slight issue when coding. I want to drop or keep a variable and also use the compress statement. How do I code this correctly?.

For example:

data monthly_06 (drop=hospice) (compress=yes);
set a.monthly_06;

run;

/****Error log page*****/

73 Data monthly_06 (drop= hospice) (compress=yes);
                                                           _
                                                          22
                                                          76
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, /, ;, _DATA_, _LAST_, _NULL_.
ERROR 76-322: Syntax error, statement will be ignored.

Remove the additional parenthesis. 

View solution in original post

1 REPLY 1
Reeza
Super User
data want(drop=make origin compress=yes);
 set sashelp.cars;
 run;

@CathyVI wrote:

Hi,

I have always encounter this slight issue when coding. I want to drop or keep a variable and also use the compress statement. How do I code this correctly?.

For example:

data monthly_06 (drop=hospice) (compress=yes);
set a.monthly_06;

run;

/****Error log page*****/

73 Data monthly_06 (drop= hospice) (compress=yes);
                                                           _
                                                          22
                                                          76
ERROR 22-322: Syntax error, expecting one of the following: a name, a quoted string, /, ;, _DATA_, _LAST_, _NULL_.
ERROR 76-322: Syntax error, statement will be ignored.

Remove the additional parenthesis. 

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
  • 1 reply
  • 562 views
  • 1 like
  • 2 in conversation