BookmarkSubscribeRSS Feed
SASPhile
Quartz | Level 8

There are some text fields that have value "not assigned". how  to change it "  " for all text fields that have that value in all datasets in a library?

i.e all occurences of "not assigned" change to " "

5 REPLIES 5
Reeza
Super User

If varName = ‘not assigned” then call missing(varName);

 

CALL MISSING() would set this to missing. 

 

SAS doesn't really have the concept of ‘null’ as other languages do, but it has missing. 

SASPhile
Quartz | Level 8

there are 100's of variables in multiple datasets

Kurt_Bremser
Super User

@SASPhile wrote:

there are 100's of variables in multiple datasets



Which means you have a serious conceptual issue. You should take care of that when you import the data in the first place.

 

ballardw
Super User

@Kurt_Bremser wrote:

@SASPhile wrote:

there are 100's of variables in multiple datasets



Which means you have a serious conceptual issue. You should take care of that when you import the data in the first place.

 


Quite so.

I have several custom informats depending on the project that turn various text strings such as N/A, UNK, or  "(NO DATA)" and "(NOTHING ENTERED)" to missing, or "special missing" as needed, when reading the files.

Reeza
Super User
Fun. Write a macro then that does it for one data set and then call it for all. You can use _character_ to reference all the character variables in a data set and use an array loop to set it.