BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hello ,

could you please guide me.I want to concatenate my three datafiles.I had the data in .dat format and i used the following codes to permamnently store my SAS dataset in the C drive using code :

libname sc 'C:\SAS';

data sc.period1;
infile 'h:\SAScourse\ period1_sales_data.dat';
input TransactionID $1-8
DateofSale $9-18
TimeofSale $19-26
LaptopModel $27-32
UnitsSold 33-35
Warranty 36;
proc print data=sc. period1;
run;

data period2A;
infile 'h:\SAScourse\period2_sales_data_A.dat';
Input TransactionID $1-8
DateofSale $9-18
LaptopModel $19-24
UnitsSold 25-27
Warranty 28;
proc print data=period2A;
run;

data period2B;
infile 'c:\Cwa\period1_sales_data.dat';
input TransactionID $1-8
DateofSale $9-16
;
run;
proc print data=period2B;
run;

I want to concatenate the there datasets ' period 1', 'period 2A,' and ' Period 2B' into one single SAS datafile to be stored permanently in my 'C:\SAS'; to make useful analysis of data .

Kind Regards ,
mark
1 REPLY 1
Cynthia_sas
SAS Super FREQ
Hi:
This question doesn't seem related to SAS/GRAPH or ODS GRAPHICS. This might be a question that would be better asked in one of the other forums. Perhaps in the SAS Procedures forum, where you asked about data similar to what you've posted here:
http://support.sas.com/forums/message.jspa?messageID=32178#32178
http://support.sas.com/forums/message.jspa?messageID=32184#32184

In general, you use the SET statement in a DATA Step program or PROC APPEND to concatenate or combine datasets. To merge or join datasets, you would use the MERGE statement in a DATA Step program or join in PROC SQL.An overview of these techniques is contained in this discussion:
http://support.sas.com/documentation/cdl/en/lrcon/61722/HTML/default/a001081414.htm

cynthia

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