BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
mssun
Calcite | Level 5

Hello, 

 

I have a large dataset with one or few observations that has date shown as asterisks (as in the attached image). I wonder how should I remove them? The date format is YYMMDD8.

 

I've read this thread,  Why are my dates showing up as asterisks?, which recommend transforming date into Excel date format before importing. But my dataset is too large for Excel. 

 

Edit:

Based on suggestions of answerers, I print out the date with BEST32 and it shows following results. Apparently it is way too large for date, so I managed to remove them by setting a threshold. It's not a good idea to "hard code" a range because I have no idea on future ranges, so I'm still open to any other solutions available. Thank you for your help!

 

Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Astounding
PROC Star

Almost certainly .....

 

The asterisks are showing up because the values for these variables are too large.  The values won't fit into the YYMMDD8. format.

 

Can't tell from this vantage point what is actually in these variables or how it got there.  Can only tell that it's bad data.

 

If you switch the format to something wider, you might be able to get an idea of what is there.  You could try a format like date10. or yymmdd11. 

 

But you would only discover what the values actually look like and might not solve the riddle of how the bad data got there.

View solution in original post

4 REPLIES 4
Astounding
PROC Star

Almost certainly .....

 

The asterisks are showing up because the values for these variables are too large.  The values won't fit into the YYMMDD8. format.

 

Can't tell from this vantage point what is actually in these variables or how it got there.  Can only tell that it's bad data.

 

If you switch the format to something wider, you might be able to get an idea of what is there.  You could try a format like date10. or yymmdd11. 

 

But you would only discover what the values actually look like and might not solve the riddle of how the bad data got there.

mssun
Calcite | Level 5
Yes, it seems to be the problem. Probably need to specify wider format when importing the data. Thank you for answering!
ballardw
Super User

Can you print those values with a best32. format and show us the result?

Or change the format temporarily in the table and show use what a best32 reveals.

 

mssun
Calcite | Level 5
Thank you! I did identify the problem by print BEST32. format. Removed them manually afterwards.

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

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
  • 4 replies
  • 1662 views
  • 1 like
  • 3 in conversation