![]() | ![]() | ![]() | ![]() | ![]() |
Before you run the examples, open the zip file under the Downloads tab. Using the list below, create the folders and copy the data files so that the data are available during your SAS session.
Create the folder c:\MyRawData and copy these files to it:
Address.dat IceCreamSales.dat Shakespeare.dat
Admit.dat IceCreamSales2.dat Shoe.dat
AllScores.dat Lengths.dat Shoesales.dat
Artists.dat Library.dat South.dat
Baseball.dat LibraryBooks.dat Speed.dat
Basketball.dat Mag.dat Survey.dat
Boats2.dat Mens5000.dat Temperature.dat
Boats.dat Mountains.dat Temps.dat
Books.dat Movies.dat ToadJump.dat
Bus.dat NatPark.Dat Tomatoes.dat
Candy.dat NewAdmit.dat Traffic.dat
Cars.dat North.dat Train.dat
Choc.dat Olympic1500.dat Transpos.dat
Chocolate.dat OnionRing.dat TropicalSales.dat
Chocsales.dat Onions.dat UsedCars.dat
Coffee.dat OrdersQ3.dat Walk.dat
Criterium.dat Parks.dat WBRK.dat
CustAddress.dat Picbooks.dat Zoo.dat
Disc.dat Precipitation.dat
Exercise.dat President.dat Bands.csv
Flowers.dat Pumpkin.dat Bands2.csv
Games.dat Records.dat Women.csv
Garden.dat Scores.dat
Home.dat SeaLife.dat
Create the folder c:\MyFiles and copy this file to it: Baseball.xls
Create the folder c:\MyWebLogs and copy this file to it: dogweblogs.txt
Create the folder c:\MyExcelFiles and copy these files to it: Baseball.xls, OnionRing.xls
Create the folder c:\MyData to store files when you run examples
Create the folder c:\MyHTML to store files when you run examples
Create the folder c:\MyHTMLFiles to store files when you run examples
Create the folder c:\MyPDFFiles to store files when you run examples
Create the folder c:\MyRTFFiles to store files when you run examples
Create the folder c:\MySASLib and copy this file to it: TropicalSales.dat
Section 9.3
First Program
LIBNAME travel 'c:\MySASLib'; DATA travel.golf; INFILE 'c:\MyRawData\Golf.dat'; INPUT CourseName $18. NumberOfHoles Par Yardage GreenFees; RUN;Second Program
LIBNAME travel 'c:\MySASLib'; * Create Tab-delimited file; PROC EXPORT DATA = travel.golf OUTFILE = 'c:\MyRawData\Golf.txt' REPLACE; RUN;
Section 9.4
First Program
LIBNAME travel 'c:\MySASLib'; DATA travel.golf; INFILE 'c:\MyRawData\Golf.dat'; INPUT CourseName $18. NumberOfHoles Par Yardage GreenFees; RUN;Second Program
LIBNAME travel 'c:\MySASLib'; * Create Microsoft Excel file'; PROC EXPORT DATA=travel.golf OUTFILE = 'c:\MyExcel\Golf.xls' REPLACE; RUN;
Section 9.5
First Program
LIBNAME travel 'c:\MySASLib'; DATA travel.golf; INFILE 'c:\MyRawData\Golf.dat'; INPUT CourseName $18. NumberOfHoles Par Yardage GreenFees; RUN;Second Program
LIBNAME travel 'c:\MySASLib'; DATA _NULL_; SET travel.golf; FILE 'c:\MyRawData\Newfile.dat'; PUT CourseName 'Golf Course' @32 GreenFees DOLLAR7.2 @40 'Par ' Par; RUN;
Section 9.6
First Program
LIBNAME travel 'c:\MySASLib'; ODS CSV FILE='c:\MyCSVFiles\golfinfo.csv'; PROC PRINT DATA = travel.golf; TITLE 'Golf Course Information'; RUN; OSD CSV CLOSE;Second Program
LIBNAME travel 'c:\MySASLib'; ODS HTML FILE='c:\MyHTMLFiles\golfinfo.html'; PROC PRINT DATA = travel.golf NOOBS; TITLE 'Golf Course Information'; RUN; ODS HTML CLOSE;
Section 9.7
LIBNAME sports 'c:\MySASLib'; DATA sports.golflinux(OUTREP=LINUX_32); SET sports.golf; RUN;
The sample is authored by Lora D. Delwiche and Susan J. Slaughter.
Their book The Little SAS Book: A Primer, Fourth Edition is available for sale in our online bookstore.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
These sample files and code examples are provided by SAS Institute Inc. "as is" without warranty of any kind, either express or implied, including but not limited to the implied warranties of merchantability and fitness for a particular purpose. Recipients acknowledge and agree that SAS Institute shall not be liable for any damages whatsoever arising out of their use of this material. In addition, SAS Institute will provide no support for the materials contained herein.
Section 9.3, Output
CourseName NumberOfHoles Par Yardage GreenFees
Kapalua Plantation 18 73 7263 125
Pukalani 18 72 6945 55
Sandlewood 18 72 6469 35
Silversword 18 71 57
Waiehu Municipal 18 72 6330 25
Grand Waikapa 18 72 6122 200
| Type: | Sample |
| Date Modified: | 2009-01-29 17:21:35 |
| Date Created: | 2009-01-28 13:53:55 |
| Product Family | Product | Host | SAS Release | |
| Starting | Ending | |||
| SAS System | Base SAS | z/OS | ||
| OpenVMS VAX | ||||
| Microsoft® Windows® for 64-Bit Itanium-based Systems | ||||
| Microsoft Windows Server 2003 Datacenter 64-bit Edition | ||||
| Microsoft Windows Server 2003 Enterprise 64-bit Edition | ||||
| Microsoft Windows XP 64-bit Edition | ||||
| Microsoft® Windows® for x64 | ||||
| OS/2 | ||||
| Microsoft Windows 95/98 | ||||
| Microsoft Windows 2000 Advanced Server | ||||
| Microsoft Windows 2000 Datacenter Server | ||||
| Microsoft Windows 2000 Server | ||||
| Microsoft Windows 2000 Professional | ||||
| Microsoft Windows NT Workstation | ||||
| Microsoft Windows Server 2003 Datacenter Edition | ||||
| Microsoft Windows Server 2003 Enterprise Edition | ||||
| Microsoft Windows Server 2003 Standard Edition | ||||
| Microsoft Windows XP Professional | ||||
| Windows Millennium Edition (Me) | ||||
| Windows Vista | ||||
| 64-bit Enabled AIX | ||||
| 64-bit Enabled HP-UX | ||||
| 64-bit Enabled Solaris | ||||
| ABI+ for Intel Architecture | ||||
| AIX | ||||
| HP-UX | ||||
| HP-UX IPF | ||||
| IRIX | ||||
| Linux | ||||
| Linux for x64 | ||||
| Linux on Itanium | ||||
| OpenVMS Alpha | ||||
| OpenVMS on HP Integrity | ||||
| Solaris | ||||
| Solaris for x64 | ||||
| Tru64 UNIX | ||||




