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 (April 2007, week 1)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Fri, 6 Apr 2007 05:47:35 -0700
Reply-To:   sbarry@SBBWORKS.COM
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Scott Barry <sbarry@SBBWORKS.COM>
Organization:   http://groups.google.com
Subject:   Re: How to read multiple files in a single FTP connection?
Comments:   To: sas-l@uga.edu
In-Reply-To:   <C527DE636D0FE74ABDD3D7E44759013F01F4FAEB@CHN-HCLT-EVS03.HCLT.CORP.HCL.IN>
Content-Type:   text/plain; charset="iso-8859-1"

On Apr 6, 5:42 am, vijayakum...@HCL.IN ("Vijaya Kumar Damodaran (ETS)") wrote: > =20 > > Hi, > > =20 > > The following program is working fine. > > =20 > > I need to establish 2 FTP connections for transferring 2 CSV files from > UNIX to Windows. > > =20 > > Can we achieve the same using single FTP connection? > > =20 > > =20 > > Thanks in Advance. > > Vijaya Kumar D > > =20 > > /*********************************************************************/ > > /*Connecting to the Unix Server 10.13.41.92 */ > > /*********************************************************************/ > > FILENAME Myfile1 FTP "rpm_MONTHLY_ALL.csv" > > CD=3D"/usr/username" > > USER=3D"username" > > PASS=3D"user" > > HOST=3D"10.13.41.92"; > > /*********************************************************************** > ***/ > > /*Reading the CSV file rpm_MONTHLY_ALL.csv in to SAS using FORMATTED > INPUT*/ > > /*********************************************************************** > ***/ > > =20 > > data MONTHLY(drop=3Dvar6); > > infile Myfile1 dsd ; > > input MACHID $ SERIAL :$9.; > > run; > > =20 > > /*********************************************************************/ > > /*Connecting to the Unix Server 10.13.41.92 */ > > /*********************************************************************/ > > FILENAME Myfile2 FTP "rpm_QUARTERLY_ALL.csv" > > CD=3D"/usr/username" > > USER=3D"username" > > PASS=3D"user" > > HOST=3D"10.13.41.92"; > > /*********************************************************************** > ***/ > > /*Reading the CSV file rpm_QUARTERLY_ALL.csv in to SAS using FORMATTED > INPUT*/ > > /*********************************************************************** > ***/ > > =20 > > data QUARTERLY; > > infile Myfile2 dsd ; > > input MACHID $ SERIAL :$9. NAME :$21. NETWORK_ADDRESS ~ $11.; > > =20 > > run; > > =20 > > DISCLAIMER: > ---------------------------------------------------------------------------­= > -------------------------------------------- > > The contents of this e-mail and any attachment(s) are confidential and= > intended for the named recipient(s) only. > It shall not attach any liability on the originator or HCL or its= > affiliates. Any views or opinions presented in=20 > this email are solely those of the author and may not necessarily reflect= > the opinions of HCL or its affiliates. > Any form of reproduction, dissemination, copying, disclosure, modification,= > distribution and / or publication of=20 > this message without the prior written consent of the author of this e-mail= > is strictly prohibited. If you have=20 > received this email in error please delete it and notify the sender= > immediately. Before opening any mail and=20 > attachments please check them for viruses and defect. > > ---------------------------------------------------------------------------­= > --------------------------------------------

Treat the two files as a concatenation using the FILENAME statement and enclose your files in parentheses (as well as quotations). And since your input files contain differerent layouts, use the INFILE option MISSOVER and add DATA step code to detect what file you are processing and how to handle both conditions.

Scott Barry SBBWorks, Inc.


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