BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8

data tty;

set _admit;

if indexw((compress('ED','IP','AV',"'")),EncType) then output;

run;

enctype has values

'ED','IP','AV' for each record.

I get the folowing error.

ERROR 72-185: The COMPRESS function call has too many arguments.

2 REPLIES 2
PGStats
Opal | Level 21

It is not clear to me what you are trying to do. Could you explain? - PG

PG
LinusH
Tourmaline | Level 20

Refering to the documentation, compress compresses one string at a time, not multiple.

http://support.sas.com/documentation/cdl/en/lefunctionsref/63354/HTML/default/viewer.htm#n0fcshr0ir3...

And why do you want to compress ' from hard coded strings apparently not containing that char?

My guess is that you want to see if EncType has any of the listed values...?

If the subset is the only logic you wish to use, a where clause should be more suitable:

where EncType in ('ED','IP','AV');

Data never sleeps

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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.

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
  • 2 replies
  • 1061 views
  • 0 likes
  • 3 in conversation