SAS Procedures

Help using Base SAS procedures
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-white.png

Our biggest data and AI event of the year.

Don’t miss the livestream kicking off May 7. It’s free. It’s easy. And it’s the best seat in the house.

Join us virtually with our complimentary SAS Innovate Digital Pass. Watch live or on-demand in multiple languages, with translations available to help you get the most out of every session.

 

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.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 4 replies
  • 2553 views
  • 0 likes
  • 2 in conversation