Calculating Median

Peter Bateman ppfb@hotmail.com
Wed, 04 Aug 2004 12:04:25 -0300


I realized that the previous code would not work because
the ACCESS statement would reset my defines from the usefile.
So this one is given to create littorals in the access statement.
Two pass QUIZ solution with executable FINAL FOOTING :
access file
sort on x
define x-count integer = 1
define half_1 = 0.5
report summary x x-count subtotal noreset
set subfile name xsub

Final Footing ' access *xsub link to record ( ' &
              half_1 subtotal initial 0.5 noreset &
                 ') of *xsub alias low & ' &
              skip 1 &
              '              link to record ( '&
              half_1 subtotal initial 1  noreset &
              ') of *xsub alias high & ' &
              skip 1

set report device disc name usefile
set page width 72 length 0
set nohead
set close
go ; this gives the values in sequence with a sequence number

use usefile
; assuming the first record is record 1

define median = ( x of low + x of high ) / 2
report median
set report limit 1
go

Regards,
Peter Bateman

I realized that the previous code would not work because
the ACCESS statement would reset my defines from the usefile.
So this one is given to create littorals in the access statement.
Two pass QUIZ solution with executable FINAL FOOTING :
access file
sort on x
define x-count integer = 1
define half_1 = 0.5
report summary x x-count subtotal noreset
set subfile name xsub

Final Footing ' access *xsub link to record ( ' &
              half_1 subtotal initial 0.5 noreset &
                 ') of *xsub alias low & ' &
              skip 1 &
              '              link to record ( '&
              half_1 subtotal initial 1  noreset &
              ') of *xsub alias high & ' &
              skip 1

set report device disc name usefile
set page width 72 length 0
set nohead
set close
go ; this gives the values in sequence with a sequence number

use usefile
; assuming the first record is record 1

define median = ( x of low + x of high ) / 2
report median
set report limit 1
go

Regards,
Peter Bateman

I realized that the previous code would not work because
the ACCESS statement would reset my defines from the usefile.
So this one is given to create littorals in the access statement.
Two pass QUIZ solution with executable FINAL FOOTING :
access file
sort on x
define x-count integer = 1
define half_1 = 0.5
report summary x x-count subtotal noreset
set subfile name xsub

Final Footing ' access *xsub link to record ( ' &
              half_1 subtotal initial 0.5 noreset &
                 ') of *xsub alias low & ' &
              skip 1 &
              '              link to record ( '&
              half_1 subtotal initial 1  noreset &
              ') of *xsub alias high & ' &
              skip 1

set report device disc name usefile
set page width 72 length 0
set nohead
set close
go ; this gives the values in sequence with a sequence number

use usefile
; assuming the first record is record 1

define median = ( x of low + x of high ) / 2
report median
set report limit 1
go

Regards,
Peter Bateman

I realized that the previous code would not work because
the ACCESS statement would reset my defines from the usefile.
So this one is given to create littorals in the access statement.
Two pass QUIZ solution with executable FINAL FOOTING :
access file
sort on x
define x-count integer = 1
define half_1 = 0.5
report summary x x-count subtotal noreset
set subfile name xsub

Final Footing ' access *xsub link to record ( ' &
              half_1 subtotal initial 0.5 noreset &
                 ') of *xsub alias low & ' &
              skip 1 &
              '              link to record ( '&
              half_1 subtotal initial 1  noreset &
              ') of *xsub alias high & ' &
              skip 1

set report device disc name usefile
set page width 72 length 0
set nohead
set close
go ; this gives the values in sequence with a sequence number

use usefile
; assuming the first record is record 1

define median = ( x of low + x of high ) / 2
report median
set report limit 1
go

Regards,
Peter Bateman

I realized that the previous code would not work because
the ACCESS statement would reset my defines from the usefile.
So this one is given to create littorals in the access statement.
Two pass QUIZ solution with executable FINAL FOOTING :
access file
sort on x
define x-count integer = 1
define half_1 = 0.5
report summary x x-count subtotal noreset
set subfile name xsub

Final Footing ' access *xsub link to record ( ' &
              half_1 subtotal initial 0.5 noreset &
                 ') of *xsub alias low & ' &
              skip 1 &
              '              link to record ( '&
              half_1 subtotal initial 1  noreset &
              ') of *xsub alias high & ' &
              skip 1

set report device disc name usefile
set page width 72 length 0
set nohead
set close
go ; this gives the values in sequence with a sequence number

use usefile
; assuming the first record is record 1

define median = ( x of low + x of high ) / 2
report median
set report limit 1
go

Regards,
Peter Bateman

_________________________________________________________________
Designer Mail isn't just fun to send, it's fun to receive. Use special 
stationery, fonts and colors. 
http://join.msn.com/?pgmarket=en-ca&page=byoa/prem&xAPID=1994&DI=1034&SU=http://hotmail.com/enca&HL=Market_MSNIS_Taglines 
  Start enjoying all the benefits of MSNŽ Premium right now and get the 
first two months FREE*.