LISTSERV at the University of Georgia
Menubar Imagemap
Home Browse Manage Request Manuals Register
Previous (more recent) messageNext (less recent) messagePrevious (more recent) in topicNext (less recent) in topicPrevious (more recent) by same authorNext (less recent) by same authorPrevious page (May 2002, week 5)Back to main SAS-L pageJoin or leave SAS-L (or change settings)ReplyPost a new messageSearchProportional fontNon-proportional font
Date:   Thu, 30 May 2002 11:51:27 +0200
Reply-To:   Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Sender:   "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From:   Jim Groeneveld <J.Groeneveld@ITGROUPS.COM>
Subject:   Re: Copying output files using SAS
Comments:   To: Edward Heaton <HEATONE@WESTAT.COM>
Comments:   cc: "Simon.Gillow@BBG.CO.UK" <Simon.Gillow@BBG.CO.UK>
Content-Type:   text/plain; charset="iso-8859-1"

Hi Simon and Edward,

Copying files with long file name specifications in a DOS window under Windows, and thus after an X command as well, is fully supported. Names with embedded spaces should be put in quotes. The DOS 7.x DIR, REN, COPY, XCOPY and possibly more commands or external programs do support lfns. There are even DOS file managers and other programs by third parties supporting the Windows lfns. Besides the correspondence between the short and the long names is given in the DIR command.

Anyway, I would advise to copy files outside and independent of SAS, because even SAS only runs a DOS shell (window) in which the actual copying is done. It has nothing to do with SAS. It is something where the operating system (Windows) is for. You just have to use Windows Explorer (or My Computer). There are many ways in which you may copy a file, drag (from the original drive/directory) and drop (to the destination) with the mouse, copy (from) and paste (to) and even more; see Windows help. Doing it with the COPY command is pure DOS, which also worked before Windows existed: start a DOS window (MS DOS prompt from the Start menu) and just enter the COPY command (COPY fromfile tofile).

Copying files from a DOS shell of SAS only makes sense if you want SAS to determine which files to copy.

Regards - Jim. -- Y. (Jim) Groeneveld, MSc IMRO TRAMARKO tel. +31 412 407 070 senior statist./data man. P.O. Box 1 fax. +31 412 407 080 J.Groeneveld@ITGroups.com 5350 AA BERGHEM, NL www.imrotramarko.com

Computers aren't there to be kept busy, but to keep us busy.

Notice of confidentiality: this e-mail may contain confidential information intended for the addressed recipient only. If you have received this e-mail in error please delete this e-mail and please notify the sender so that proper delivery can be arranged.

