LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous messageNext messagePrevious in topicNext in topicPrevious by same authorNext by same authorPrevious page (November 1999, week 2)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:         Fri, 12 Nov 1999 17:07:41 -0500
Reply-To:     Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Sender:       "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:         Howard Schreier <Howard_Schreier@ITA.DOC.GOV>
Subject:      Re: Coverting Unix dataset into PC dataset
Content-Type: text/plain; charset=US-ASCII

Since transport libraries and CPORT containers are sequential, the FTP access method can be used to move them from the old machine to the new.

This can reduce a three-step process to two. Instead of

convert, transfer, convert back

it can be either

convert with remote output, convert back

or

convert, convert back with remote input.

> * 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


Back to: Top of message | Previous page | Main SAS-L page