BookmarkSubscribeRSS Feed
bigban777
Obsidian | Level 7

 

 

I am a beginner in SAS. The my problem is  i dont know how raw data to transfer to formated table. so

from data(snap.png)

Снимок.PNG

 

i should get that table(r33.jpg)

Subject: 1-6 (6 times), so tm=0 first six rows(10a.m. meal), tm1 for next 6 

Time: g1-g10 but labeled as -15 0 30 60 ....

Снимок3.PNG

 

I tried your code(Sas system program.sas)

 

data want;
infile 'path to your file' dsd truncover;
input id g1-g10;run;

and i got following result (file: 4535.png)

4535.PNG 

 

That is my original problem:(r31.jpeg)

Снимок2.PNG

 

Thank you for your help and your time

 

 


4535.PNGr (31).jpgr (33).jpgsnap.PNG
5 REPLIES 5
Astounding
PROC Star

The first step doesn't involve any programming.  The first step is for you to decide what variable name you would like to use for each of the 11 columns of data.  Valid names in SAS begin with a letter (or an underscore) and contain up to 32 characters (letters, numbers, and underscores).  Once you have done that, there are many posters on this board who can help with the next steps.

bigban777
Obsidian | Level 7
So, for example each column name is g1...g10, What is the code? i need a code, pls
Reeza
Super User

 

 

http://www.ats.ucla.edu/stat/sas/modules/input.htm

 

data want;
infile 'path to your file' dsd truncover;
input id g1-g10;
run;

 

 

Reeza
Super User

If it didn't work, post your code and log. We can't see the errors on your computer otherwise. 

 

Post a sample of the file. We can't work off of images. 

 

Try some of the options in the link above.  

 

Astounding
PROC Star

Get rid of "dsd".  That should be enough to get it to run.  DSD implies that commas instead of blanks should be the delimiters between fields.

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

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
  • 5 replies
  • 1106 views
  • 0 likes
  • 3 in conversation