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

  1. * Program CSEUPDAT - Allows an operator to change/add to the MEMBERS file
  2. STORE DATE() TO INDATE
  3. Set deleted on
  4. Select secondary
  5. Store 'ROOM=' to infield
  6.  ? '  ',ename,'-  LODGING names               '+curdate
  7.  Find &INFIELD
  8.  Store ' ' to romvalid
  9.  If #=0
  10.  ? 'No Lodgings found. '
  11.  else
  12.  Set raw on
  13.  Do while spact=infield
  14.   Store romvalid+$(spact,5,4) to romvalid
  15.   Store $(spact,1,9) to innf
  16.   ? '[',$(spact,6,3),']  ',$(spact,9,30)
  17.   Do while spact=innf.or.$(spact,9,1)='.'
  18.     SKIP
  19.   enddo
  20.  enddo
  21.  Store 'Y' to xsel
  22.  ? '   VALID LODGING CODES: ',romvalid
  23.  ?
  24.  endif
  25. Store 'TRAN=' to infield
  26. ? '  ',ename,' TRANSPORTATION names        '+curdate
  27.  Find &INFIELD
  28.  Store ' ' to tranvalid
  29.  If #=0
  30.  ? 'No Transportation codes found. '
  31.  else
  32.  Set raw on
  33.  Do while spact=infield.and. .not. EOF
  34.   Store tranvalid+$(spact,5,6) to tranvalid
  35.   Store $(spact,1,11) to innf
  36.   ? '[',$(spact,6,5),']  ',$(spact,11,28)
  37.   Do while (spact=innf.or.$(spact,11,1)='.').and. .not.EOF
  38.     SKIP
  39.   enddo
  40.  enddo
  41.  Store 'Y' to xsel
  42.  ? '   VALID TRANSPORTATION CODES: ',tranvalid
  43.  endif
  44. Accept 'Press <retn> to continue ' to xx
  45. Select primary
  46. Store F to ADDEDREC
  47. Store T to CONTINU
  48. STORE '       ' TO ESELECT
  49. DO WHILE CONTINU
  50.   ERASE
  51.   @ 1,1 say ename
  52.   @ 1,63 say curdate
  53.   @ 2,1 say 'DATA DISK = '+D
  54.   @ 4,20 say 'Special Event Attender Update Process        1-/CSEUPDAT/'
  55.   @ 7,12 say 'M)  Merge new names from MEMBERS marked "SPECIAL"'
  56.  @ 8,12 say 'A)  Add a new Attender                                 /CSEADD  /'
  57.   @ 9,12 say "C)  Change an Attender's information"
  58.   @ 10,12 say "D)  Delete an Attender"
  59.   @ 11,12 say 'Q)  QUIT'
  60.  ?
  61. Accept '                 Enter selection ' to ESEL
  62. ?
  63.   Store T to INVALCC
  64.   Do while INVALCC
  65.     Store F to invalcc
  66.     Do CASE
  67.     CASE !(ESEL) = 'A'
  68.       DO CSEADD.CMD
  69.       Store T to ADDEDREC
  70.     CASE !(esel)='M'
  71. ? 'This routine uses the MEMBERS file which must be present on the data disk.'
  72.       Accept 'OK? ' to xx
  73.       Store d+':MEMBERS' to NFILE
  74.       If !(xx)='Y'
  75.       If .not. file(NFILE)
  76.   Accept 'The MEMBERS file is not present on the data disk. Press <retn>' to XX
  77.       else
  78.        ? '    Now reading the MEMBERS file for members marked "Special"'
  79.        Select secondary
  80.        Use &NFILE
  81.        Store 0 to reccc
  82.        Do while .not. EOF
  83.         Store 0 to rec
  84.         Store 0 to recc
  85.         Store '   ' to recnumbs
  86.         Do while rec<60 .and..not. EOF
  87.           If $(membstatus,9,1)='x'
  88.             Store rec+1 to rec
  89.             Select primary
  90.             Append blank
  91.             Replace last:name with S.last:name
  92.             Replace first:name with S.first:name
  93.             Replace address with S.address
  94.             Replace city:state with S.city:state
  95.             Replace zip with S.zip
  96.             Replace ss:sc:memb with S.ss:sc:memb
  97.             Replace membstatus with S.membstatus
  98.             Replace comments with S.comments
  99.             Replace birthdate with S.birthdate
  100.             Replace home:phone with S.home:phone
  101.             Replace dates with s.dates
  102.             Replace amount with ECOST
  103.             Store reccc+1 to reccc
  104.             Store recnumbs+str(#,4) to recnumbs
  105.             Select secondary
  106.          ? str(#,4),' ',$(last:name,1,12),$(first:name,1,11),home:phone,address
  107.          ?? membstatus
  108.             Replace membstatus with $(membstatus,1,8)+'y'
  109.           endif
  110.           SKIP
  111.          enddo
  112.           If rec>0
  113.             Store str(#,4) to lrec
  114.             Use EDIRFILE index EDIRFILE
  115.             Store recc+rec to recc
  116.             Store rec to recx
  117. ? recc,' RECORDS TRANSFERED FROM MEMBERS. Now processing them (the last 60).'
  118.             Store 0 to rec
  119.             Do while rec<recx
  120.               Store rec+1 to rec
  121.               Select primary
  122.               Store $(recnumbs,rec*4,4) to reci
  123.               GOTO &reci
  124.   ? 'Now editing record for: ',last:name,first:name
  125.   ?
  126.   ?
  127.   ?
  128.     @ 21,0 say 'Enter SESSIONS   ' get SESSIONS
  129.     @ 22,0 say 'Enter EQUIPMENT  ' get EQUIPMENT
  130.     READ
  131.     Set intensity off
  132.  ?
  133.  If romvalid<>' '
  134.  Store F to goodlodg
  135.  Do while .not. goodlodg
  136.  Do while .not. goodlodg
  137.   ? '    VALID LODGINGS: ',romvalid
  138.   ? 'Lodging code format: LLL RRRR  - LLL=Building,  RRRR=Room/Bed'
  139.   Accept '   Select a Lodging code (3,4 characters) ' to inlodg
  140.   Store inlodg+'        ' to inlodg
  141.   Store $(inlodg,1,3) to inlodgx
  142.   Store $(inlodg,5,5) to inlodgy
  143.   ? 'BUILDING: ',inlodgx,'      ROOM/BED: ',inlodgy
  144.   Store '='+inlodgx to innlodge
  145.   Store T to goodlodg
  146.   If !(inlodg)='Q     '.or.inlodg='         '
  147.     Store '         ' to inlodg
  148.     Store '________' to xx
  149.   else
  150.    If @(innlodge,romvalid)=0
  151.     ? 'Lodging code is not found. Enter another.'
  152.     Store F to goodlodg
  153.    endif
  154.   endif
  155.  enddo
  156.  If inlodg<>'         '
  157.   Select secondary
  158.   Store 'ROOM='+$(inlodg,1,9) to xx
  159.   Find &xx
  160.   If #=0
  161.     Append blank
  162.     Replace spact with xx+$(P.last:name,1,11)+' '+$(P.first:name,1,10)
  163.     Select primary
  164.     Replace room with inlodg
  165.   else
  166.     If $(spact,15,22)='                      '
  167.       Replace spact with xx+$(P.last:name,1,11)+' '+$(P.first:name,1,10)
  168.       Select primary
  169.       Replace room with inlodg
  170.     else
  171.     ? 'This Lodging is already assigned. Enter another.'
  172.     Store F to goodlodg
  173.     endif
  174.   endif
  175.  endif
  176.  enddo
  177.  ? 'Now assigned: ',xx,'  ',P.last:name,P.first:name
  178.  ?
  179.  endif
  180.  If tranvalid<>' '
  181.  Store F to goodlodg
  182.  Do while .not. goodlodg
  183.   ? 'VALID TRANSPORTATION CODES: ',tranvalid
  184.   Accept '      Select a Transportation code (5 characters) ' to inlodg
  185.   STORE INLODG+'    ' to inlodg
  186.   Store $(inlodg,1,5) to inlodg
  187.   Store '='+inlodg to innlodge
  188.   Store T to goodlodg
  189.   If !(inlodg)='Q    '.or.inlodg='     '
  190.     Store '     ' to inlodg
  191.   else
  192.    If @(innlodge,tranvalid)=0
  193.     ? 'Transportation code is not found. Enter another '
  194.     Store F to goodlodg
  195.    endif
  196.   endif
  197.  enddo
  198.  If !(inlodg)<>'     '
  199.    Select primary
  200.    Store $(last:name,1,11)+' '+$(first:name,1,10) to nfind
  201.    Replace transpor with inlodg
  202.    Select secondary
  203.    Append blank
  204.    Replace spact with 'TRAN='+inlodg+' '+nfind
  205.    ? 'Now assigned:  ',spact
  206.  else
  207.    ? 'Now assigned:  TRAN=_____'
  208.  endif
  209.  ?
  210.  endif
  211.             enddo
  212.             Use &NFILE
  213.             GOTO &lrec
  214.           endif
  215.        enddo
  216.        ? RECCC,' TOTAL RECORDS APPENDED TO MEMBERSE.'
  217.        ?
  218.        Accept 'File update is complete. Press <return> to continue ' to xx
  219.       endif
  220.       endif
  221.     CASE !(ESEL) = 'C' .or. !(ESEL) = 'D'
  222.       Store F to CSEEDIT
  223.       If len(ESEL) > 1
  224.         Select primary
  225.         Store len(esel) to n
  226.         Store val($(esel,2,n-1)) to nn
  227.         If NN > 0
  228.          Store str(NN,5) to xx
  229.          GOTO &XX
  230.          If !(esel)='D'
  231.            ? 'The following name is to be deleted: ',last:name,first:name
  232.            Accept 'OK? ' to xx
  233.            If !(xx)='Y'
  234.              ? 'DELETED -',last:name,first:name
  235.              DELETE
  236.            else
  237.              ? 'No delete is made.'
  238.            endif
  239.          else
  240.            Store T to CSEEDIT
  241.          endif
  242.         else
  243.           Accept 'Invalid record number. Press <retn> ' to xx
  244.         endif
  245.       else
  246.         Store '   Editing' to deled
  247.         Do CSECHECK.CMD
  248.         If found
  249.           Store T to CSEEDIT
  250.         endif
  251.       endif
  252.       If CSEEDIT
  253.          Store 0.00 to pd1
  254.          Store 0.00 to pd2
  255.          Store pd1+val($(paid1,1,9)) to pd1
  256.          Store pd2+val($(paid2,1,9)) to pd2
  257.          ERASE
  258.   Set intensity on
  259.   Store STR(#,5) to RECSTR
  260.   @ 2,10 say 'CSEVENT   -   Editing record number '+RECSTR
  261.   @ 5,1  say 'LAST NAME  '  GET LAST:NAME
  262.   @ 5,40 SAY 'FIRST NAME '  GET FIRST:NAME
  263.   @ 6,40 say 'HOME PHONE '  get home:phone
  264.   @ 6,1  SAY 'ADDRESS    '  GET ADDRESS
  265.   @ 7,1  SAY 'CITY,STATE '  GET CITY:STATE
  266.   @ 7,40 SAY 'ZIP CODE   '  GET ZIP
  267.   @  8,1  SAY 'BIRTHDATE  ' GET BIRTHDATE PICTURE 'XX/XX/XX-XXX'
  268.   @  8,40 SAY 'MEMBSTATUS ' GET MEMBSTATUS
  269.   @  9,1  SAY 'SS/SC MEMB ' GET SS:SC:MEMB
  270.   @  9,40 SAY 'COMMENTS   ' get COMMENTS
  271.   @ 11,1 say 'LODGING  = '+ROOM
  272.   @ 12,1 say 'TRANSPORTATION  = '+transpor
  273.   @ 10,40 say 'AMOUNT   $' get amount
  274.   @ 11,40 say 'PAID-1   $' get pd1
  275.   @ 11,66 say $(paid1,11,8)
  276.   @ 12,40 say 'PAID-2   $' get pd2
  277.   @ 12,66 say $(paid2,11,8)
  278.   @ 14,1 say 'EQUIPMENT' get EQUIPMENT
  279.   @ 15,1 say 'SESSIONS ' GET SESSIONS
  280.   @ 17,10 say 'Press <ctrl-W> when editing is complete.'
  281.   ?
  282.   READ
  283.   If val($(paid1,1,9))<>pd1
  284.     Replace paid1 with str(pd1,9,2)+' '+indate
  285.   endif
  286.   If val($(paid2,1,9))<>pd2
  287.     Replace paid2 with str(pd2,9,2)+' '+indate
  288.   endif
  289.   Set intensity off
  290.       endif
  291.       Store F to invalcc
  292.     CASE !(ESEL) = 'Q'
  293.       Store F to CONTINU
  294.     OTHERWISE
  295.       Accept 'Illegal entry.  Please enter again ' to ESEL
  296.       Store T to invalcc
  297.     ENDCASE
  298.     enddo
  299.  ENDDO
  300. RETURN
  301.           N
  302.           HERWISE
  303.       Accept 'Illegal entry.  Please enter again ' to ESEL
  304.       Store T to invalcc
  305.     ENDCASE
  306.     enddo
  307.  ENDDO
  308. RETURN
  309.           DO
  310. RETURN
  311.           umber '+RECSTR
  312.   @ 5,1