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

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

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
  • 591 views
  • 0 likes
  • 2 in conversation