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-2026-white.png



April 27 – 30 | Gaylord Texan | Grapevine, Texas

Registration is open

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!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 1319 views
  • 0 likes
  • 2 in conversation