Hi! As you can see I am seeing some weird format logins in the dataset. I am trying to delete them but couldn't really find out a way. Eg: login=12963 . I can't find out a way to delete the records when they're made up by pure numbers. I tried to proc sort the numbers but this didn't work, SAS is not showing me those records who are made up by numbers at the first rows. Any help is appreciated! Thanks!
> I am seeing some weird format logins
Why are they weird?
> I can't find out a way to delete the records when they're made up by pure numbers.
Try this: if compress(VAR,,'d')=' ' then delete;
> I can't find out a way to delete the records when they're made up by pure numbers.
Try this: if compress(VAR,' ','d') then delete;
> SAS is not showing me those records who are made up by numbers at the first row
What does this mean?
@yichentian226 wrote:
Hi! As you can see I am seeing some weird format logins in the dataset. I am trying to delete them but couldn't really find out a way. Eg: login=12963 . I can't find out a way to delete the records when they're made up by pure numbers. I tried to proc sort the numbers but this didn't work, SAS is not showing me those records who are made up by numbers at the first rows. Any help is appreciated! Thanks!
Please run Proc Contents on your SAS data set and tell use what the variable name is, the variable type and the format assigned.
The PICTURE you show appears to come from a spreadsheet. One of the truly obnoxious thing about spreadsheets is that certain types of files when opened with spreadsheet software will pick and chose some values to display as a different format.
So what you seeing may not be the value that was in SAS.
April 27 – 30 | Gaylord Texan | Grapevine, Texas
Walk in ready to learn. Walk out ready to deliver. This is the data and AI conference you can't afford to miss.
Register now and lock in 2025 pricing—just $495!
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.
Ready to level-up your skills? Choose your own adventure.