Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Question in range list cannot make all the column viewable

How can I change all the column in $8.?

Below is my code

data workout;
input Day1-Day7 $8. ;
datalines;
chest leg back rest chest leg back;
run;

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

And the result only show the last column "Day7" with "back" and other column just show "." only

>Solution :

First of all, your code will likely not produce any output. The semicolon ; ending the data enumeration should be located on a separate line, not on the same line as your records.

Secondly, only Day7 has a value because it is the only variable that you specify as character. Make sure to use parenthesis around the type and length and use the colon : modifier to tell SAS to read the variables until there is a space or delimiter (:$8.).

Also, the run; at the end is not needed, but does not harm any 😉

data workout;
input (Day1-Day7) (:$8.);
datalines;
chest leg back rest chest leg back
; 
chest leg back rest chest leg back
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading