home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / database / chrchpr4.zip / M2COLROS.CMD < prev    next >
OS/2 REXX Batch file  |  1987-01-06  |  5KB  |  193 lines

  1. * Program M2COLROS - Makes a 2-column roster, from any file.
  2. Select primary
  3. Store CNAME+' Roster  - -  '+curmonth+', 19'+$(date(),7,2) to SCHDR
  4. Find &ANAME1
  5. If #=0
  6.   Accept 'No records in input file for this code. Press <retn> ' to XX
  7.   RETURN
  8. endif
  9. Store F to newlettr
  10. Store $(last:name,1,1) to linitial
  11. Store '                                              ' to NME
  12. Select secondary
  13. Use FILLFILE
  14. STORE T TO MORNAMES
  15. If $(MFILE,3,6)='FCMEMB'
  16.   Store 27 to colcount
  17.   Store '   ' to colspace
  18. else
  19.   Store 25 to colcount
  20.   Store ' ' to colspace
  21. endif
  22. Store 0 to pagenumb
  23. Do while mornames
  24.   Store 1 to colnum
  25.   Store 1 to colum
  26.   Store pagenumb+1 to pagenumb
  27.   Store STR(PAGENUMB,2) to page
  28.   ? 'Now creating page ',page
  29.   Do while colnum < 3 .and. mornames
  30.     Select secondary
  31.     GOTO top
  32.     Store 0 to nmcnt
  33.     Do while NMCNT < 15 .and. mornames
  34.       If newlettr
  35.         Replace nameline with $(nameline,1,colum)+nme
  36.         SKIP
  37.         Replace nameline with $(nameline,1,colum)+NMe
  38.         SKIP
  39.         Replace nameline with $(nameline,1,colum)+nma
  40.         SKIP
  41.         Replace nameline with $(nameline,1,colum)+NME
  42.         SKIP
  43.         Store F to newlettr
  44.         Store NMCNT+1 to NMCNT
  45.       endif
  46. *     Do M2COLNXT.CMD
  47. * Program M2COLNXT - Reads and formats one name from a MEMBERS file
  48. Select primary
  49. Store trim(last:name)+', '+Trim(first:name) to F1
  50. If len(f1) < colcount
  51.   Store colcount-len(f1)+1 to len1
  52. else
  53.   Store 1 to len1
  54.   Store $(f1,1,colcount) to F1
  55. endif
  56. If $(home:phone,1,2) = '  '
  57.   Store '            ' to F2
  58. else
  59.   Store 'H: '+home:phone to f2
  60. endif
  61. Store F1+$(NME,1,len1)+F2 to NMA
  62. If work:phone <> '         '
  63.   Store 'W: '+work:phone to F1
  64. else
  65.   Store '            ' to F1
  66. endif
  67. Store address+colspace+f1 to NMB
  68. Store trim(city:state)+' '+zip to F1
  69. If len(F1) < colcount
  70.   Store colcount-len(F1)+1 to len1
  71. else
  72.   Store 1 to len1
  73.   Store $(F1,1,colcount) to F1
  74. endif
  75. Store '             ' to F3
  76. If $(MFILE,3,6)='FCMEMB'
  77.   If $(birthdate,13,2)<>'  '
  78.     Store 'hBD: '+$(birthdate,1,5) to F2
  79.     Store 'wBD: '+$(birthdate,10,5) to F3
  80.   else
  81.     Store ' BD: '+$(birthdate,1,5) to F2
  82.   endif
  83. else
  84.   If $(birthdate,1,2) = '  ' .or. $(birthdate,1,2) = '00'
  85.     Store '            ' to F2
  86.   else
  87.     Store 'BD: '+$(birthdate,1,5) to F2
  88.   endif
  89. endif
  90. Store F1+$(NME,1,LEN1)+F2 to NMC
  91. Store $(NME,1,colcount)+F3 to NMD
  92. SKIP
  93.   Do while .not. EOF .and. (* .or. &BNAME)
  94.     SKIP
  95.   enddo
  96.   If EOF .or. &ANAME<>ANAME1
  97.     Store F to mornames
  98.   endif
  99. If $(last:name,1,1) <> LINITIAL
  100.   Store $(last:name,1,1) to linitial
  101.   If LSEP='Y'
  102.    If mornames
  103.     Store T to newlettr
  104.    endif
  105.   endif
  106. endif
  107. Select secondary
  108. *RETURN
  109.       Replace nameline with $(nameline,1,colum)+NMA
  110.       SKIP
  111.       Replace nameline with $(nameline,1,colum)+NMB
  112.       SKIP
  113.       Replace nameline with $(nameline,1,colum)+NMC
  114.       SKIP
  115.       Replace nameline with $(nameline,1,colum)+NMD
  116.       SKIP
  117.       Store nmcnt+1 to nmcnt
  118.       If newlettr
  119.         Store $(NME,1,14)+'- '+linitial+' -'+$(nme,1,16) to nma
  120.         If nmcnt < 14
  121.           Replace nameline with $(nameline,1,colum)+nme
  122.           SKIP
  123.           Replace nameline with $(nameline,1,colum)+nme
  124.           SKIP
  125.           Replace nameline with $(nameline,1,colum)+nma
  126.           SKIP
  127.           Replace nameline with $(nameline,1,colum)+NME
  128.           SKIP
  129.           Store nmcnt+1 to nmcnt
  130.           Store F to newlettr
  131.         else
  132.           If nmcnt=14
  133.             Replace nameline with $(nameline,1,colum)+nme
  134.             SKIP
  135.             Replace nameline with $(nameline,1,colum)+nme
  136.             SKIP
  137.             Replace nameline with $(nameline,1,colum)+nme
  138.             SKIP
  139.             Replace nameline with $(nameline,1,colum)+nme
  140.             SKIP
  141.           endif
  142.           Store 15 to nmcnt
  143.         endif
  144.       endif
  145.     enddo
  146.     Store colnum+1 to colnum
  147.     Store 42 to colum
  148.   enddo
  149.   If colnum = 2 .and. nmcnt < 15
  150.     Store NMCNT*4+5  to linecnt
  151.   else
  152.     Store 65 to linecnt
  153.   endif
  154.   Select secondary
  155.   GOTO top
  156.   Set format to print
  157.   Store 5 to linenum
  158.   @ 2,20 say SCHDR
  159.   Do while linenum < linecnt
  160.     Store 0 to OLINE
  161.     Do while OLINE < 4
  162.       @ linenum,0 say $(nameline,1,80)
  163.       SKIP
  164.       Store linenum+1 to linenum
  165.       Store OLINE+1 to OLINE
  166.     enddo
  167.   enddo
  168.   EJECT
  169. enddo
  170. Set format to screen
  171. Release NMA,NMB,NMC,NMD,NME,NMCNT,NEWLETTR,PAGE,PAGENUM,COLUM,COLNUM,F1,F2,F3
  172. RELEASE LINENUM,OLINE,NAMELINE,SCHDR,MORNAMES,LENL,COLCOUNT,COLSPACE,LINITIAL
  173. RETURN
  174.  
  175.  25 to colcount
  176.   Store ' ' to colspace
  177. endif
  178. Store 0 to pagenumb
  179. Do while mornames
  180.   Store 1 to colnum
  181.   Store 1 to colum
  182.   Store pagenumb+1 to pagenumb
  183.   Store STR(PAGENUMB,2) to page
  184.   ? 'Now creating page ',page
  185.   Do while colnum < 3 .and. mornames
  186.     Select secondary
  187.     GOTO top
  188.     Store 0 to nmcnt
  189.     Do while NMCNT < 15 .and. mornames
  190.       If newlettr
  191.         Replace nameline with $(nameline,1,colum)+nme
  192.         SKIP
  193.         Replace nameline with $(nameline,1,colum)+NMe