home *** CD-ROM | disk | FTP | other *** search
/ Columbia Kermit / kermit.zip / ibm370 / iktutl.asm < prev    next >
Assembly Source File  |  2020-01-01  |  201KB  |  2,483 lines

  1. *COPY                                                 IKTUTL            05000000
  2.          CHECKVER IKTUTL,4.3                                   @SC90072 05000500
  3.          TITLE 'CWDSET/DSPACE Routines - set/show working directory'    05001000
  4. * Set new 'working directory', i.e., DSN prefix                         05001500
  5. * Entry: SCANPTR string has option                                      05002000
  6. * Exit: R15=0 if ok, R15=1 if error or help needed. ERRNUM unchanged.   05002500
  7. CWDSET   ENTER                                                 @SC86164 05003000
  8.          SR    5,5                                             @SC86299 05003500
  9.          MVI   IFILE+44,C' '                                   @SC86299 05004000
  10.          NTOKN N=CWDLEN,H=CWDERR                               @SC86299 05004500
  11.          LA    1,0(7,6)      End of string                     @SC86299 05005000
  12.          BCTR  1,0                                             @SC86299 05005500
  13.          CLC   =C'()',0(1)   Prefix is PDS name?               @SC86299 05006000
  14.          BNE   CWDTL         No                                @SC86299 05006500
  15.          S     7,F2          Yes, remove null member name      @SC86299 05007000
  16.          BM    CWDERR                                          @SC86299 05007500
  17.          MVI   IFILE+44,C'.' Indicate PDS wanted               @SC86299 05008000
  18. CWDTL    LA    7,1(7)        Token length                      @SC86299 05008500
  19.          CH    7,LA44+2      Suitable?                         @SC86299 05009000
  20.          BH    CWDERR        Too long                          @SC86299 05009500
  21.          LR    5,7                                             @SC86299 05010000
  22.          ICM   7,8,BLANK                                       @SC86299 05010500
  23.          LA    0,IFILE                                         @SC86299 05011000
  24. LA44     LA    1,44          Length of DSN alone               @SC86299 05011500
  25.          MVCL  0,6           Copy to filename buffer           @SC86299 05012000
  26.          TR    IFILE,UPCASE  And upcase it                     @SC87034 05012500
  27.        NXTFSET IFILE,CWD,E=CWDERR                              @SC86295 05013000
  28. CWDLEN   MVC   DEST(45),IFILE Save new prefix                  @SC86299 05013500
  29.          STH   5,DESTL                                         @SC86299 05014000
  30.          B     RTRN0                                           @SC86295 05014500
  31. CWDERR   PTEXT '&CWDERRM'                                      @SC86299 05015000
  32.          B     SUBERR                                          @SC86295 05015500
  33. *                                                                       05016000
  34. *        DSPACE Routine - display available disk space         @SC86164 05016500
  35. *                                                                       05017000
  36. * Show space available in 'working directory' or other area             05017500
  37. * Entry: SCANPTR string has option (none => working directory)          05018000
  38. * Exit: R15=0 if ok, R15=1 if error or help needed. ERRNUM unchanged    05018500
  39. DSPACE   ENTER ALT                                             @SC86164 05019000
  40. * * * * * * * * * * * * * * * * * * * * * *                             05019500
  41.          PTEXT '&SPACERR'                                      @SC86299 05020000
  42.          B     SUBERR                                          @SC86299 05020500
  43. * * * * * * * * * * * * * * * * * * * * * *                             05021000
  44.          B     RTRN0                                           @SC86295 05021500
  45.          LOCALS ,                                              @SC86295 05022000
  46.          EXIT  ,                                               @SC86295 05022500
  47.          TITLE 'FSPEC Routine - extract filespec from scan string'      05023000
  48. *                                                                       05023500
  49. * Entry: R1->name field, R0=flags selecting operation (see below)       05024000
  50. *        For parse operations, SCANPTR defines the input string.        05024500
  51. *        For getting foreign or display filespec, R7->output buffer     05025000
  52. * Exit: if not FFNEW, then R15=0 if ok, 1 if ?, 2 if bad.               05025500
  53. *        For R15=1 or 2 R3,R4 give message.  ERRNUM may be leftover.    05026000
  54. *                                                                       05026500
  55. *                                 Flags:                  Notes:        05027000
  56. *   Tasks:               FFRCF FFSND FFGET FFNEW                        05027500
  57. * Parse RECV               X                     set ROVR properly      05028000
  58. * Parse SEND 1st                 X                                      05028500
  59. * Parse SEND 2nd           X     X                                      05029000
  60. * Parse GET 1st                        X                                05029500
  61. * Parse GET 2nd            X           X         set ROVR properly      05030000
  62. * Parse F-packet   (FFHDR) X     X     X                                05030500
  63. * Parse for Generic(FFUTL)       X     X         FFWLD: allow partial   05031000
  64. * Parse TAKE                                                            05031500
  65. *                                                                       05032000
  66. * Get unique name                            X     R15: 0=>ok, 1=>bad   05032500
  67. * Interactive name check               X     X     R15: 0=>ok, 1=>bad   05033000
  68. * Get foreign name (FFENC) X                 X     R15->end of string   05033500
  69. * Get display form (FFDSP)       X           X     R15->end of string   05034000
  70. *                                                                       05034500
  71. FSPEC    ENTER                                                 @SC86295 05035000
  72.          STC   0,FSPFLG                                        @SC86295 05035500
  73.          LR    5,0                                             @SC88049 05036000
  74.          SRL   5,4           Convert flags to index            @SC88049 05036500
  75.          LR    0,1           Copy ptr to filespec              @SC86295 05037000
  76.          TM    FSPFLG,FFNEW                                    @SC86295 05037500
  77.          BO    FSPWRN                                          @SC86295 05038000
  78.          LR    8,1           Save ptr to DSN field             @SC86299 05038500
  79.          XC    0(52,8),0(8)  Clear DSN field                   @SC86299 05039000
  80.          MVC   52(8,8),=CL8' ' Clear password                  @SC88342 05039500
  81.          PTEXT '&BADFSPC'                                      @SC86299 05040000
  82.          MVI   ERRNUM,ERRFNE Assume bad file name              @SC86158 05040500
  83.          IC    5,FSP0(5)     Get dispatch adr                  @SC88049 05041000
  84.          B     FSP0(5)       Go to proper handler              @SC88049 05041500
  85. *               TAKE        GET 1st    SEND 1st    Generic     @SC88049 05042000
  86. FSP0    DC AL1(FSPCPY-FSP0,FSPSN2-FSP0,FSPASC-FSP0,FSPUTL-FSP0) SC88049 05042500
  87. *               RECEIVE     GET 2nd    SEND 2nd    F-packet    @SC88049 05043000
  88.         DC AL1(FSPRC-FSP0,FSPRC-FSP0,FSPSN2-FSP0,FSPHD-FSP0)   @SC88049 05043500
  89. FSPUTL   TM    FSPFLG,FFWLD  Utility: default to all files?    @SC88049 05044000
  90.          BZ    FSPASC        No                                @SC86295 05044500
  91.          LA    1,LFID                                          @SC88043 05045000
  92.          LA    14,DEST       Default to prefix                 @SC88043 05045500
  93.          LH    15,DESTL                                        @SC88043 05046000
  94.          BAL   2,FSPBPAD     Copy with blank fill              @SC88070 05046500
  95.          LR    0,8           Restore ptr to name field         @SC88043 05047000
  96. FSPASC   TM    FL2,SRV       Server mode?                      @SC86295 05047500
  97.          BZ    FSPCPY        No, don't need to convert         @SC86295 05048000
  98.          ICM   15,15,LEN     Get length                        @SC86295 05048500
  99.          BZ    FSPCPY                                          @SC86295 05049000
  100.          BCTR  15,0          Correct for EX                    @SC86158 05049500
  101.          L     5,ADR         Get string ptr                    @SC89215 05050000
  102.          EX    15,FSPTRAE    Change to EBCDIC                  @SC89215 05050500
  103.          EX    15,FSPTRUP    Upcase and dot to space           @SC89215 05051000
  104.          B     FSPCPY                                          @SC86295 05051500
  105. FSPTRAE  TR    0(,5),ATOED                                     @SC89301 05052000
  106. FSPTRUP  TR    0(,5),UPCASE                                    @SC89215 05052500
  107. FSPRC    NI    FL1,255-ROVR  Setup for RECEIVE                 @SC86295 05053000
  108.          NI    FL4,255-NMOK-NMCHNG  Collision not checked yet  @SC90033 05053500
  109.          MVI   0(1),C'$'     Allow missing DSN                 @SC86299 05054000
  110.          B     FSPCPY                                          @SC86295 05054500
  111. FSPHD    MVI   0(1),1        Use default if missing DSN        @SC86299 05055000
  112.          B     FSPCPY                                          @SC86299 05055500
  113. FSPSN2   CLI   BRK,C','                                        @SC88306 05056000
  114.          BE    RTRN0         No foreign name: multiple format  @SC88306 05056500
  115.          NTOKN H=FSP2H,N=RTRN0                                 @SC88306 05057000
  116.          LA    7,1(,7)       Get token length                  @SC89179 05057500
  117.          LA    1,L'JFNAM                                       @SC86295 05058000
  118.          CR    7,1           Does it fit?                      @SC89179 05058500
  119.          BNH   *+6           Yes                               @SC86224 05059000
  120.          LR    7,1           Use what we can                   @SC86224 05059500
  121.          LR    3,0                                             @SC86295 05060000
  122.          STC   7,0(3)        Save length                       @SC86224 05060500
  123.          LA    0,1(3)                                          @SC86295 05061000
  124.          MVCL  0,6           Get fn, at least                  @SC86224 05061500
  125.          B     RTRN0                                           @SC86295 05062000
  126. *                                                                       05062500
  127. FSPSLSH  TRT   0(,6),FSPTRSL Find slash, if any                @SC88342 05063000
  128. FSPPSMV  MVC   52(,8),1(1)   Copy password into field          @SC88342 05063500
  129. *                                                                       05064000
  130. FSPCPY   NTOKN H=FSPH,N=FSPZ                                   @SC86299 05064500
  131. FSPCP2   MVC   FSPCH1,0(6)   Save 1st char                     @SC88043 05065000
  132.          MVI   TRTBL+C'.',1  Set to intercept these            @SC88043 05065500
  133.          MVI   TRTBL+C'(',2                                    @SC86299 05066000
  134.          KCALL FOPSTR,LFID(,8),E=FSPINV                        @SC89218 05066500
  135.          LR    2,7           Save length-1                     @SC88342 05067000
  136.          LA    15,44         Length of DSN proper              @SC86299 05067500
  137.          AR    7,6           Last char of string               @SC86299 05068000
  138.          LR    1,7                                             @SC88342 05068500
  139.          EX    2,FSPSLSH     Look for '/'                      @SC88342 05069000
  140.          BZ    FSPPSZ        No password                       @SC88342 05069500
  141.          SR    7,1           Get length                        @SC88342 05070000
  142.          BNP   FSPPSY        None after all                    @SC88342 05070500
  143.          CH    7,*+10        Check against maximum             @SC88342 05071000
  144.          BNH   *+8           Ok                                @SC88342 05071500
  145.          LA    7,8           Max length                        @SC88342 05072000
  146.          BCTR  7,0           Prepare for MVC                   @SC88342 05072500
  147.          EX    7,FSPPSMV     Move password to output field     @SC88342 05073000
  148. FSPPSY   LR    7,1           Remove password from string       @SC88342 05073500
  149.          BCTR  7,0           Remove '/' too                    @SC88342 05074000
  150. FSPPSZ   DS    0H                                              @SC88342 05074500
  151.          CLI   0(6),C''''    Full name?                        @SC86299 05075000
  152.          BNE   FSPPRE        No, add prefix                    @SC86299 05075500
  153.          LA    6,1(6)        Yes, skip over quote              @SC86299 05076000
  154.          CLI   0(7),C''''    Must have close quote as well     @SC86299 05076500
  155.          BNE   *+6                                             @SC86299 05077000
  156.          BCTR  7,0           Back up over it                   @SC86299 05077500
  157.          BE    *+8                                             @SC86299 05078000
  158.          BAL   9,FSPTU       Missing: quit if user typed this  @SC86299 05078500
  159.          B     FSPPREZ                                         @SC86299 05079000
  160. FSPPRE   CLI   0(7),C''''    Better not be trailing quote      @SC86299 05079500
  161.          BNE   *+10          Ok                                @SC86299 05080000
  162.           BAL  9,FSPTU       Error                             @SC86299 05080500
  163.           BCTR 7,0           Didn't quit, so patch it up       @SC86299 05081000
  164.          LH    1,DESTL       Length of prefix                  @SC86299 05081500
  165.          LTR   1,1           Any?                              @SC86299 05082000
  166.          BZ    FSPPREZ       No                                @SC86299 05082500
  167.          LA    14,DEST       Ptr to prefix string              @SC86299 05083000
  168.          MVCL  0,14          Copy prefix to name field         @SC86299 05083500
  169.          CLI   DESTP,C'.'    PDS?                              @SC86299 05084000
  170.          BNE   FSPDOT        No, join with a dot               @SC88070 05084500
  171.          BAL   2,FSPBFIL     Yes, prefix is entire DSN         @SC88070 05085000
  172.          TM    FSPFLG,FFHDR  Reading from header packet?       @SC88070 05085500
  173.          BNO   FSPCPP        No, user must have entered it     @SC88070 05086000
  174.          BAL   9,FSPFDOT     Ok, find file type, if any        @SC88070 05086500
  175.          LR    7,1           And skip it                       @SC88070 05087000
  176.          B     FSPCPG                                          @SC88070 05087500
  177. FSPDOT   LA    14,LOCASE+C'.'                                  @SC86299 05088000
  178.          LA    1,1                                             @SC86299 05088500
  179.          MVCL  0,14          Append a dot                      @SC86299 05089000
  180. FSPPREZ  BAL   2,FSPANAT     Add '#' if numeric char next      @SC86299 05089500
  181. FSPCPA   BAL   9,FSPFDOT     Find a break (dot or end)         @SC88070 05090000
  182.          SR    1,6           Length of token                   @SC86299 05090500
  183.          BP    *+8                                             @SC86299 05091000
  184.           BAL  9,FSPTU       Null token                        @SC86299 05091500
  185.          LR    14,6          Save start of token               @SC86299 05092000
  186.          AR    6,1           Ptr to break                      @SC86299 05092500
  187.          CR    1,5           Max allowed for this token        @SC86299 05093000
  188.          BNH   *+10          Ok                                @SC86299 05093500
  189.           BAL  9,FSPTU       Too long                          @SC86299 05094000
  190.           LR   1,5           Use max                           @SC86299 05094500
  191.          CR    1,15          Room left in name field?          @SC86299 05095000
  192.          BNH   FSPCPC        Ok                                @SC86299 05095500
  193.          BAL   9,FSPTU       Overfilled                        @SC86299 05096000
  194.          MVI   TRTBL+C'.',0  Keep going, but ignore further tok@SC86299 05096500
  195.          LR    1,15                                            @SC86299 05097000
  196. FSPCPC   MVCL  0,14          Copy token                        @SC86299 05097500
  197.          BCT   2,FSPCPF      Go if reached end of name         @SC86299 05098000
  198.          LA    6,1(6)        Skip over dot                     @SC86299 05098500
  199.          CR    6,7           Was dot the last char?            @SC86299 05099000
  200.          BH    FSPCPE        Yes, oops                         @SC86299 05099500
  201.          C     15,F1         Room for another token?           @SC86299 05100000
  202.          BH    FSPDOT        Ok, keep going                    @SC86299 05100500
  203.          SR    5,5           No, suppress further tokens       @SC86299 05101000
  204.          BAL   9,FSPTU       Quit if user typed it             @SC86299 05101500
  205.          B     FSPCPA        Keep going                        @SC86299 05102000
  206. FSPTRT   TRT   0(,6),TRTBL   Find end of token                 @SC86299 05102500
  207. FSPCPE   BAL   9,FSPTU       Quit if user type it              @SC86299 05103000
  208. FSPCPF   CR    6,7                                             @SC92147 05103500
  209.          BNL   FSNOTGDG      End of name, definitely not GDG   @SC92147 05104000
  210.          CH    15,=H'9'      Room for last GDG index?          @SC92147 05104500
  211.          BL    FSNOTGDG      No, definitely not GDG            @SC92147 05105000
  212.          CLI   1(6),C'+'                                       @GA92147 05105500
  213.          BE    FSCPGDG                                         @GA92147 05106000
  214.          CLI   1(6),C'-'                                       @GA92147 05106500
  215.          BE    FSCPGDG                                         @GA92147 05107000
  216.          CLI   1(6),C'0'                                       @GA92147 05107500
  217.          BNE   FSNOTGDG                                        @GA92147 05108000
  218. FSCPGDG  SR    7,6           Get source length in R7           @GA92147 05108500
  219.          LA    7,1(,7)       Bump length by 1                  @GA92147 05109000
  220.          ICM   7,8,BLANK     For padding                       @GA92147 05109500
  221.          LR    1,15          Dest length remaining             @GA92147 05110000
  222.          MVCL  0,6           Move GDG 'member'                 @GA92147 05110500
  223.          CLM   7,7,F0        Any overflow?                     @SC92147 05111000
  224.          BE    *+12          No, continue                      @SC92147 05111500
  225.           BAL  9,FSPTU       Error                             @SC92147 05112000
  226.           MVI  43(8),C')'    Try to repair it, if possible     @SC92147 05112500
  227.          LR    7,6           Reset "end" ptr                   @SC92147 05113000
  228.          LA    5,FSPTBGDG    Use table for GDG names           @SC92147 05113500
  229.          B     FSPCPG        Go fill member field with blanks  @SC92147 05114000
  230. FSNOTGDG BAL   2,FSPBFIL     Fill the rest with blanks         @GA92147 05114500
  231.          LA    5,FSPTAB      Use table for normal DSNAMEs      @SC92147 05115000
  232.          BCTR  6,0           Back up to last char of DSN       @SC86299 05115500
  233.          CR    6,7                                             @SC86299 05116000
  234.          BE    FSPCPG        No member name                    @SC86299 05116500
  235.          LA    6,2(6)        Ptr to member name                @SC86299 05117000
  236.          CLI   0(7),C')'     Must be matching paren            @SC86299 05117500
  237.          BE    FSPCPG        Ok                                @SC86299 05118000
  238.          BAL   9,FSPTU       Oops                              @SC86299 05118500
  239. FSPCPP   LA    7,1(7)        Pretend it's there                @SC86299 05119000
  240. FSPCPG   SR    7,6           Length of member name             @SC86299 05119500
  241.          LA    15,8          Length of member name, if any     @SC88070 05120000
  242.          BZ    FSPCPM        None, forget it                   @SC86299 05120500
  243.          ST    5,FSPDSN      Save table ptr                    @SC92147 05121000
  244.          BAL   2,FSPANAT     '#' if numeric char next          @SC86299 05121500
  245.          L     5,FSPDSN      Restore                           @SC92147 05122000
  246. FSPCPM   LR    14,0                                            @SC86299 05122500
  247.          ICM   7,8,BLANK                                       @SC86299 05123000
  248.          MVCL  14,6          Copy member name                  @SC86299 05123500
  249.          CLM   7,7,F0        Did it fit?                       @SC86299 05124000
  250.          BE    *+8                                             @SC86299 05124500
  251.           BAL  9,FSPTU       Oops                              @SC86299 05125000
  252.          MVC   FSPDSN,0(8)   Save raw name                     @SC86299 05125500
  253.          TR    FSPDSN,UPCASE Upcase it                         @SC87034 05126000
  254.          TR    0(52,8),0(5)  Convert to valid chars, if nec.   @SC92147 05126500
  255.          TR    44(8,8),FSPMTAB Stricter limits on member name  @SC86299 05127000
  256.          TR    52(8,8),UPCASE Upcase password, if any          @SC88342 05127500
  257.          CLI   FSPFLG,FFUTL  DELETE?                           @SC88096 05128000
  258.          BE    FSPTCNV       Yes, allow '*'                    @SC88096 05128500
  259.          CLI   FSPFLG,FFSND  Send request?                     @SC88096 05129000
  260.          BE    FSPTCNV       Yes, allow '*'                    @SC88096 05129500
  261.          TR    0(52,8),FSPSTAB  Convert asterisk to pound sign @SC88096 05130000
  262. FSPTCNV  DS    0H                                              @SC88096 05130500
  263.          CLC   FSPDSN,0(8)   Any conversions?                  @SC86299 05131000
  264.          BE    *+8           No, ok                            @SC86299 05131500
  265.           BAL  9,FSPTU       Yes, quit if user typed it        @SC86299 05132000
  266.          OI    FL1,ROVR      Found a name                      @SC86299 05132500
  267.          MVI   TRTBL+C'.',0  Restore table                     @SC86299 05133000
  268.          MVI   TRTBL+C'(',0                                    @SC86299 05133500
  269.          TM    FSPFLG,FFHDR  Parse for TAKE?                   @SC88043 05134000
  270.          BNZ   RTRN0         No, fine                          @SC88043 05134500
  271.          CLI   FSPCH1,C''''  Fully qualified?                  @SC88043 05135000
  272.          BE    RTRN0         Yes, honor it                     @SC88043 05135500
  273.          LA    1,44(8)       No, find end of name              @SC88043 05136000
  274.          LR    14,1                                            @SC88043 05136500
  275.          TRT   0(44,8),TRTBL Get ptr to end+1 in R1            @SC88043 05137000
  276.          SR    14,1          Length remaining                  @SC88043 05137500
  277.          CH    14,=H'5'                                        @SC88043 05138000
  278.          BL    RTRN0         Too short anyway                  @SC88043 05138500
  279.          S     1,F8                                            @SC88043 05139000
  280.          CLC   0(8,1),DKERMINI Is it .KERMINI?                 @SC88113 05139500
  281.          BE    RTRN0         Yes, that's ok                    @SC88043 05140000
  282.          CLC   =C'.TAKE',3(1) Or is is .TAKE?                  @SC88043 05140500
  283.          BE    RTRN0         That's ok too                     @SC88043 05141000
  284.          MVC   8(5,1),=C'.TAKE' No, use default type           @SC88043 05141500
  285.          B     RTRN0                                           @SC87034 05142000
  286. *                                                                       05142500
  287. FSPZ     LA    6,=C'$.$'     In case we must use default       @SC87338 05143000
  288.          LA    7,3-1                                           @SC87338 05143500
  289.          CLI   0(8),1                                          @SC86299 05144000
  290.          BE    FSPCP2        Get default DSN 'prefix.$.$'      @SC87338 05144500
  291.          BH    RTRN0         Don't insist                      @SC86299 05145000
  292.          PTEXT '&NOFSPEC'                                      @SC86299 05145500
  293.          B     FSPINV                                          @SC86299 05146000
  294. FSPTU    TM    FSPFLG,FFHDR                                    @SC86299 05146500
  295.          BOR   9             From other Kermit, accept it      @SC86299 05147000
  296. FSPINV   MVI   TRTBL+C'.',0  Restore table                     @SC86299 05147500
  297.          MVI   TRTBL+C'(',0                                    @SC86299 05148000
  298.          LA    15,2                                            @SC86299 05148500
  299.          B     FSPPTRS                                         @SC86295 05149000
  300. *                                                                       05149500
  301. FSPBFIL  LR    1,15          Length remaining                  @SC88070 05150000
  302.          SR    15,15         Set up just to pad                @SC88070 05150500
  303. FSPBPAD  ICM   15,8,BLANK                                      @SC88070 05151000
  304.          MVCL  0,14          Copy with blank fill              @SC88070 05151500
  305.          BR    2                                               @SC88070 05152000
  306. *                                                                       05152500
  307. FSPFDOT  LA    1,1(7)        End of string                     @SC88070 05153000
  308.          LA    2,2           In case no breaks                 @SC86299 05153500
  309.          SR    7,6                                             @SC86299 05154000
  310.          EX    7,FSPTRT      Find break                        @SC86299 05154500
  311.          AR    7,6           Restore ptr to last char          @SC86299 05155000
  312.          BR    9                                               @SC88070 05155500
  313. *                                                                       05156000
  314. FSPH     PTEXT '&FMTFSPC&FSPCPRM'                              @SC91224 05156500
  315.          CLI   FSPFLG,FFSND  SEND 1st?                         @SC89261 05157000
  316.          BE    *+8           Yes, use whole message            @SC89261 05157500
  317.           SH   4,=H'&FMTOPT' Chop off option part              @SC91224 05158000
  318.          B     FSP0H                                           @SC86295 05158500
  319. FSP2H    PTEXT '&FORFSPC'                                      @SC86295 05159000
  320. FSP0H    LA    15,1                                            @SC86295 05159500
  321. FSPPTRS  RETREG 3,4          Return msg ptrs                   @SC86295 05160000
  322. FSPRET   RET   ,                                               @SC86295 05160500
  323. *                                                                       05161000
  324. * Non-parsing functions . . .                                           05161500
  325. *                                                                       05162000
  326. * Get unique filespec                                                   05162500
  327. FSPWRN   LR    4,1           Save name ptr                     @SC86295 05163000
  328.          TM    FSPFLG,FFENC                                    @SC86295 05163500
  329.          BO    FSPENC        Encode name into buffer           @SC86295 05164000
  330.          TM    FSPFLG,FFDSP                                    @SC86295 05164500
  331.          BO    FSPDSP        Copy name into buffer for display @SC86295 05165000
  332.          TM    FL4,NMOK      Already checked?                  @SC87012 05165500
  333.          BO    RTRN0         Yes, ok                           @SC87012 05166000
  334.          MVC   XFILE,0(4)    Save original name                @SC90033 05166500
  335. * This routine checks to see if the old data set is a PDS.     @TS86001 05167000
  336. * If so, it then allocates and opens the data set and does a   @TS86001 05167500
  337. * FIND to determine if the member is present.                  @TS86001 05168000
  338.          LA    5,10          Allowed retries (0-9)             @SC88125 05168500
  339.          LA    7,C'0'        Extra character                   @BS86001 05169000
  340.          MVC   FSPDSN,0(4)                                     @SC87015 05169500
  341.          BAL   9,FSPTOPN                                       @SC87015 05170000
  342.          USING FDBD,1                                          @SC87015 05170500
  343.          CLI   FSPDSMB,C' '  Member specified?                 @SC87015 05171000
  344.          BE    FSPNOPDS      No, be sure it isn't a PDS        @SC87015 05171500
  345.          TM    FDBFLGS,PDSF  Yes, be sure it is                @SC87015 05172000
  346.          BZ    RTRN1         Too bad                           @SC87015 05172500
  347.          XC    FSPDSMB,FSPDSMB Signal DSORG=PO for allocation  @SC88119 05173000
  348.          OPENF I,FSPDSN,FILFDB,PDSPTR,E=FSPDERM                @SC88049 05173500
  349.          MVC   FSPDSMB,44(4) Copy requested member name        @SC87015 05174000
  350.          LA    1,FSPDSMB+7   Last char of member               @SC87015 05174500
  351.          TRT   FSPDSMB,TRTBL Find blank                        @SC87015 05175000
  352.          LR    6,1           Tentative byte to modify          @SC86299 05175500
  353.          BAL   3,FSPRMPT     Set up rechecking via R3          @SC88125 05176000
  354. FSPTFND  L     1,PDSPTR                                        @SC87015 05176500
  355.          FIND  (1),FSPDSMB,D Search for member name            @SC87015 05177000
  356.          B     *+4(15)       Branch on return code             @TS86001 05177500
  357.          B     0(9)          0  - member was found             @TS86001 05178000
  358.          B     FSPNOKM       4  - member not found             @TS86001 05178500
  359.          B     FSPDERR       8  - I/O error or lack of memory  @TS86001 05179000
  360. FSPTOPN  OPENF T,FSPDSN,E=FSPNOKD No collision                 @SC87015 05179500
  361.          BR    9                                               @SC87015 05180000
  362. FSPNOPDS TM    FDBFLGS,PDSF  Be sure it isn't a PDS            @SC87015 05180500
  363.          BO    FSPDERM       Too bad                           @SC88076 05181000
  364.          LA    3,FSPTOPN     Just test DSN for existence       @SC87015 05181500
  365.          MVI   TRTBL+C'.',1                                    @SC87015 05182000
  366.          TRT   FSPDSN(9),TRTBL Find end of 1st index           @SC87015 05182500
  367.          LR    6,1                                             @SC87015 05183000
  368.          LA    1,8(6)        Last possible end of 2nd          @SC87015 05183500
  369.          TRT   2(7,6),TRTBL                                    @SC87015 05184000
  370.          MVI   TRTBL+C'.',0  Restore TRT                       @SC87015 05184500
  371.          LR    6,1           Byte to modify                    @SC87015 05185000
  372.          BZ    FSPRMPT       Index level was 8 bytes           @SC87015 05185500
  373.          CLI   FSPDSN+43,C' ' Exactly 44 bytes already?        @SC88125 05186000
  374.          BE    *+10          No, there's some room             @SC88125 05186500
  375.           BCTR 6,0           Yes, can't shift name over        @SC88020 05187000
  376.           B    FSPRMPT                                         @SC88020 05187500
  377.          LA    1,FSPDSN                                        @SC87015 05188000
  378.          MVC   1(43,1),0(4)  Shift name over one               @SC87015 05188500
  379.          SR    6,1                                             @SC87015 05189000
  380.          EX    6,FSPMVDS     And copy beginning back           @SC87015 05189500
  381.          AR    6,1                                             @SC87015 05190000
  382. FSPRMPT  OI    FL4,NMCHNG    Yes, remember collision occurred  @SC90033 05190500
  383.          CLI   CLSNFL,C'O'   Old-fashioned WARNING ON?         @SC90033 05191000
  384.          BNE   FSPSTA        No, concoct unique name           @SC90033 05191500
  385.          TM    FSPFLG,FFGET  User typed it?                    @SC87015 05192000
  386.          BO    FSPRMP2       Yes                               @TS86001 05192500
  387. FSPSTA   STC   7,0(6)        Modify DSN                        @SC88125 05193000
  388.          BALR  9,3           See if still a conflict           @SC88125 05193500
  389.          LA    7,1(7)        Bump counter                      @BS86001 05194000
  390.          BCT   5,FSPSTA                                        @BS86001 05194500
  391. FSPDERR  CLOSF PDSPTR        Close the data set                @SC87015 05195000
  392. FSPDERM  PTEXT '&FILCLSN'                                      @SC88049 05195500
  393.          L     1,EMSGP       Explanatory message               @SC88049 05196000
  394.          MVC   0(21,1),0(3)                                    @SC88049 05196500
  395.          ST    4,EMSGL                                         @SC88049 05197000
  396.          B     FSP0H         Return ptrs and rc=1              @SC88049 05197500
  397. FSPMVDS  MVC   0(,1),0(4)                                      @SC88020 05198000
  398. FSPNOKM  MVC   44(8,4),FSPDSMB                                 @SC87015 05198500
  399. FSPNOKD  MVC   0(44,4),FSPDSN Copy name back                   @SC87015 05199000
  400. FSPNOK   OI    FL4,NMOK                                        @SC87015 05199500
  401.          CLOSF PDSPTR                                          @SC87015 05200000
  402.          B     RTRN0                                           @SC87015 05200500
  403. FSPRMP2  LA    7,CMD                                           @SC87015 05201000
  404.          LA    0,FFDSP                                         @SC87015 05201500
  405.          KCALL FSPEC,(4)     Format DSN for message            @SC87015 05202000
  406.          PTEXT '&QQWRITE',AREG=0,LREG=1  Ask if ok             @SC92300 05202500
  407.          LR    2,15                                            @SC92300 05203000
  408.          LR    3,1                                             @SC92300 05203500
  409.          MVCL  2,0                                             @SC92300 05204000
  410.          SR    2,7                                             @SC92300 05204500
  411.          RTEXT (7),PROMPT=((7),(2))                            @SC92300 05205000
  412.          LTR   0,0           Length of reply                   @SC87015 05205500
  413.          BNP   FSPDERR       If zero give up                   @SC88076 05206000
  414.          TR    0(9,7),UPCASE Upcase 1st chars of reply         @SC87015 05206500
  415.          CLC   =C'&AAAAAOK',0(7)   Was reply "ok"?             @SC88076 05207000
  416.          BNE   FSPDERR       No, abort operation               @SC88076 05207500
  417.          B     FSPNOK                                          @SC87015 05208000
  418. *                                                                       05208500
  419. * Encode name at (R1) into (R7) buffer (in ASCII), possibly with        05209000
  420. *  substitution from JFSPEC, but disable subsequent subst.              05209500
  421. *  Return updated ptr in R15                                            05210000
  422. FSPENC   LA    1,JFSPEC      Complex string?                   @SC86224 05210500
  423.          BAL   14,PAKFOR                                       @SC86224 05211000
  424.          BNZ   FSPECPZ       Yes, name overridden              @SC86299 05211500
  425.          CLI   44(4),C' '    Member?                           @SC86299 05212000
  426.          BE    FSPENT        No, get name and type from DSN    @SC86299 05212500
  427.          MVC   0(8,7),44(4)  Yes, use member name              @SC88070 05213000
  428.          LA    1,8(7)        Possible end                      @SC88070 05213500
  429.          TRT   0(8,7),TRTBL  Find end of name                  @SC88070 05214000
  430.          LR    5,1           Save                              @SC88070 05214500
  431.          BAL   9,FSPESCNS    Find last DSN qualifier           @SC88070 05215000
  432.          MVI   0(5),C'.'     Join to member name               @SC88070 05215500
  433.          MVC   1(8,5),0(3)   Copy the qualifier                @SC88070 05216000
  434.          SR    5,7           Length of member name             @SC88070 05216500
  435.          LA    1,1(5,1)      Adjust effective end of DSN       @SC88070 05217000
  436.          B     FSPENTR       Done, convert to ASCII            @SC88070 05217500
  437. FSPENT   BAL   9,FSPESCNS    Find last qualifier               @SC88070 05218000
  438.          BCTR  3,0           Move back to separating dot       @SC88070 05218500
  439.          BAL   9,FSPESCN     Back to previous qualifier        @SC88070 05219000
  440.          MVC   0(17,7),0(3)  At most 2 tokens + dot            @SC86299 05219500
  441.          B     FSPENTR       Done, convert to ASCII            @SC88070 05220000
  442. *                                                                       05220500
  443. FSPESCNS LA    1,44(4)                                         @SC86299 05221000
  444.          TRT   0(44,4),TRTBL Find end of DSN                   @SC86299 05221500
  445.          LR    3,1                                             @SC92147 05222000
  446.          BCTR  3,0           Check to see if relative GDG      @SC92147 05222500
  447.          CLI   0(3),C')'                                       @SC92147 05223000
  448.          BNE   FSPESCN2      No, that's fine                   @SC92147 05223500
  449. FSPESCNL BCTR  3,0           Look back for opening parenthesis @SC92147 05224000
  450.          CR    3,4           Past beginning of DSN?            @SC92147 05224500
  451.          BL    FSPESCN2      Yes, must be weird                @SC92147 05225000
  452.          CLI   0(3),C'('                                       @SC92147 05225500
  453.          BNE   FSPESCNL      Keep looking                      @SC92147 05226000
  454.          LR    1,3           Found it, lop off relative number @SC92147 05226500
  455. FSPESCN2 DS    0H                                              @SC92147 05227000
  456.          LR    3,1                                             @SC86299 05227500
  457. FSPESCN  BCTR  3,0           Scan back for dots                @SC86299 05228000
  458.          CR    3,4           Past beginning of DSN?            @SC86299 05228500
  459.          BL    FSPECP        Yes, use all                      @SC86299 05229000
  460.          CLI   0(3),C'.'     No, found dot?                    @SC86299 05229500
  461.          BNE   FSPESCN       No, keep looking                  @SC86299 05230000
  462. FSPECP   LA    3,1(3)        Stuff to copy                     @SC86299 05230500
  463.          BR    9                                               @SC88070 05231000
  464. FSPENTR  DS    0H            Translate and adjust ptr          @SC88070 05231500
  465.          TR    0(17,7),ETOAD                                   @SC89301 05232000
  466.          SR    1,3           Length of stuff copied            @SC86299 05232500
  467.          AR    7,1           Advance ptr                       @SC86299 05233000
  468. FSPECPZ  MVI   JFSPEC,0      Turn off string                   @SC86299 05233500
  469. FSPENR   LR    15,7          Save ptr                          @SC86295 05234000
  470.          B     FSPRET                                          @SC86295 05234500
  471. *                                                                       05235000
  472. * Copy name at (R1) into (R7) buffer in display form                    05235500
  473. *  Return updated ptr in R15                                            05236000
  474. FSPDSP   LR    14,7          Copy output ptr                   @SC86299 05236500
  475.          LA    2,DEST        Check if prefix exists            @SC86299 05237000
  476.          LH    3,DESTL                                         @SC86299 05237500
  477.          LTR   3,3                                             @SC86299 05238000
  478.          BZ    FSPDCP        No prefix, skip quotes            @SC86299 05238500
  479.          LA    1,1(3)        One extra for dot                 @SC86299 05239000
  480.          ICM   3,8,LOCASE+C'.'                                 @SC86299 05239500
  481.          CLCL  0,2           Does it match prefix?             @SC86299 05240000
  482.          BE    FSPDCP        Yes, chop it off                  @SC86299 05240500
  483.          LR    0,4           No, use quotes for whole name     @SC86299 05241000
  484.          MVI   0(14),C''''                                     @SC86299 05241500
  485.          LA    14,1(14)                                        @SC86299 05242000
  486. FSPDCP   LA    1,44(4)                                         @SC86299 05242500
  487.          TRT   0(44,4),TRTBL Find end of name                  @SC86299 05243000
  488.          SR    1,0           Length                            @SC86299 05243500
  489.          LR    15,1                                            @SC86299 05244000
  490.          MVCL  14,0          Copy name to buffer               @SC86299 05244500
  491.          CLI   44(4),C' '    Member name, too?                 @SC86299 05245000
  492.          BE    FSPDCY        No, done                          @SC86299 05245500
  493.          MVI   0(14),C'('    Yes, insert in parens             @SC86299 05246000
  494.          MVC   1(8,14),44(4) Copy name to buffer               @SC86299 05246500
  495.          LA    1,9(14)                                         @SC86299 05247000
  496.          TRT   1(8,14),TRTBL Find end of member name           @SC86299 05247500
  497.          MVI   0(1),C')'     Close member name                 @SC86299 05248000
  498.          LA    14,1(1)                                         @SC86299 05248500
  499. FSPDCY   LR    15,14         Return output ptr                 @SC86299 05249000
  500.          CLI   0(7),C''''    Need close quote?                 @SC86299 05249500
  501.          BNE   *+12          No, that's all                    @SC86299 05250000
  502.          MVI   0(15),C''''   Yes, do it                        @SC86299 05250500
  503.          LA    15,1(15)                                        @SC86299 05251000
  504.          B     FSPRET                                          @SC86299 05251500
  505. *                                                                       05252000
  506. * Insert '#' if token would otherwise begin with a digit       @SC86299 05252500
  507. FSPANAT  LA    5,8           Tentative token length            @SC86299 05253000
  508.          CLI   0(6),C'0'     Digit?                            @SC86299 05253500
  509.          BLR   2             No, ok                            @SC86299 05254000
  510.          CLI   0(6),C'9'     Really?                           @SC86299 05254500
  511.          BHR   2             No, but illegal anyway            @SC86299 05255000
  512.          BAL   9,FSPTU       Bad form                          @SC86299 05255500
  513.          LA    14,LOCASE+C'#'                                  @SC86299 05256000
  514.          LA    1,1                                             @SC86299 05256500
  515.          MVCL  0,14          Copy '#'                          @SC86299 05257000
  516.          BCTR  5,0           Now allow only 7                  @SC86299 05257500
  517.          BR    2                                               @SC86299 05258000
  518. *                                                                       05258500
  519. FSPTRSL  DC    XL256'00'     For finding a '/'                 @SC88342 05259000
  520.          ORG   FSPTRSL+C'/'                                    @SC88342 05259500
  521.          DC    X'1'                                            @SC88342 05260000
  522.          ORG   ,                                               @SC88342 05260500
  523. *                                                                       05261000
  524. * Valid DSN characters                                         @SC86299 05261500
  525. FSPTAB   DC    64C'#',C' '           space                     @SC86299 05262000
  526.          DC    10C'#',C'.'           dot                       @SC86299 05262500
  527.          DC    15C'#',C'$*'          dollar sign, asterisk     @SC86299 05263000
  528.          DC    03C'#',C'-'           hyphen                    @SC86299 05263500
  529.          DC    26C'#',C'#@'          pound sign, at sign       @SC86299 05264000
  530.          DC    04C'#',C'ABCDEFGHI'   a-i                       @SC86299 05264500
  531.          DC    07C'#',C'JKLMNOPQR'   j-r                       @SC86299 05265000
  532.          DC    08C'#',C'STUVWXYZ'    s-z                       @SC86299 05265500
  533.          DC    22C'#',C'{ABCDEFGHI'  {,A-I                     @SC86299 05266000
  534.          DC    07C'#',C'JKLMNOPQR'   J-R                       @SC86299 05266500
  535.          DC    08C'#',C'STUVWXYZ'    S-Z                       @SC86299 05267000
  536.          DC    06C'#',C'0123456789'  0-9                       @SC86299 05267500
  537.          DC    06C'#'                                          @SC86299 05268000
  538. * Valid GDG name characters                                    @SC92147 05268500
  539. FSPTBGDG DC    64C'#',C' '           space                     @SC92147 05269000
  540.          DC    10C'#',C'.'           dot                       @SC92147 05269500
  541.          DC    01C'#',C'(+'          paren, plus (for GDGs)    @GA92147 05270000
  542.          DC    12C'#',C'$*)'         dollar, asterisk, paren   @GA92147 05270500
  543.          DC    02C'#',C'-'           hyphen                    @GA92147 05271000
  544.          DC    26C'#',C'#@'          pound sign, at sign       @SC92147 05271500
  545.          DC    04C'#',C'ABCDEFGHI'   a-i                       @SC92147 05272000
  546.          DC    07C'#',C'JKLMNOPQR'   j-r                       @SC92147 05272500
  547.          DC    08C'#',C'STUVWXYZ'    s-z                       @SC92147 05273000
  548.          DC    22C'#',C'{ABCDEFGHI'  {,A-I                     @SC92147 05273500
  549.          DC    07C'#',C'JKLMNOPQR'   J-R                       @SC92147 05274000
  550.          DC    08C'#',C'STUVWXYZ'    S-Z                       @SC92147 05274500
  551.          DC    06C'#',C'0123456789'  0-9                       @SC92147 05275000
  552.          DC    06C'#'                                          @SC92147 05275500
  553. * Valid member name characters                                 @SC86299 05276000
  554. FSPMTAB  DC    75AL1(*-FSPMTAB),C'#' dot                       @SC86299 05276500
  555.          DC    20AL1(*-FSPMTAB),C'#' hyphen                    @SC88096 05277000
  556.          DC    95AL1(*-FSPMTAB),C'#' {                         @SC86299 05277500
  557.          DC    63AL1(*-FSPMTAB)                                @SC86299 05278000
  558. * Replace asterisks if not a send request                      @SC88096 05278500
  559. FSPSTAB  DC    92AL1(*-FSPSTAB),C'#' asterisk                  @SC88096 05279000
  560.          DC    163AL1(*-FSPSTAB)                               @SC88096 05279500
  561.          LOCALS ,                                              @SC86295 05280000
  562. PDSPTR   DS    A             Ticket for PDS testing            @SC87015 05280500
  563. FSPDSN   DS    0CL60         Temp for name field               @SC88342 05281000
  564. PDSNM    DS    CL44          Test DSN                          @SC87015 05281500
  565. FSPDSMB  DS    CL8           Test member                       @SC87015 05282000
  566. FSPPASS  DS    CL8           Password                          @SC88342 05282500
  567. FSPFLG   DS    X             Filespec flags                    @SC86295 05283000
  568. FSPCH1   DS    C             Saved 1st char of spec.           @SC88043 05283500
  569. FSPEC    EXIT                                                  @SC86295 05284000
  570.          TITLE 'KHELP routine - perform HELP command'                   05284500
  571. * Handle HELP command, rest of string given by SCANPTR.                 05285000
  572. * On entry, R6->help command string                                     05285500
  573. KHELP    ENTER ,                                               @SC86355 05286000
  574.          LR    8,6           Save ptr to command               @SC88043 05286500
  575.          NTOKN N=KHLI        See if subcommand given           @SC86355 05287000
  576.          L     1,=A(USNCMD)  Command table                     @SC87117 05287500
  577.          SCAN  (1),KHLF,NODISP                                 @SC86355 05288000
  578.          WTEXT '&BADSBCM'   Not found                          @SC86355 05288500
  579.          RET   ,                                               @SC86355 05289000
  580. KHLF     CLM   7,8,F0        Just '?'                          @SC86355 05289500
  581.          BE    RTRN          Yes, done                         @SC86355 05290000
  582. KHLI     LM    6,7,SCANPTR   Rest of string                    @SC88043 05290500
  583.          AR    6,7           Ptr to end                        @SC88043 05291000
  584.          LR    0,8           Start of command                  @SC88043 05291500
  585.          SR    6,0           Total length                      @SC88043 05292000
  586.          NI    FL4,255-UCMD                                    @SC88043 05292500
  587.          KCALL SUPFNC,3      Do it                             @SC86355 05293000
  588.          RET   ,                                               @SC86355 05293500
  589.          LOCALS ,                                                       05294000
  590. KHELP    EXIT  ,                                               @SC87007 05294500
  591.          TITLE 'SUPFNC Routine - various supervisor functions' @SC86158 05295000
  592. SUPFNC   ENTER                                                 @SC86295 05295500
  593. *  On entry, R1 = operation code, R0 = possible ptr            @SC86158 05296000
  594. * Exit: R15 set (0 => ok, <0 => illegal cmd, >0 => depends)             05296500
  595. *       ERRNUM set appropriately (R1=1,3,4) or unchanged (2,5-11)       05297000
  596. * 1 -> Start typeout interception.  N.B.  &MAXLR >> 2048 for this       05297500
  597. * 2 -> Clean up afterwards and stop interception                        05298000
  598. * 3 -> Execute host command with or without interception                05298500
  599. *      If UCMD set, SCANPTR gives text, else R0->text,R6=len            05299000
  600. * 4 -> (not used)                                                       05299500
  601. * 5 -> Stop interception if going                                       05300000
  602. * 6 -> Retrieve original cmd parm string into CBUF (R15=1 if null)      05300500
  603. * 7 -> Test for stacked lines, return number in R15                     05301000
  604. * 8 -> Log off (must return to TMP)                                     05301500
  605. * 9 -> Wait specified time                                              05302000
  606. * 10-> Return clock time in R15 (centisec)                              05302500
  607. * 11-> Setup up new prompt string at (R0)                               05303000
  608.          STC   1,SFCFLGS                                       @SC92342 05303500
  609.          AR    1,1                                             @SC92342 05304000
  610.          LH    1,SFCT-2(1)                                     @SC92342 05304500
  611.          B     SFCT(1)                                         @SC92342 05305000
  612. SFCT     DC    Y(ICPBEG-SFCT,ICPFIN-SFCT,ICPHST-SFCT)  1-3     @SC92342 05305500
  613.          DC    Y(ICPCMIL-SFCT,ICPRST-SFCT,SFCLIN-SFCT) 4-6     @SC92342 05306000
  614.          DC    Y(SFCSTK-SFCT,SFCKIL-SFCT,SFCWT-SFCT)   7-9     @SC92342 05306500
  615.          DC    Y(SFCCLK-SFCT,SFCRET-SFCT,SFCRET-SFCT) 10-12    @SC92342 05307000
  616. *                                                                       05307500
  617. * Start interception, initialize ptrs                          @SC86158 05308000
  618. ICPBEG   DS    0H                                              @SC92342 05308500
  619.          MVI   ERRNUM,ERRNOE OK                                @SC86158 05309000
  620.          L     1,WBUF        Output buffer                     @SC90264 05309500
  621.          LA    0,2048(,1)    Skip over some, to be safe        @SC90264 05310000
  622.          A     1,F64KP       End of buffer                     @SC90264 05310500
  623.          LR    15,0                                            @SC86158 05311000
  624.          STM   15,0,TXTPTR   Save                              @SC86158 05311500
  625.          STM   0,1,SVCOPTR                                     @SC86158 05312000
  626.          SR    1,0           Get length                        @SC86158 05312500
  627.          L     15,=X'15000000'                                 @SC86158 05313000
  628.          MVCL  0,14          Fill with NL (X'15')              @SC86158 05313500
  629. * ------------ determine if SVC screen is possible             @SC88026 05314000
  630. * -            if so, then do it                               @SC88026 05314500
  631.          B     ICPSTK                                          @SC88026 05315000
  632.          MVI   ICPFL,2       Now intercepting subtask SVC's    @SC88026 05315500
  633. SFCRET   DS    0H                                              @SC92342 05316000
  634.          B     RTRN0                                           @SC88026 05316500
  635. *          Can't screen SVC's, create a STACK element          @SC88026 05317000
  636. ICPSTK   OPENF T,STKDSN,E=ICPST2 See if any previous output    @SC88026 05317500
  637.          USING FDBD,1        Yes, clear it                     @SC88106 05318000
  638.          SR    3,3                                             @SC88106 05318500
  639.          LA    4,FDBDEVT-2   Create volume list (n,type,vol)   @SC88106 05319000
  640.          MVC   0(2,4),F1+2   Just one volume                   @SC88106 05319500
  641.          STM   2,4,SFCDEL+4  Simulate CAMLST                   @SC88106 05320000
  642.          MVI   SFCDEL,X'0C'  Code for UNCAT                    @SC88106 05320500
  643.          CATALOG SFCDEL                                        @SC88106 05321000
  644.          MVI   SFCDEL,X'41'  Codes for SCRATCH                 @SC88106 05321500
  645.          MVI   SFCDEL+2,X'40'                                  @SC88106 05322000
  646.          SCRATCH SFCDEL                                        @SC88106 05322500
  647.          DROP  1                                               @SC88106 05323000
  648. ICPST2   LA    1,STKDSN      Get ptrs to DYNALC arguments      @SC88026 05323500
  649.          LA    2,STKDD                                         @SC88026 05324000
  650.          LA    3,FILUNT                                        @SC88026 05324500
  651.          LA    4,FILVOL                                        @SC88026 05325000
  652.          LA    5,=X'42'      NEW,CATLG                         @SC88026 05325500
  653.          LA    6,FILTRKAL                                      @SC88026 05326000
  654.          LA    7,STKDRC                                        @SC88026 05326500
  655.          STM   1,7,STKDYN    Set up calling sequence           @SC88026 05327000
  656.          OI    STKDYN+24,X'80'  No buffer ptr                  @SC88119 05327500
  657.          KCALL DYNALC,STKDYN,EXT Allocate output file          @SC88026 05328000
  658.          MVI   CPECB,0       Clear ECB (for neatness)          @SC88076 05328500
  659.          STACK MF=(E,IOPLAREA),PARM=STKA  Create STACK elt.    @SC88026 05329000
  660.          MVI   ICPFL,1       Now intercepting                  @SC87020 05329500
  661.          B     RTRN0                                           @SC86295 05330000
  662. * Clean up after interception                                  @SC86295 05330500
  663. ICPFIN   DS    0H                                              @SC92342 05331000
  664.          L     5,SVCOPTR     End of text                       @SC86158 05331500
  665.          ST    5,TXTPTR+4    Save                              @SC86158 05332000
  666. ICPRST   CLI   ICPFL,2       Were we intercepting SVC's?       @SC92342 05332500
  667.          BNE   ICPFINST      No, see if STACK                  @SC88026 05333000
  668. *---------- stop snagging SVC's                                @SC88026 05333500
  669.          B     ICPRST1       Ok                                @SC88026 05334000
  670. ICPFINST CLI   ICPFL,1       Were we intercepting via STACK?   @SC88026 05334500
  671.          BNE   ICPRST1       No, fine                          @SC88026 05335000
  672.          MVI   CPECB,0       Clear ECB (for neatness)          @SC88076 05335500
  673.          STACK MF=(E,IOPLAREA),PARM=STKZ Yes, remove STACK elt.@SC88026 05336000
  674.          CLI   SFCFLGS,5     Stop intercepting without cleanup?@SC92342 05336500
  675.          BE    ICPRST1       Yes, quit now                     @SC92342 05337000
  676. *          Copy output to buffer                               @SC88026 05337500
  677.          OPENF I,STKDSN,FILFDB,STKTKT,E=ICPRST1                @SC88026 05338000
  678.          L     3,STKTKT      Ptr to FAB                        @SC88106 05338500
  679.          USING FABD,3                                          @SC88106 05339000
  680.          L     5,TXTPTR+4    Buffer ptr                        @SC88026 05339500
  681. ICPSTLP  READF STKTKT,BUFFER=(5),BSIZE=255,E=ICPSTZ            @SC88026 05340000
  682.          TM    FDBFLGS,FABRECCC Carriage control?              @SC88246 05340500
  683.          BZ    *+8           No, that's fine                   @SC88106 05341000
  684.          MVI   0(5),C' '     Yes, blank it out                 @SC88106 05341500
  685.          AR    5,0           Space over data                   @SC88026 05342000
  686.          LA    5,1(5)        Leave one X'15'                   @SC88026 05342500
  687.          B     ICPSTLP       And read more                     @SC88026 05343000
  688. ICPSTZ   CLOSF STKTKT        Done                              @SC88026 05343500
  689.          ST    5,TXTPTR+4    New end of output                 @SC88026 05344000
  690.          DROP  3                                               @SC88106 05344500
  691. ICPRST1  MVI   ICPFL,0                                         @SC87020 05345000
  692.          B     RTRN0                                                    05345500
  693. * Execute TSO command at (R0) with length (R6), unless UCMD set,        05346000
  694. *  in which case string given by SCANPTR                                05346500
  695. ICPHST   DS    0H                                              @SC92342 05347000
  696.          TM    FL4,UCMD      User command?                     @SC86295 05347500
  697.          BO    ICPCM0        Yes, scan already set up          @SC86355 05348000
  698. ICPCMI   ST    0,ADR         Set scan string ptrs              @SC86355 05348500
  699.          ST    6,LEN                                           @SC86355 05349000
  700. ICPCM0   LM    0,1,SCANPTR   Get length and adr                @SC87034 05349500
  701.          LTR   6,0           Copy length                       @SC87034 05350000
  702.          BNP   ICPCMIL       No good                           @SC87034 05350500
  703.          BCTR  6,0                                             @SC87034 05351000
  704.          LA    5,0(6,1)      Point to last character in string @GH89057 05351500
  705.          NTOKN N=ICPCMIL     No good                           @SC86355 05352000
  706.          MVI   SFCBUF+4,C' ' Initialize command buffer ...     @GH89057 05352500
  707.          MVC   SFCBUF+4+1(256-1),SFCBUF+4 ... to blanks        @GH89057 05353000
  708.          SR    5,6           Compute decremented length ...    @GH89057 05353500
  709.          MVC   SFCBUF+4(*-*),0(6)  Copy text to command buffer @GH89057 05354000
  710.          EX    5,*-6         ... and nothing else              @GH89057 05354500
  711.          LR    5,6           Start of command name             @SC86355 05355000
  712.          EX    7,TRUPCAS     Capitalize command name           @GH89112 05355500
  713.          LA    7,1(7)        Length of name                    @SC86355 05356000
  714.          MVC   EXCFLG,0(6)   Copy 1st character (% if implicit)@SC89073 05356500
  715.          CLI   0(6),C'%'     Is it implicit EXEC?              @SC89073 05357000
  716.          BNE   SFCCM1        No                                @SC89073 05357500
  717.           BCT  7,*+8         Yes, chop off '%'                 @SC89073 05358000
  718.            B   ICPCMIL       Oops, name was just '%'           @SC89073 05358500
  719.           LA   6,1(6)                                          @SC89073 05359000
  720. SFCCM1   DS    0H                                              @SC89073 05359500
  721.          ICM   7,8,BLANK     Set up for padding                @SC86355 05360000
  722.          L     2,ORGR1       Get address of kermit CPPL        @TS86001 05360500
  723.          MVC   ATCHCPPL(16),0(2)  initialize attach CPPL       @TS86001 05361000
  724.          LA    2,ATCHCPPL    Get address of attach CPPL        @TS86001 05361500
  725.          USING CPPL,2        Make attach CPPL addressable      @TS86001 05362000
  726.          LA    1,SFCBUF                                        @SC86355 05362500
  727.          ST    1,CPPLCBUF    Put the command buffer into CPPL  @TS86001 05363000
  728.          L     3,CPPLECT     Get the ECT address               @TS86001 05363500
  729.          USING ECT,3         Make it addressable               @TS86001 05364000
  730.          MVC   ECTPCMD,ORGPCMD Initialize, in case sub HELP    @SC89052 05364500
  731.          LA    14,ECTSCMD                                      @SC86355 05365000
  732.          LA    15,L'ECTSCMD                                    @SC86355 05365500
  733.          MVCL  14,6          Copy to subcommand field          @SC86355 05366000
  734.          CLM   7,7,F0                                          @SC88054 05366500
  735.          BNE   ICPCMIL       Command name longer than 8        @SC88054 05367000
  736.          CLI   ECTSCMD,C'H'  Is it HELP?                       @SC88043 05367500
  737.          BNE   *+12          It's not subcommand help          @SC88043 05368000
  738.          TM    FL4,UCMD      It might be (if generated)        @SC88043 05368500
  739.          BZ    *+10          ... yes, HELP as subcommand       @SC88043 05369000
  740.           MVC  ECTPCMD,ECTSCMD This is really a command        @SC88026 05369500
  741.          LR    4,6           Default parameter ptr             @SC86355 05370000
  742.          LR    8,6           Default end of string             @SC86355 05370500
  743.          NTOKN N=SFCNPRM     Find parameters, if any           @SC86355 05371000
  744.          L     8,ADR                                           @SC86355 05371500
  745.          A     8,LEN         True end of string                @SC86355 05372000
  746.          LR    4,6           Start of parameters               @SC86355 05372500
  747. SFCNPRM  SR    4,5           Get offset to parameters          @SC86355 05373000
  748.          STH   4,SFCBUF+2    Save in command buffer            @SC86355 05373500
  749.          MVC   SFCBLDL(4),=H'1,60' Set BLDL count & length     @SC90149 05374000
  750.          SR    8,5           Get total length                  @SC86355 05374500
  751.          LA    8,4(8)        Plus prefix info                  @SC88022 05375000
  752.          STH   8,SFCBUF      Save in command buffer            @SC86355 05375500
  753.          CLI   EXCFLG,C'%'   Check for explicit implicit clist @SC89073 05376000
  754.          BNE   SFCLOCCP      Try for a CP first                @GH89056 05376500
  755. SFCEXEC  XC    SFCBUF+2(2),SFCBUF+2   Indicate implicit clist  @GH89056 05377000
  756.          CLC   ECTSCMD,=CL8'EXEC'     (Avoid looping)          @GH89056 05377500
  757.          BE    ICPCMIL       This shouldn't happen!            @GH89056 05378000
  758.          MVC   SFCBLDL+4(8),ECTSCMD Copy into BLDL list        @GH89050 05378500
  759.          ICM   1,15,SYSPROC  Ptr to CLIST library DCB          @SC89073 05379000
  760.          BZ    ICPCMIL       No such library                   @SC89073 05379500
  761.          BLDL  (1),SFCBLDL                                     @SC89073 05380000
  762.          LTR   15,15                                           @SC89073 05380500
  763.          BNZ   ICPCMIL       Couldn't find the CLIST           @SC89073 05381000
  764.          MVC   ECTPCMD,=CL8'EXEC'  Ok, locate EXEC             @GH89056 05381500
  765.          MVC   ECTSCMD,=CL8'EXEC'                              @GH89056 05382000
  766. SFCLOCCP DS    0H            Come here to try again            @GH89056 05382500
  767.          MVC   SFCBLDL+4(8),ECTSCMD Copy into BLDL list        @GH89050 05383000
  768.          BLDL  0,SFCBLDL     Check for command to ATTACH       @GH89050 05383500
  769.          LTR   15,15         Does command exist?               @GH89050 05384000
  770.          BNZ   SFCEXEC       No: assume a CLIST                @GH89056 05384500
  771.          STAX  SFCATTN,DEFER=NO,REPLACE=NO,MF=(E,SFCSTBL),     @SC88118+05385000
  772.                USADDR=ATCHECB  In case subtask has no STAX     @SC88118 05385500
  773.          ATTACH ECB=ATCHECB,DE=SFCBLDL+4,SHSPV=78,SZERO=NO,            +05386000
  774.                MF=(E,(2)),SF=(E,ATCBLK)                        @SC86355 05386500
  775.          LTR   15,15         Was attach successful?            @TS86001 05387000
  776.          BZ    *+12          Ok                                @SC88118 05387500
  777.           BAL  14,SFCATCLN   Restore everything                @SC88118 05388000
  778.           B    ICPCMIL       No, must not exist                @SC88026 05388500
  779.          ST    1,ATCHTCB     Save TCB address                  @TS86001 05389000
  780.          WAIT  ECB=ATCHECB   Wait for subtask to finish        @TS86001 05389500
  781.          LA    1,ATCTXP      Set up req blk ptr to text list   @SC88087 05390000
  782.          LA    4,ATCTXT      Text list follows RB              @SC88087 05390500
  783.          MVC   0(6,4),=H'1,1,4' Text unit type 1: TCB adr      @SC88087 05391000
  784.          LA    5,ATCDRB      RB ptr follows text list          @SC88087 05391500
  785.          ST    1,ATCDRB+8    Fill in RB                        @SC88087 05392000
  786.          STM   4,5,ATCTXP    Fill in text list + RB ptr        @SC88087 05392500
  787.          MVI   ATCTXP,X'80'  Only item in text list            @SC88087 05393000
  788.          MVC   0(2,5),=AL1(20,5) Finish up RB: length, type    @SC88087 05393500
  789.          MVI   ATCRBP,X'80'                                    @SC88087 05394000
  790.          LA    1,ATCRBP                                        @SC88087 05394500
  791.          SVC   99            DYNALLOC to free allocations      @SC88087 05395000
  792.          DETACH ATCHTCB      Detach the subtask                @TS86001 05395500
  793.          BAL   14,SFCATCLN   Restore everything                @SC88118 05396000
  794.          SR    4,4                                             @SC86355 05396500
  795.          ICM   4,7,ATCHECB+1 Get return code                   @SC86355 05397000
  796. * Issue return code msg if needed                              @SC86295 05397500
  797.          BZ    SFCZRC        RC=0                              @SC86158 05398000
  798.          LR    15,6                                            @SC90264 05398500
  799.          TM    FL4,UCMD      User cmd?                         @SC86316 05399000
  800.          BZ    RTRN          No. No message, just rc in R15    @SC90264 05399500
  801.          MVC   CMD(2),=C'R(' Set up message                    @SC86209 05400000
  802.          LA    15,CMD+2                                        @SC86209 05400500
  803.          BAL   2,EDDEC       Edit RC into msg                  @SC86295 05401000
  804.          MVI   0(15),C')'    Format is R(rc)                   @SC86209 05401500
  805.          LA    0,1(15)                                         @SC86268 05402000
  806.          LA    1,CMD         Start of edited string            @SC86209 05402500
  807.          SR    0,1           Length                            @SC86268 05403000
  808.          WTEXT (1),(0)                                         @SC86268 05403500
  809. SFCZRC   LR    15,4                                            @SC86295 05404000
  810.          MVI   ERRNUM,ERRNOE No errors                         @SC86295 05404500
  811.          B     RTRN                                            @SC86295 05405000
  812. ICPCMIL  MVI   ERRNUM,ERRSYS Illegal system command            @SC86295 05405500
  813.          B     RTRNM1                                          @SC86295 05406000
  814. *                                                                       05406500
  815. SFCATCLN STAX  ,             Restore after ATTACH (saves R14)  @SC88118 05407000
  816.          BR    14                                              @SC88118 05407500
  817. *                                                                       05408000
  818. SFCATTN  STM   14,12,12(13)  Save regs                         @SC88118 05408500
  819.          LR    3,15                                            @SC88118 05409000
  820.          USING SFCATTN,3                                       @SC88118 05409500
  821.          L     4,8(1)        Ptr to ECB                        @SC88118 05410000
  822.          LA    2,4(4)        Ptr to TCB                        @SC88118 05410500
  823.          TM    0(4),X'40'    Already finished?                 @SC88118 05411000
  824.          BO    SFCATTNR      Yes, we just missed it            @SC88118 05411500
  825.          STATUS STOP,TCB=(2) Suppress execution                @SC88118 05412000
  826.          POST  (4)           No, so we just drop it            @SC88118 05412500
  827. SFCATTNR LM    14,12,12(13)  Restore regs                      @SC88118 05413000
  828.          BR    14                                              @SC88118 05413500
  829.          DROP  3                                               @SC88118 05414000
  830. *                                                                       05414500
  831. SFCLIN   DS    0H                                              @SC92342 05415000
  832. * Retrieve original command line arguments, if any             @SC86295 05415500
  833. *   Return code =0 if yes, =1 if no                            @SC86295 05416000
  834. *   Leave string in CBUF buffer (up to 256), length in CLEN    @SC86295 05416500
  835.          L     2,ORGR1       Original R1                       @SC86355 05417000
  836.          L     3,CPPLCBUF    CBUF ptr                          @SC91121 05417500
  837.          LH    5,0(,3)       PARM length                       @SC91121 05418000
  838.          AR    5,3           End of data                       @SC91121 05418500
  839.          LH    4,2(,3)       Parm offset                       @SC91121 05419000
  840.          LA    4,4(4,3)      Start of data                     @SC91121 05419500
  841.          SR    5,4           Length of data                    @SC91121 05420000
  842.          BNP   RTRN1         Nothing there                     @SC86299 05420500
  843.          LA    6,7+4(,5)     Add 4 for overhead and round      @SC91121 05421000
  844.          N     6,=F'-7'      ... to doubleword                 @SC91121 05421500
  845.          GETMAIN R,LV=(6),SP=1                                 @SC91121 05422000
  846.          ST    1,APGPB+GTPBIBUF-GTPB  Save ptr for GETLIN      @SC91121 05422500
  847.          STH   6,0(,1)       Set up new block                  @SC91121 05423000
  848.          SR    6,5           Deduct data length                @SC91121 05423500
  849.          S     6,F4          and overhead                      @SC91121 05424000
  850.          STH   6,2(,1)       The rest is the new offset        @SC91121 05424500
  851.          LA    0,4(6,1)      New starting point for data       @SC91121 05425000
  852.          LR    1,5                                             @SC91121 05425500
  853.          MVCL  0,4           Fill up new block                 @SC91121 05426000
  854.          B     RTRN0                                           @SC86295 05426500
  855. *                                                                       05427000
  856. * Test for stacked commands                                    @SC86295 05427500
  857. *   return code = number of stacked lines                      @SC86295 05428000
  858. SFCSTK   DS    0H                                              @SC92342 05428500
  859.          LA    2,APGPB                                         @NW86330 05429000
  860.          USING GTPB,2                                          @NW86330 05429500
  861.          ICM   1,15,GTPBIBUF Ptr to input buffer, if any       @SC87015 05430000
  862.          BNZ   RTRN1         Yes, line is stacked              @SC87015 05430500
  863.          SR    0,0                                             @SC91205 05431000
  864.          IC    0,ERRNUM      Get current status code           @SC91205 05431500
  865.          C     0,F1                                            @SC91205 05432000
  866.          BH    *+6                                             @SC91205 05432500
  867.           SR   0,0           Treat 1 as if 0                   @SC91205 05433000
  868.          L     1,ORGR1       Get ptr to CPPL                   @SC91205 05433500
  869.          USING CPPL,1                                          @SC91205 05434000
  870.          L     1,CPPLECT     Get ECT ptr                       @SC91205 05434500
  871.          USING ECT,1                                           @SC91205 05435000
  872.          STCM  0,7,ECTRTCD   Set CC for any CLIST running      @SC91205 05435500
  873.          DROP  1                                               @SC91205 05436000
  874.          MVI   CPECB,0       Clear ECB                         @SC88119 05436500
  875.          L     15,GETLINAD   Entry point for GETLINE routine   @NW86330 05437000
  876.          GETLINE PARM=(2),TERMGET=(EDIT,NOWAIT),ENTRY=(15),            +05437500
  877.                MF=(E,IOPLAREA)                                 @SC87015 05438000
  878.          C     15,F4         Check return code                 @SC87015 05438500
  879.          BNH   RTRN1         Got one now                       @SC88095 05439000
  880.          MVC   GTPBIBUF,F0   Clear it, just in case            @SC88095 05439500
  881.          B     RTRN0         Nothing stacked                   @SC88095 05440000
  882.          DROP  2                                               @SC90264 05440500
  883. *                                                                       05441000
  884. * Log out                                                      @SC86295 05441500
  885. SFCKIL   DS    0H                                              @SC92342 05442000
  886.          LR    3,13                                            @SC88026 05442500
  887.          L     3,4(3)        Look back through save areas      @SC88026 05443000
  888.          CLC   =A(USNTRF),16(3) Find main loop                 @SC89215 05443500
  889.          BNE   *-10                                            @SC88026 05444000
  890.          L     3,8(3)        Ptr to main save area             @SC88026 05444500
  891.          OI    KFLG-USNTRFSV(3),CMDC Set flag to quit          @SC88026 05445000
  892.          PTEXT 'LOGOFF',AREG=0,LREG=6                          @SC88026 05445500
  893.          NI    FL4,255-UCMD  Internal                          @SC86355 05446000
  894.          B     ICPCMI        Do it                             @SC86355 05446500
  895. *                                                                       05447000
  896. * Wait specified time in R0 (sec)                                       05447500
  897. SFCWT    DS    0H                                              @SC92342 05448000
  898.          MH    0,=H'100'     Convert to centisec               @SC86299 05448500
  899.          ST    0,TMPDW                                         @SC86299 05449000
  900.         STIMER WAIT,BINTVL=TMPDW                               @SC86299 05449500
  901.          B     RTRN0                                           @SC86295 05450000
  902. *                                                                       05450500
  903. * Return time in centisec in R15                                        05451000
  904. SFCCLK   DS    0H                                              @SC92342 05451500
  905.          STCK  TMPDW         Store TOD clock                   @SC86295 05452000
  906.          LM    14,15,TMPDW                                     @SC86295 05452500
  907.          SLDL  14,8          Take mod 204 days                 @SC86295 05453000
  908.          SRDL  14,20         Get in microsec                   @SC86295 05453500
  909.          D     14,=F'10000'  Get in centisec                   @SC86295 05454000
  910.          B     RTRN                                            @SC86295 05454500
  911. *                                                                       05455000
  912.          TITLE 'SVC interceptor,  executed in system protect key'       05455500
  913.          USING ICPTYP,15                                       @SC86283 05456000
  914. ICPTYP   STM   12,14,SVCSV1  Save regs                         @SC86283 05456500
  915.          LR    13,15         Addressability                    @SC87020 05457000
  916.          DROP  15                                                       05457500
  917.          USING ICPTYP,13                                       @SC87020 05458000
  918. ICPTGO   LM    14,15,SVCOPTR Output ptrs                       @SC86158 05458500
  919.          SR    15,14         Length left                       @SC86158 05459000
  920.          LA    12,255        Limit                             @SC86158 05459500
  921.          CLR   12,0          Buffer length                     @SC87020 05460000
  922.          BNH   *+8           Too big                           @SC86158 05460500
  923.          LR    12,0          Ok, use it                        @SC87020 05461000
  924.          LTR   12,12                                           @SC86158 05461500
  925.          BNP   ICPTRET                                         @SC86283 05462000
  926.          CR    12,15         Enough room?                      @SC86283 05462500
  927.          BH    ICPTRET       No                                @SC86283 05463000
  928.          BCTR  12,0          Set up for mvc                    @SC86158 05463500
  929.          EX    12,SVCCOPY    Move to WBUF                      @SC86158 05464000
  930.          LA    14,2(12,14)   New end                           @SC86158 05464500
  931.          ST    14,SVCOPTR                                      @SC86158 05465000
  932. ICPTRET  SR    15,15         Success                           @SC86283 05465500
  933.          LM    12,14,SVCSV1  Restore regs                      @SC86283 05466000
  934.          BR    14            Return                            @SC86283 05466500
  935. SVCCOPY  MVC   0(,14),0(1)                                     @SC87020 05467000
  936. *                                                                       05467500
  937. * Storage for SVC interception                                 @SC86158 05468000
  938. SVCSV1   DS    2F            Saved 12,13                       @SC86158 05468500
  939. SVCSV2   DS    2F            Saved 14,15                       @SC86158 05469000
  940. SVCOPTR  DS    2F            Buffer output and end ptrs        @SC86158 05469500
  941. STKA     STACK MF=L,DATASET=(*,OUTDD=STKDD)                    @SC88026 05470000
  942. STKZ     STACK MF=L,DELETE=TOP                                 @SC88026 05470500
  943. STKDD    DC    CL8'K999999Y' DD name for STACK interception    @SC88026 05471000
  944.          LOCALS ,                                              @SC86295 05471500
  945. ATCHCPPL DS    4F            Subtask CPPL area                 @TS86001 05472000
  946. SFCSTBL  STAX  MF=L          ATTN during subtask execution     @SC88118 05472500
  947. ATCBLK   ATTACH SF=L         ATTACH parameter list             @SC88022 05473000
  948. ATCHECB  DS    F             Subtask ECB                       @TS86001 05473500
  949.          DS    6X            Leave some space for text unit    @SC88291 05474000
  950. ATCHTCB  DS    F             Subtask TCB ptr                   @TS86001 05474500
  951. ATCTXT   EQU   ATCHTCB-6,6   Prefix to TCB ptr (watch overlap!)@SC88087 05475000
  952. SFCBUF   DS    F,CL256       Command buffer                    @GH89057 05475500
  953. SFCBLDL  DS    2H            BLDL list: count & length         @GH89050 05476000
  954.          DS    CL8,XL52      BLDL list: membername, TTRC, etc. @GH89050 05476500
  955. SFCDEL   DS    0F            CAMLST overlays...                @SC88106 05477000
  956. STKDYN   DS    7F            DYNALC calling sequence           @SC88026 05477500
  957. *               - Also used for CAMLST UNCAT/SCRATCH & DYNALLOC@SC88106 05478000
  958. STKDRC   DS    F             DYNALC return code                @SC88026 05478500
  959. STKTKT   DS    A             Ptr to STACK file FAB             @SC88026 05479000
  960.          ORG   STKDYN        Overlay interception stuff        @SC88087 05479500
  961. ATCDRB   DS    5F            DYNALLOC RB (init to zeroes)      @SC88087 05480000
  962. ATCTXP   DS    A             Text unit list (ATCTXT)           @SC88087 05480500
  963. ATCRBP   DS    A             Ptr to RB                         @SC88087 05481000
  964.          ORG   ,                                               @SC88087 05481500
  965. EXCFLG   DS    C             Flag for implicit EXEC            @SC89073 05482000
  966. SFCFLGS  DS    X             Type of call to SUPFNC            @SC92342 05482500
  967. SUPFNC   EXIT                                                  @SC86158 05483000
  968.          TITLE 'TERMIO Routine - Handle terminal I/O'                   05483500
  969. * R1 points to a pair of (adr,len) for read or write.  If I/O is        05484000
  970. * successfull, R15 returns transferred byte count (else returns -1).    05484500
  971. *               Command code is in R0:                                  05485000
  972. * 1 => Open line for I/O            4 => Write packet                   05485500
  973. * 2 => Close line                   5 => Read packet                    05486000
  974. * 3 => Reset line status after    ( 6 => Write message ) not used       05486500
  975. *      environment changes                                              05487000
  976. *                                                                       05487500
  977. TERMIO   ENTER                                                          05488000
  978.          SR    15,15         OK                                @SC86295 05488500
  979.          STC   0,CONSOPR                                       @SC92180 05489000
  980.          BCT   0,TRMCLS                                        @SC86295 05489500
  981. * Open terminal line for protocol                                       05490000
  982.          STAX  BR14,REPLACE=NO  Ingore attention interrupts    @SC88118 05490500
  983.          MVI   RIOC,X'80'    Nothing saved                     @SC86295 05491000
  984.          MVI   TRMFLG,X'FF'  Initialize w/r flag               @SC87275 05491500
  985.          CLI   TRMTP,C'F'    Non-transparent full-screen?      @SC92030 05492000
  986.          BNE   RTRN0         No, all set                       @SC92030 05492500
  987.          STFSMODE ON,INITIAL=YES,NOEDIT=YES Full-screen mode   @SC92030 05493000
  988.          LA    1,TRMFULA1    Set up introducer: adr            @SC92030 05493500
  989.          LA    2,TRMFULL1    Length                            @SC92030 05494000
  990.          STM   1,2,WRCMD                                       @SC92030 05494500
  991.          LA    0,TRMFULL1+TRMFULL2                             @SC92030 05495000
  992.          ICM   1,8,=X'03'    FULLSCR (for VTAM)                @SC92030 05495500
  993.          BAL   8,TRMLOG                                        @SC92180 05496000
  994.          TPUT  (1),(0),R     Clear and format                  @SC92030 05496500
  995.          B     RTRN0                                           @SC86295 05497000
  996. * Close terminal line after protocol transfer                           05497500
  997. TRMCLS   BCT   0,TRMRSET                                       @SC86295 05498000
  998.          STAX                                                           05498500
  999.          CLI   TRMTP,C'F'    Non-transparent full-screen?      @SC92030 05499000
  1000.          BNE   RTRN0         No, all set                       @SC92030 05499500
  1001.          STFSMODE OFF                                          @SC92030 05500000
  1002.          SR    0,0                                             @SC92030 05500500
  1003.          KCALL SCRNIO        One final CLEAR                   @SC92030 05501000
  1004.          B     RTRN0                                           @SC86295 05501500
  1005. * (Re)set terminal characteristics to suit environment                  05502000
  1006. TRMRSET  BCT   0,TRMRW                                         @SC86295 05502500
  1007.          B     RTRN0                                           @SC86295 05503000
  1008. *                                                                       05503500
  1009. *  Perform I/O request                                                  05504000
  1010. TRMRW    BCT   0,TRMRD                                         @SC87015 05504500
  1011.          CLI   WRRD,0        Write/read?                       @SC87275 05505000
  1012.          BNE   *+8           Yes                               @SC87275 05505500
  1013.          MVI   TRMFLG,0      Indicate no action on follow-up   @SC87275 05506000
  1014.          L     0,4(1)        Get length                        @SC87015 05506500
  1015.          L     1,0(1)        and address                       @SC87015 05507000
  1016.          CLI   TRMTP,C'F'    Full-screen non-transparent?      @SC92030 05507500
  1017.          BNE   TRMW0         No                                @SC92030 05508000
  1018.          LA    2,TRMFULA2    Stuff to append to stream         @SC92030 05508500
  1019.          XI    FL3,FCLRF     Flip switch for clearing          @SC92030 05509000
  1020.          TM    FL3,FCLRF     Clearing now?                     @SC92030 05509500
  1021.          BO    TRMWAP        Yes, finish stream                @SC92030 05510000
  1022.          LA    2,TRMFULB2    Stuff to append if not clearing   @SC92030 05510500
  1023.          MVC   0(TRMFULL1,1),TRMFULB1 Replace introducer       @SC92030 05511000
  1024. TRMWAP   LR    3,0                                             @SC92030 05511500
  1025.          AR    3,1           End of data                       @SC92030 05512000
  1026.          MVC   0(TRMFULL2,3),0(2) Append extra commands        @SC92030 05512500
  1027.          AH    0,=Y(TRMFULL2) Add length of extra              @SC92030 05513000
  1028.          B     TRMW1                                           @SC92030 05513500
  1029. TRMW0    DS    0H                                              @SC92030 05514000
  1030.          ICM   1,8,=X'02'    CONTROL                           @SC87317 05514500
  1031.          CLI   TRMTP,C'V'                                      @SC88323 05515000
  1032.          BNE   *+8                                             @SC87317 05515500
  1033. TRMW1    DS    0H                                              @SC92030 05516000
  1034.          ICM   1,8,=X'03'    FULLSCR (for VTAM)                @SC88323 05516500
  1035.          BAL   8,TRMLOG                                        @SC92180 05517000
  1036.          TPUT  (1),(0),R     Flags already set                 @SC87317 05517500
  1037.          B     RTRN0                                           @SC87317 05518000
  1038. *                                                                       05518500
  1039. * TRMLOG: Dump command parameters and data buffer              @SC92180 05519000
  1040. * Return via R8.  R3, R7, and R14-R15 destroyed.               @SC92180 05519500
  1041. TRMLOG   STM   0,1,TRMLRS    Save ptrs                         @SC92180 05520000
  1042.          LA    1,TRMLRS      Get plist ptr                     @SC92180 05520500
  1043.          SLR   2,2           Convert op. code to log label     @SC92180 05521000
  1044.          IC    2,CONSOPR                                       @SC92180 05521500
  1045.          LA    2,CONSOPRS(2)                                   @SC92180 05522000
  1046.          IC    0,0(,2)                                         @SC92180 05522500
  1047.          LA    2,8           Size of plist                     @SC92180 05523000
  1048.          BAL   7,SCRLOG      Log it                            @SC92180 05523500
  1049.          LM    0,1,TRMLRS    Restore R1                        @SC92180 05524000
  1050.          LA    2,C'd'                                          @SC92180 05524500
  1051.          BAL   7,SCRLOG      Log it                            @SC92180 05525000
  1052.          LM    0,1,TRMLRS    Restore R1                        @SC92180 05525500
  1053.          BR    8                                               @SC92180 05526000
  1054. *                                                                       05526500
  1055. * Read from terminal                                                    05527000
  1056. TRMRD    MVC   KTGETT(8),0(1) Copy adr,len                     @SC87015 05527500
  1057.          TS    TRMFLG                                          @SC87275 05528000
  1058.          BZ    RTRN0         Just a follow-up. 0-length read   @SC87275 05528500
  1059.          MVI   ECBTGET,0     Clear ECB                         @SC87015 05529000
  1060.          SR    5,5           Set flag 'no timing'              @SC87015 05529500
  1061.          ICM   5,1,TIMOSRV   Timing allowed?                   @SC90045 05530000
  1062.          BZ    TRMPST                                          @NW86330 05530500
  1063.          ICM   5,1,TIMOUT    Any timing requested?             @SC87015 05531000
  1064.          BZ    TRMPST        No, just wait                     @SC87015 05531500
  1065.          MH    5,=H'100'                                       @SC87015 05532000
  1066.          ST    5,TMPDW                                         @SC87015 05532500
  1067.          LA    1,ECBTGET     ECB for timer to post             @SC88299 05533000
  1068.          STCM  1,15,TMXPT    Set up addressibility             @SC88299 05533500
  1069.          STIMER REAL,TMXIT,BINTVL=TMPDW                        @SC88299 05534000
  1070. TRMPST   POST  ECBREAD       Tell async sub to go for it       @NW86330 05534500
  1071.          WAIT  ECB=ECBTGET                                     @NW86330 05535000
  1072.          CLI   ECBTGET+3,0   Check return code                 @NW86330 05535500
  1073.          BNE   TRMTIM                                          @NW86330 05536000
  1074.          LTR   5,5           Timing enabled?                   @SC87015 05536500
  1075.          BZ    TRMRET        No, fine                          @SC87015 05537000
  1076.          TTIMER CANCEL       Yes, kill timer                   @SC87015 05537500
  1077. TRMRET   DS    0H                                              @SC92030 05538000
  1078.          L     0,KTGETT+4                                      @SC92030 05538500
  1079.          L     1,KTGETT                                        @SC92030 05539000
  1080.          BAL   8,TRMLOG      Log data read                     @SC92180 05539500
  1081.          L     15,KTGETT+4   Get length read                   @SC92030 05540000
  1082.          S     15,WRCMDL+4   Deduct 3 for buffer adr           @SC92030 05540500
  1083.          B     RTRN                                            @SC87015 05541000
  1084. TRMTIM   DETACH TASKADD      Blow off task                     @NW86330 05541500
  1085.          MVI   ECBREAD,0     Zero out read ECB                 @NW86330 05542000
  1086.          ATTACH EP=KERMTGET,MF=(E,COMPTR)                      @NW86330 05542500
  1087.          ST    1,TASKADD     Save adr for detach               @NW86330 05543000
  1088.          L     1,APKT        Ptr to data buffer                @SC87015 05543500
  1089.          MVI   0(1),AT       Timed out                         @SC87015 05544000
  1090.          B     RTRN1         Set count to one                  @SC87015 05544500
  1091. *                                                                       05545000
  1092. TRMFULA1 DC    X'C2,11,4040,3C,4040,00,1D60,11,C150'           @SC92030 05545500
  1093. TRMFULL1 EQU   *-TRMFULA1                                      @SC92030 05546000
  1094. TRMFULA2 DC    X'11,C36F,1D40,13'                              @SC92030 05546500
  1095. TRMFULL2 EQU   *-TRMFULA2                                      @SC92030 05547000
  1096. TRMFULB1 DC    X'C2,11,4040,3C,4040,00,1D60,11,C650'           @SC92030 05547500
  1097. TRMFULB2 DC    X'11,C86F,1D40,13'                              @SC92030 05548000
  1098.          LTORG                                                 @SC92180 05548500
  1099.          TITLE 'KERMTGET Routine - Read from terminal (timed)'          05549000
  1100. *  ECB's control timing flow                                   @NW86330 05549500
  1101. KERMTGET CSECT                                                 @SC87015 05550000
  1102.          USING *,12                                            @SC88299 05550500
  1103.          SAVE  (14,12),,*                                      @SC87015 05551000
  1104.          LR    12,15                                           @SC88299 05551500
  1105.          LM    10,11,0(1)    Set up addressibility             @SC87015 05552000
  1106. KTGLP0   WAIT  ECB=ECBREAD                                     @NW86330 05552500
  1107.          MVI   ECBREAD,0     Zero ECB                          @NW86330 05553000
  1108.          L     1,KTGETT      Adr of buffer to put in           @NW86330 05553500
  1109.          L     0,KTGETT+4    Max TGET (although tcam's 4k)     @NW86330 05554000
  1110.          TGET  (1),(0),ASIS                                    @NW86330 05554500
  1111.          LTR   15,15                                           @NW86330 05555000
  1112.          BZ    KTGLEN        Ok                                @NW86330 05555500
  1113.          C     15,F12                                          @NW86330 05556000
  1114.          BE    KTGLEN        Ok                                @NW86330 05556500
  1115.          CH    15,=H'24'                                       @SC92030 05557000
  1116.          BE    KTGLEN        Ok, Full-screen                   @SC92030 05557500
  1117.          SR    1,1           Error                             @NW86330 05558000
  1118.          BCTR  1,0                                             @NW86330 05558500
  1119. KTGLEN   ST    1,KTGETT+4    Save length                       @SC87015 05559000
  1120.          POST  ECBTGET       Tell em we read it                @NW86330 05559500
  1121.          B     KTGLP0        Keep repeating                    @NW86330 05560000
  1122.          LTORG                                                 @SC87015 05560500
  1123.          TITLE 'GETLIN Routine - Get a line from terminal'     @SC87015 05561000
  1124. * Entry: R1->buffer of length 256                              @SC87015 05561500
  1125. * Exit: Buffer filled, R0=length, R15=0 if ok. Else R15=1.     @SC87015 05562000
  1126. GETLIN   ENTER                                                 @SC87015 05562500
  1127.          LR    8,1           Save buffer ptr                   @SC88095 05563000
  1128.          LA    9,256         For copying                       @SC88095 05563500
  1129.          LA    3,APGPB       Ptr to GETLINE block              @SC88095 05564000
  1130.          USING GTPB,3                                          @SC88095 05564500
  1131.          ICM   5,15,GTPBIBUF Already got something?            @SC88095 05565000
  1132.          BNZ   GTL1          Yes, return it                    @SC87015 05565500
  1133.          SR    0,0                                             @SC91205 05566000
  1134.          IC    0,ERRNUM      Get current status code           @SC91205 05566500
  1135.          C     0,F1                                            @SC91205 05567000
  1136.          BH    *+6                                             @SC91205 05567500
  1137.           SR   0,0           Treat 1 as if 0                   @SC91205 05568000
  1138.          L     1,ORGR1       Get ptr to CPPL                   @SC91205 05568500
  1139.          USING CPPL,1                                          @SC91205 05569000
  1140.          L     1,CPPLECT     Get ECT ptr                       @SC91205 05569500
  1141.          USING ECT,1                                           @SC91205 05570000
  1142.          STCM  0,7,ECTRTCD   Set CC for any CLIST running      @SC91205 05570500
  1143.          DROP  1                                               @SC91205 05571000
  1144.          MVI   CPECB,0       Clear ECB                         @SC88119 05571500
  1145.          L     15,GETLINAD   Entry point for GETLINE routine   @NW86330 05572000
  1146.          GETLINE PARM=(3),TERMGET=(EDIT,WAIT),ENTRY=(15),      @SC88095+05572500
  1147.                MF=(E,IOPLAREA)                                 @SC87015 05573000
  1148.          SR    2,2                                             @SC88095 05573500
  1149.          C     15,F4         Problem?                          @SC87015 05574000
  1150.          BH    GTLA          Yes, give up with len=0           @SC87015 05574500
  1151.          L     5,GTPBIBUF    Ptr to input buffer               @SC88095 05575000
  1152. GTL1     LH    1,0(5)        Length of stuff (inc. header)     @SC88095 05575500
  1153.          AR    1,5           End of buffer                     @SC88095 05576000
  1154.          LR    0,1           Save end                          @SC88095 05576500
  1155.          LH    6,2(5)        Get starting offset (init. 0)     @SC88095 05577000
  1156.          LA    6,4(6,5)      Ptr into buffer                   @SC88095 05577500
  1157.          LR    2,1                                             @SC88095 05578000
  1158.          SR    2,6           Length of text remaining          @SC88095 05578500
  1159.          BNP   GTLFRE        None, return length 0             @SC88095 05579000
  1160.          SR    4,4                                             @SC88095 05579500
  1161.          IC    4,LNDLM       Get delimiter                     @SC88095 05580000
  1162.          LA    4,TRTBL(4)    Ptr to delimiter char             @SC88095 05580500
  1163.          MVI   0(4),1        Set up to snag delims             @SC88095 05581000
  1164.          MVI   TRTBL+C' ',0  And ignore blanks                 @SC88095 05581500
  1165.          CR    2,9           Get shorter of 256 and string     @SC88095 05582000
  1166.          BNH   *+6                                             @SC88095 05582500
  1167.           LR   2,9                                             @SC88095 05583000
  1168.          BCTR  2,0           Set up for EX                     @SC88095 05583500
  1169.          EX    2,GTLTRT                                        @SC88095 05584000
  1170.          MVI   0(4),0        Now clear out table               @SC88095 05584500
  1171.          MVI   TRTBL+C' ',1  And restore                       @SC88095 05585000
  1172.          SR    1,6           Length of line                    @SC88095 05585500
  1173.          LR    7,1           Set up MVCL                       @SC88095 05586000
  1174.          CR    9,7           Get shorter of 256 and string     @SC88095 05586500
  1175.          BNH   *+6                                             @SC88095 05587000
  1176.           LR   9,7                                             @SC88095 05587500
  1177.          LR    2,9           Length actually copied            @SC88095 05588000
  1178.          MVCL  8,6                                             @SC88095 05588500
  1179.          AR    6,7           In case we couldn't use it all    @SC88095 05589000
  1180.          CR    6,0           Finished input?                   @SC88095 05589500
  1181.          BNL   GTLFRE        Yes, release it                   @SC88095 05590000
  1182.          S     6,F3          + 1 - 4: skip over linend char    @SC88095 05590500
  1183.          SR    6,5           New offset ptr                    @SC88095 05591000
  1184.          STH   6,2(5)                                          @SC88095 05591500
  1185.          B     GTLZ          Return                            @SC88095 05592000
  1186. GTLFRE   LR    1,5           This buffer is used up            @SC88095 05592500
  1187.          LH    0,0(1)        Get total length                  @SC88095 05593000
  1188.          FREEMAIN RC,LV=(0),A=(1),SP=1 Free input buffer       @NW86330 05593500
  1189. GTLA     MVC   GTPBIBUF,F0   Clear input indicator             @SC87015 05594000
  1190. GTLZ     RETREG (0,2)        Return (2) as R0                  @SC89218 05594500
  1191.          B     RTRN0                                           @SC87015 05595000
  1192.          DROP  3                                               @SC88095 05595500
  1193. GTLTRT   TRT   0(,6),TRTBL   Find a delimiter                  @SC88095 05596000
  1194.          LOCALS ,                                              @SC87015 05596500
  1195. GETLIN   EXIT  ,                                               @SC87015 05597000
  1196.          TITLE 'SCRNIO Routine - Handle screen I/O via Series/1'        05597500
  1197. * R1 points to a pair of (adr,len) for read or write.  If I/O is        05598000
  1198. * successfull, R15 returns transferred byte count (else returns -1).    05598500
  1199. *               Command code is in R0:                                  05599000
  1200. * 0 => Clear screen on console (not comm line)                 @SC90045 05599500
  1201. * 1 => Open screen for I/O            4 => Write packet (gets ATTN)     05600000
  1202. * 2 => Close screen                   5 => Read packet                  05600500
  1203. * 3 => Reset screen status after      6 => Write message (no ATTN)      05601000
  1204. *      environment changes                                              05601500
  1205. *                                                                       05602000
  1206. TERMIO   ENTER AGAIN                                           @SC92180 05602500
  1207. SCRNIO   ENTER ALT                                             @SC92180 05603000
  1208.          LA    8,SCRPLST     Get PLST ptr                      @SC90222 05603500
  1209.          LR    6,1           Save ptr to plist                 @SC90222 05604000
  1210.          LTR   0,0                                             @SC90045 05604500
  1211.          BZ    SCRCLR                                          @SC90045 05605000
  1212.          STC   0,CONSOPR     Save command code                 @LP88158 05605500
  1213.          BCT   0,SCRCLS                                        @SC86295 05606000
  1214. * Set up for transparent I/O                                            05606500
  1215.          L     1,=A(IDEFS)   CSECT of initializations          @SC90173 05607000
  1216.          USING DEFS,1        Mapped via DSECT                  @SC90173 05607500
  1217.          LA    2,S1DATA      Series/1 introducer               @SC90173 05608000
  1218.          LA    3,S1ORDL+2    Length + 2                        @SC90173 05608500
  1219.          CLI   TRMTP,C'S'                                      @SC90173 05609000
  1220.          BE    SCRPRSET      Do it                             @SC90173 05609500
  1221.          LA    2,GRDATA      Graphics introducer               @SC90173 05610000
  1222.          LA    3,GRDL+2      Length + 2                        @SC90173 05610500
  1223.          CLI   TRMTP,C'G'                                      @SC90173 05611000
  1224.          BE    SCRPRSET      Do it                             @SC90173 05611500
  1225.          LA    2,AEADAT      AEA introducer                    @SC90173 05612000
  1226.          LA    3,AEAL+2                                        @SC90173 05612500
  1227.          DROP  1                                               @SC90173 05613000
  1228. SCRPRSET LR    5,3                                             @SC90173 05613500
  1229.          LA    4,S1EOL+2     Get start of command buffer       @SC90173 05614000
  1230.          SR    4,5                                             @SC90173 05614500
  1231.          STM   4,5,S1XOPL    Set up prompt plist               @SC90173 05615000
  1232.          S     5,F2          Deduct stuff already there        @SC90173 05615500
  1233.          MVCL  4,2                                             @SC90173 05616000
  1234.          MVI   SCRLST,0      Clear op code                     @SC88091 05616500
  1235.          STFSMODE ON,INITIAL=YES,NOEDIT=YES Full-screen mode   @TS86001 05617000
  1236.          LA    6,CLRSPLST                                      @SC90222 05617500
  1237.          BAL   9,SCRNEXW     Clear screan                      @SC90222 05618000
  1238.          B     RTRN0                                           @SC86295 05618500
  1239. SCRCLR   CLI   TRMTP,C'T'    Is it a TTY terminal?             @SC90045 05619000
  1240.          BE    RTRN0         Yes, can't clear screen           @SC90045 05619500
  1241.          CLI   TRMTP,C'V'    Is it a TTY terminal?             @SC90045 05620000
  1242.          BE    RTRN0         Yes, can't clear screen           @SC90045 05620500
  1243.          CLI   TRMTP,C'F'    Is it some full-screen?           @SC92030 05621000
  1244.          BE    *+12          Yes, must clear frequently        @SC92030 05621500
  1245.          TM    FL2,PROTO     In protocol mode?                 @SC90045 05622000
  1246.          BO    RTRN0         Yes, skip clearing screen         @SC90045 05622500
  1247.          STFSMODE ON,INITIAL=YES,NOEDIT=YES Full-screen mode   @SC91246 05623000
  1248.          B     SCRCLRB       Do it                             @SC91246 05623500
  1249. SCRCLS   BCT   0,SCRRSET                                       @SC86295 05624000
  1250. * Clean up after I/O                                                    05624500
  1251. SCRCLRB  DS    0H                                              @SC91246 05625000
  1252.          LA    6,CLRSPLST                                      @SC90222 05625500
  1253.          BAL   9,SCRNEXW     Clear screan                      @SC90222 05626000
  1254.          STFSMODE OFF                                          @TS86001 05626500
  1255.          B     RTRN0                                           @SC86295 05627000
  1256. * (Re)set device characteristics to suit environment                    05627500
  1257. SCRRSET  BCT   0,SCRRW                                         @SC86295 05628000
  1258.          B     RTRN0                                                    05628500
  1259. *                                                                       05629000
  1260. *  Perform I/O request                                                  05629500
  1261. SCRRW    DS    0H                                              @SC90222 05630000
  1262.          SR    2,2                                             @SC88091 05630500
  1263.          IC    2,SCRLST      1=>Write, 2=>Read, 3=>Wr. msg.    @SC88091 05631000
  1264.          STC   0,SCRLST      Save new code                     @SC88091 05631500
  1265.          BCT   0,SCRRD       Different handling for each       @SC88019 05632000
  1266. SCRWM    DS    0H            Come back here for message        @SC88105 05632500
  1267.          BAL   9,SCRNEXW     Write it                          @SC90222 05633000
  1268.          ICM   1,15,SCRRC    Check return code                 @SC90222 05633500
  1269.          BNZ   RTRNM1        This may never happen             @SC90222 05634000
  1270.          B     RTRN0         Assume OK                         @SC88019 05634500
  1271. SCRRD    BCT   0,SCRWM       Go if "Write message"             @SC88019 05635000
  1272.          C     2,F3          Was last operation a Write msg?   @SC88091 05635500
  1273.          BNE   SCRRD1        No, fine                          @SC88091 05636000
  1274.          TPG   SCRF6,1       Yes, must trigger a READ MOD      @SC90145 05636500
  1275. SCRRD1   DS    0H                                              @SC88091 05637000
  1276.          MVI   4(8),X'81'    Flags: TGET                       @SC88019 05637500
  1277. SCRE4TRY BAL   9,SCRNEX      Execute internal subr             @SC93159 05638000
  1278.          LTR   15,15         Did it fail?                      @LP88188 05638500
  1279.          BL    RTRN          Yes, continue                     @LP88188 05639000
  1280.          TM    FL2,PROTO     In midst of transfer?             @SC88203 05639500
  1281.          BZ    RTRN          No, must be status check          @SC88203 05640000
  1282.          L     1,4(,8)       Data address                      @LP88188 05640500
  1283.          CLI   0(1),X'E4'    7171 overrun (line error)?        @LP88188 05641000
  1284.          BNE   RTRN          No, continue                      @LP88188 05641500
  1285.          LA    8,SCRE4RES    Reset transparent mode            @SC93159 05642000
  1286.          MVI   CONSOPR,6                                       @SC93159 05642500
  1287.          BAL   9,SCRNEXP                                       @SC93159 05643000
  1288.          LA    8,SCRE4RET                                      @LP88188 05643500
  1289.          MVI   CONSOPR,4     And send a dummy packet           @LP88188 05644000
  1290.          BAL   9,SCRNEXP                                       @SC93159 05644500
  1291.          MVI   CONSOPR,5     Do the read again                 @LP88188 05645000
  1292.          LA    8,SCRPLST     Get PLST ptr                      @SC93159 05645500
  1293.          B     SCRE4TRY      Loop until no more E4 reply       @LP88188 05646000
  1294. *                                                                       05646500
  1295. * SCRLOG: Hexadecimal log of (R2) bytes at address (R1)        @LP88158 05647000
  1296. * Log label is taken from R0 low order byte.                   @SC89166 05647500
  1297. * Return via R7.  R0-R3 and R15 destroyed.                     @SC89166 05648000
  1298. SCRLOG   TM    FL1,DEBUG     Logging in effect?                @SC87286 05648500
  1299.          BZR   7             No, that's all                    @SC89166 05649000
  1300.          TM    DBGFLG,DBGIO  I/O stuff requested?              @SC88168 05649500
  1301.          BZR   7             No, skip it                       @SC89166 05650000
  1302.          L     3,LOGBUF      Ptr to buffer                     @LP88158 05650500
  1303.          STC   0,0(,3)       Set log label                     @SC89166 05651000
  1304.          LA    3,2(,3)       Start of data area                @SC91172 05651500
  1305.          TM    DBGFLG,DBGTI  Times requested?                  @SC91172 05652000
  1306.          BZ    SCRLOGA       No, just do hex dump              @SC91172 05652500
  1307.          ST    1,SCRLR1      Save ptr to block                 @SC91172 05653000
  1308.          BAL   14,ACCTTOD    Get time of day in seconds        @SC91172 05653500
  1309.          MVI   0(3),C' '     Leave a space                     @SC91172 05654000
  1310.          KCALL DUMPTOD,1(3)  Format time into buffer           @SC91172 05654500
  1311.          LR    3,15          Get ptr to end of string          @SC91172 05655000
  1312.          L     1,SCRLR1      Restore R1                        @SC91172 05655500
  1313. SCRLOGA  LA    0,6*9(,3)     End of line buffer                @SC91172 05656000
  1314.          TM    DBGFLG,DBGLO  Long buffer requested?            @SC90222 05656500
  1315.          BZ    *+8                                             @SC90222 05657000
  1316.           LA   0,50*9(,3)    Yes, long buffer                  @SC91172 05657500
  1317. SCRLOGLP MVI   0(3),C' '     Add for readability               @LP88158 05658000
  1318.          UNPK  1(9,3),0(5,1) Unpack into buffer                @SC88168 05658500
  1319.          TR    1(8,3),TRHEX  Convert to printable hex          @SC88168 05659000
  1320.          LA    3,9(3)        Advance text ptr                  @SC88168 05659500
  1321.          LA    1,4(1)        and data source                   @LP88158 05660000
  1322.          S     2,F4          Finished data?                    @SC88168 05660500
  1323.          BNP   SCRLGEND      Yes, go write                     @LP88158 05661000
  1324.          CR    3,0           Reached text limit?               @LP88158 05661500
  1325.          BL    SCRLOGLP      no, loop for more slices          @LP88158 05662000
  1326.          MVC   0(3,3),=C'...' Show incomplete                  @LP88158 05662500
  1327.          LA    3,3(3)                                          @SC88168 05663000
  1328. SCRLGEND DS    0H                                              @LP88158 05663500
  1329.          AR    2,2           Check for incomplete slice        @SC88168 05664000
  1330.          BNM   *+6           No, ok                            @SC88168 05664500
  1331.          AR    3,2           Yes, adjust end of text           @SC88168 05665000
  1332.          S     3,LOGBUF      Get length of text                @SC88168 05665500
  1333.          WRITF LOGPTR,BSIZE=(3) Log it                         @LP88158 05666000
  1334.          TM    DBGFLG,DBGSV  SAVE requested?                   @SC88168 05666500
  1335.          BZR   7             No, skip closing log file         @SC89166 05667000
  1336.          SAVEF LOGPTR        Update disk directory             @SC88168 05667500
  1337.          BR    7                                               @SC89166 05668000
  1338. *                                                                       05668500
  1339. SCRNEXW  MVI   4(8),X'03'    Flags: FULLSCR/NOEDIT             @SC90222 05669000
  1340.          MVI   12(8),X'01'   More flags: NOEDIT for TPUT       @SC90222 05669500
  1341. SCRNEX   MVC   5(3,8),1(6)   Copy adr                          @SC90222 05670000
  1342.          MVC   2(2,8),6(6)   Copy len                          @SC90222 05670500
  1343.          OI    12(8),X'80'   Flag for extended plist           @SC90222 05671000
  1344. SCRNEXP  DS    0H                                              @SC93159 05671500
  1345.          LR    1,8           Get plist ptr                     @SC90222 05672000
  1346.          SLR   2,2           Convert op. code to log label     @LP88158 05672500
  1347.          IC    2,CONSOPR                                       @LP88158 05673000
  1348.          LA    2,CONSOPRS(2)                                   @LP88158 05673500
  1349.          IC    0,0(,2)                                         @SC89166 05674000
  1350.          LA    2,16          Size of plist                     @SC90222 05674500
  1351.          BAL   7,SCRLOG      Log it                            @SC90222 05675000
  1352.          CLI   CONSOPR,5     Read operation?                   @SC90222 05675500
  1353.          BE    SCRNEXG       Yes, use registers only           @SC90222 05676000
  1354.          ICM   0,8,=X'80'    Set hi bit of R0                  @SC90222 05676500
  1355.          LR    1,8           Get ptr for SVC                   @SC90222 05677000
  1356.          TPUT  (1),(0),R                                       @SC90222 05677500
  1357.          LH    5,2(,8)       Number of chars sent              @SC90222 05678000
  1358.          B     SCRNEXT       Now rejoin                        @SC90222 05678500
  1359. SCRNEXG  LM    0,1,0(8)      Load up registers for SVC         @SC90222 05679000
  1360.          TGET  (1),(0),R                                       @SC90222 05679500
  1361.          LR    5,1           Number of chars recv'd            @SC90222 05680000
  1362. SCRNEXT  ST    15,SCRRC      Save return code                  @SC90222 05680500
  1363.          LTR   15,15                                           @SC90222 05681000
  1364.          BZ    SCRNEXD       Ok, log data                      @SC90222 05681500
  1365.          CH    15,=H'24'     Check for "ok, but NOEDIT"        @SC91259 05682000
  1366.          BE    SCRNEXD       Yup, that's ok                    @SC91259 05682500
  1367.          LA    1,SCRRC                                         @SC90222 05683000
  1368.          LA    2,4                                             @SC90222 05683500
  1369.          LA    0,C'e'        "Error" label                     @SC90222 05684000
  1370.          BAL   7,SCRLOG      Log the return code               @SC90222 05684500
  1371. SCRNEXD  L     1,4(,8)       Data address                      @SC90222 05685000
  1372.          LA    0,C'd'        "Data" label                      @SC89166 05685500
  1373.          LR    2,5           Data size                         @SC90222 05686000
  1374.          BAL   7,SCRLOG      Log data                          @SC90222 05686500
  1375.          LR    15,5                                            @LP88186 05687000
  1376.          S     15,WRCMDL+4   Deduct 3 for buffer adr           @SC90173 05687500
  1377.          BNMR  9             Presumably ok                     @SC92030 05688000
  1378.          CLI   WRRD,0        Was it write-only?                @SC92030 05688500
  1379.          BNER  9             No                                @SC92030 05689000
  1380.          C     5,F1          If READ, did we get just AID?     @SC92030 05689500
  1381.          BNER  9             No                                @SC92030 05690000
  1382.          SR    15,15         Yes, assume all is well           @SC92030 05690500
  1383.          BR    9                                               @SC86299 05691000
  1384. *                                                                       05691500
  1385. SCRE4RES TPUT  SCRE4LTM,SCRE4LTL,NOEDIT,MF=L                   @SC93159 05692000
  1386. SCRE4RET TPUT  SCRE4DWR,SCRE4DWL,NOEDIT,MF=L                   @SC93159 05692500
  1387. SCRE4LTM DC    &S1CMD,AL1(SBA),X'4040',AL1(ICR),X'4040' Reset  @SC93159 05693000
  1388. SCRE4LTL EQU   *-SCRE4LTM    Length of command                 @SC88168 05693500
  1389. SCRE4DWR DC    &S1CMD,AL1(SBA),X'5D7F',AL1(SBA),X'000180' packe@SC93159 05694000
  1390. SCRE4DWL EQU   *-SCRE4DWR    Length of command                 @SC88168 05694500
  1391. *                                                                       05695000
  1392. CLRSPEC  DC    &S1CMD,AL1(SBA),X'4040',X'3C404000' Clr scrn    @SC90264 05695500
  1393. CLRSPECL EQU   *-CLRSPEC     Length of clear screen            @TS86001 05696000
  1394. CLRSPLST DC    AL4(CLRSPEC,CLRSPECL)                           @SC90222 05696500
  1395. *                                                                       05697000
  1396. CONSOPRS DC    C'?ocswrmg'   Console command labels for log    @SC93146 05697500
  1397. SCRF6    DC    X'F6'         Cmd to trigger a READ MOD         @SC90145 05698000
  1398.          LOCALS ,                                              @SC86299 05698500
  1399. SCRPLST  DS    4F            Plist for TPUT/TGET               @SC88019 05699000
  1400. TRMLRS   EQU   SCRPLST       Saved registers for logging       @SC92180 05699500
  1401. SCRRC    DS    F             Return code from TPUT/TGET        @SC90222 05700000
  1402. SCRLR1   DS    F             Saved R1 in SCRLOG                @SC91172 05700500
  1403. CONSOPR  DS    XL1           Current I/O operation             @SC89180 05701000
  1404. SCRNIO   EXIT  ,                                               @SC86299 05701500
  1405.          TITLE 'SETMSG Routine - controls CP breakin'                   05702000
  1406. * Entry: R1 selects operation                                           05702500
  1407. * Exit: R15=0 if ok                                                     05703000
  1408. * 1-> Analyze user environment, determine if suitable.                  05703500
  1409. *     Save quantities needed and condition line for entering commands.  05704000
  1410. *     Perform any system-dependent initialization.                      05704500
  1411. * 2-> Condition line for protocol transfers.                            05705000
  1412. * 3-> Decondition line at end of transfer.                              05705500
  1413. * 4-> System-dependent clean-up at exit.                                05706000
  1414. * 5-> Reperform system-dependent initialization after SET LINE.         05706500
  1415. SETMSG   ENTER ,                                               @SC87015 05707000
  1416.          BCT   1,STM2                Go if R1 not 1, so no init         05707500
  1417.          L     1,ORGR1       Get original R1                   @SC86299 05708000
  1418.          TM    0(1),X'80'    Is this a command processor?      @SC86299 05708500
  1419.          BO    NOTCP         No, then refuse user              @SC86299 05709000
  1420.          USING CPPL,1                                          @SC86299 05709500
  1421.          L     2,CPPLUPT     Get ptr to UPT                    @SC86299 05710000
  1422.          USING UPT,2                                           @SC86299 05710500
  1423.          XR    3,3                                             @SC86299 05711000
  1424.          IC    3,UPTPREFL    Get length                        @SC86299 05711500
  1425.          STH   3,DESTL       Save for later                    @SC86299 05712000
  1426.          MVC   DEST(7),UPTPREFX Move prefix                    @SC86299 05712500
  1427.          MVI   DESTP,C' '    Not a PDS                         @SC86299 05713000
  1428.          MVC   OLDUPTSW,UPTSWS  Save UPTSWS for later          @TL89181 05713500
  1429.          LA    4,IOPLAREA    Get address of IOPL               @TS86001 05714000
  1430.          USING IOPL,4        Make it addressable               @TS86001 05714500
  1431.          MVC   IOPLUPT,CPPLUPT Copy UPT ptr                    @TS86001 05715000
  1432.          L     3,CPPLECT     Copy ECT ptr                      @SC89052 05715500
  1433.          ST    3,IOPLECT                                       @SC89052 05716000
  1434.          LA    0,CPECB       Get address of ECB                @TS86001 05716500
  1435.          ST    0,IOPLECB     Put into IOPL                     @TS86001 05717000
  1436.          USING ECT,3                                           @SC89052 05717500
  1437.          MVC   ORGPCMD,ECTPCMD Save for Kermit HELP            @SC89052 05718000
  1438.          DROP  3,4                                             @SC89052 05718500
  1439.          OPENF L,=C'SYSPROC ',,SYSPROC,E=STMS1                 @SC89073 05719000
  1440. STMS1    DS    0H                                              @SC89073 05719500
  1441.          B     STMOK         Do some more setup                @SC90173 05720000
  1442. *                                                                       05720500
  1443. STM5X    DS    0H            Now set up controller type        @SC90173 05721000
  1444.          MVI   TRMTP,C'&KCONT'  1st assume TTY                 @SC88309 05721500
  1445.          GTSIZE ,            Get terminal info                 @SC86299 05722000
  1446.          LTR   0,0           Is this a graphics device?        @SC86299 05722500
  1447.          BZ    STMSTY        No                                @SC86299 05723000
  1448.          GTTERM PRMSZE=GTTSIZ,ATTRIB=GTTATTR,MF=(E,GTTPL)      @DL92073 05723500
  1449.          SR    1,1           Assume Query not allowed          @SC91311 05724000
  1450.          TM    GTTATTR+3,1                                     @SC91311 05724500
  1451.          BZ    STMGRS        Query not allowed                 @SC91311 05725000
  1452.          LA    1,STCQBIT     Ok, Query is allowed              @SC91311 05725500
  1453. STMGRS   DS    0H                                              @SC91311 05726000
  1454.          O     1,=A(&CONOPTS)                        Options   @SC91311 05726500
  1455.          KCALL SETCON        Find out just what kind...        @SC91311 05727000
  1456.          B     RTRN0                                           @SC90173 05727500
  1457. STMSTY  STSIZE SIZE=130      Set up linesize                   @TS86001 05728000
  1458.          STCC  ATTN          Try PROFILE(ATTN)                 @GH89042 05728500
  1459.          LTR   0,0           Check for LD=ATTN                 @GH89042 05729000
  1460.          BM    RTRN0         Must be TCAM TTY                  @SC90173 05729500
  1461.          LA    15,X'FF'      Set mask                          @GH89042 05730000
  1462.          NR    15,0          Isolate old LD                    @GH89042 05730500
  1463.          STCC  LD=(15)       Restore old LD                    @GH89042 05731000
  1464.          LTR   0,0           Did first STCC work?              @GH89042 05731500
  1465.          BM    RTRN0         Yes: must be TCAM TTY             @SC90173 05732000
  1466.          MVI   TRMTP,C'V'    No: must be VTAM TWX              @GH89042 05732500
  1467.          B     RTRN0                                           @SC90173 05733000
  1468. STMOK    DS    0H                                              @SC88042 05733500
  1469. *          Note: KWRKBASE is 11...                             @SC89268 05734000
  1470.          STM   10,11,COMPTR  Save ptrs for KERMTGET            @SC87015 05734500
  1471.          LA    0,STKDSN      Set up DSN for STACK              @SC88026 05735000
  1472.          LH    1,DESTL                                         @SC88026 05735500
  1473.          LA    2,DEST        Get userid prefix                 @SC88026 05736000
  1474.          LA    3,LFID                                          @SC88026 05736500
  1475.          MVCL  0,2           Copy prefix                       @SC88026 05737000
  1476.          LR    1,3                                             @SC88026 05737500
  1477.          LA    2,=CL8'.KER.BUF'                                @SC88026 05738000
  1478.          LA    3,8           Copy rest of name                 @SC88026 05738500
  1479.          ICM   3,8,BLANK     Fill with blanks                  @SC88026 05739000
  1480.          MVCL  0,2                                             @SC88026 05739500
  1481.          LA    5,READATTN    ATTN routine adr (just post ECB)  @SC88118 05740000
  1482.          LA    6,CPECB       Ptr to ECB to post on ATTN        @SC88118 05740500
  1483.          STAX  (5),MF=(E,STAXPLR),USADDR=(6)                   @SC88118 05741000
  1484.          LOAD  EP=IKJGETL    Get line routine adr              @NW86330 05741500
  1485.          ST    0,GETLINAD    Store it off                      @NW86330 05742000
  1486.          LA    0,PTLLEN                                        @SC88026 05742500
  1487.          ST    0,PTPB+4      Set up PUTLINE parameter block    @SC88026 05743000
  1488.          LOAD  EP=IKJPUTL    PUTLINE routine adr               @SC88026 05743500
  1489.          ST    0,PUTLINAD                                      @SC88026 05744000
  1490.          L     5,=A(KERMTGET) Adr of TGET module               @NW86330 05744500
  1491.          PTEXT 'IDENTIFY failed.' Just in case                 @SC87015 05745000
  1492.          IDENTIFY EP=KERMTGET,ENTRY=(5)                        @NW86330 05745500
  1493.          LTR   15,15                                           @NW86330 05746000
  1494.          BNZ   SUBERR                                          @SC87015 05746500
  1495.          PTEXT 'ATTACH failed.' Just in case                   @SC87015 05747000
  1496.          ATTACH EP=KERMTGET,MF=(E,COMPTR)                      @SC87015 05747500
  1497.          LTR   15,15                                           @NW86330 05748000
  1498.          BNZ   SUBERR                                          @SC87015 05748500
  1499.          ST    1,TASKADD     Save adr for detach               @NW86330 05749000
  1500.          B     STM5X                                           @SC90173 05749500
  1501. *                                                                       05750000
  1502. READATTN STM   14,12,12(13)  Save registers                    @SC88118 05750500
  1503.          L     1,8(1)        Get ptr to term ECB               @SC88118 05751000
  1504.          POST  (1)           Post it                           @SC88118 05751500
  1505.          LM    14,12,12(13)  Restore registers                 @SC88118 05752000
  1506.          BR    14                                              @SC88118 05752500
  1507. *                                                                       05753000
  1508. STM2     BCT   1,STM3                Go if R1 was not 2, so not off     05753500
  1509.          CLI   S1HND,XON     User wants special one anyway?    @SC87343 05754000
  1510.          BNE   STM2X                                           @SC87343 05754500
  1511.          BAL   14,TTYCHK     TTY terminals can't change hndshk @SC92030 05755000
  1512.           MVI  S1HND,0       System provides the handshake     @SC87343 05755500
  1513. STM2X    DS    0H                                              @SC87343 05756000
  1514.          TM    FL1,TSTF                                        @SC86295 05756500
  1515.          BO    RTRN0         Just testing, don't change it     @SC86295 05757000
  1516.          CLI   TRMLIN,C' '   Alternate comm line?              @SC87300 05757500
  1517.          BNE   RTRN1         Not allowed!                      @SC87300 05758000
  1518.          STCOM NO            Set NOINTERCOM during protocol    @TL89181 05758500
  1519.          ICM   1,15,STMUOFF  Turn off, just in case            @SC88042 05759000
  1520.          B     STMD                                                     05759500
  1521. *                                                                       05760000
  1522. STM3     BCT   1,STM4                                          @SC86316 05760500
  1523.          TM    OLDUPTSW,UPTNCOM  Chk for NOINTERCOM in old UPT @TL89181 05761000
  1524.          BO    STM3A         If so, leave it off               @TL89181 05761500
  1525.          STCOM YES           Otherwise, set INTERCOM back on   @TL89181 05762000
  1526. STM3A    DS    0H                                              @TL89181 05762500
  1527.          ICM   1,3,STMUCH    Restore user's settings           @SC88042 05763000
  1528.          ICM   1,12,STMUOFF  Set flags to modify CDEL+LDEL     @SC88042 05763500
  1529. STMD     LA    0,7                                             @SC88042 05764000
  1530.          SLL   0,24          Set entry code for STCC           @SC88042 05764500
  1531.          SVC   94                                              @SC88042 05765000
  1532.          STC   0,STMUCH      Save previous LDEL                @SC88042 05765500
  1533.          STC   1,STMUCH+1    and CDEL                          @SC88042 05766000
  1534.          DROP  1,2                                             @SC88042 05766500
  1535.          B     RTRN0                                                    05767000
  1536. *                                                                       05767500
  1537. STM4     BCT   1,STM5        Special clean-up                  @SC87351 05768000
  1538.          DETACH TASKADD      Kill sub-task                     @SC87296 05768500
  1539.          CLOSF SYSPROC       Close CLIST library               @SC89073 05769000
  1540.          B     RTRN0         Special clean-up done             @SC87296 05769500
  1541. *                                                                       05770000
  1542. STM5     DS    0H            Re-init after SET LINE            @SC87351 05770500
  1543.          MVI   TRMTP,C'N'    Assume bad until validated        @SC90173 05771000
  1544.          CLI   TRMLIN,C' '   External line?                    @SC87351 05771500
  1545.          BE    STM5X         No, use terminal                  @SC90173 05772000
  1546.          B     RTRN1         Other lines not allowed           @SC90173 05772500
  1547. *                                                                       05773000
  1548. NOTCP    PTEXT '&NOTCPER'                                      @SC86299 05773500
  1549.          TPUT  (3),(4)       Simplest output method...         @SC88287 05774000
  1550.          B     RTRN1                                           @SC88287 05774500
  1551. *                                                                       05775000
  1552. STMUOFF  DC    X'3000FFFF'   No char & line delete             @SC88042 05775500
  1553. *                                                                       05776000
  1554.          LOCALS ,                                              @SC86295 05776500
  1555. GTTPL    GTTERM MF=L         Parameter block for GTTERM        @SC91311 05777000
  1556. GTTATTR  DS    F             Results from GTTERM               @SC91311 05777500
  1557. GTTSIZ   DS    H             GTTERM size response (ignore)     @DL92073 05778000
  1558. SETMSG   EXIT                                                           05778500
  1559.          TITLE 'DISKIO Routine - performs disk I/O functions'           05779000
  1560. * ERRNUM unchanged unless there is a disk error                         05779500
  1561. * Function selected on entry by R0:                                     05780000
  1562. * 0=> same as 9 (q.v.), but if ok, return R1->buffer,R0=# and remove    05780500
  1563. *   the sequence number (if any) from the buffer (used for TAKE files)  05781000
  1564. * 1=> open (in): R1->pattern FDB, R2->name.  Returns R0->FAB, R1->FDB   05781500
  1565. * 2=> open (out): (same)                                                05782000
  1566. * 3=> test name: R2->name.  Returns R1->FDB if file found and  @SC91269 05782500
  1567. *     writable (else R15=1)                                    @SC91269 05783000
  1568. *       (will say "found" if member given, but it's not a PDS) @SC88043 05783500
  1569. *       (will say "not found" if given member of PDS is missing)        05784000
  1570. * 4=> close file: R1->adr(FAB).                                         05784500
  1571. * 5=> set up search: R1->pattern name.                                  05785000
  1572. * 6=> return next file in list:  Returns R1->FDB + sets up FILNAM       05785500
  1573. * 7=> close search (if any).                                            05786000
  1574. * 8=> test CWD string: R1->string.  Returns R15=0 if ok, else =1.       05786500
  1575. * 9=> read: R1->FAB.  Returns R15=12 if EOF, 0 if ok; R0=# data         05787000
  1576. * 10=> write: R1->FAB.  Returns R15=13 if disk full, 0 if ok.           05787500
  1577. * 11=> test space: R1->pattern FDB (has size in Kbytes),                05788000
  1578. *  R2->name (used if FAB not found), R6->adr(FAB). Return R15=0 if ok.  05788500
  1579. * 12=> analyze R/W error, set ERRNUM, make EMSG: R1->FAB, TMPDW=code    05789000
  1580. *      always returns R15=1                                             05789500
  1581. * 13=> directory info on file: R1->name.  Returns R15=0 if ok.          05790000
  1582. * 14=> delete file: R1->name.  Returns R15=0 if ok.                     05790500
  1583. * 15=> rename file: R1->name, R2->new name.  Returns R15=0 if ok.       05791000
  1584. * 16=> copy file: R1->name, R2->new name.  Returns R15=0 if ok.         05791500
  1585. * 21=> save file status in directory: R1->FAB.                 @SC88168 05792000
  1586. * 22=> open library (in): R2->DDNAME.  Return R15=0 if ok.     @SC89073 05792500
  1587. * 23=> point for next read, R1->adr(FDB), R2=records to skip.  @SC89218 05793000
  1588. *      Return R15=0 if ok.                                     @SC89218 05793500
  1589. * 24=> test name: R2->name.  Returns R1->FDB if file found and @SC91269 05794000
  1590. *      readable (else R15=1)                                   @SC91269 05794500
  1591. DISKIO   ENTER                                                          05795000
  1592.          USING FABD,3                                          @SC86295 05795500
  1593.          SR    4,4           Signal no block assigned          @SC86295 05796000
  1594.          STC   0,DSKCOD      Save function code (for now)      @SC88101 05796500
  1595.          LA    5,DYNDSP                                        @SC86345 05797000
  1596.          LA    6,FDBTRKAL-FDBD(1) Use pattern TRKAL            @SC88026 05797500
  1597.          LA    7,DYNRC                                         @SC86345 05798000
  1598.          L     8,DFMSGP      Ptr to message buffer             @SC88119 05798500
  1599.          XC    0(4,8),0(8)   Clear out old message             @SC88119 05799000
  1600.          STM   5,8,DYNPL+16  Set up calling sequence           @SC86345 05799500
  1601.          LA    5,DISKIO+4095                                   @SC92022 05800000
  1602.          USING DISKIO+4095,5                                   @SC92022 05800500
  1603.          LR    6,0                                             @SC92022 05801000
  1604.          AR    6,6                                             @SC92022 05801500
  1605.          LH    6,DSK0(6)     Get handler address               @SC92022 05802000
  1606.          B     DSK0(6)       Do the function                   @SC92022 05802500
  1607. DSK0     DC    Y(DSKRED-DSK0,DSKOPNI-DSK0,DSKOPNO-DSK0)   0-2  @SC89073 05803000
  1608.          DC    Y(DSKTEST-DSK0,DSKCLOS-DSK0,DSKNSET-DSK0)  3-5  @SC89073 05803500
  1609.          DC    Y(DSKNXT-DSK0,DSKXSET-DSK0,DSKCWDF-DSK0)   6-8  @SC89073 05804000
  1610.          DC    Y(DSKRED-DSK0,DSKWRT-DSK0,DSKTSP-DSK0)     9-11 @SC89073 05804500
  1611.          DC    Y(DSKXXX-DSK0),8Y(DSKUTL-DSK0)            12-20 @SC89073 05805000
  1612.          DC    Y(DSKTCLOS-DSK0,DSKOPLIB-DSK0)            21-22 @SC89073 05805500
  1613.          DC    Y(DSKPNT-DSK0,DSKTEST-DSK0)               23-24 @SC91269 05806000
  1614.          DC    8Y(DSKER1-DSK0)   Spares                        @SC89073 05806500
  1615. *                                                                       05807000
  1616. * Open for input file whose name is at (R2), FDB at (R1)                05807500
  1617. DSKOPNI  DS    0H                                              @SC89073 05808000
  1618.          BAL   9,DSKALC      Get FAB                           @SC86295 05808500
  1619.          BAL   2,DSKLKP      Get DSCB                          @SC86299 05809000
  1620.          BNZ   DSKER1        Not found                         @SC86295 05809500
  1621.          BAL   14,DSKTCON    Check PDS notation                @SC88119 05810000
  1622.          BAL   14,DSKVALS                                      @SC86295 05810500
  1623.          BAL   9,DSKFABS     Set up FAB from FDB               @SC86299 05811000
  1624.          LH    0,FABLRECL                                      @SC86299 05811500
  1625.          CH    0,FDBBSIZ+2   Too big?                          @SC86299 05812000
  1626.          BNL   *+8           Yes, just read a buffer full      @SC86299 05812500
  1627.          ST    0,FDBBSIZ     Set buffer size, in case RECFM=F  @SC86299 05813000
  1628.          B     DSKOPT        Open and test                     @SC88049 05813500
  1629. *                                                                       05814000
  1630. * Open for output file whose name is at (R2), FDB at (R1)               05814500
  1631. DSKOPNO  DS    0H                                              @SC89073 05815000
  1632.          BAL   9,DSKALC      Get FAB                           @SC86295 05815500
  1633.          BAL   2,DSKLKP      Get DSCB                          @SC86299 05816000
  1634.          MVI   DYNDSP,X'42'  NEW,CATLG if not found            @SC89250 05816500
  1635.          BNZ   DSKOPN        Not found, just writing new       @SC86299 05817000
  1636.          BAL   14,DSKTCON    Check PDS notation                @SC88119 05817500
  1637.          MVI   DYNDSP,X'18'  OLD,KEEP                          @SC86299 05818000
  1638.          TM    DS1DSO,2      PDS?                              @SC88083 05818500
  1639.          BO    DSKOPVA       Yes, keep the other members!      @SC88083 05819000
  1640.          TM    FDBFLGS,APPN                                    @SC86295 05819500
  1641.          BZ    *+8                                             @SC90033 05820000
  1642.          MVI   DYNDSP,X'28'  MOD,KEEP                          @SC88083 05820500
  1643.          TM    FDBFLGS,APPN+SVATT                              @SC90033 05821000
  1644.          BZ    DSKOPN                                          @SC90033 05821500
  1645. DSKOPVA  DS    0H                                              @SC88083 05822000
  1646.          BAL   14,DSKVALS                                      @SC86295 05822500
  1647.          BAL   9,DSKFABS     Set up FAB from FDB               @SC86299 05823000
  1648. DSKOPN   MVI   DSKOPLS,X'8F' Code for OPEN OUTPUT              @SC88049 05823500
  1649.          LH    0,FDBLRC                                        @SC88120 05824000
  1650.          BAL   2,DSKTV                                         @SC88120 05824500
  1651.           S    0,F4          Deduct 4 for RDW if RECFM=V       @SC88120 05825000
  1652.          ST    0,FABLRTR     Set effective record length       @SC88120 05825500
  1653. DSKOPT   KCALL DYNALC,DYNPL,EXT                                @SC86299 05826000
  1654.          CLI   DYNRC+3,0                                       @SC88119 05826500
  1655.          BNE   DSKERAL       Error on allocation               @SC88119 05827000
  1656.          CLI   DYNDSP,X'42'  NEW dataset?                      @SC88090 05827500
  1657.          BNE   DSKOPBZ       No, assume BLKSIZE is ok          @SC88090 05828000
  1658.          DEVTYPE FABDDNAM,DYNPL  Yes, get max block            @SC88090 05828500
  1659.          ICM   0,15,DYNPL+4                                    @SC88090 05829000
  1660.          BNH   DSKOPBZ       Max not defined??                 @SC88090 05829500
  1661.          CH    0,FABBLKSI                                      @SC88090 05830000
  1662.          BNL   DSKOPBZ       Current BLKSIZE is ok             @SC88090 05830500
  1663.          STH   0,FABBLKSI    Mustn't exceed physical limits!   @SC88090 05831000
  1664. DSKOPBZ  DS    0H                                              @SC88090 05831500
  1665.          OPEN  MF=(E,DSKOPLS)                                  @SC88049 05832000
  1666.          TM    FABOFLGS,X'10'                                  @SC86299 05832500
  1667.          BZ    DSKER1        Didn't work                       @SC86299 05833000
  1668.          LA    9,FDBD        FDB pointer                       @SC91283 05833500
  1669.          RETREG (0,3),(1,9)  Return FAB ptr in R0, FDB in R1   @SC91283 05834000
  1670.          B     RTRN0                                           @SC86295 05834500
  1671. *                                                                       05835000
  1672. * Open library with DDNAME at (R2) - for BLDL only             @SC89073 05835500
  1673. DSKOPLIB LR    8,2                                             @SC89073 05836000
  1674.          LA    1,TAKFDB      VB/256                            @SC89073 05836500
  1675.          LA    2,F0+FABDSN-FABDSMB DS=PO                       @SC89073 05837000
  1676.          BAL   9,DSKALC      Get a DCB                         @SC89073 05837500
  1677.          MVC   FABDDNAM,0(8) Use given DD name                 @SC89073 05838000
  1678.          DMSFREE DWORDS=176/8,ERR=DSKER1 Get a JFCB            @SC89073 05838500
  1679.          LR    7,1           Save ptr to block                 @SC92022 05839000
  1680.          ST    7,FABEXL      Add to exit list                  @SC92022 05839500
  1681.          MVI   FABEXL,7      Mark it a JFCB                    @SC89073 05840000
  1682.          RDJFCB MF=(E,DSKOPLS)                                 @SC88073 05840500
  1683.          LR    6,15                                            @SC89073 05841000
  1684.          DMSFRET DWORDS=176/8,LOC=(7)                          @SC92022 05841500
  1685.          LTR   15,6                                            @SC89073 05842000
  1686.          BNZ   DSKER1                                          @SC89073 05842500
  1687.          MVI   FABEXL,0      Disable JFCB ptr                  @SC89073 05843000
  1688.          B     DSKOPBZ       Now open for input                @SC89073 05843500
  1689. *                                                                       05844000
  1690. * Test for existence of file whose name is at (R2)                      05844500
  1691. DSKTEST  DS    0H                                              @SC89073 05845000
  1692.          LR    8,2           Save DSN ptr                      @SC89250 05845500
  1693.          LA    1,FILFDB      Default pattern for HRECALL       @SC89250 05846000
  1694.          BAL   9,DSKALC      Allocate DCB                      @SC89250 05846500
  1695.          BAL   2,DSKLKP      Get DSCB                          @SC86299 05847000
  1696.          BNZ   DSKER1        Not found                         @SC86299 05847500
  1697.          CLI   FABDSMB,C' '  Did we want a member?             @SC88119 05848000
  1698.          BE    DSKTE1        No, fine                          @SC88043 05848500
  1699.          TM    DS1DSO,2      Was it a PDS?                     @SC88043 05849000
  1700.          BZ    DSKTE1        No, ignore the conflict for now   @SC88043 05849500
  1701.          XC    FABDSMB,FABDSMB Signal DSORG=PO                 @SC88119 05850000
  1702.          OPENF I,FABDSN,FILFDB,DSKTKT,E=DSKER1                 @SC89250 05850500
  1703.          MVC   FABDSMB,44(8) Restore member name               @SC89250 05851000
  1704.          L     1,DSKTKT                                        @SC88043 05851500
  1705.          MVC   PDSBLK(4),=Y(1,58)   Set count and length       @GH90139 05852000
  1706.          MVC   PDSMEMBR,44(8)   Move in member name            @GH90139 05852500
  1707.          BLDL  (1),PDSBLK    See if member is there            @GH90139 05853000
  1708.          LR    6,15          Save return code                  @SC92022 05853500
  1709.          CLOSF DSKTKT        Close it up again                 @SC88043 05854000
  1710.          LTR   6,6                                             @SC92022 05854500
  1711.          BNZ   DSKER1        Wasn't there                      @SC89250 05855000
  1712. DSKTE1   MVC   DSKSTT+FDBD-FABD(FDBINFO),FDBD  Save FDB stuff  @SC89250 05855500
  1713.          LA    0,FABDWDS     Release FAB storage               @SC89250 05856000
  1714.          LR    1,3                                             @SC89250 05856500
  1715.          DMSFRET DWORDS=(0),LOC=(1)                            @SC89250 05857000
  1716.          SR    4,4           Mark it gone                      @SC89250 05857500
  1717.          LA    3,DSKSTT      Ptr for internal FDB              @SC89250 05858000
  1718.          BAL   14,DSKVALS    Fill out FDB                      @SC89250 05858500
  1719.          LA    9,FDBD        FDB pointer                       @SC91283 05859000
  1720.          RETREG (1,9)  Return FDB ptr in R1                    @SC91283 05859500
  1721.          B     RTRN0                                           @SC86299 05860000
  1722. *                                                                       05860500
  1723. * Close file whose ticket is at (R1), release block                     05861000
  1724. DSKCLOS  DS    0H                                              @SC89073 05861500
  1725.          ICM   3,15,0(1)     Get FAB ptr, if any               @SC86295 05862000
  1726.          BZ    RTRN0         None, ignore                      @SC86295 05862500
  1727.          MVI   0(1),X'80'    Flag for normal close             @SC88049 05863000
  1728.          LR    2,1           Save ptr                          @SC88049 05863500
  1729.          CLOSE MF=(E,(1))    Close it                          @SC88049 05864000
  1730.          XC    0(4,2),0(2)   Ok, now clear ticket              @SC88049 05864500
  1731.          TM    FABBUFCB+3,1  Any buffers?                      @SC88043 05865000
  1732.          BO    DSKFRPZ       No, fine                          @SC88043 05865500
  1733.       FREEPOOL (3)                                             @SC86299 05866000
  1734. DSKFRPZ  DS    0H            Now free whole FAB                @SC88043 05866500
  1735.          LA    0,FABDWDS                                       @SC86295 05867000
  1736.          LR    1,3                                             @SC86299 05867500
  1737.        DMSFRET DWORDS=(0),LOC=(1)                              @SC86295 05868000
  1738.          B     RTRN0                                           @SC86295 05868500
  1739. *                                                                       05869000
  1740. * TClose file whose ticket is in (R1)                          @SC88168 05869500
  1741. DSKTCLOS ST    1,DSKTKT                                        @SC88168 05870000
  1742.          MVI   DSKTKT,X'80'  Flag for normal close             @SC88168 05870500
  1743.          CLOSE MF=(E,DSKTKT),TYPE=T                            @SC88168 05871000
  1744.          B     RTRN0                                           @SC88168 05871500
  1745. *                                                                       05872000
  1746. * Read from file whose ticket is at (R1)                                05872500
  1747. DSKRED   DS    0H                                              @SC89073 05873000
  1748.          LTR   3,1           Get FAB ptr                       @SC86299 05873500
  1749.          BNP   RTRN1         Not defined anymore               @SC86299 05874000
  1750.          L     15,FABGET     I/O routine                       @SC86299 05874500
  1751.          BALR  14,15         Go to it                          @SC86299 05875000
  1752.          LM    14,15,FDBBUFF Get buffer and size               @SC92022 05875500
  1753.          LH    7,FABLRECL    Actual length                     @SC86299 05876000
  1754.          LR    0,7           Save length for number check      @SC88101 05876500
  1755.          AR    7,1           End of record                     @SC86299 05877000
  1756.          BAL   2,DSKTV                                         @SC86299 05877500
  1757.           LA   1,4(1)        Skip over SDW if V                @SC86299 05878000
  1758.          CLI   DSKCOD,0      NONUM?                            @SC88101 05878500
  1759.          BNE   DSKREDC       No, use everything                @SC88101 05879000
  1760.          CLI   FDBRCF,C'F'   Fixed-length records?             @SC88101 05879500
  1761.          BNE   DSKREDV       No, line numbers at start (if any)@SC88101 05880000
  1762.          CH    0,=H'80'      See if F/80                       @SC88101 05880500
  1763.          BNE   DSKREDC       No                                @SC88101 05881000
  1764.          MVZ   DSKMNTH(5),75(1)  See if 76-80 are all numeric  @SC90213 05881500
  1765.          CLC   DSKMNTH(5),=8C'0' (DSKMNTH was cleared: LOCAL)  @SC90213 05882000
  1766.          BNE   DSKREDC       No                                @SC88101 05882500
  1767.          S     7,F8          Yes, move the end back            @SC88101 05883000
  1768.          B     DSKREDC                                         @SC88101 05883500
  1769. DSKREDV  LA    0,8(1)        Is length at least 8?             @SC88101 05884000
  1770.          CR    0,7                                             @SC88101 05884500
  1771.          BNL   DSKREDC       No, can't be numbered             @SC88101 05885000
  1772.          MVZ   DSKMNTH(8),0(1)   See if 1-8 all numeric        @SC90213 05885500
  1773.          CLC   DSKMNTH(8),=8C'0' (DSKMNTH was cleared: LOCAL)  @SC90213 05886000
  1774.          BNE   DSKREDC       No, not numbered                  @SC88101 05886500
  1775.          LA    1,8(1)        Yes, skip over number             @SC88101 05887000
  1776. DSKREDC  DS    0H                                              @SC88101 05887500
  1777.          SR    7,1           Revised length                    @SC86299 05888000
  1778.          LR    6,1                                             @SC86299 05888500
  1779.          CR    7,15                                            @SC92022 05889000
  1780.          BNL   *+6                                             @SC86299 05889500
  1781.           LR   15,7          Buffer not filled                 @SC92022 05890000
  1782.          L     1,4(13)                                         @SC86299 05890500
  1783.          ST    15,20(,1)     Return length in R0               @SC92022 05891000
  1784.          CLI   DSKCOD,0      NONUM?                            @SC88101 05891500
  1785.          BNE   *+8                                             @SC88101 05892000
  1786.           ST   14,24(,1)     Yes, return R1 ptr                @SC92022 05892500
  1787.          MVCL  14,6          Copy to buffer                    @SC92022 05893000
  1788.          B     RTRN0                                           @SC86299 05893500
  1789. * End of file on input. Don't close it yet.                    @SC86295 05894000
  1790. DSKEOD   LA    15,12         End return code                   @SC86295 05894500
  1791.          B     RTRN                                            @SC86295 05895000
  1792. *                                                                       05895500
  1793. * Write to file whose ticket is at (R1)                                 05896000
  1794. DSKWRT   DS    0H                                              @SC89073 05896500
  1795.          LTR   3,1           Get FAB ptr                       @SC86299 05897000
  1796.          BNP   RTRN1         Not defined anymore               @SC86299 05897500
  1797.          LM    8,9,FDBBUFF   Get buffer and size               @SC92022 05898000
  1798. DSKWR1   LR    6,9           Copy for LRECL                    @SC92022 05898500
  1799.          BAL   2,DSKTV                                         @SC86299 05899000
  1800.           LA   6,4(,9)       + 4 if RECFM=V                    @SC92022 05899500
  1801.          STH   6,FABLRECL    Set up for output                 @SC86299 05900000
  1802.          IC    7,ERRNUM      Save previous error code, if any  @SC88139 05900500
  1803.          MVI   ERRNUM,0      Clear error number                @SC86299 05901000
  1804.          L     15,FABGET     I/O routine                       @SC86299 05901500
  1805.          BALR  14,15         Do it                             @SC86299 05902000
  1806.          SR    15,15                                           @SC86299 05902500
  1807.          ICM   15,1,ERRNUM   See if deadly error               @SC86299 05903000
  1808.          BNZ   RTRN          Yes, pass return code             @SC86299 05903500
  1809.          STC   7,ERRNUM      Restore previous error code       @SC88139 05904000
  1810.          TM    FABRECFM,FABRECU  Check if V                    @SC91283 05904500
  1811.          BNM   DSKWR2        No, U                             @SC91283 05905000
  1812.          TM    FABRECFM,FABRECF                                @SC91283 05905500
  1813.          BO    DSKWR2        No, F                             @SC91283 05906000
  1814.          XC    0(4,1),0(1)                                     @SC86299 05906500
  1815.          STCM  6,3,0(1)      In case V                         @SC86299 05907000
  1816.           LA   1,4(1)        V: space over SDW                 @SC86299 05907500
  1817. DSKWR2   DS    0H                                              @SC91283 05908000
  1818.          LR    6,1                                             @SC86299 05908500
  1819.          LR    7,9                                             @SC92022 05909000
  1820.          MVCL  6,8           Copy to output record             @SC92022 05909500
  1821.          B     RTRN0                                           @SC86295 05910000
  1822. *                                                                       05910500
  1823. * Point past 1st N records of file at (R1)                     @SC89218 05911000
  1824. DSKPNT   ICM   3,15,0(1)     Get ticket                        @SC89218 05911500
  1825.          BZ    RTRN1         Not open                          @SC89218 05912000
  1826.          LR    3,1                                             @SC89218 05912500
  1827.          LTR   2,2           Number of records to skip         @SC89218 05913000
  1828.          BNP   RTRN0         Never mind                        @SC89218 05913500
  1829. DSKPNTL  READF 0(,3),E=RTRN1 Skip one                          @SC89218 05914000
  1830.          BCT   2,DSKPNTL     ... until finished                @SC89218 05914500
  1831.          B     RTRN0         Return with completion code       @SC89218 05915000
  1832. *                                                                       05915500
  1833. * Analyze error: packed dec. code in TMPDW                              05916000
  1834. DSKXXX   DS    0H                                              @SC89073 05916500
  1835.          MVI   ERRNUM,ERRDIE Set Kermit error code             @SC87338 05917000
  1836.          L     2,EMSGP       Ptr to msg buffer                 @SC87338 05917500
  1837.          CLC   =C'  ',0(2)   Proper SYNAD message?             @SC87338 05918000
  1838.          BE    *+10          Yes, ok                           @SC87338 05918500
  1839.          XC    EMSGL,EMSGL   No, clear length                  @SC87338 05919000
  1840.          B     RTRN1                                           @SC87338 05919500
  1841. *                                                                       05920000
  1842. * Disk utility for file(s) at (R1) and (R2)                             05920500
  1843. DSKUTL   LR    8,0           Save code-12                      @SC86316 05921000
  1844.          MVC   DSKPSAV(8),DESTL+1 Save Kermit prefix           @SC88043 05921500
  1845.          L     14,ORGR1      Find User prefix                  @SC88043 05922000
  1846.          USING CPPL,14                                         @SC88043 05922500
  1847.          L     14,CPPLUPT                                      @SC88043 05923000
  1848.          USING UPT,14                                          @SC88043 05923500
  1849.          MVC   DESTL+1(1),UPTPREFL Use that for now            @SC88043 05924000
  1850.          MVC   DEST(7),UPTPREFX                                @SC88043 05924500
  1851.          DROP  14                                              @SC88043 05925000
  1852.          SH    0,=H'13'      Code-13: DIR,DEL,REN,COP          @SC89073 05925500
  1853.          SLA   0,3                                             @SC86295 05926000
  1854.          LA    14,DSKCMDS                                      @SC92022 05926500
  1855.          AR    14,0          Ptr to command name               @SC92022 05927000
  1856.          LA    7,CMD         Buffer for system command         @SC86299 05927500
  1857.          MVC   0(8,7),0(14)                                    @SC92022 05928000
  1858.          LA    7,8(7)                                          @SC86299 05928500
  1859.          LTR   0,0           Was it DIR?                       @SC88043 05929000
  1860.          BNZ   DSKUTP        No, use filespec(s) as is         @SC88043 05929500
  1861.          MVC   0(4,7),=C'LVL(' Yes, maybe need an option       @SC88043 05930000
  1862.          MVC   4(44,7),0(1)  If so, need whole filespec        @SC88043 05930500
  1863.          LA    0,4(7)                                          @SC88043 05931000
  1864.          LA    1,44                                            @SC88043 05931500
  1865.          LA    14,DEST       Comparand is user prefix          @SC88043 05932000
  1866.          LH    15,DESTL                                        @SC88043 05932500
  1867.          ICM   15,8,BLANK    Extended with blanks              @SC88043 05933000
  1868.          CLCL  0,14                                            @SC88043 05933500
  1869.          BE    DSKUTX        Just that - no options            @SC88043 05934000
  1870.          LA    1,4+44(7)                                       @SC88043 05934500
  1871.          TRT   4(44,7),TRTBL Find end of filespec              @SC88043 05935000
  1872.          MVI   0(1),C')'     And complete the syntax           @SC88043 05935500
  1873.          LA    7,1(1)        End of command string             @SC88043 05936000
  1874.          B     DSKUTX        Do it                             @SC88043 05936500
  1875. DSKUTP   DS    0H            Other utilities...                @SC88043 05937000
  1876.          BAL   3,DSKUTCP                                       @SC86295 05937500
  1877.          SRA   0,4                                             @SC86295 05938000
  1878.          BZ    *+10                                            @SC86295 05938500
  1879.          LR    1,2           2nd file                          @SC86295 05939000
  1880.          BAL   3,DSKUTCP                                       @SC86295 05939500
  1881. DSKUTX   MVC   DESTL+1(8),DSKPSAV Restore Kermit prefix        @SC88043 05940000
  1882.          LA    0,CMD                                           @SC86295 05940500
  1883.          LR    6,7                                             @SC86299 05941000
  1884.          SR    6,0                                             @SC86299 05941500
  1885.          NI    FL4,255-UCMD  Not user command: adr=(0),len=(6) @SC86295 05942000
  1886.          KCALL SUPFNC,3      Execute it                        @SC86295 05942500
  1887.          B     RTRN                                            @SC86295 05943000
  1888. *                                                                       05943500
  1889. DSKUTCP  LR    4,0           Save ID                           @SC86299 05944000
  1890.          LA    0,FFDSP                                         @SC86299 05944500
  1891.          KCALL FSPEC                                           @SC86299 05945000
  1892.          MVI   0(15),C' '                                      @SC86299 05945500
  1893.          LA    7,1(15)       New output ptr                    @SC86299 05946000
  1894.          LR    0,4                                             @SC86299 05946500
  1895.          BR    3                                               @SC86295 05947000
  1896. *                                                                       05947500
  1897. DSKCMDS  DC    C'LISTCAT '   Utility command names             @SC86299 05948000
  1898.          DC    C'DELETE  '                                     @SC86299 05948500
  1899.          DC    C'RENAME  '                                     @SC86299 05949000
  1900.          DC    C'COPY    '                                     @SC86299 05949500
  1901. *                                                                       05950000
  1902. DSKTV    TM    FABRECFM,FABRECU                                @SC86299 05950500
  1903.          BNM   4(2)          U                                 @SC86299 05951000
  1904.          TM    FABRECFM,FABRECF                                @SC86299 05951500
  1905.          BO    4(2)          F                                 @SC86299 05952000
  1906.          BR    2             V                                 @SC86299 05952500
  1907. * Check PDS notation -- must match DSORG.  Return via R14               05953000
  1908. DSKTCON  TM    DS1DSO,2      Partitioned?                      @SC88119 05953500
  1909.          BO    DSKTCOP       Yes, insist on member name        @SC88119 05954000
  1910.          CLI   FABDSMB,C' '  Member name?                      @SC88119 05954500
  1911.          BER   14            No, ok                            @SC88119 05955000
  1912.          B     DSKER1                                          @SC88119 05955500
  1913. DSKTCOP  CLI   FABDSMB,C' '  Member name?                      @SC88119 05956000
  1914.          BNER  14            Yes, ok                           @SC88119 05956500
  1915.          CLI   FABDSMB+1,0   No, but maybe just want directory?@SC88119 05957000
  1916.          BER   14            Yes, ok                           @SC88119 05957500
  1917. * Return on error, release useless block, if any                        05958000
  1918. DSKER1   LTR   1,4           Any block assigned?               @SC86295 05958500
  1919.          BZ    RTRN1         No                                @SC86295 05959000
  1920.          LA    0,FABDWDS     Yes, release it                   @SC86295 05959500
  1921.        DMSFRET DWORDS=(0),LOC=(1)                              @SC86295 05960000
  1922.          B     RTRN1         Flag error                        @SC86295 05960500
  1923. *                                                                       05961000
  1924. DSKERAL  L     1,DFMSGP      Ptr to DAIRFAIL buffer            @SC88119 05961500
  1925.          SR    9,9                                             @SC88119 05962000
  1926.          ICM   9,3,0(1)      Length of message                 @SC88119 05962500
  1927.          BZ    DSKER1        None (why not?)                   @SC88119 05963000
  1928.          LA    8,4(1)        Start of text                     @SC88119 05963500
  1929.          CLC   =C'IKJ',0(8)  Has msg id?                       @SC88119 05964000
  1930.          BNE   *+8                                             @SC88119 05964500
  1931.           LA   8,10(8)       Yes, skip it                      @SC88119 05965000
  1932.          S     8,F2                                            @SC88119 05965500
  1933.          MVC   0(2,8),=C'  ' Make it begin with two blanks     @SC88119 05966000
  1934.          AR    9,1           End of message                    @SC88119 05966500
  1935.          SR    9,8           Length to use                     @SC88119 05967000
  1936. DSKERMSG L     6,EMSGP       Explanation buffer                @SC89250 05967500
  1937.          LA    7,LEMSG       Length of same                    @SC88119 05968000
  1938.          CR    7,9                                             @SC88119 05968500
  1939.          BNH   *+6                                             @SC88119 05969000
  1940.           LR   7,9           Too long, use what we can         @SC88119 05969500
  1941.          ST    7,EMSGL       Usable length                     @SC88119 05970000
  1942.          MVCL  6,8           Copy to buffer                    @SC88119 05970500
  1943.          B     DSKER1                                          @SC88119 05971000
  1944. *                                                                       05971500
  1945. * Allocate FAB.  Enter with R1->FDB pattern, R2->DSN           @SC92022 05972000
  1946. * Clobber 0,1,2,15.  Set R3,R4->new FAB, R6->pattern.          @SC92022 05972500
  1947. * Return via R9.                                               @SC92022 05973000
  1948. DSKALC   DS    0H                                              @SC92022 05973500
  1949.          LA    6,1           Update counter                    @SC86299 05974000
  1950.          A     6,EVCTR                                         @SC86299 05974500
  1951.          ST    6,EVCTR                                         @SC86299 05975000
  1952.          LR    6,1           Save FDB ptr                      @SC92022 05975500
  1953.          LA    0,FABDWDS                                       @SC86295 05976000
  1954.        DMSFREE DWORDS=(0),ERR=DSKER1                           @SC86295 05976500
  1955.          LR    3,1           New block ptr                     @SC86295 05977000
  1956.          ST    3,DSKOPLS     Save for OPEN plist               @SC88049 05977500
  1957.          MVI   DYNDSP,X'88'  SHR,KEEP                          @SC86299 05978000
  1958.          MVI   DSKOPLS,X'80' Code for OPEN INPUT               @SC88049 05978500
  1959.          LR    4,3           Indicate we have it               @SC88120 05979000
  1960.          XC    0(8*FABDWDS,3),0(3)                             @SC86295 05979500
  1961.          MVC   FDBD(FDBCOP),0(6) Copy user's FDB               @SC92022 05980000
  1962.          MVC   FABDSN,0(2)                                     @SC86299 05980500
  1963.          LA    15,FABDSN     Set up DSN ptr                    @SC86299 05981000
  1964.          LA    0,FABDDNAM    Get DDN ptr                       @SC86299 05981500
  1965.          LA    1,FDBUNT      Get UNIT ptr                      @SC86299 05982000
  1966.          LA    2,FDBVOL      Get VOL ptr                       @SC86299 05982500
  1967.          STM   15,2,DYNPL    Set up DYNALC                     @SC86299 05983000
  1968.          MVI   FABBUFCB+3,1  Fill out DCB                      @SC86299 05983500
  1969.          MVI   FABDSORG,X'40' =PS                              @SC86299 05984000
  1970.          MVI   FABMACR,X'48' MACRF=GL                          @SC88043 05984500
  1971.          CLI   FABDSMB,0     Special case of PDS?              @SC88119 05985000
  1972.          BNE   *+16          No                                @SC88043 05985500
  1973.          MVI   FABDSORG,X'02' Yes, set DSORG=PO                @SC86299 05986000
  1974.          MVI   FABMACR,X'24' ... and MACRF=R                   @SC88043 05986500
  1975.          MVI   FABDSMB,C' '  and blot out member               @SC88119 05987000
  1976.          MVC   FABMACR+1(1),FABMACR                            @SC88043 05987500
  1977.          MVI   FABIOBAD+3,1                                    @SC86299 05988000
  1978.          LA    0,DSKEOD                                        @SC86299 05988500
  1979.          LA    1,FABEXL      Modifiable exit list              @SC89073 05989000
  1980.          MVC   4(8,1),DSKOPEX Copy usual stuff into it         @SC89073 05989500
  1981.          STM   0,1,FABEODAD                                    @SC86299 05990000
  1982.          UNPK  FABDDNAM,EVCTR(5)                               @SC86299 05990500
  1983.          TR    FABDDNAM,TRHEX  Get unique DDNAME               @SC86299 05991000
  1984.          MVI   FABDDNAM,C'K'                                   @SC86299 05991500
  1985.          MVI   FABDDNAM+7,C'Z'                                 @SC86299 05992000
  1986.          MVI   FABOFLGS,2    Not open yet                      @SC88043 05992500
  1987.          MVI   FABCHECK+3,1                                    @SC86299 05993000
  1988.          LA    1,DSKSYN                                        @SC87338 05993500
  1989.          ST    1,FABSYNAD    In case of error                  @SC86299 05994000
  1990.          MVI   FABIOBA+3,1                                     @SC86299 05994500
  1991.          MVC   FABEOBAD(16),FABIOBA                            @SC87314 05995000
  1992.          MVI   FABEOB+3,1                                      @SC86299 05995500
  1993. DSKFABS  LH    1,FDBBLKSI    Copy Info to DCB                  @SC88120 05996000
  1994.          STH   1,FABBLKSI                                      @SC88120 05996500
  1995.          STH   1,FABLRECL                                      @SC86299 05997000
  1996.          MVI   FABRECFM,FABRECU                                @SC86299 05997500
  1997.          CLI   FDBRCF,C'U'                                     @SC86299 05998000
  1998.          BE    DSKFABCC                                        @SC88246 05998500
  1999.          MVC   FABLRECL,FDBLRC Use true LRECL after all        @SC88120 05999000
  2000.          MVI   FABRECFM,FABRECF+FABRECBR                       @SC86299 05999500
  2001.          CLI   FDBRCF,C'F'                                     @SC86299 06000000
  2002.          BE    DSKFABCC                                        @SC88246 06000500
  2003.          MVI   FABRECFM,FABRECV+FABRECBR                       @SC86299 06001000
  2004. DSKFABCC XC    FABRECFM,FDBFLGS Copy carriage control flags    @SC88246 06001500
  2005.          NI    FABRECFM,255-FABRECCC  And only those flags     @SC88246 06002000
  2006.          XC    FABRECFM,FDBFLGS                                @SC88246 06002500
  2007.          BR    9                                               @SC86299 06003000
  2008. *                                                                       06003500
  2009. * Call with R15->name, return to R2 with CC set (Z if ok)               06004000
  2010. * Clobbers or sets 0,1,6,7,14,15.  Assumes R3->full FAB        @SC89250 06004500
  2011. * Assumes name ptr already stored in DYNPL, in case migrated   @SC89250 06005000
  2012. DSKLKP   SR    0,0                                             @SC86299 06005500
  2013.          LA    1,CAMVOLS                                       @SC86299 06006000
  2014.          LA    14,X'44'      Name code                         @SC86299 06006500
  2015.          SLL   14,24                                           @SC86299 06007000
  2016.          STM   14,1,CAMLOC   Save dsn ptr, etc                 @SC86299 06007500
  2017.          LA    0,CAMVOLS+6                                     @SC86299 06008000
  2018.          LA    1,CAMDSCB                                       @SC86299 06008500
  2019.          LA    14,X'C1'      Search code                       @SC86299 06009000
  2020.          SLL   14,24                                           @SC86299 06009500
  2021.          STM   14,1,CAMOBT                                     @SC86299 06010000
  2022.          LA    7,1           Flag for 1st pass                 @SC89250 06010500
  2023. DSKLKPL  DS    0H                                              @SC89250 06011000
  2024.          MVC   CAMVOLS(2),F0 Clear volume count                @SC92147 06011500
  2025.         LOCATE CAMLOC                                          @SC86299 06012000
  2026.          LTR   6,15          Retain 1st code in R6             @SC86299 06012500
  2027.          BZ    DSKLKPCT      Cataloged ok                      @SC90275 06013000
  2028.          CLI   FDBVOL,C' '   Not cataloged, any volume given?  @SC90275 06013500
  2029.          BE    DSKLKPNF      No, can't find it                 @SC90275 06014000
  2030.          MVC   CAMVOLS+6(6),FDBVOL  Try default volume         @SC88342 06014500
  2031.          LA    0,=C'SYSALLDA' and insist on catchall UNIT      @SC88342 06015000
  2032.          ST    0,DYNPL+8      for DYNALC                       @SC90275 06015500
  2033.          OBTAIN CAMOBT       Get DSCB if on given volume       @SC90275 06016000
  2034. DSKLKPNF LTR   15,15         Non-zero return code => not found @SC90275 06016500
  2035.          BR    2                                               @SC90275 06017000
  2036. DSKLKPCT DS    0H            Cataloged dataset                 @SC90275 06017500
  2037.          LA    15,1                                            @SC92147 06018000
  2038.          CLC   CAMVOLS(2),F0 Any volume list returned?         @SC92147 06018500
  2039.          BE    DSKLKPNF      No, must be GDG name (+n)         @SC92147 06019000
  2040.         OBTAIN CAMOBT        Get DSCB                          @SC86299 06019500
  2041.          LA    0,=C' '       Cataloged, don't specify          @SC88342 06020000
  2042.          LR    1,0                                             @SC88342 06020500
  2043.          STM   0,1,DYNPL+8                                     @SC88342 06021000
  2044.          LTR   15,15         Test return code                  @SC89250 06021500
  2045.          BZR   2             Ok, file was found                @SC89250 06022000
  2046.          BCT   7,DSKLKPZ     Quit if already tried recall      @SC89250 06022500
  2047.          TM    FL2,PROTO     Transfer/server mode in progress? @SC89250 06023000
  2048. *        BO    DSKLKPZ       Quit if in protocol mode          @SC89250 06023500
  2049.          CLC   =C'MIGRAT',CAMVOLS+6                            @SC89250 06024000
  2050.          BNE   DSKLKPZ       Quit if volume not MIGRAT         @SC89250 06024500
  2051.          L     6,DYNPL       Get ptr to name again             @SC89250 06025000
  2052.          MVC   LKPMEM,44(6)  Save member name, if any          @SC89250 06025500
  2053.          MVI   44(6),C' '    And blank it out                  @SC89250 06026000
  2054.          KCALL DYNALC,DYNPL,EXT  Set up DD                     @SC89250 06026500
  2055.          MVC   44(8,6),LKPMEM Restore member name              @SC89250 06027000
  2056.          CLI   DYNRC+3,0                                       @SC89250 06027500
  2057.          BNE   DSKER1        Quit if failed                    @SC89250 06028000
  2058.          OPEN  MF=(E,DSKOPLS) Open (and wait for recall)       @SC89250 06028500
  2059.          CLOSE MF=(E,DSKOPLS) Don't use, just close it         @SC89250 06029000
  2060.          TM    FABBUFCB+3,1                                    @SC89250 06029500
  2061.          BO    DSKLKPL       No buffers, all set               @SC89250 06030000
  2062.          FREEPOOL (3)        Free buffers first                @SC89250 06030500
  2063.          B     DSKLKPL       Try all over again to LOCATE      @SC89250 06031000
  2064. *                                                                       06031500
  2065. DSKLKPZ  PTEXT '&MIGRATD',AREG=8,LREG=9                        @SC89250 06032000
  2066.          B     DSKERMSG      Copy msg to buffer                @SC89250 06032500
  2067. *                                                                       06033000
  2068. * Handle synchronous disk I/O errors                                    06033500
  2069. DSKSYN   SYNADAF ACSMETH=QSAM Get system to do the work        @SC87338 06034000
  2070.          L     2,EMSGP       Ptr to msg buffer                 @SC87338 06034500
  2071.          MVC   0(80,2),48(1) Copy message (inc. 2 blanks)      @SC87338 06035000
  2072.          LA    2,80                                            @SC87338 06035500
  2073.          ST    2,EMSGL       Length of string                  @SC87338 06036000
  2074.          SYNADRLS            Clean up                          @SC87338 06036500
  2075.          B     RTRN1                                           @SC87338 06037000
  2076. *                                                                       06037500
  2077. * Set up search through list of files, pattern at (R1)                  06038000
  2078. DSKNSET  DS    0H                                              @SC89073 06038500
  2079.          MVI   CIROPT,2      Get full names                    @SC87015 06039000
  2080.          L     3,CIRWA       Initialize length ptrs            @SC87015 06039500
  2081.          MVC   0(4,3),CIRWAL                                   @SC87015 06040000
  2082.          NI    DSKFL,255-WFN-NXDON                             @SC87015 06040500
  2083.          MVC   NXFN,0(1)     Copy name                         @SC87015 06041000
  2084.          LA    1,NXFN+52     End of member slot                @SC88096 06041500
  2085.          TRT   NXFN+44(8),TRTBL Find end of member name        @SC88096 06042000
  2086.          LR    7,1           Save ptr                          @SC92022 06042500
  2087.          LA    1,NXFN+44                                       @SC87015 06043000
  2088.          TRT   NXFN(44),TRTBL                                  @SC87015 06043500
  2089.          LR    3,1           End of name                       @SC87015 06044000
  2090.          MVI   TRTBL+C'*',1                                    @SC87015 06044500
  2091.          LA    0,NXFN                                          @SC88096 06045000
  2092.          LA    9,DSKNDIR     Where to go if no "*" in DSN      @SC88096 06045500
  2093.          LA    14,DSKNCIR    Where to go if "*" found          @SC88096 06046000
  2094.          TRT   NXFN(44),TRTBL Check for wild card              @SC87015 06046500
  2095. DSKNSW   BZR   9             Len=max, just use the one file    @SC88096 06047000
  2096.          CLI   0(1),C'*'     Did we find an asterisk           @SC87015 06047500
  2097.          BNER  9             No, just the end of the name      @SC88096 06048000
  2098.          MVI   TRTBL+C'*',0                                    @SC88096 06048500
  2099.          OI    DSKFL,WFN     Mark it wild                      @SC87015 06049000
  2100.          LA    4,1(1)                                          @SC87015 06049500
  2101.          ST    4,NXSFPTR     Save ptr to suffix                @SC87015 06050000
  2102.          SR    3,4                                             @SC87015 06050500
  2103.          STH   3,DSNSFL      and length                        @SC87015 06051000
  2104.          SR    1,0                                             @SC87015 06051500
  2105.          STH   1,DSNPFL      Length of prefix                  @SC87015 06052000
  2106.          BR    14            Now get name list                 @SC88096 06052500
  2107. DSKNCIR  CLI   NXFN+44,C' '  Insist no members if wild DSN     @SC88096 06053000
  2108.          BNE   RTRN1                                           @SC88096 06053500
  2109.          AR    1,0           End of prefix string              @SC88096 06054000
  2110. DSKNPLP  BCTR  1,0           Scan back for a dot               @SC88096 06054500
  2111.          CR    1,0           Must be one, else we scan universe@SC88096 06055000
  2112.          BNH   RTRN1         None there, give up               @SC88096 06055500
  2113.          CLI   0(1),C'.'                                       @SC88096 06056000
  2114.          BNE   DSKNPLP       Keep looking                      @SC88096 06056500
  2115.          SR    1,0           Count of bytes in whole qualifiers@SC88096 06057000
  2116.          L     14,CIRSRCH    Argument ptr                      @SC87015 06057500
  2117.          LA    15,44                                           @SC87015 06058000
  2118.          ICM   1,8,BLANK                                       @SC87015 06058500
  2119.          MVCL  14,0          Copy with blank fill              @SC87015 06059000
  2120.          LINK  EP=IKJEHCIR,MF=(E,CIRPARM) Call catalog routine @NW86330 06059500
  2121.          LTR   15,15                                           @SC87015 06060000
  2122.          BNZ   RTRN1         Not found                         @SC87015 06060500
  2123.          LA    1,45-4        Skip count bytes, then back one   @SC88096 06061000
  2124. DSKNRET  L     2,CIRWA       ADR OF RETURNED CATALOG BUFFER    @SC88096 06061500
  2125.          SR    2,1           Back up one item                  @SC88096 06062000
  2126.          ST    2,CATDSPTR    Save ptr to buffer                @NW86330 06062500
  2127.          B     RTRN0                                           @SC86295 06063000
  2128. *                                                                       06063500
  2129. DSKNDIR  LR    3,7           Use end of member name            @SC92022 06064000
  2130.          LA    0,NXFN+44     Start of member                   @SC88096 06064500
  2131.          LA    9,RTRN0       Where to go if not wild           @SC88096 06065000
  2132.          TRT   NXFN+44(8),TRTBL Find any '*'                   @SC88096 06065500
  2133.          MVI   TRTBL+C'*',0  Now restore table                 @SC88096 06066000
  2134.          BAL   14,DSKNSW     Return here if '*' found          @SC88096 06066500
  2135.          SR    4,4           Clear FAB ptr                     @SC88096 06067000
  2136.          LA    1,DSKDPAT     Sample DCB info                   @SC88096 06067500
  2137.          LA    2,CAMVOLS     Reuse this area for the DSN       @SC88096 06068000
  2138.          MVC   0(44,2),NXFN  Copy DSN                          @SC88096 06068500
  2139.          MVI   44(2),C' '    And blank out member              @SC88096 06069000
  2140.          BAL   9,DSKALC      Get a DCB (FAB)                   @SC88096 06069500
  2141.          BAL   2,DSKLKP      Get DSCB                          @SC88096 06070000
  2142.          BNZ   DSKER1        Not found                         @SC89317 06070500
  2143.          TM    DS1DSO,2      Is it really a PDS?               @SC88096 06071000
  2144.          BZ    DSKER1        No, give up                       @SC89317 06071500
  2145.          KCALL DYNALC,DYNPL,EXT Allocate file                  @SC88096 06072000
  2146.          OPEN  MF=(E,DSKOPLS)   And open it to the directory   @SC88096 06072500
  2147.          TM    FABOFLGS,X'10'   Ok?                            @SC88096 06073000
  2148.          BZ    DSKER1        Too bad                           @SC88096 06073500
  2149.          ST    4,DSKTKT      Save ptr to FAB                   @SC88096 06074000
  2150.          L     2,CIRWA       Start of name buffer              @SC88096 06074500
  2151.          LH    9,CIRWAL      Length                            @SC88096 06075000
  2152.          AR    9,2           End of buffer                     @SC88096 06075500
  2153.          S     9,FDBBSIZ     Back up one block                 @SC88096 06076000
  2154. DSKDL1   READF DSKTKT,BUFFER=(2),E=DSKDLZ Read a block         @SC88096 06076500
  2155.          SR    7,7                                             @SC88096 06077000
  2156.          ICM   7,3,0(2)      Get length of block info          @SC88096 06077500
  2157.          AR    7,2           End of block                      @SC88096 06078000
  2158.          BCTR  7,0           Set up BXLE                       @SC88096 06078500
  2159.          LA    8,2(2)        Point to member info              @SC88096 06079000
  2160. DSKDL2   CLC   0(8,8),=8X'FF' End of directory?                @SC88096 06079500
  2161.          BE    DSKDLZ        Yes, all done                     @SC88096 06080000
  2162.          TM    11(8),X'80'   Alias member?                     @SC88096 06080500
  2163.          BO    DSKDL3        Yes, ignore it                    @SC88096 06081000
  2164.          MVI   0(2),C'A'     Create table entry                @SC88096 06081500
  2165.          MVC   1(8,2),0(8)   with member name                  @SC88096 06082000
  2166.          LA    2,9(2)                                          @SC88096 06082500
  2167. DSKDL3   IC    6,11(8)       Get entry length                  @SC88096 06083000
  2168.          N     6,=F'31'                                        @SC88096 06083500
  2169.          LA    6,12(6,6)     In bytes                          @SC88096 06084000
  2170.          BXLE  8,6,DSKDL2    On to next member                 @SC88096 06084500
  2171.          CR    2,9           Room for another block in table?  @SC88096 06085000
  2172.          BNH   DSKDL1        Ok                                @SC88096 06085500
  2173. DSKDLZ   MVI   0(2),0        End of table                      @SC88096 06086000
  2174.          CLOSF DSKTKT        Release the file                  @SC88096 06086500
  2175.          C     2,CIRWA       Did we find anything?             @SC88096 06087000
  2176.          BE    RTRN1         No??                              @SC88096 06087500
  2177.          LA    1,9           Length of entries                 @SC88096 06088000
  2178.          B     DSKNRET       Go init. ptr into table           @SC88096 06088500
  2179. DSKDPAT  DC    A(0,256),C'F',X'0',H'256,0,0,256'               @SC88096 06089000
  2180. *                                                                       06089500
  2181. * Flush previous file pattern                                           06090000
  2182. DSKXSET  DS    0H                                              @SC89073 06090500
  2183.          OI    DSKFL,NXDON                                     @SC87015 06091000
  2184.          B     RTRN0                                           @SC87015 06091500
  2185. *                                                                       06092000
  2186. * Check CWD string, return code in R15                                  06092500
  2187. DSKCWDF  DS    0H                                              @SC89073 06093000
  2188.          SR    4,4           Clear FAB ptr                     @SC91283 06093500
  2189.          LR    2,1           Temp name ptr                     @SC91283 06094000
  2190.          LA    1,DSKDPAT     Sample DCB info                   @SC91283 06094500
  2191.          BAL   9,DSKALC      Get a DCB (FAB)                   @SC91283 06095000
  2192.          BAL   2,DSKLKP      Check name                        @SC87015 06095500
  2193.          BNZ   DSKCWDZ       No conflict, assume valid         @SC91283 06096000
  2194.          TM    DS1DSO,2      Was a full DSN, check DSORG       @SC88054 06096500
  2195.          BO    DSKCWD1       It's a PDS -- see if it matches   @SC88054 06097000
  2196.          CLI   FABDSMB,C'.'  PDS requested?                    @SC91283 06097500
  2197.          BE    DSKER1        Yes, but file not found           @SC91283 06098000
  2198.          B     DSKCWDZ                                         @SC91283 06098500
  2199. DSKCWD1  CLI   FABDSMB,C'.'  PDS requested?                    @SC91283 06099000
  2200.          BNE   DSKER1        No, but file was found            @SC91283 06099500
  2201. DSKCWDZ  B     DSKFRPZ       Yes, ok                           @SC91283 06100000
  2202. *                                                                       06100500
  2203. * Check disk space for proposed file: FDB at (R1), FAB ptr at (R6)      06101000
  2204. DSKTSP   DS    0H                                              @SC89073 06101500
  2205. * - - - get size of available space in R0,R1                   @SC87015 06102000
  2206.          LA    0,1023        For now, claim 4 Tbyte            @SC87015 06102500
  2207.          SRDA  0,10          Convert to Kbytes                 @SC86316 06103000
  2208.          CLR   1,2                                             @SC87012 06103500
  2209.          BL    RTRN1         No room                           @SC86316 06104000
  2210.          B     RTRN0         Ok                                @SC86316 06104500
  2211. *                                                                       06105000
  2212. * Check against prefix and suffix criteria and return next match,       06105500
  2213. *   if any                                                              06106000
  2214. * Also return info in a File Descriptor Block                  @SC86151 06106500
  2215. DSKNXT   DS    0H                                              @SC89073 06107000
  2216.          TM    DSKFL,NXDON                                     @SC87015 06107500
  2217.          BO    RTRN1         Nothing more                      @SC87015 06108000
  2218.          MVC   FILNAM,NXFN                                     @SC87015 06108500
  2219.          TM    DSKFL,WFN     Are we scanning?                  @SC87015 06109000
  2220.          BO    NXFBEG        Yes, do it                        @SC87015 06109500
  2221.          OI    DSKFL,NXDON   No, that's the only one           @SC87015 06110000
  2222.          LA    2,FILNAM                                        @SC87015 06110500
  2223.          B     DSKTEST       Now return file info              @SC89157 06111000
  2224. NXFBEG   L     6,CATDSPTR    Ptr to place in catalog           @NW86330 06111500
  2225.          USING CATDSET,6                                       @NW86330 06112000
  2226.          LA    7,NXFN+44     Start of member                   @SC88096 06112500
  2227.          LA    8,8-1         Length of member name             @SC88096 06113000
  2228.          C     7,NXSFPTR     Is suffix part of member name?    @SC88096 06113500
  2229.          BL    *+12          Yes, we're set                    @SC88096 06114000
  2230.           LA   7,NXFN        No, use start of DSN              @SC88096 06114500
  2231.           LA   8,44-1        and length                        @SC88096 06115000
  2232. NXFDS    LA    6,2(8,6)      Next                              @SC88096 06115500
  2233.          CLI   TYPEBYTE,C'A'                                   @NW86330 06116000
  2234.          BNE   NXFZ          Assume end of list                @SC87015 06116500
  2235.          LH    2,DSNPFL      Get prefix length                 @SC87015 06117000
  2236.          LTR   2,2                                             @NW86330 06117500
  2237.          BNP   XL0092                                          @NW86330 06118000
  2238.          LR    14,7          Compare saved prefix              @SC88096 06118500
  2239.          LA    3,CATDNAME     against this name                @SC87015 06119000
  2240.          LA    9,0(2,3)      End of possible match             @SC92022 06119500
  2241.          BCTR  2,0           Set up for CLC                    @SC87015 06120000
  2242.          EX    2,NXFCMP                                        @SC87015 06120500
  2243.          BNE   NXFDS         No match                          @SC87015 06121000
  2244. XL0092   CLC   DSNSFL,F0                                       @SC87015 06121500
  2245.          BNH   XL0002        Don't check suffix                @NW86330 06122000
  2246.          LA    1,1(8,3)      Limit of name field               @SC88096 06122500
  2247.          EX    8,NXFTRT      Find end of name                  @SC88096 06123000
  2248.          LR    3,1                                             @SC87015 06123500
  2249.          LH    4,DSNSFL                                        @SC87015 06124000
  2250.          SR    3,4           Ptr to start of suffix            @SC87015 06124500
  2251.          CR    3,9                                             @SC92022 06125000
  2252.          BL    NXFDS         Shorter than prefix+suffix        @SC88096 06125500
  2253.          BCTR  4,0                                             @SC87015 06126000
  2254.          L     14,NXSFPTR    Ptr to comparison suffix          @SC87015 06126500
  2255.          EX    4,NXFCMP                                        @SC87015 06127000
  2256.          BNE   NXFDS         No match                          @SC87015 06127500
  2257. XL0002   SH    7,=Y(NXFN-FILNAM)  Transpose into FILNAM        @SC88096 06128000
  2258.          EX    8,NXFCOP      Copy DSN (or member)              @SC88096 06128500
  2259.          ST    6,CATDSPTR    Save ptr for next time            @NW86330 06129000
  2260.          LA    2,FILNAM                                        @SC87015 06129500
  2261.          B     DSKTEST       Now return file info              @SC89157 06130000
  2262. *                                                                       06130500
  2263. NXFCMP   CLC   0(,3),0(14)                                     @SC87015 06131000
  2264. NXFTRT   TRT   0(,3),TRTBL   Find end of name                  @SC88096 06131500
  2265. NXFCOP   MVC   0(,7),CATDNAME Copy name                        @SC88096 06132000
  2266. *                                                                       06132500
  2267. NXFZ     OI    DSKFL,NXDON                                     @SC87015 06133000
  2268.          B     RTRN1         Ran out of names                  @SC87015 06133500
  2269. *                                                                       06134000
  2270. * Clobbers any registers, returns via 14                       @SC90139 06134500
  2271. DSKVALS  DS    0H                                              @SC92170 06135000
  2272.          NI    FDBFLGS,255-PDSF                                @SC87015 06135500
  2273.          TM    DS1DSO,2      ORG=PO?                           @SC87015 06136000
  2274.          BZ    DSKNOPDS      No                                @GH90139 06136500
  2275.          OI    FDBFLGS,PDSF  Yes, it's a PDS                   @SC87015 06137000
  2276.          IC    15,PDSINDIC   Get indicator                     @GH90139 06137500
  2277.          N     15,=X'0000001F'  Isolate last 5 bits            @GH90139 06138000
  2278.          BZ    DSKNOPDS      No user data in directory         @GH90139 06138500
  2279.          CH    15,=H'15'     Enough user data?                 @GH90139 06139000
  2280.          BNE   DSKNOPDS      No - use date/time from DSCB      @GH90139 06139500
  2281.          TM    PDSINDIC,X'60'   TTRs in user data area?        @GH90139 06140000
  2282.          BNZ   DSKNOPDS      Yes - can't handle load modules   @GH90139 06140500
  2283.          CLI   ISPFMDTM,X'23' Is hour plausible?               @SC90139 06141000
  2284.          BH    DSKNOPDS      No - use DSCB date                @SC90139 06141500
  2285.          CLI   ISPFMDTM+1,X'59' Is minute plausible?           @SC90139 06142000
  2286.          BH    DSKNOPDS      No - use DSCB date                @SC90139 06142500
  2287.          TRT   ISPFMDTM,DSKPMSK Valid decimal time?            @SC90139 06143000
  2288.          BNZ   DSKNOPDS      No - use DSCB date                @SC90139 06143500
  2289.          CLC   ISPFMDDT+2(2),=X'366F' Is day of year plausible?@SC90139 06144000
  2290.          BH    DSKNOPDS      No - use DSCB date                @SC90139 06144500
  2291.          CLC   ISPFMDDT+2(2),=X'0010' Is day of year plausible?@SC90139 06145000
  2292.          BL    DSKNOPDS      No - use DSCB date                @SC90139 06145500
  2293.          TM    ISPFMDDT+3,X'08'  Valid sign nybble?            @SC90139 06146000
  2294.          BZ    DSKNOPDS      No - use DSCB date                @SC90139 06146500
  2295.          NI    ISPFMDDT+3,X'F0'  Remove sign nybble            @SC90139 06147000
  2296.          TRT   ISPFMDDT,DSKPMSK Valid decimal date?            @SC90139 06147500
  2297.          BNZ   DSKNOPDS      No - use DSCB date                @SC90139 06148000
  2298.          OI    ISPFMDDT+3,X'0F' Insert plus sign               @SC90139 06148500
  2299.          MVC   FDBDATE+4(2),ISPFMDTM Copy hours, minutes       @GH90139 06149000
  2300.          XC    TMPDW,TMPDW                                     @GH90139 06149500
  2301.          MVC   TMPDW+4(4),ISPFMDDT  Move modification date     @GH90139 06150000
  2302.          CVB   6,TMPDW       Get 00YYDDD in binary             @GH90139 06150500
  2303.          SRDA  6,32                                            @GH90139 06151000
  2304.          D     6,=F'1000'    Separate YY from DDD              @GH90139 06151500
  2305.          STCM  6,B'0011',DS1CRDT+1   Save DDD                  @GH90139 06152000
  2306.          STC   7,DS1CRDT     Save YY                           @GH90139 06152500
  2307.          LA    15,DS1CRDT    Point to modified creation date   @GH90139 06153000
  2308.          B     DSKCRDT       Skip to date conversion           @GH90139 06153500
  2309. DSKNOPDS DS    0H                                              @SC90139 06154000
  2310.          LA    15,DS1CRDT    Assume creation date to be used   @GH89270 06154500
  2311.          CLI   DS1MDDT,99    Is year plausible?                @GH89270 06155000
  2312.          BH    DSKCRDT       No - use creation date            @GH89270 06155500
  2313.          CLC   DS1MDDT+1(2),=AL2(366) Is day of year plausible?@GH89270 06156000
  2314.          BH    DSKCRDT       No - use creation date            @GH89270 06156500
  2315.          CLC   DS1MDDT+1(2),=AL2(1)   Is day of year plausible?@GH89270 06157000
  2316.          BL    DSKCRDT       No - use creation date            @GH89270 06157500
  2317.          CLI   DS1MDTM,X'23' Is hour plausible?                @GH89270 06158000
  2318.          BH    DSKCRDT       No - use creation date            @GH89270 06158500
  2319.          CLI   DS1MDTM+1,X'59' Is minute plausible?            @GH89270 06159000
  2320.          BH    DSKCRDT       No - use creation date            @GH89270 06159500
  2321.          TRT   DS1MDTM,DSKPMSK Valid decimal?                  @SC90139 06160000
  2322.          BNZ   DSKCRDT       No - use creation date            @SC90139 06160500
  2323.          CLC   DS1MDDT,DS1CRDT Is mod date before creation?    @GH89270 06161000
  2324.          BL    DSKCRDT       Yes - use creation date           @GH89270 06161500
  2325.          CLC   DS1MDDT,DS1RFDT After latest ref?               @GH89270 06162000
  2326.          BH    DSKCRDT       Yes - use creation date           @GH89270 06162500
  2327.          MVC   FDBDATE+4(2),DS1MDTM Copy hours, minutes        @GH89270 06163000
  2328.          LA    15,DS1MDDT    Use modification date             @GH89270 06163500
  2329. DSKCRDT  SR    7,7                                             @SC90139 06164000
  2330.          IC    7,0(,15)      Get year in binary                @SC90139 06164500
  2331.          CLC   0(3,15),F0                                      @SC92181 06165000
  2332.          BE    DSKVDATZ      Date field is null, skip it       @SC92181 06165500
  2333.          CVD   7,TMPDW                                         @SC87296 06166000
  2334.          MVO   FDBDATE+1(2),TMPDW Copy year                    @SC87296 06166500
  2335.          ICM   7,3,1(15)     Get day-of-year in binary         @GH89270 06167000
  2336.          MVC   DSKMNTH,=AL1(30,31,30,31,31,30,31,30,31,28,31)  @SC86299 06167500
  2337.          TM    0(15),3       Check for leap year               @GH89270 06168000
  2338.          BNZ   *+8                                             @SC87296 06168500
  2339.          MVI   DSKMNTH+9,29  Leap year, change Feb.            @SC86299 06169000
  2340.          LA    6,11                                            @SC86299 06169500
  2341.          SR    0,0                                             @SC86299 06170000
  2342. DSKVMDL  IC    0,DSKMNTH-1(6)                                  @SC86299 06170500
  2343.          SR    7,0           Test if passed the right month    @SC86299 06171000
  2344.          BNP   DSKVMDM       Got it                            @SC86299 06171500
  2345.          BCT   6,DSKVMDL                                       @SC86299 06172000
  2346.          SR    0,0           Hit December                      @SC86299 06172500
  2347. DSKVMDM  AR    7,0           Get day of month                  @SC86299 06173000
  2348.          LCR   6,6                                             @SC86299 06173500
  2349.          LA    6,12(6)       Get month                         @SC86299 06174000
  2350.          MH    6,=H'100'                                       @SC86299 06174500
  2351.          AR    6,7           Combine MMDD                      @SC86299 06175000
  2352.          MH    6,=H'10'                                        @SC86299 06175500
  2353.          CVD   6,TMPDW                                         @SC86299 06176000
  2354.          MVC   FDBDATE+2(2),TMPDW+5                            @SC86299 06176500
  2355.          MVI   FDBDATE,X'19' Assume 20th Cent                  @SC86295 06177000
  2356.          CLI   FDBDATE+1,X'50'                                 @SC86295 06177500
  2357.          BH    *+8           Ok                                @SC86295 06178000
  2358.          MVI   FDBDATE,X'20' Must be 21st                      @SC86295 06178500
  2359. DSKVDATZ DS    0H                                              @SC92181 06179000
  2360. * = = = = = get file size in bytes in R6,R7 - - -                       06179500
  2361.          SR    6,6           Return 0 for now (i.e., unknown)  @SC87015 06180000
  2362.          SR    7,7                                             @SC87015 06180500
  2363.          AL    7,=F'1023'    Round up                          @SC87007 06181000
  2364.          BNO   *+8           No overflow                       @SC86239 06181500
  2365.          LA    6,1(6)                                          @SC86239 06182000
  2366.          SRDA  6,10                                            @SC86239 06182500
  2367.          ST    7,FDBSIZE                                       @SC86299 06183000
  2368.          MVC   FDBBLKSI,DS1BLK                                 @SC86299 06183500
  2369.          MVC   FDBDEVT,CAMDEVT Copy device type                @SC88106 06184000
  2370.          MVC   FDBVOL,CAMVOLS+6   Copy volume name             @GH88319 06184500
  2371.          XC    FDBFLGS,DS1RCF Copy carriage control flags      @SC88246 06185000
  2372.          NI    FDBFLGS,255-FABRECCC  And only those flags      @SC88246 06185500
  2373.          XC    FDBFLGS,DS1RCF                                  @SC88246 06186000
  2374.          LH    1,DS1BLK      Use BLKSIZE if 'U'                @SC86299 06186500
  2375.          MVI   FDBRCF,C'U'                                     @SC86299 06187000
  2376.          TM    DS1RCF,FABRECU                                  @SC86299 06187500
  2377.          BO    DSKVLR                                          @SC86299 06188000
  2378.          LH    1,DS1LRC      Use LRECL if 'F'                  @SC86299 06188500
  2379.          MVI   FDBRCF,C'F'                                     @SC86299 06189000
  2380.          TM    DS1RCF,FABRECF                                  @SC86299 06189500
  2381.          BO    DSKVLR                                          @SC86299 06190000
  2382.          MVI   FDBRCF,C'V'                                     @SC86299 06190500
  2383. DSKVLR   STH   1,FDBLRC                                        @SC86299 06191000
  2384.          L     7,4(13)       Get previous stack frame          @SC88048 06191500
  2385.          L     1,4(7)        and the one before                @SC88076 06192000
  2386.          CLC   =A(SERVER),16(1) Was the caller SERVER?         @SC89215 06192500
  2387.          BE    *+12          Yes, ok                           @SC88076 06193000
  2388.           CLC  =A(USNTRF),16(1) No, was it USNTRF?             @SC89215 06193500
  2389.           BNER 14            No, don't bother checking TAKE's  @SC88076 06194000
  2390.          USING SERVERSV,7    Assume SERVER or USNTRF           @SC88048 06194500
  2391.          ICM   0,15,TAKLEV   Any TAKE files open?              @SC88048 06195000
  2392.          BNPR  14            No, that's fine                   @SC88048 06195500
  2393.          CH    0,=Y(TAKMAX)  Be sure this is valid             @SC88048 06196000
  2394.          BNLR  14            Oops, give up                     @SC88048 06196500
  2395. DSKVACT  LR    6,0                                             @SC88048 06197000
  2396.          SLA   6,2                                             @SC88048 06197500
  2397.          L     6,TAKTAB-4(6) Fetch a file ticket               @SC88048 06198000
  2398.          CLC   FABDSN,FABDSN-FABD(6) Does the name match?      @SC88048 06198500
  2399.          BE    DSKVACS       Yes, this file is in use          @SC88048 06199000
  2400.          BCT   0,DSKVACT     No, keep looking                  @SC88048 06199500
  2401.          BR    14            No match, that's ok               @SC88048 06200000
  2402. DSKVACS  OI    FDBFLGS,FDBACTV Yes, turn on flag               @SC88048 06200500
  2403.          DROP  7                                               @SC88048 06201000
  2404.          BR    14                                              @SC86299 06201500
  2405. *                                                                       06202000
  2406. DSKPMSK  DC    10XL16'10101010101'  Mask for valid P bytes     @SC90139 06202500
  2407.          DC    96X'01'                                         @SC90139 06203000
  2408. *                                                                       06203500
  2409. DSKOPEX  DC    0F'0',X'05',AL3(DSKOPC) OPEN EXIT               @SC86299 06204000
  2410.          DC    X'91',AL3(DSKABEND)  DCB ABEND exit             @TS86001 06204500
  2411. *                                                                       06205000
  2412. * Look for x37 abends                                          @TS86001 06205500
  2413. DSKABEND MVI   ERRNUM,ERRFUL Assume full                       @SC86355 06206000
  2414.          XC    EMSGL,EMSGL   Clear extra message               @SC87338 06206500
  2415.          CLC   =X'B370',0(1) B37 abend?                        @TS86001 06207000
  2416.          BE    DSKABX        Yes                               @SC86355 06207500
  2417.          CLC   =X'D370',0(1) D37 abend?                        @TS86001 06208000
  2418.          BE    DSKABX        Yes                               @SC86355 06208500
  2419.          CLC   =X'E370',0(1) E37 abend?                        @TS86001 06209000
  2420.          BE    DSKABX        Yes                               @SC86355 06209500
  2421. * Look for 013 abend                                           @TS86001 06210000
  2422.          MVI   ERRNUM,ERRDIE Assume I/O error                  @SC86355 06210500
  2423.          CLC   =X'0130',0(1) 013 abend?                        @TS86001 06211000
  2424.          BNE   DSKABX        No, assume worst                  @SC86355 06211500
  2425.          CLI   2(1),X'14'    Mismatch DSORG?                   @TS86001 06212000
  2426.          BNE   *+12          No                                @SC86355 06212500
  2427.          MVI   ERRNUM,ERRFNE Yes, member invalid or missing    @SC86355 06213000
  2428.          B     DSKABX                                          @SC86355 06213500
  2429.          CLI   2(1),X'18'    Unknown member name?              @TS86001 06214000
  2430.          BNE   DSKABX        No, assume worst                  @SC86355 06214500
  2431.          MVI   ERRNUM,ERRFNF Yes, say "not found"              @SC86355 06215000
  2432. DSKABX   MVI   3(1),X'04'    Ignore if possible                @SC86355 06215500
  2433.          BR    14            Return                            @TS86001 06216000
  2434. *                                                                       06216500
  2435. DSKOPC   LR    3,1                                             @SC86299 06217000
  2436.          LH    9,FABBLKSI                                      @SC92022 06217500
  2437.          LTR   9,9                                             @SC92022 06218000
  2438.          BP    *+8                                             @SC86299 06218500
  2439.           LH   9,=H'6233'                                      @SC92022 06219000
  2440.          LR    6,9                                             @SC92022 06219500
  2441.          TM    FABRECFM,FABRECU                                @SC86299 06220000
  2442.          BO    DSKOPS                                          @SC86299 06220500
  2443.          LH    6,FABLRECL                                      @SC86299 06221000
  2444.          BNZ   *+8                                             @SC86299 06221500
  2445.          OI    FABRECFM,FABRECV+FABRECBR                       @SC86299 06222000
  2446.          LTR   6,6                                             @SC86299 06222500
  2447.          BP    DSKOPQ                                          @SC86299 06223000
  2448.          LA    6,80                                            @SC86299 06223500
  2449.          BAL   2,DSKTV                                         @SC88049 06224000
  2450.           LA   6,4(6)        Allow LRECL=84 for VB             @SC88049 06224500
  2451. DSKOPQ   TM    FABRECFM,FABRECF                                @SC86299 06225000
  2452.          BZ    DSKOPV                                          @SC86299 06225500
  2453.          SR    8,8                                             @SC92022 06226000
  2454.          DR    8,6                                             @SC92022 06226500
  2455.          LTR   9,9                                             @SC92022 06227000
  2456.          BP    *+8                                             @SC88104 06227500
  2457.           LA   9,1           BLKSIZE was less than LRECL!      @SC92022 06228000
  2458.          MR    8,6                                             @SC92022 06228500
  2459.          B     DSKOPS                                          @SC86299 06229000
  2460. DSKOPV   LA    4,4(6)                                          @SC86299 06229500
  2461.          CR    4,9                                             @SC92022 06230000
  2462.          BNH   DSKOPS                                          @SC86299 06230500
  2463.          LR    9,4                                             @SC92022 06231000
  2464. DSKOPS   STH   6,FABLRECL                                      @SC86299 06231500
  2465.          STH   9,FABBLKSI                                      @SC92022 06232000
  2466.          BR    14                                              @SC86299 06232500
  2467. *                                                                       06233000
  2468.          DROP  6                                               @SC87015 06233500
  2469.          DROP  3                                               @SC90264 06234000
  2470.          DROP  5                                               @SC92022 06234500
  2471. *                                                                       06235000
  2472.          LOCALS ,                                              @SC86295 06235500
  2473. DYNPL    DS    A(0,0,0,0,DYNDSP,0,DYNRC)                       @SC88026 06236000
  2474.          DS    A(0)          Ptr to message buffer             @SC88119 06236500
  2475. DYNRC    DS    F                                               @SC86299 06237000
  2476. DSKTKT   DS    A             Ptr for testing member            @SC88043 06237500
  2477. DSKOPLS  DS    F             Ptr to new FAB                    @SC88049 06238000
  2478. DYNDSP   DS    X                                               @SC86299 06238500
  2479. DSKMNTH  DS    XL11          Month length table                @SC86299 06239000
  2480. DSKPSAV  EQU   DSKMNTH,8     Buffer for saved prefix           @SC88043 06239500
  2481. DSKCOD   DS    X             Saved DISKIO code                 @SC88308 06240000
  2482.          EXIT                                                           06240500
  2483.