BookmarkSubscribeRSS Feed
leahstinson
Calcite | Level 5

How do you want me to show you the log? I am sorry. It is hard explaining and showing this way if you can not fully see the whole thing. 

leahstinson
Calcite | Level 5

1.PNG

2.PNG

This is the complete log. 

leahstinson
Calcite | Level 5

I am just trying to figure out why I get output data but no results. 

Patrick
Opal | Level 21

@leahstinson 

Use below highlighted icon and then copy/paste your log as text.

Patrick_0-1665020514285.png

...or attach the ....log file via 

Patrick_1-1665020563347.png

 

Looking at your code the first issue you're having is:

Patrick_2-1665020612473.png
Patrick_3-1665020646567.png

 

You need to add TRUNCOVER or MISSOVER to your infile statement.

You likely should also define what character delimits your source data. If it's a comma then add to the infile statment: dlm=','

And you should also ensure that SAS treats consecutive delimiters as two delimiters. DSD is doing this for you.

infile '/home/u62178216/my_content/Week5.txt'  dsd dlm=',' truncover;

If you have problems with the syntax of infile/input statements then using SAS EG (and something similar with SAS Studio): Use the import wizard as it will generate the code for you. And if you're not happy then you can take the code and just amend it to your needs. In EG it's under menu: File/Import Data.

 

 

 

Tom
Super User Tom
Super User

So your program does not match the data. 

The log is showing that all of the lines have exactly 9 characters. 

Tom_0-1665029557155.png

Your input statement is trying to read 12 characters per line.

input sexvar$ 1 genhlth$ 2 physhlth$ 3-4 medcost$ 5 diabage3$ 6-7 smoke$ 8 
      indortan$ 9-11 race$ 12 
;

Why not LOOK at the data and SEE what it looks like?

Here is a simple data step that will read the first few lines and dump them to the log.

data _null_;
  infile '/home/u62178216/my_content/Week5.txt'  obs=10;
  input;
  list;
run;

If the issue is just that RACE is missing on every line and INDORTAN is only one character on every line then the previously suggested solution of add the TRUNCOVER option to the INFILE statement will fix the program.  But if the data shows something else then you will probably need to change the INPUT statement instead.

 

 

To copy a SAS log use the mouse or the cursor keys to highlight the lines of text you want and the use the COPY function of your computer.  Usually Ctrl-C on most computers.  You can then click on the Insert Code button in the forum to open a pop-up window where you can paste in the lines of text you now have in the paste buffer.

Tom_0-1665021299030.png

 

sas-innovate-2024.png

Available on demand!

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

 

Register now!

Click image to register for webinarClick image to register for webinar

Classroom Training Available!

Select SAS Training centers are offering in-person courses. View upcoming courses for:

View all other training opportunities.

Discussion stats
  • 19 replies
  • 1321 views
  • 0 likes
  • 5 in conversation