BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi SAS Experts!!!

I need your help regarding date format in SAS.

I am reading the date field from the file in form of Character and after certian processing, I need to validate if the field is in proper date format (DDMMYY6.)or not.

For the above purpose I am using following condition -

if (NOT missing(input(dateField, ddmmyy6.))) then


In this case I am getting expected output, but for any invalid date (e.g. 30 Feb) the log file shows a note as -
NOTE: Invalid argument to function INPUT at line 595 column 17.
date_values=300208 valid=0 new_date=. _ERROR_=1 _N_=1


However when i used the date format with ?? ( as specified below), I got the same expected result without any note or warning in log.

if (NOT missing(input(dateField, ??ddmmyy6.))) then


The log file was absolutely clean and pretty.

I got this "??" format from one of the internet site.

I really want to know what difference this ?? stuff makes to the format and if it is safe to use this format.

Request you to share the information regarding the usage and significance of this "??" .

regards
Kapil Agrawal
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Refer to SAS 9.2 Language DOC on INPUT function.

Scott Barry
SBBWorks, Inc.

http://support.sas.com/documentation/cdl/en/lrdict/59540/HTML/default/a000180357.htm
deleted_user
Not applicable
Hi Scott.

Thank you very much.

The link mentioned by you talks exactly same what I was looking for 🙂

Thnx a ton!!!


Kapil Agrawal

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
  • 2 replies
  • 816 views
  • 0 likes
  • 2 in conversation