BookmarkSubscribeRSS Feed
laxmanpai
Calcite | Level 5

Hi Team,

 

I have a Data folder in SAS DI which has over 152 Tables. I need to export these 152 datasets to be copied as .csv files and need to be exported to a local folder .

 

Could you let me know

3 REPLIES 3
JosvanderVelden
SAS Super FREQ
What are the properties of the data folder? Are the tables SAS tables?
What do you mean by local folder? Local for the server where SAS is running or a workstation where you are running SAS clients (ex. SAS management console & SAS enterprise guide)?
What are you going to use to run the export code? A batch process on the server or SAS Enterprise Guide or ???
LinusH
Tourmaline | Level 20

Assuming these table have different table structures.

The answer depends on what level of lineage you require.

From implementation/coding perspective, you can easily write a macro that exports all table in a libref to a certain location.

Fore some traceability. you can add this into a DI Studio job an link all source table to this step.

For full lineage, you would use the file writer transformation on each source table and have a corresponding external file object defined.

Data never sleeps
RacheLGomez123
Fluorite | Level 6

Suppose we have the following dataset in SAS:

/*create dataset*/
data my_data;
input A B C;
datalines;
1 4 76
2 3 49
2 3 85
4 5 88
2 2 90
4 6 78
5 9 80
;
run;

/*view dataset*/
proc print data=my_data;

 


We can use the following code to export this dataset to a CSV file called data.csv:

/*export dataset*/
proc export data=my_data
outfile="/home/u13181/data.csv"
dbms=csv
replace;
run;


I can then navigate to the location on my computer where I exported the file and view it:

 

The data in the CSV file matches the dataset from SAS.

 

Regards,

Rachel Gomez

sas-innovate-wordmark-2025-midnight.png

Register Today!

Join us for SAS Innovate 2025, our biggest and most exciting global event of the year, in Orlando, FL, from May 6-9. Sign up by March 14 for just $795.


Register now!

How to connect to databases in SAS Viya

Need to connect to databases in SAS Viya? SAS’ David Ghan shows you two methods – via SAS/ACCESS LIBNAME and SAS Data Connector SASLIBS – in this video.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 3 replies
  • 878 views
  • 0 likes
  • 4 in conversation