home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr4.zip
/
M2COLROS.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
5KB
|
193 lines
* Program M2COLROS - Makes a 2-column roster, from any file.
Select primary
Store CNAME+' Roster - - '+curmonth+', 19'+$(date(),7,2) to SCHDR
Find &ANAME1
If #=0
Accept 'No records in input file for this code. Press <retn> ' to XX
RETURN
endif
Store F to newlettr
Store $(last:name,1,1) to linitial
Store ' ' to NME
Select secondary
Use FILLFILE
STORE T TO MORNAMES
If $(MFILE,3,6)='FCMEMB'
Store 27 to colcount
Store ' ' to colspace
else
Store 25 to colcount
Store ' ' to colspace
endif
Store 0 to pagenumb
Do while mornames
Store 1 to colnum
Store 1 to colum
Store pagenumb+1 to pagenumb
Store STR(PAGENUMB,2) to page
? 'Now creating page ',page
Do while colnum < 3 .and. mornames
Select secondary
GOTO top
Store 0 to nmcnt
Do while NMCNT < 15 .and. mornames
If newlettr
Replace nameline with $(nameline,1,colum)+nme
SKIP
Replace nameline with $(nameline,1,colum)+NMe
SKIP
Replace nameline with $(nameline,1,colum)+nma
SKIP
Replace nameline with $(nameline,1,colum)+NME
SKIP
Store F to newlettr
Store NMCNT+1 to NMCNT
endif
* Do M2COLNXT.CMD
* Program M2COLNXT - Reads and formats one name from a MEMBERS file
Select primary
Store trim(last:name)+', '+Trim(first:name) to F1
If len(f1) < colcount
Store colcount-len(f1)+1 to len1
else
Store 1 to len1
Store $(f1,1,colcount) to F1
endif
If $(home:phone,1,2) = ' '
Store ' ' to F2
else
Store 'H: '+home:phone to f2
endif
Store F1+$(NME,1,len1)+F2 to NMA
If work:phone <> ' '
Store 'W: '+work:phone to F1
else
Store ' ' to F1
endif
Store address+colspace+f1 to NMB
Store trim(city:state)+' '+zip to F1
If len(F1) < colcount
Store colcount-len(F1)+1 to len1
else
Store 1 to len1
Store $(F1,1,colcount) to F1
endif
Store ' ' to F3
If $(MFILE,3,6)='FCMEMB'
If $(birthdate,13,2)<>' '
Store 'hBD: '+$(birthdate,1,5) to F2
Store 'wBD: '+$(birthdate,10,5) to F3
else
Store ' BD: '+$(birthdate,1,5) to F2
endif
else
If $(birthdate,1,2) = ' ' .or. $(birthdate,1,2) = '00'
Store ' ' to F2
else
Store 'BD: '+$(birthdate,1,5) to F2
endif
endif
Store F1+$(NME,1,LEN1)+F2 to NMC
Store $(NME,1,colcount)+F3 to NMD
SKIP
Do while .not. EOF .and. (* .or. &BNAME)
SKIP
enddo
If EOF .or. &ANAME<>ANAME1
Store F to mornames
endif
If $(last:name,1,1) <> LINITIAL
Store $(last:name,1,1) to linitial
If LSEP='Y'
If mornames
Store T to newlettr
endif
endif
endif
Select secondary
*RETURN
Replace nameline with $(nameline,1,colum)+NMA
SKIP
Replace nameline with $(nameline,1,colum)+NMB
SKIP
Replace nameline with $(nameline,1,colum)+NMC
SKIP
Replace nameline with $(nameline,1,colum)+NMD
SKIP
Store nmcnt+1 to nmcnt
If newlettr
Store $(NME,1,14)+'- '+linitial+' -'+$(nme,1,16) to nma
If nmcnt < 14
Replace nameline with $(nameline,1,colum)+nme
SKIP
Replace nameline with $(nameline,1,colum)+nme
SKIP
Replace nameline with $(nameline,1,colum)+nma
SKIP
Replace nameline with $(nameline,1,colum)+NME
SKIP
Store nmcnt+1 to nmcnt
Store F to newlettr
else
If nmcnt=14
Replace nameline with $(nameline,1,colum)+nme
SKIP
Replace nameline with $(nameline,1,colum)+nme
SKIP
Replace nameline with $(nameline,1,colum)+nme
SKIP
Replace nameline with $(nameline,1,colum)+nme
SKIP
endif
Store 15 to nmcnt
endif
endif
enddo
Store colnum+1 to colnum
Store 42 to colum
enddo
If colnum = 2 .and. nmcnt < 15
Store NMCNT*4+5 to linecnt
else
Store 65 to linecnt
endif
Select secondary
GOTO top
Set format to print
Store 5 to linenum
@ 2,20 say SCHDR
Do while linenum < linecnt
Store 0 to OLINE
Do while OLINE < 4
@ linenum,0 say $(nameline,1,80)
SKIP
Store linenum+1 to linenum
Store OLINE+1 to OLINE
enddo
enddo
EJECT
enddo
Set format to screen
Release NMA,NMB,NMC,NMD,NME,NMCNT,NEWLETTR,PAGE,PAGENUM,COLUM,COLNUM,F1,F2,F3
RELEASE LINENUM,OLINE,NAMELINE,SCHDR,MORNAMES,LENL,COLCOUNT,COLSPACE,LINITIAL
RETURN
25 to colcount
Store ' ' to colspace
endif
Store 0 to pagenumb
Do while mornames
Store 1 to colnum
Store 1 to colum
Store pagenumb+1 to pagenumb
Store STR(PAGENUMB,2) to page
? 'Now creating page ',page
Do while colnum < 3 .and. mornames
Select secondary
GOTO top
Store 0 to nmcnt
Do while NMCNT < 15 .and. mornames
If newlettr
Replace nameline with $(nameline,1,colum)+nme
SKIP
Replace nameline with $(nameline,1,colum)+NMe