|
CD:
I'd submitted this on the "L" sometime ago...
/* macro to convert as SAS dataset to export format*/
options mprint;
%macro cnvtdat(xlib=,xdata=);
libname indat "&xlib";
libname outdat xport "&xlib.&xdata..xpt";
data outdat.&xdata;
set indat.&xdata;
run;
%mend cnvtdat;
%cnvtdat(xlib=home/greg/mydata/,xdata=myfile);
Notice that I make use of the xport engine on the libname statement. And
putting th code in a macro makes it a little more flexible since I can change
the library location and/or file. To add even more flexibility, draw a
distinction between the input library location and output library location by
adding an addtional macro parameter like the following:
%macro cnvtdat(inlib=,outlib=,xdata=);
libname indat "&inlib";
libname outdat xport "&outlib.&xdata..xpt";
data outdat.&xdata;
set indat.&xdata;
run;
%mend cnvtdat;
%cnvtdat(inlib=home/greg/mydata, outlib=/home/dest/data/,xdata=myfile);
Also remember that when you move your transport/xport datasets, set FTP as
binary.
AND finally, the listed code sets one dataset per xport file. With a little
manipulation of the code, you can add more datasets to an xport file.
Good Luck, CD.
-----------------------------------------
Gregory Cox
Westat
coxg1@westat.com
____________________Reply Separator____________________
Subject: Re: Coverting Unix dataset into PC dataset
Author: California Doll <vwilkins@MY-DEJA.COM>
Date: 11/12/99 5:13 AM
In SAS Unix you must write a program to generate a SAS transport file on
the Unix machine. Transfer this file to the PC. You must then write a
program on the PC to convert the transport file to a PC dataset.
You should look up PROC CPORT, PROC CIMPORT, PROC COPY using the xport
engine on the libname statement. and more
there is more than one way to accomplish this task. As I do not have a
Unix box available to me I can not be of any further assistance.
--
California Doll
It takes time to be a success,
but time is all it takes.
- Anonymous
In article <382b72f4.0@news.syr.edu>,
"Minsup Song" <msong@syr.edu> wrote:
> Dear
>
> My data are stored on Unix with the file name of MYFILE.ssd001. Thus,
I've
> to use SAS-Unix to work with it.
> But I want to report the results with a PC with the file name of
###.sd2.
>
> I down load thd MYFILE.ssd001 into my PC. How can I convert it into
PC data
> set?
>
> Any help would be very appreciated!
>
> M.S. Song
>
>
Sent via Deja.com http://www.deja.com/
Before you buy.
|