BookmarkSubscribeRSS Feed
8 REPLIES 8
andreas_lds
Jade | Level 19

Importing multiple files of the same type has been discussed so many times, you should be able to find solutions - maybe not for xpt-files, but that should be easy to adept.

 

XPT-files are created by proc cport, right? You will have to import them by using proc cimport.

thanikondharish
Calcite | Level 5
s i know by using proc cport i get only one xpt file but how to get all xpt
files at a time
andreas_lds
Jade | Level 19

Same problem as in the other post i replied to: your problem-description is vague and it is hardly possible to understand what you have and what you want.

 

The subject of your message is "how import all xpt files from pc files" - that implies that you already have xpt-files and want to import them. For that task you use proc cimport.

 

Now you are talking about exporting files:


@thanikondharish wrote:
s i know by using proc cport i get only one xpt file but how to get all xpt
files at a time

So, please explain what you have and what you want as result.

Kurt_Bremser
Super User

Post proper questions in proper language. Don't force us to guess what you're really after. If you don't want to invest the time to post a proper question, then why are you here at all?

thanikondharish
Calcite | Level 5
sorry i can't get idea how to ask this question .This task will do myself
thanq
SASKiwi
PROC Star

I think it would help if you posted some example code of what you have tried - we do understand that trying to explain technical problems in English can be hard when it is not your first language.

thanikondharish
Calcite | Level 5
%macro xportallfiles;
options mprint symbolgen nofmterr ;
%let filrf=mydir;
%let rc=%sysfunc(filename(filrf,"E:\sas\TABLES PRACTICE\"));
%let did=%sysfunc(dopen(&filrf));
%let fname=;
%let memcount=%sysfunc(dnum(&did));
%if &memcount > 0 %then
%do i=1 %to &memcount;
%let fname=%sysfunc(dread(&did,&i));
%let iw=%index(&fname,.); /* find start of extension */
%let exts=%substr(&fname,&iw); /* find file extension */
libname xx xport "E:\sas\TABLES PRACTICE\&fname.";
proc copy in=xx out=work ;
run;
%end;
%let rc=%sysfunc(dclose(&did));
%mend xportallfiles;

%xportallfiles;
if i use this code i will get xpt files from where we will give location
SASKiwi
PROC Star

So what is the problem with this program? Posting the program's SAS log may help.

SAS Innovate 2025: Call for Content

Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!

Submit your idea!

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