How to Upload Data in Sas University Edition
After your datafiles have been uploaded to your SAS OnDemand for Academics account, you can import the data into a SAS data footstep. The easiest way to practise so is to apply the Import Data task:
-
Click Tasks and Utilities in the Navigation pane, and so click Import Data.
This volition create a new tab in the piece of work area, titled Import Information ane.
-
You can decide to drag and drop your files or select a file to import. In our instance, the Excel file with the sample data is located in our Sample data binder. (Remember: when using SAS OnDemand for Academics, your data must exist uploaded into theServer Files and Folders tab. If y'all exercise not see any data files in this window, you lot nearly likely demand to upload them; see the previous section on uploading data to SAS ODA.)
-
One time you've chosen the Excel file with the data, click Open. SAS will populate the file data and generate code for importing.
-
To run the lawmaking, click the Run button (running homo icon) to execute the code.
-
Once y'all've executed the code, check the Log to see if any errors take occurred. If successful, the Log window should tell us how many observations and variables the new dataset contains.
Additionally, you can preview the dataset in the Output Data tab.
-
If yous are satisfied with the effect of the import process, you take the option to salve the Import task past clicking the Save button (floppy deejay icon). This will create a *.ctl file in your SAS ODA account, which you tin use to repeat/re-create the import procedure in the time to come. We highly recommend doing this and so y'all have a record of how you lot imported the information.
Understanding the Import Syntax
Let's take a closer look at the syntax that SAS generates when using the Import tool and sympathize what each line is doing:
The first 4 lines are comments -- they exercise non comprise executable code, and exist only as notes for human readers. The notes contain the proper noun and location of the imported file, and the appointment that the import code was generated.
The first executable line of code is
%web_drop_table(Work.IMPORT);
This particular command "clears out" any data in the organisation saved under the WORK.IMPORT name. Y'all might notice that this command looks very different than the PROC IMPORT and PROC CONTENTS commands. Notice the pct symbol (%) at the start of the line: this tells usa that %web_drop_table
is a user-defined macro command. In this case, it'due south a function that SAS themselves divers to quickly delete a detail dataset. If you've imported another dataset into SAS using the Import task under the name WORK.IMPORT and want to keep information technology, make sure you relieve it under a name other than Work.IMPORT, or else you will lose it!
The offset pertinent line starts with the FILENAME
statement, which specifies the path to the file containing the data to import. In item, it assigns the nickname REFFILE to the total file path where our data is located. This means that we can but type the nickname REFFILE in the PROC IMPORT
pace instead of having to write out the full file path.
The next cake of lawmaking is the PROC IMPORT
statement, which triggers the data import action. Note the get-go semicolon is not until the third line. This is because the syntax includes quite a few options associated with the PROC IMPORT
statement:
- The
OUT
selection tells SAS where to put the new SAS dataset it is creating – in this case nosotros told information technology to put the new SAS dataset "import" in the Work library. - The
DATAFILE
option points to the file directory of the dataset you lot are importing. - The
DBMS
pick tells SAS what engine to utilise to read the data (in this case, the XLSX engine). This value will depend on what type of file you're importing. -
GETNAMES=YES
instructs SAS to utilise the kickoff row of the file equally variable names.
The PROC IMPORT code in this stride is very similar to the PROC IMPORT code one would use for "desktop" SAS, so for more information about PROC IMPORT, encounter our Importing Excel Files into SAS tutorial.
Following the PROC IMPORT
command, SAS generates code for PROC CONTENTS
, which displays information about the newly-imported dataset (Piece of work.IMPORT).
PROC CONTENTS is a standard SAS procedure; for more information near how to use and understand it, see the Summarizing Dataset Contents with PROC CONTENTS tutorial.
Source: https://libguides.library.kent.edu/SAS/OnDemandImportData
0 Response to "How to Upload Data in Sas University Edition"
Post a Comment