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