Date: Thu, 17 Sep 2009 05:49:19 -0700
Reply-To: Amar Mundankar <amarmundankar@GMAIL.COM>
Sender: "SAS(r) Discussion" <SAS-L@LISTSERV.UGA.EDU>
From: Amar Mundankar <amarmundankar@GMAIL.COM>
Organization: http://groups.google.com
Subject: Re: i want to give serial no's for reporting
Content-Type: text/plain; charset=ISO-8859-1
On Sep 17, 5:26 pm, naga <nagabioc...@gmail.com> wrote:
> hi sas experts
> im using data from sashelp.class
> im using where statement to read 'm' data type in proc print
> but im getting out put like this
> The SAS
> System
> 17:48 Thursday, June 17,
> 1993
>
> Obs Name Sex Age Height Weight
>
> 1 Alfred M 14 69.0 112.5
> 5 Henry M 14 63.5 102.5
> 6 James M 12 57.3 83.0
> 9 Jeffrey M 13 62.5 84.0
> 10 John M 12 59.0 99.5
> 15 Philip M 16 72.0 150.0
> 16 Robert M 12 64.8 128.0
> 17 Ronald M 15 67.0 133.0
> 18 Thomas M 11 57.5 85.0
> 19 William M 15 66.5 112.0
>
> but i want show obs 1-10sequencely for reporting only
> like this
> Obs Name Sex Age Height Weight
>
> 1 Alfred M 14 69.0 112.5
> 2 Henry M 14 63.5 102.5
> 3 James M 12 57.3 83.0
> 4 Jeffrey M 13 62.5 84.0
> 5 John M 12 59.0 99.5
> 6 Philip M 16 72.0 150.0
> 7 Robert M 12 64.8 128.0
> 8 Ronald M 15 67.0 133.0
> 9 Thomas M 11 57.5 85.0
> 10 William M 15 66.5 112.0
>
> thanks in advance
Hi Naga,
If you can use Proc SQL then following code will serve your purpose.
proc sql;
select monotonic() as obs, * from sashelp.class where sex = 'M';
quit;
Thanks and Regards,
Amar Mundankar.
|