BookmarkSubscribeRSS Feed
Anton64
Calcite | Level 5

I have to import a file from stata in v8xpt format.

My SAS version is the 9.4.

Which procedure should I to follow? 

Running the macro %xpt2loc it returns the error:

ERROR: Invalid DO loop control information, either the INITIAL or TO expression is missing or the BY expression is missing, zero,
or invalid.
 
2 REPLIES 2
Tom
Super User Tom
Super User

So you asked STATA to write data in SAS's transport format?

Note that SAS transport files are binary files, even though the top of the file looks like text, so make sure to move them as binary when transferring using tools like FTP.

You can look at the beginning of the file to see if it really looks like a SAS transport file.  An easy way is with a simple data step.

What do you get if you run something like this?

data _null_;
  infile 'mydata.xpt' lrecl=80 recfm=f obs=3 ;
  input;
  list;
run;

 

Anton64
Calcite | Level 5

the file used as test has the extension .V8xpt and the system is not recognizing it.   

hackathon24-white-horiz.png

2025 SAS Hackathon: There is still time!

Good news: We've extended SAS Hackathon registration until Sept. 12, so you still have time to be part of our biggest event yet – our five-year anniversary!

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 2 replies
  • 2782 views
  • 0 likes
  • 2 in conversation