Help using Base SAS procedures

PROC COPY

Reply
N/A
Posts: 0

PROC COPY

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...
Super Contributor
Super Contributor
Posts: 3,174

Re: PROC COPY

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.
N/A
Posts: 0

Re: PROC COPY

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
N/A
Posts: 0

Re: PROC COPY

and the variable is OTH1A, length=250, format=$250. informat=$250.
Super Contributor
Super Contributor
Posts: 3,174

Re: PROC COPY

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.
Ask a Question
Discussion stats
  • 4 replies
  • 514 views
  • 0 likes
  • 2 in conversation