14.03.2014 Views

Scripting Guide - SAS

Scripting Guide - SAS

Scripting Guide - SAS

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

42 Getting Started Chapter 3<br />

Gluing Scripts Together<br />

2. Select Text Files from the list next to File name (or the Files of type list on Windows XP).<br />

3. In the Open as section, select Data, using best guess.<br />

JMP formats the data based on tabs, commas, white space, and other characters in the text file.<br />

4. Next to File name, select Text Files.<br />

5. Browse to select the file, and then select Open.<br />

The file is opened as a data table. The data table includes a script named Source. This JSL script imports<br />

your text file with the text import rules that you used.<br />

6. From the red triangle menu for Source, select Edit.<br />

You can copy this script, paste it into a new script window, and save it. Then you can run this script later<br />

to reimport the text file.<br />

Tip: The import script is an Open() expression that specifies the text file and the import options to<br />

correctly import the file into JMP. The first part of this expression is the pathname to the specific file that<br />

you imported. If you save this script and want to run it a different place, you might need to edit the<br />

pathname so that it points to the text file. Pathnames are discussed in greater detail in “Path Variables” on<br />

page 105 in the “Types of Data” chapter.<br />

Import a Microsoft Excel File<br />

1. Select File > Open.<br />

The Open Data File window appears.<br />

2. Next to File name, select Excel Files.<br />

3. Select Best guess.<br />

JMP formats the data based on tabs, commas, white space, and other characters in the text file.<br />

4. Browse to select the file, and then select Open.<br />

Your data table does not include a Source script, because nothing was imported.<br />

The script to open an Excel file into JMP is an Open() expression:<br />

Open( pathname );<br />

For example, to open the Solubil.xls file that is in your Sample Import Data folder, type this line into a<br />

script window and run it:<br />

Open( "$SAMPLE_IMPORT_DATA/Solubil.xls" );<br />

Gluing Scripts Together<br />

Suppose new data is saved out to an Excel file once a week, and you need to produce the same reports every<br />

week. You could open the file and perform the same steps every week. However, creating a script that<br />

imports the new Excel file into JMP and runs all analyses automatically is more efficient. The following<br />

example shows you how to set up your script and run it each week.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!