[prev in list] [next in list] [prev in thread] [next in thread] 

List:       sas-l
Subject:    Re: finding a maximum value
From:       Richard DeVenezia <radevenz () IX ! NETCOM ! COM>
Date:       1999-09-30 23:34:33
[Download RAW message or body]

KK,

No offense, but you haven't tried very hard.
No need for arrays or a max function if you are only scanning a file using
data step.

data maxes;
  infile cards end=end
  retain maxpaid 0;
  input accno paid;
  if paid > maxpaid then maxpaid=paid;
  if end then output;
  keep maxpaid;
cards;
....
;
run;

If you absolutely, have to, need to, use max function do
maxpaid=max(maxpaid,paid);

Rich.

<kkana@my-deja.com> wrote in message news:7t0bvh$f3b$1@nnrp1.deja.com...
> Hi all,
>
>   How to find a maximum value of a field in a file
> with out using any procedures.This file contains
> thousands of records.Using arrays and Max function
> how to find a max value of dollar amount field.
>
> Cards
>
> a/c no  paid
> 1       45
> 2       67
> ..
> ;
> thanks for your help
> kk
>
>
> Sent via Deja.com http://www.deja.com/
> Before you buy.

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic