home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Overload
/
ShartewareOverload.cdr
/
database
/
chrchpr4.zip
/
MSPFMAIL.CMD
< prev
next >
Wrap
OS/2 REXX Batch file
|
1987-01-06
|
3KB
|
118 lines
* Program MSPFMAIL - Prints mailing labels for a specified file of people.
* MLABLSPP (labels-per-page)
* MLSPACNG (spacing between labels) - must be > 2
* MLCOL1 (column number for 1st column of labels)
* MLCOL2 (column number for 2nd column of labels; Equals 0 if only 1-col labels
* C - running current column
* MAXLINE - computed maximum CURLINE count
*
Select secondary
USE MDIRFILE index MDIRFILE
GOTO 19
Store val($(spact,28,2)) to MLSPACNG
SKIP
Store val($(spact,28,2)) to MLINESPP
SKIP
Store val($(spact,27,2)) to MLCOL1
SKIP
Store val($(spact,29,2)) to MLCOL2
SKIP
Store val($(spact,16,2)) to voteage
USE
STORE MLINESPP-1 TO MAXLINE
Store 'Mailing labels: ' to HML
Store str(MLINESPP,2) to mlax
Store str(MLSPACNG,2) to Mlsx
STORE STR(MLCOL1,2) TO ML11X
STORE STR(MLCOL2,2) TO ML22X
Set RAW on
If MLCOL2>0
STORE ML11X+', 2ND COLUMN = '+STR(MLCOL2,2) TO ML11X
endif
? HML,MLAX,' LINES / PAGE, SPACING = ',MLSX,', 1ST COLUMN = ',ML11X
Set RAW off
Set format to print
Select primary
Use &SPFILE
If ANAME1<>'ALL'
Find &ANAME1
If #=0
Accept 'No records found with this code. Press <retn> ' to XX
Return
endif
endif
Store T to BEGINNG
Store 0 to CURLINE
Store '1' to C
Store ' ' to XZIP
Do while .not. EOF .AND. &ANAME=ANAME1
If .not. BEGINNG
If fullzip='Y'
Store zone to xzip
endif
If MLCOL2=0
@ curline,MLCOL1 say TRIM(FIRST:NAME)+' '+TRIM(LAST:NAME)
@ curline+1,MLCOL1 say ADDRESS
@ curline+2,MLCOL1 say TRIM(CITY:STATE)+' '+ZIP+xzip
Store curline+MLSPACNG to curline
else
Store trim(first:name)+' '+trim(last:name) to NAMEC&C
Store address to ADDRC&C
Store trim(city:state)+' '+zip+xzip to CITYC&C
If C='2'
@ curline,MLCOL1 say NAMEC1
@ curline,MLCOL2 say NAMEC2
@ curline+1,MLCOL1 say ADDRC1
@ curline+1,MLCOL2 say ADDRC2
@ curline+2,MLCOL1 say CITYC1
@ curline+2,MLCOL2 say CITYC2
Store curline+MLSPACNG to curline
Store '1' to C
else
Store '2' to C
endif
endif
If curline>MAXLINE
EJECT
Store 0 to curline
endif
SKIP
endif
Store F to BEGINNG
Do while .not. EOF .and. (* .or. &BNAME)
SKIP
enddo
enddo
If C='2' .and. MLCOL2>0
@ CURLINE,MLCOL1 SAY NAMEC1
@ CURLINE+1,MLCOL1 SAY ADDRC1
@ CURLINE+2,MLCOL1 SAY CITYC1
endif
EJECT
USE
Set format to screen
Release ANAME,ANAME1,XX,XNAME,MLSPACNG,MLINESPP,MLCOL1,MLCOL2,MAXLINE,HML,XZIP
RELEASE MLAX,MLSX,ML11X,ML22X,BEGINNG,CURLINE,C,NAMEC1,NAMEC2,ADDRC1,ADDRC2
RELEASE CITYC1,CITYC2,SPFILE,YEARVAL,VOTEDATE,YEARSTR,INBDATE,BNAME
RETURN
'ALL'
Find &ANAME1
If #=0
Accept 'No records found with this code. Press <retn> ' to XX
Return
endif
endif
Store T to BEGINNG
Store 0 to CURLINE
Store '1' to C
Store ' ' to XZIP
Do while .not. EOF .AND. &ANAME=ANAME1
If .not. BEGINNG
If fullzip='Y'
Store zone to xzip
endif
If MLCOL2=0
@ curline,MLCOL1 say TRIM(FIRST:NAME)+' '+TRIM(LAST:NAME)
@ curline+1,MLCOL1 say ADDRESS
@ curline+2,MLCOL1 say TRIM(CITY:STATE)+' '+ZIP+xzip
Store c