The SAS Output Delivery System and reporting techniques

convert into xpt file

Reply
Contributor
Posts: 66

convert into xpt file

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;

Grand Advisor
Posts: 10,211

Re: convert into xpt file

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?

Contributor
Posts: 66

Re: convert into xpt file

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

 

Grand Advisor
Posts: 10,211

Re: convert into xpt file

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.

Contributor
Posts: 66

Re: convert into xpt file

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.

 

 

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