BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello ,

i merged two datasets "period2_A" and "period2_sales_data_B" into a single data set "period2" and used the code :

libname sc 'c:\SAS';
data period2_A;
infile 'c:\SAS\period2_sales_data_A.dat';
Input TransactionID $1-8
DateofSale $9-18
LaptopModel $19-24
UnitsSold 25-27
Warranty 28;
Proc sort data = period2_A;
By TransactionID;
proc print data=period2_A;
TITLE 'period2_sales_data_A';
RUN;

data period2_sales_data_B;
infile 'c:\SAS\period2_sales_data_B.dat';
Input TransactionID $1-8
TimeofSale $9-16;
Proc sort data = period2_sales_data_B;
By TransactionID;
proc print data=period2_sales_data_B;
TITLE 'period2_sales_data_B';
RUN;

*Merge data sets period2_A and period2_sales_data_B by Transaction ID;
data period2;
merge period2_A period2_sales_data_B;
By TransactionID;
Proc Print data= period2;
Title "Period 2 sales" ;
Run;


I want to save my merged dataset permamnently in the same location as my two datasets which is libname sc 'c:\SAS'; .

Kind Regards ,

mark
1 REPLY 1
deleted_user
Not applicable
Hi Mark,

Since you have already specified the libname statement in the beginning, You just have to write a small code to save it to the permanent directory as the other two datasets. Try this after you have created period2 in work directory.

data sc.period2;
set period2;
run;

"sc" is the library reference of the directory which you have used to import other two datasets.

I hope this answers your question.

Thanks,
Saurabh.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 1885 views
  • 0 likes
  • 1 in conversation