BookmarkSubscribeRSS Feed
deleted_user
Not applicable
I have a string parameter that I have that I enter as a date (mm/dd/yyyy). I do not have this parameter enclosed in quotes because of something I am doing later in the process. I then want to subtract 1 day from this date that is being entered. So, I am trying to convert this string into a date so I can use the INTNX function. I am having troubles converting the parameter string into a date format.

Please help! Message was edited by: rmccray
2 REPLIES 2
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Try using the INPUT function in a SAS variable assignment statement, specifying the appropriate INFORMAT name as the second argument. Check resources on the SAS support http://support.sas.com/ website, such as the technical conference paper listed below.

Scott Barry
SBBWorks, Inc.

A Beginners Guide to SAS  Date and Time Handling
Wayne Finley, State of California HHSDC, Sacramento, CA
http://www2.sas.com/proceedings/sugi25/25/btu/25p058.pdf
Doc_Duke
Rhodochrosite | Level 12
input(, mmddyy10.) will convert to a number, PUT(, mmddyy10.) goes the other way, so to get the new var to have a string value that is one day less,

=PUT(INPUT(,mmddyy10.)-1,mmddyy10.);

Doc Muhlbaier
Duke

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!

SAS Enterprise Guide vs. SAS Studio

What’s the difference between SAS Enterprise Guide and SAS Studio? How are they similar? Just ask SAS’ Danny Modlin.

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
  • 677 views
  • 0 likes
  • 3 in conversation