BookmarkSubscribeRSS Feed
mesfandiari231
Calcite | Level 5

I have a code question to ask you. I will just send it in a moment in teams. I would like to create a couple new variables in a file,
I think (hope) it will be pretty straightforward.


On each record in a data set I have:
Arrival Fiscal Month Arrival
Fiscal YearEncounter Date (formatted mmddyy10.)
On that same record, I want to create two new variables:An "Arrival Date" variable formatted as mmddyy10., where you just set the day to
the first of the month. So if someone has an Arrival Fiscal Month of 07 and an Arrival Fiscal Year of 2021, then their Arrival Date would
be 07/01/21.A flag for whether the Encounter Date occurs within the year prior to the Arrival Date (I assume this will be based on
some sort of datediff function of 365 days or 12 months)

 

3 REPLIES 3

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