BookmarkSubscribeRSS Feed
srisai
Calcite | Level 5
Hi All,

Can we derive a date variable in information map studio?
Here is the problem description below,
I would like to derive a date variable from already existing 2 variables i.e i have a registered dataset in Information Map studio and i have corresponding map also.
I have 2 date variables like start date and drop date.........so here i would like to create a new variable which is going to have both start and drop dates together as data values.
So could you please help me how to derive teh new variable in information map studio in order to achieve this?

Please respond.

Thanks,
Sri
4 REPLIES 4
Cynthia_sas
SAS Super FREQ
Hi:
I don't understand what you mean when you say " i would like to create a new variable which is going to have both start and drop dates together as data values."

Usually date variables are numeric variables that hold 1 value -- the number of days since Jan 1, 1960 (the SAS "internal" value of 0). So if you have this data:
[pre]
Start Drop
-3334 0 (Internally Stored Values)
[/pre]
The start date would represent Nov 15, 1950 and the drop date would represent Jan 1, 1960 for those two separate internally stored date variables.

How would you envision creating 1 new variable from 2 variables??? What would the new variable look like? Would it represent the number of days between the start date and the drop date? Would it be a numeric variable or a character variable??? Can you use the two dates above and show what your new variable would look like?? Can you explain how you would use this new variable that somehow "had both dates together as data values"??

cynthia
srisai
Calcite | Level 5
Hi,

It looks like my explanation confusing you. I just gave that as a sample explanation.
Here is the brief description below,

I have two variables in the dataset
1 call date
2 login date

so here i need to derive a new variable based on these call date and login date coulumns.
My derivation is like this,

if call date ne . then newvariable = call date
if login date ne . then newvariable = login date

So i would like to derive the new variable in information map studio not in SAS/EG.
Hope it understand and if not let me know.

Thanks,
Sri
TSBruce
SAS Employee
You could create a new data item of type Date that is based on a case statement. For example, a case statement could looke like the following:

case when <<table.date1>> ne . then <<table.date1>> else <<table.date2>> end
srisai
Calcite | Level 5
Hey........

Thank you so much..........case statement working fine......

Thanks,
Sri

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