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.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

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.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 1 reply
  • 985 views
  • 0 likes
  • 2 in conversation