- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
I imported an Excel file into my SAS program, but now I am having problems trying to graph the data. This is the code I have so far:
/* Generated Code (IMPORT) */
/* Source File: EG01-46IQ.xls */
/* Source Path: /folders/myfolders */
/* Code generated on: 1/31/19, 9:08 PM */
%web_drop_table(WORK.IMPORT);
FILENAME REFFILE '/folders/myfolders/EG01-46IQ.xls';
PROC IMPORT DATAFILE=REFFILE
DBMS=XLS
OUT=WORK.IMPORT;
GETNAMES=YES;
RUN;
PROC CONTENTS DATA=WORK.IMPORT; RUN;
%web_open_table(WORK.IMPORT);
data WORK.INPUT;
The data is an Excel file of one column of numerical data. I do not know if I am supposed to use the datalines command or how to tell SAS what to do with the imported data. Any advice is much appreciated! 🙂
Accepted Solutions
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Before attempting to graph make sure that the as generated by the Import step matches your expectations. Proc Import uses a few rows of the data to guess what variable types and lengths the values will be. Because of the unstructured nature of spreadsheet files where a single column of data can have character values, numeric values and dates you may expect one form of data but not get it. Verify that the values you need to be numeric for your process are, that dates or times are SAS values with formats such as Date9,r mmddyy or time and simple $ (character) of best (numeric) as they will not behave as dates when needed.
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
That code you post (and please avoid coding all in upper case!!) simply imports a spreadsheet into a dataset - a dataset is SAS storage for data. The contents just prints metadata about the data. To do a graph you then need to submit further code for how to and what to produce. If you do not know anything about SAS, then its a good idea to go through the SAS videos:
https://video.sas.com/category/videos/how-to-tutorials
To learn how to use the software, in that you will see how you can manipulate and process data, and produce a variety of outputs.
When you are sufficiently clear on using SAS, then look at this blog, in which you will find code examples of most types of graphs:
- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content
Before attempting to graph make sure that the as generated by the Import step matches your expectations. Proc Import uses a few rows of the data to guess what variable types and lengths the values will be. Because of the unstructured nature of spreadsheet files where a single column of data can have character values, numeric values and dates you may expect one form of data but not get it. Verify that the values you need to be numeric for your process are, that dates or times are SAS values with formats such as Date9,r mmddyy or time and simple $ (character) of best (numeric) as they will not behave as dates when needed.