> -----Original Message----- > From: Edward Heaton [SMTP:HEATONE@WESTAT.COM] > Sent: Wednesday, May 29, 2002 8:27 PM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Re: Copying output files using SAS > > Simon, > > This is a little more difficult, but it's possible. Again, this assumes > all > of the *.doc files are ASCII. This code will copy all files with an > extension of DOC. The CALL EXECUTE generates a series of DATA steps that > run after the DATA _NULL_ has finished. > > FileName files pipe "dir C:\CopyFrom" ; > Data _null_ ; > Infile files truncOver ; > /* Input ; Put _inFile_ ; > Input > extension $ 10-12 > fileName $ 45-100 > ; > If ( extension eq "DOC" ) ; > Call execute ( > "Data _null_; Infile 'C:\CopyFrom\" || trim(fileName) || > "'; File 'C:\CopyTo\" || trim(fileName) || > "'; Input; Put _inFile_; Run;" > ) ; > Run ; > > You might have to use the commented-out code instead of what follows to > assure that the column numbers in the INPUT statement are valid for your > operating system. > > Hope this works for you, > Ed > > Edward Heaton, Senior Systems Analyst, > Westat (An Employee-Owned Research Corporation), > 1550 Research Boulevard, Room 2018, Rockville, MD 20850-3195 > Voice: (301) 610-4818 Fax: (301) 294-3992 > mailto:EdwardHeaton@westat.com http://www.westat.com > > > -----Original Message----- > From: Simon Gillow [mailto:Simon.Gillow@bbg.co.uk] > Sent: Wednesday, May 29, 2002 6:07 AM > To: Edward Heaton > Subject: RE: Copying output files using SAS > > > Edward, > > Thanks for sending this macro a while ago, it works a treat. > > I don't suppose you would know how to use wildcards in the macro. I want > to > copy all *.doc files in a folder to another drive and at present I have to > hardcode the name for each and every file. > > Thanks, > > Simon > > > > > > > HEATONE@WESTAT.com on 10/05/2002 21:43:32 > To: SAS-L@LISTSERV.UGA.EDU, Simon Gillow/Finance/Lending/BBGroup@BBGROUP > cc: > > Subject: RE: Copying output files using SAS > > Simon; > > Since all of your files are ASCII text files (Yes, RTF is ASCII.) you can > use the following macro. > > %macro copy ( inFile= , file= ) ; > Data _null_ ; > InFile "&inFile" ; > File "&file" ; > Input ; > Put _inFile ; > Run ; > %mEnd copy ; > > Ed > > Edward Heaton, Senior Systems Analyst, > Westat (An Employee-Owned Research Corporation), > 1550 Research Boulevard, Room 2018, Rockville, MD 20850-3195 > Voice: (301) 610-4818 Fax: (301) 294-3992 > mailto:EdwardHeaton@westat.com http://www.westat.com > > > -----Original Message----- > From: Simon Gillow [mailto:Simon.Gillow@BBG.CO.UK] > Sent: Friday, May 10, 2002 6:19 AM > To: SAS-L@LISTSERV.UGA.EDU > Subject: Copying output files using SAS > > > We are using SAS v8.2 on an NT server and SAS/CONNECT (my client PC is > also > NT). Unfortunately our server can't see any network drives (something to > do > with getting the spawner to log us in and a conflict as we use NT and > Novell > Netware - SI are investigating but if anyone has any experience I would > appreciate any help). > > At present I have the vast majority of my programs running remotely and > then > return to the local session to use DM commands to save the log (as DM > commands > don't work remotely), I also use local X commands like: > > x 'copy k:\reports\nl_info\weekly\output\dde_wk* > r:\reports\nl_info\weekly\output'; > > These copy the resultant CSV, HTML and RTF files to network drives. My > problem > is that as copy is a DOS command it only > allows 8.3 names. We are used to giving files meaningful names and don't > want > to revert to 8 character names? Any ideas on > how to copy files with long filenames using SAS? > > Thanks, > Simon > > > ********************************************************************** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. If you have received this email in error please notify > the system manager. > > This footnote also confirms that this email message has been swept by > MIMEsweeper for the presence of computer viruses. > > > Bradford & Bingley plc > Registered Office: PO Box 88, Croft Road, Crossflatts, Bingley, West > Yorkshire, BD16 2UA > Registered in England No. 3938288 > Regulated by the Financial Services Authority and a Member of the General > Insurance Standards Council. > > http://www.bbg.co.uk > Bradford Bingley plc > ********************************************************************** > > > > > ********************************************************************** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. If you have received this email in error please notify > the system manager. > > This footnote also confirms that this email message has been swept by > MIMEsweeper for the presence of computer viruses. > > > Bradford & Bingley plc > Registered Office: PO Box 88, Croft Road, Crossflatts, Bingley, West > Yorkshire, BD16 2UA > Registered in England No. 3938288 > Regulated by the Financial Services Authority and a Member of the General > Insurance Standards Council. > > http://www.bbg.co.uk > Bradford Bingley plc > ********************************************************************** > > > > ********************************************************************** > This email and any files transmitted with it are confidential and > intended solely for the use of the individual or entity to whom they > are addressed. If you have received this email in error please notify > the system manager. > > This footnote also confirms that this email message has been swept by > MIMEsweeper for the presence of computer viruses. > > > Bradford & Bingley plc > Registered Office: PO Box 88, Croft Road, Crossflatts, Bingley, West > Yorkshire, BD16 2UA > Registered in England No. 3938288 > Regulated by the Financial Services Authority and a Member of the General > Insurance Standards Council. > > http://www.bbg.co.uk > Bradford Bingley plc > **********************************************************************


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