home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
CP/M
/
CPM_CDROM.iso
/
mbug
/
mbug073.arc
/
GENELOGY.LBR
/
LAGE.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1979-12-31
|
2KB
|
61 lines
* LAGE.CMD to produce list of age at death
DO lgetrec
STORE ' ' TO header,given1,famname1,given2,famname2,order
STORE ' ' TO born,died,age,year1,year2
STORE 0 TO total,n
DO CASE
CASE type = 'N'
IF nom1 # nom2
STORE nom1+" to "+nom2 TO order
ELSE
STORE nom1+"s" TO order
ENDIF
CASE type = 'R'
STORE 'Records '+TRIM(mfirst)+' to '+TRIM(mlst) TO order
ENDCASE
IF myprnt = 'P'
SET PRINT ON
@ 6,0 SAY CHR(27)+'Y'
@ 6,30 SAY xinv+'Turn Printer ON'+xnor
?? " "
SET MARGIN TO 3
@ 6,0
ENDIF
ERASE
IF myprnt ='P'
SET PRINT ON
ENDIF
? " "+order+", Ages at Death"
?
DO WHILE &mvar <=mlast .AND. .NOT. EOF
IF borndate > " " .AND. (dieddate > " " .AND. dieddate # '........')
STORE TRIM(borndate) TO born
STORE TRIM(dieddate) TO died
STORE $(born,len(born)-3,len(born)) TO year1
STORE $(died,len(died)-3,len(died)) TO year2
STORE STR(VAL(year2)-VAL(year1),3) TO age
IF VAL(age) > 13
STORE VAL(age)+ total TO total
STORE n+1 TO n
ENDIF
? #,surname,firstnms,age
ENDIF
SKIP
IF type ='R'
STORE STR(#,4) TO mvar
ENDIF
ENDDO
?
IF total > 0 .AND. n > 0
? ' Average Age at Death = '+STR(total/n,2)
?
ENDIF
SET PRINT OFF
? ' Press <RETURN> when ready'
SET CONSOLE OFF
WAIT
SET CONSOLE ON
SET INDEX TO
ERASE
RETURN