BookmarkSubscribeRSS Feed
deleted_user
Not applicable
Hi,

I'm using PROC COPY to convert some SAS datasets to .xpt files .
I'm getting an error message:
The character variable xxxxx has too long a value for the XXXXX library.

Any idea how this could be resolved?

Thanks in advance...
4 REPLIES 4
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
What is the SAS version and tell us more about the SAS CHARACTER variable in question (use the SAS CONTENTS procedure for variable info)? Also, have you looked at the SAS documentation on TRANSPORT file limitations? It would be best to paste the SAS log information exactly as it is generated -- also searching the SAS support http://support.sas.com/ website may provide you information about the limits with using a TRANSPORT file.

Scott Barry
SBBWorks, Inc.
deleted_user
Not applicable
Dear Scott,

here's the program we're using...

%MACRO _export(inpath=,
outpath=,
check_report=no);

*----------------------------------------------------------;
* Libname setup
*----------------------------------------------------------;
LIBNAME INPATH "&inpath";
OPTIONS nofmterr;

*----------------------------------------------------------;
* 1- Count up members
*----------------------------------------------------------;
PROC SQL NOPRINT;
*----A: Count # of library members;
SELECT COUNT(*) INTO :numdsets
FROM dictionary.tables
WHERE LIBNAME="INPATH";
QUIT;

%IF &numdsets>0 %THEN %DO;
PROC SQL NOPRINT;
*----B: Count # of library members;
SELECT DISTINCT (memname) INTO :mem1-:mem%TRIM(%LEFT(&numdsets))
FROM dictionary.tables
WHERE LIBNAME="INPATH";
QUIT;

*----------------------------------------------------------;
* 2- Transport individual datasets
*----------------------------------------------------------;
%DO i=1 %TO &numdsets;
LIBNAME outxpt SASV5XPT "&outpath/%LOWCASE(&&mem&i).xpt" LRECL=320;

*----A: Create Transport Files from datasets;
PROC COPY IN=inpath OUT=outxpt;
SELECT &&mem&i;
RUN;

%IF %UPCASE(&check_report)=YES %THEN %DO;
*----B - Optional: CHECKING: RE-CREATE datasets from Transport Files;
PROC COPY IN=outxpt OUT=work;
SELECT &&mem&i;
RUN;

ODS HTML FILE="&outpath/%LOWCASE(&&mem&i)_compare.html";
PROC COMPARE DATA=inpath.&&mem&i COMPARE=work.&&mem&i;
RUN;
ODS HTML CLOSE;
%END;
LIBNAME outxpt;
%END;
%END;
%ELSE %PUT
----------------------------------------------------------------
----------------------------------------------------------------
There is no dataset to transport in &inpath directory
----------------------------------------------------------------
----------------------------------------------------------------;
%MEND _export;

%_export(inpath =/vob/CICL670A/CICL670AUS02/report/import/data_s,
outpath=/vob/CICL670A/pool/pool_904/report/export/pool_904/raw,
check_report=yes);

We're currently using SAS8.2 version..

and here's the log:

ERROR: The character variable OTH1A has too long a value for the OUTXPT library.
ERROR: File OUTXPT.BCL.DATA has not been saved because copy could not be completed

Thank you
deleted_user
Not applicable
and the variable is OTH1A, length=250, format=$250. informat=$250.
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
Your LIBNAME statement has a hardcoded "engine" of SASV5XPT, which is a SAS Version 5 XPORT format.

I would say that it's time to review and update your SAS application for software-version currency compliance, as in get updated to a current, supported SAS software version level.

In the meantime, you will want to search the SAS support website for pre-historic information about the SAS engine you are using and limitations.

Scott Barry
SBBWorks, Inc.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 2009 views
  • 0 likes
  • 2 in conversation