BookmarkSubscribeRSS Feed
sammydouglas
Calcite | Level 5

Hey there!

 

So I'm trying to figure out how to merge three data sets by a variable "Order_ID" into one with the name "delivery_dtl"

these are the three data sets:

data quick
slow
veryslow;

 

set orders;

 

Thanks for any help 🙂

4 REPLIES 4
sammydouglas
Calcite | Level 5

oh i think i got it

 

is it

 

data delivery_dtl;

 

merge quick

slow

veryslow;

 

by Order_ID;

 

run; 

sammydouglas
Calcite | Level 5

great that worked.

 

Now how to do this:

 

Create a new variable delivery_speed in the data step; based on which data set the row / data is coming from.

 

Create a new variable report_month that will show the month and year part of the ‘delivery_date’ alone

 

I dont even understand the first task..

Oliee
Calcite | Level 5
using the data above..

data delivery_dtl;
format delivery_date mmddyy10. ;
set delivery_dtl;
run;

Reeza
Super User

Question 1 - > is the observation in the merged data set from slow, quick or fast dataset?

Are you sure the question said merge?  Not combine? At any rate, if they all have the same variables this doesn't quite make sense because all the variables will be overwritten. Either use the data set option IN or INDSNAME. The documentation has examples of each option. 

 

Here's the link to the IN docs

https://support.sas.com/documentation/cdl/en/ledsoptsref/69751/HTML/default/viewer.htm#n1p1o2dsuc465...

 

Question 2 - > Look at Year/Month() functions, see the functions under Date&Time Category. 

http://support.sas.com/documentation/cdl/en/lefunctionsref/69762/HTML/default/viewer.htm#p0w6napahk6...

 

 

 

 

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