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-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

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