DATA Step, Macro, Functions and more

convert multiple xpt files inti sas datasets

Reply
Contributor
Posts: 33

convert multiple xpt files inti sas datasets

I have a folder in sas studio with multiple xpt files.How to convert it into sas datasets?I can do it choosing each file in to a dataset but how to make it dynamic?

Super User
Posts: 3,102

Re: convert multiple xpt files inti sas datasets

Start by getting the import for one file working properly first. Here is a link to the CIMPORT procedure to get you started:

 

http://support.sas.com/documentation/cdl/en/proc/69850/HTML/default/viewer.htm#p1be86uw07acoin1aodzs...

 

A dynamic solution will most likely involve building a macro.

Contributor
Posts: 33

Re: convert multiple xpt files inti sas datasets

libname xylib xport "/home/p0/AM2/data/agxpt/*.xpt ";
proc copy in=xylib out=work;
run;

I tried this to convert all xpt files frm agxpt folder but only 4 files i see converted into dataset.Folder have 7 files.Any idea why?

Ask a Question
Discussion stats
  • 2 replies
  • 559 views
  • 0 likes
  • 2 in conversation