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

  1. * Program MTWOLINE - One-line roster of a selected group from the input file.
  2. * Inputs: ANAME - type of filename
  3. *    File name (Already "USED")
  4. *    ANAME,ANAME1 - Selected group within FILENAME; quit when &ANAME<>ANAME1
  5. *    BNAME - Selected subgroup to be selected; skip all records that
  6. *                   have &BNAME "True"
  7. *    CNAME - First line title
  8. *    OTH1 - OTHER code to be printed in OTH field when not blank and matched
  9. *   MSEL - Selected report type: From SSSC or SP:ACTIVTY; with switches
  10. *   ANAME - Type of file being read: SSSC,SPAC
  11. * This is an incomplete list of input parameters.
  12. If ANAME1<>'ALL'
  13. Find &ANAME1
  14. If # = 0
  15.   ? 'No records in this file with this code. '
  16.   Store F to invalidd
  17.   RETURN
  18. endif
  19. endif
  20.   Store MSEL to othfield
  21.   Store ' ' to oth1
  22.   ? 'Now printing a two-line report [TL] for ',ANAME1
  23.   Select secondary
  24.   Store len(othfield) to lenfield
  25.   If lenfield > 1
  26.     Store $(othfield,2,1) to othf2
  27.     If othf2='/' .or. othf2='\'
  28.      If lenfield>4
  29.         Store $(othfield,3,3) to oth1
  30.         Store oth1+':' to othfind
  31.         Find &othfind
  32.         If # = 0
  33.           ? 'OTHER code not found in MDIRFILE. '
  34.           RETURN
  35.         else
  36.           Store trim($(spact,6,6))+':' to othheadr
  37.         endif
  38.      else
  39.         ?  'OTHER code option not 3 characters.'
  40.         RETURN
  41.      endif
  42.     endif
  43.   endif
  44. Select primary
  45. Store 99 to curline
  46. Store 0 to pagenum
  47. Store T to BEGINNG
  48. Set format to print
  49. Store val($(date(),7,2)) to curyear
  50. Store T to mornames
  51. IF LEN(CNAME)<40
  52.   STORE '         '+CNAME to CNAME
  53. endif
  54. Do while mornames
  55.   If curline > 62
  56.     If .not. BEGINNG
  57.       EJECT
  58.     endif
  59.     Store pagenum+1 to pagenum
  60.     @ 0,0 say CNAME
  61.     @ 0,52 say curdate
  62.     @ 0,72 say 'Page'+str(pagenum,3)
  63.     @ 2,0 say fcolhdr
  64.     @ 2,13 say 'PHONE      NAME                 ADDRESS'
  65.     Store 4 to curline
  66.   endif
  67.   If .not. BEGINNG
  68.     Store '  ' to graddate
  69.     If oth1<>' '
  70.     If othf2='\'
  71.       Store $(birthdate,10,2) to graddate
  72.       If graddate<>'  '
  73.         Store val(graddate) to faddress
  74.         If faddress<50
  75.           Store 100+faddress to faddress
  76.         endif
  77.         Store faddress-curyear to faddress
  78.         If nmonth>5
  79.           Store str(13-faddress,2) to graddate
  80.         else
  81.           Store str(12-faddress,2) to graddate
  82.         endif
  83.       endif
  84.     endif
  85.     endif
  86.     @ curline,0 say &FCOLUMN
  87.     @ curline,12 say home:phone
  88.     If $(ss:sc:memb,4,1)=chr(31)
  89.      @ curline,21 say '"'
  90.     else
  91.      If $(membstatus,1,1) = 'Y'
  92.       @ curline,21 say '-'
  93.      else
  94.       If $(dates,1,4)=indate
  95.         @ curline,21 say '\'
  96.       endif
  97.      endif
  98.     endif
  99.     Store trim(first:name)+' '+trim(last:name) to fname
  100.     If len(fname) > 19
  101.       Store $(fname,1,19)+'_' to fname
  102.     endif
  103.     @ curline,22 say fname
  104.     Store trim(address)+', '+trim(city:state) to faddress
  105.     If len(faddress) > 31
  106.       Store $(faddress,1,31) to faddress
  107.     endif
  108.     @ curline,42 say trim(faddress)+' '+zip
  109.     Store curline+1 to curline
  110.     @ curline,0 say str(#,4)+' '+$(membstatus,3,2)
  111.     If oth1 <> ' '
  112.       If $(other,1,1)<>' '
  113.         Store 1 to curothr
  114.         Store other to othera
  115.         STORE ' ' TO OTHNAM1
  116.         Select secondary
  117.         Do while curothr < 4
  118.           Store $(othera,curothr*8-7,3) to otherx
  119.           If otherx='   '
  120.             Store 4 to curothr
  121.           else
  122.             If otherx = oth1
  123.               Store otherx+$(othera,curothr*8-4,4) to othfind
  124.               Find &othfind
  125.               If # <> 0
  126.                 Store $(spact,9,20) to othnam1
  127.               endif
  128.             endif
  129.             Store curothr+1 to curothr
  130.           endif
  131.         enddo
  132.         Select primary
  133.         IF OTHNAM1<>' '
  134.           @ curline,8 say othheadr+othnam1
  135.         ENDIF
  136.       endif
  137.     else
  138.      @ curline,8 say othheadr+&othnam1
  139.     endif
  140.     @ curline,37 say 'DATES:'+$(dates,1,9)
  141.     @ curline,54 say 'BA:'+$(spec:dates,1,8)+' '+$(comments,1,14)
  142.     SKIP
  143.     Store curline+2 to curline
  144.   endif
  145.   Store F to BEGINNG
  146.   Do while .not. EOF .and. (* .or. &BNAME)
  147.     SKIP
  148.   enddo
  149.   If EOF .or. &ANAME<>ANAME1
  150.     Store F to mornames
  151.   endif
  152. ENDDO
  153. If curline=99
  154.   @ 5,10 say 'No people found.'
  155. endif
  156. EJECT
  157. Release fcolhdr,fcolumn,actvname,curline,pagenum,beginng,mornames,fname,N
  158. Release oth1,othf2,othheadr,xaddress
  159. Set format to screen
  160. RETURN
  161. e to be printed in OTH field when not blank and matched
  162. *   MSEL - Selected report type: From SSSC or SP:ACTIVTY; with switint it  as  the 
  163.          header  plus print the sub-name from the code in  the  individual's 
  164.          OTHER  field,  when  he/she  has this  OTHER  category  name.   For 
  165.          example,  entering  "1/SCH"  causes  the "SCHool" header  plus  the 
  166.          particular school name to be printed in this alternate field of the 
  167.          report,  but only when each individual has a "SCH=---" specified in 
  168.          his/her OTHER field.
  169.          An additional characteristic is:  the backward slash (\) en