OK then.
183 data class;
184 set sashelp.class;
185 if _n_ in(1,4,5,19) then substr(name,3,1)='|';
186 else if _n_ in(3,6,7) then call missing(of _all_);
187 run;
NOTE: There were 19 observations read from the data set SASHELP.CLASS.
NOTE: The data set WORK.CLASS has 19 observations and 5 variables.
NOTE: DATA statement used (Total process time):
real time 0.01 seconds
cpu time 0.01 seconds
188
189 data _null_;
190 set class;
191 file log dlm='|' dsd;
192 if _n_ eq 1 then link names;
193 put (_all_)(~);
194 return;
195 names:
196 length _name_ $32;
197 do while(1);
198 call vnext(_name_);
199 if upcase(_name_) eq '_NAME_' then leave;
200 put _name_ ~ @;
201 end;
202 put;
203 return;
204 run;
"Name"|"Sex"|"Age"|"Height"|"Weight"
"Al|red"|"M"|"14"|"69"|"112.5"
"Alice"|"F"|"13"|"56.5"|"84"
" "|" "|"."|"."|"."
"Ca|ol"|"F"|"14"|"62.8"|"102.5"
"He|ry"|"M"|"14"|"63.5"|"102.5"
" "|" "|"."|"."|"."
" "|" "|"."|"."|"."
"Janet"|"F"|"15"|"62.5"|"112.5"
"Jeffrey"|"M"|"13"|"62.5"|"84"
"John"|"M"|"12"|"59"|"99.5"
"Joyce"|"F"|"11"|"51.3"|"50.5"
"Judy"|"F"|"14"|"64.3"|"90"
"Louise"|"F"|"12"|"56.3"|"77"
"Mary"|"F"|"15"|"66.5"|"112"
"Philip"|"M"|"16"|"72"|"150"
"Robert"|"M"|"12"|"64.8"|"128"
"Ronald"|"M"|"15"|"67"|"133"
"Thomas"|"M"|"11"|"57.5"|"85"
"Wi|liam"|"M"|"15"|"66.5"|"112"
NOTE: There were 19 observations read from the data set WORK.CLASS.
NOTE: DATA statement used (Total process time):
real time 0.03 seconds
cpu time 0.03 seconds
Are you ready for the spotlight? We're accepting content ideas for SAS Innovate 2025 to be held May 6-9 in Orlando, FL. The call is open until September 25. Read more here about why you should contribute and what is in it for you!
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.