home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr4.zip
/
MGSAROST.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
5KB
|
184 lines
* Program MGSAROST - Generates MACTIVTY file of people's special activities
* OUTPUT: [MACTIVTY index MACTIVTY]
Erase
Set intensity off
Set talk off
@ 2,10 say 'Activities file generation process'
? 'This program prints out data errors when found, so ready the printer.'
@ 5,0 say 'Now scanning the MDIRFILE for Special Activities names.'
Select primary
USE MDIRFILE index MDIRFILE
Store 'SPAC=' to spac
Find &SPAC
If # = 0
Accept 'No Special Activities in MDIRFILE. Press <retn> to terminate.' to XX
else
Select secondary
USE mdirfilx
Copy to SPACFILE STRUCTURE
Use SPACFILE
Select primary
Store 1 to actcount
Store ' ' to actlist
Store chr(31) to chr31
Do while $(spact,1,4) = 'SPAC'
Select secondary
Append blank
replace SPACT with $(P.SPACT,6,4)
If actcount<64
Store actlist+$(spact,1,4) to actlist
Store actcount+1 to actcount
else
? 'Special Activities found are: ',actlist
Store ' '+$(spact,1,4) to actlist
endif
Select primary
SKIP
enddo
Select secondary
USE SPACFILE
Index on SPACT to SPACFILE
USE SPACFILE index SPACFILE
? 'Special Activities found are: ',actlist
? 'Now copying MEMBERS that have Special Activities to MACTIVTY file.'
Select primary
Store d+':members' to MFILE
USE &MFILE
Store d+':MACTIVTY' to M1FILE
Set talk on
COPY to &M1FILE for $(SP:ACTiVTY,1,3) <> ' ' .and. $(membstatus,2,1) <> '*'
Set talk off
USE &M1FILE
APPEND blank
Store # to lastrec
Delete
GOTO top
Store 1 to reccount
? 'Now expanding MACTIVTY file for multi-activity people.'
Set format to print
@ 1,20 say 'Activities code errors in MEMBERS file - '+curdate
Store 3 to curline
Store 0 to recnumB
Store 0 to recc
Do while # < lastrec
Store sp:activty to sp:act
Store # to currec
Store 1 to fieldcnt
Do while fieldcnt < 21
Store $(sp:act,fieldcnt,3) to spactiv
If spactiv=' '
Store 21 to fieldcnt
else
Select secondary
Find &spactiv
If # = 0
Select primary
Store $(sp:act,fieldcnt,21-fieldcnt) to badspact
If fieldcnt=1
Delete
endif
Store 22 to fieldcnt
else
Select primary
STORE $(SP:ACT,FIELDCNT,3)+'.' TO SPACTIV
IF $(SP:ACT,FIELDCNT+3,1)='"'
STORE $(SPActiv,1,3)+chr31 TO SPACTIV
ENDIF
If fieldcnt>1
Store last:name to xlast
Store first:name to xfirst
Store membstatus to xmemb
Store home:phone to xhph
Store work:phone to xwph
Store address to xaddr
Store city:state to xcityst
Store zip to xzip
Store birthdate to xbirth
Store ss:sc:memb to xsssc
Store skills to xskills
Store other to xother
Store dates to xdates
Append blank
Replace last:name with xlast
Replace first:name with xfirst
Replace membstatus with xmemb
Replace home:phone with xhph
Replace work:phone with xwph
Replace address with xaddr
Replace city:state with xcityst
Replace zip with xzip
Replace birthdate with xbirth
Replace ss:sc:memb with xsssc
Replace skills with xskills
Replace other with xother
Replace sp:activty with spactiv
Replace dates with xdates
GOTO currec
ELSE
REPLACE SP:ACTIVTY WITH SPACTIV
endif
Store fieldcnt+4 to fieldcnt
endif
endif
enddo
If fieldcnt = 22
@ curline,1 say ss:sc:memb+last:name+first:name+home:phone+address+badspact
If *
REPLACE SP:ACTIVTY with '~~~'
endif
Store curline+1 to curline
If curline > 63
EJECT
Store 1 to curline
endif
endif
SKIP
Store recc+1 to recc
If recc = 20
Store 0 to recc
Store recnumb+20 to recnumb
Set format to screen
? recnumb,' records processed.'
Set format to print
endif
enddo
EJECT
Set format to screen
USE &M1FILE
? 'Expansion is complete. Now indexing MACTIVTY file by SP:ACTIVTY name.'
Set talk on
Index on sp:activty+last:name+first:name to &M1FILE
Set talk off
USE
? 'MACTIVTY file is complete.'
Release spac,actcount,actlist,reccount,xlast,xfirst,xmemb,xhph,xwph,xaddr,xzip
Release xcityst,xbirth,xsssc,spactiv,xskills,xother,xdates,curline,chr31
Release M1FILE,LASTREC,RECNUMB,RECC,CURREC,FIELDCNT,BADSPACT,SP:ACTIVTY
Set console off
Delete file('spacfile.dbf')
Delete file('spacfile.ndx')
Set console on
endif
RETURN
SE mdirfilx
Copy to SPACFILE STRUCTURE
Use SPACFILE
Select primary
Store 1 to actcount
Store ' ' to actlist
Store chr(31) to chr31
Do while $(spact,1,4) = 'SPAC'
Select secondary
Append blank
replace SPACT with $(P.SPACT,6,4)
If actcount<64
Store actlist+$(spact,1,4) to actlist
Store actcount+1 to actcount
else
? 'Special Activities found are: ',actlist
Store ' '+$(spact,1,4) to actlist
endif
Select primary
SKIP
enddo
Sel