BookmarkSubscribeRSS Feed
Niugg2010
Obsidian | Level 7

I want to transfer datasets into xpt file.

there are two datasets x and x2;

for dataset x  the code produces errors: The variable name aaaaaaaaa is illegal for the version 6 file XPTFILE.X.DATA. 

the reason is variable aaaaaaaaa length is over 8;

 

for dataset x2 the code has errors: The character variable b has too long a value for the XPTFILE library.

the reason is value of b length is over 200.

 

I do not want to change the variable name and value. How can I deal with these two issues?

Thanks

 

 

data x;
aaaaaaaaa="aaa";
b="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
run;

data x2;
aaaaaaa="aaa";
b="bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb";
run;

libname xptfile XPORT "G:\XXXX\abc.xpt";
proc copy in=work out = xptfile memtype=data;
select x;
run;

libname xptfile XPORT "G:\XXXXX\abc2.xpt";
proc copy in=work out = xptfile memtype=data;
select x2;
run;

4 REPLIES 4
ballardw
Super User

About your only option is not to attempt to send them to a VERSION 6 file. The version 6 will not support either of those: longer variable name or character value.

 

Are you attempting to make set that can be imported by someone on a different operating system that actualy is NOT using Version 6?

Niugg2010
Obsidian | Level 7

We are required to export datasets into XPT file.  I am not sure who will use this file.  

 

ballardw
Super User

You may need to ask someone to describe the actual file format. It seems that there is another type of file with an XPT format that is not actually a SAS Version 6 Transport file.

 

If it is supposed to be a Version 6 transport then you may need guidance on what they want to do with incompatable variable names, labels or character variable lengths.

Niugg2010
Obsidian | Level 7

Thanks. 

"Another type of file with an XPT format that is not actually a SAS Version 6 Transport file"?  can you please give me more details? I googled and have not figure out a method.

 

 

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