BookmarkSubscribeRSS Feed
sas_
Fluorite | Level 6
The data is in Text.how can i read

1 x 22
2a 33
3 aaa 44
4 bbb 55
id name age
5 ccc 66
6 ddd 55
7 eee 66
8 fff 77
id name age
9 ggg 99
10 hhh 88
11 rrr 87
12 eee 88


Hi i am having a data set in this every fifth observation is my variable name now i wnat to elimnate all the variable names in the obs and in starting varaiables name shd reflect.And i dont know the no of observations are there

output

id name$ age
1 x 22
2a 33
3 aaa 44
4 bbb 55
5 ccc 66
6 ddd 55
7 eee 66
8 fff 77
9 ggg 99
10 hhh 88
11 rrr 87
12 eee 88
1 REPLY 1
sbb
Lapis Lazuli | Level 10 sbb
Lapis Lazuli | Level 10
A DATA step can be used here and test the input record buffer for some unreasonable value then DELETE the current record.

DATA ;
INFILE ;
INPUT @;
IF UPCASE(_INFILE_) =: 'ID' THEN DELETE;
* your DATA step code goes here to read your input file as expected. ;
RUN;

SAS support website http://support.sas.com/ can provide SAS-hosted documentation and technical/conference topic papers:

http://support.sas.com/documentation/cdl/en/lrdict/61724/HTML/default/a000146932.htm

Scott Barry
SBBWorks, Inc.

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!

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

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
  • 1 reply
  • 611 views
  • 0 likes
  • 2 in conversation