User Tools

Site Tools


cdc:nos2.source:opl871:pack

Table of Contents

PACK

Table Of Contents

  • [00007] PACK - PACK FILE TO ONE RECORD.
  • [00011] PACK FILE TO ONE RECORD.

Source Code

PACK.txt
  1. IDENT PACK,PACK,PACK
  2. ABS
  3. SST
  4. SYSCOM B1
  5. ENTRY PACK
  6. ENTRY RFL=
  7. TITLE PACK - PACK FILE TO ONE RECORD.
  8. *COMMENT PACK - PACK FILE TO ONE RECORD.
  9. COMMENT COPYRIGHT CONTROL DATA SYSTEMS INC. 1992.
  10. SPACE 4
  11. *** PACK - PACK FILE TO ONE RECORD.
  12. * W.T. SACKETT. 71/01/20.
  13. SPACE 4
  14. *** PACK REMOVES ALL *EOR* AND *EOF* MARKS FROM A SPECIFIED FILE
  15. * AND COPIES IT AS ONE RECORD TO ANOTHER FILE. IF NO THIRD
  16. * PARAMETER IS SPECIFIED, THE READ IS FROM *BOI* TO *EOI*.
  17. * DIRECT ACCESS FILES MAY BE PACKED. PACK(A) AND PACK(A,A)
  18. * RETAIN FILE TYPES. IN PACK(A,B), B REMAINS AS SPECIFIED
  19. * PRIOR TO THE PACK.
  20. SPACE 4,10
  21. *** THE COMMAND.
  22. *
  23. * PACK(IFILE,OFILE,NR)
  24. *
  25. * IFILE NAME OF FILE TO BE PACKED.
  26. * OFILE NAME OF FILE TO RECEIVE PACKED DATA.
  27. * NR IF A THIRD PARAMETER IS SPECIFIED, IFILE IS NOT
  28. * REWOUND BEFORE THE PACK OCCURS.
  29. * PACK(A) = PACK(A,A).
  30. SPACE 4,10
  31. *** DAYFILE MESSAGES.
  32. *
  33. * * PACK COMPLETE.*
  34. * * PACK PARAMETER ERROR.* - NO FILE NAMES, NULL OUTPUT FILE
  35. * OR TOO MANY PARAMETERS.
  36. * * INCORRECT INPUT FILE.* - ATTEMPT TO PACK INPUT FROM A
  37. * FILE ASSIGNED TO A TIME-SHARING TERMINAL.
  38. SPACE 4
  39. ORG 110B
  40. PACK SB1 1 (B1) = 1
  41. SX6 SBUF ENTER POINTER TO OUTPUT BUFFER
  42. SA6 B0
  43. SA1 ACTR CHECK ARGUMENT COUNT
  44. MX0 42 (X0) LEFT " 0 IF INDIRECT ACCESS INPUT FILE
  45. SB7 X1-1
  46. NG B7,ERR1 IF NO PARAMETERS
  47. RETURN SCR,R
  48. SA3 ARGR FIRST PARAMETER
  49. SA2 I
  50. BX5 X0*X3 (X5) = INPUT FILE NAME IF RENAME NEEDED
  51. ZR X5,ERR1 IF NO INPUT FILE NAME
  52. BX6 -X0*X2
  53. BX7 X5+X6
  54. SA7 A2
  55. GT B7,B1,PAC1 IF NO REWIND BEFORE PACK
  56. REWIND I
  57. PAC1 ZR B7,PAC2 IF ONE PARAMETER
  58. SA1 A3+B1 NEXT PARAMETER
  59. IX2 X1-X3
  60. ZR X2,PAC2 IF PACK(A,A)
  61. ZR X1,ERR1 SECOND PARAMETER INDICATED BUT NULL
  62. SA2 SCR
  63. BX3 X0*X1
  64. BX1 -X0*X2
  65. BX6 X3+X1
  66. MX5 0 (X5) = 0 IF TWO FILES SPECIFIED
  67. SA6 SCR
  68. SB7 B7-2
  69. GE B7,B1,ERR1 IF INCORRECT PARAMETER COUNT
  70. PAC2 SA1 I SET FILE NAME IN *FILINFO* BLOCK
  71. SA2 FINB
  72. BX1 X0*X1
  73. BX6 X1+X2
  74. SA6 A2
  75. FILINFO A2 GET FILE INFORMATION
  76. SA1 FINB+1 CHECK FILE TYPE AND DEVICE TYPE
  77. MX0 -6
  78. BX7 X7-X7 CLEAR RANDOM INDEX
  79. BX2 -X0*X1
  80. LX1 59-16
  81. SX0 X2-2 SET BACKCOPY FLAG FOR QUEUED FILE
  82. ZR X0,PAC3 IF QUEUED FILE
  83. SX0 X2-4 SET BACKCOPY FLAG FOR DIRECT ACCESS FILE
  84. ZR X0,PAC3 IF DIRECT ACCESS FILE
  85. NG X1,ERR2 IF FILE TYPE *TT*
  86. LX1 59-15-59+16
  87. NG X1,PAC3 IF FILE ON MASS STORAGE
  88. BX0 X0-X0 SET BACKCOPY FLAG FOR TAPE FILE
  89. PAC3 SA7 I+6
  90. PAC4 READEI I
  91. PAC5 READW I,WBUF,WBUFL
  92. NG X1,PAC6 IF END OF INFORMATION
  93. WRITEW SCR,WBUF,WBUFL
  94. EQ PAC5 GO FINISH READ
  95.  
  96. PAC6 SB7 B6-WBUF
  97. WRITEW SCR,WBUF,B7
  98. WRITER X2
  99. REWIND X2,R
  100. ZR X5,END IF TWO DIFFERENT FILES
  101. BX7 X5
  102. SX2 I
  103. NZ X0,PAC8 IF BACKCOPY NOT REQUIRED
  104. SA3 PACA
  105. NZ X3,PAC7 IF BACKCOPY COMPLETE
  106. SX6 B1
  107. SA6 A3
  108. REWIND X2,R
  109. SA1 X2 SWITCH NAMES IN FET
  110. SA3 SCR
  111. BX6 X1
  112. BX7 X3
  113. SA6 A3
  114. SA7 X2
  115. REWIND A3,R
  116. EQ PAC4 COPY SCR TO I
  117.  
  118. PAC7 RETURN I RETURN SCRATCH FILE
  119. EQ END END PACK
  120.  
  121. PAC8 SA7 SCR+6 SET FET FOR *LFM* RENAME
  122. RECALL I
  123. STATUS I,P GET FILE STATUS
  124. SA1 I+5 GET FNT ENTRY
  125. MX0 -6
  126. BX0 -X0*X1
  127. SX1 X0-NDST
  128. NZ X1,PAC9 IF NOT *NO-AUTO-DROP* STATUS
  129. SETFS SCR,NAD RESTORE *NAD* STATUS
  130. PAC9 RENAME SCR
  131. END MESSAGE (=C* PACK COMPLETE.*)
  132. ENDRUN
  133.  
  134. ERR1 MESSAGE (=C* PACK PARAMETER ERROR.*)
  135. ABORT
  136.  
  137. ERR2 MESSAGE (=C* INCORRECT INPUT FILE.*)
  138. ABORT
  139.  
  140. PACA CON 0 BACKCOPY FLAG
  141.  
  142. FINB BSS 0 *FILINFO* PARAMETER BLOCK
  143. VFD 42/0,6/5,12/1
  144. BSSZ 4
  145. SPACE 4
  146. * COMMON DECKS.
  147. *
  148. *CALL COMCCIO
  149. *CALL COMCLFM
  150. *CALL COMCRDW
  151. *CALL COMCSYS
  152. *CALL COMCWTW
  153. *CALL COMCMAC
  154. *CALL COMSLFD
  155. *
  156. * FETS AND BUFFERS.
  157. WBUFL EQU 100B
  158. BUFL EQU 1001B
  159. I RFILEB IBUF,BUFL,(FET=8),(WSA=WBUF,WBUFL)
  160. SCR RFILEB SBUF,BUFL,FET=8),(WSA=WBUF,WBUFL)
  161. USE LITERALS
  162. IBUF EQU *
  163. WBUF EQU IBUF+BUFL
  164. SBUF EQU WBUF+WBUFL
  165. RFL= EQU SBUF+BUFL
  166. SPACE 4
  167. END
cdc/nos2.source/opl871/pack.txt ยท Last modified: 2023/08/05 17:24 by Site Administrator