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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 5 replies
  • 2715 views
  • 2 likes
  • 4 in conversation