Date: Fri, 20 Sep 1996 19:45:34 GMT
Reply-To: Rdsdnen <rasanen@SPRYNET.COM>
Sender: "SAS(r) Discussion" <SAS-L@UGA.CC.UGA.EDU>
From: Rdsdnen <rasanen@SPRYNET.COM>
Organization: Sprynet News Service
Subject: SQL pcSas 6.11 Data/SQL sample
Here's a small tip. Perhaps not new to some, maybe useful to others.
I had a problem showing the entire "reason field" in my output reports.
The problem was that the file contained variable length records, and
I couldn't predict the format. If someone has a better example, feel free
to send/post :)
*-- Here we read the Original Output File -- ;
filename a1 "z:\inetsrv\wwwroot\rob\Rejects.txt";
data e;
dv='++++++++++++++++++++++++++++++++++++++++++++++++++++++';
infile a1 ;
input ;
* -- Create a holding file for the data;
file "z:\inetsrv\wwwroot\rob\fixed.txt";
put _infile_ +1 dv ;
run;
filename a1 clear;run;
* --- Read the results, delimited by +++ ;
filename a1 "z:\inetsrv\wwwroot\rob\fixed.txt";
data e;
length reason $ 55;
infile a1 missover dlm='+++';
input @29 reason ;
run;
filename a1 clear;run;
title "Letter Test Reject Results as 45% Volume processed";
footnote "Order by Percent Descending";
proc sql;
select reason, count(*) as FREQ,
( count(*) / (select count(*) from e )) * 100 format=5.2 as PERCENT
from e
group by reason
order by percent descending;
quit;
run;
--
rasanen@sprynet.com
http://home.sprynet.com/sprynet/rasanen/