README.MVS.LE 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286
  1. Notes on Zip under MVS Language Environment (LE).
  2. First see README.MVS. This note describes just one beta test on OS/390
  3. V2R5 using IBM's C compiler (5647A01), V2R4. The major difference is
  4. the use of LE on the beta site, together with some MVS native mode
  5. fixes. Changes have not been tested on CMS.
  6. Some of the notes are to clarify things that were not clear from the
  7. MANUAL or README.MVS.
  8. 1. By default, IBM C generates the same csect name for each input
  9. source. The prelink stage does not rename them and the linkage
  10. editor throws away all but the first occurrence of each duplicate.
  11. Oops, my code just disappeared :(.
  12. To get around this "feature", compile with the CSECT option to
  13. force sensible names on the code and data sections of each csect.
  14. The name of the static data csect defaults to the source name in
  15. lower case, the code csect defaults to the source name in upper
  16. case. These csect names still have to be unique, they cannot be
  17. the same as function names. Of course, several csects have a
  18. function which is the same name as the source in lower case, not
  19. exactly an unusual occurrence. Therefore to make the csect name
  20. unique, some of the sources have
  21. #ifdef MVS
  22. # pragma csect(STATIC,xxxx_s)
  23. #endif
  24. Where xxxx is an abbreviation of the source name. There has to be
  25. a better way!
  26. 2. The prelink step always gets cond code 4. It complains about
  27. unresolved references, ignore it unless the linker also complains.
  28. Prelink also complains about duplicate @@PPA2 sections and so does
  29. the linker, but it seems to do no harm. Compile and link steps
  30. should get 0, just prelink gets 4. See JCL at the bottom.
  31. 3. Under MVS native mode (not Open Edition), tmpnam() returns a quoted
  32. name of 5 qualifiers. The first is a HLQ chosen according to the
  33. MVS LE algorithm (see below), the other qualifiers are time stamps.
  34. If running on MVS and tmpnam() returns a quoted name with at leat
  35. one '.', it is only safe to let the user change the high level
  36. qualifier. Therefore -b insists on a single qualifier without '.'
  37. in the MVS native environment.
  38. 4. In Open Edition (OE) mode, the manual says that tmpnam() returns a
  39. fully qualified name in directory TMPDIR or /tmp if TMPDIR is not
  40. set. There is no point in zip trying to override that name so -b
  41. is ignored in MVS OE mode (untested). The user should specify
  42. environment variable TMPDIR instead.
  43. 5. The MVS LE algorithm for choosing the high level qualifier for
  44. native filenames is interesting, as in "May you live in interesting
  45. times". The HLQ varies according to the environment the program is
  46. running in, sometimes it is userid, sometimes it is TSO prefix.
  47. See OS/390 C/C++ Programming Guide, Using a Data Set Name,
  48. somewhere around section 2.9.
  49. If in doubt, use fully qualified and quoted names. Instead of
  50. archive.zip, use 'prefix.archive.zip'. For input files, instead of
  51. filename, use 'prefix.filename'. For PARM= in JCL, double up the
  52. quotes. You even have to quote filenames in stdin.
  53. 6. If your PARM includes any '/', make sure the PARM starts with '/'.
  54. LE assumes anything before the first '/' is LE run time parameters.
  55. It does no harm to always code a leading '/' for LE parms.
  56. 7. JCL limits a PARM= to 100 characters total with approx. 65 on a
  57. single line. Alas the syntax for continuing PARM= always embeds an
  58. extra ',' somewhere in the parameters that the program finally
  59. gets. No workaround, limit your PARM to a single line. With the
  60. extra quotes around filenames, that does not leave much room. In
  61. most cases, you will have to use '-@' to read the list of filenames
  62. from SYSIN (stdin), it will not fit on a single PARM line.
  63. 8. Filenames can be dataset names or you can refer to a ddname with
  64. 'DD:name', case insensitive for external files, case sensitive for
  65. OE files. You can even specify 'dd:name(mem)'. No wildcards, to
  66. zip a complete pds you have to specify each member individually.
  67. Directory recursion in OE does not appear to work at the moment.
  68. 9. Zip attempts to map MVS filenames to Unix style names. It did not
  69. work correctly for quoted names, fixed. Although you can pick up
  70. an external (non-OE) file with a name using any case, be aware that
  71. the mapping to a Unix style name faithfully follows the case you
  72. supply.
  73. 10. The archive file was being created with recfm=V and lrecl=32760.
  74. 32760 is not valid for recfm=V under MVS, I originally changed it
  75. to lrecl=32756. Then zip broke trying to fseek() over a record
  76. boundary, I do not know whether this was a zip or LE bug. Trial
  77. and error showed that recfm=U with byteseek seems to work on MVS.
  78. No BDW or RDW, just a byte stream. The blocksize is always 6144.
  79. NOTE: This is an incompatible change from the previous beta,
  80. archive files used to be recfm=V. That should not matter
  81. because we just transfer the data, ignoring BDW and RDW
  82. anyway.
  83. 11. Zip used to complain about preallocated but empty archives, wrong
  84. length records, no signature etc. The usual IBM/360 problem of no
  85. end of file marker in a new, unopened dataset. Fixed, see routine
  86. readzipfile in zipfile.c for the gory details. PARM= works fine.
  87. 12. Several source files have records that are more than 80 bytes long.
  88. It works if you transfer to mainframe datasets with a larger lrecl,
  89. I used recfm=fb,lrecl=120 for the .C and .H files. To compile with
  90. anything longer than 72 bytes, you need MVS C options NOMARGINS and
  91. NOSEQUENCE (NOMAR,NOSEQ).
  92. 13. cmsmvs was still using zname instead of name for open. Fixed.
  93. 14. zip has to jump through a lot of hoops to see if an existing
  94. zipfile actually contains data. A side effect of this is that
  95. creating a zipfile with the RLSE parameter is a waste of time.
  96. Keith Owens <kaos@ocs.com.au>. Not a maintainer, just a beta tester.
  97. Mon Sep 14 19:31:30 EST 1998
  98. Sample JCL to compile Zip under MVS LE. You might need a large region,
  99. I used REGION=128M on the job card. Also watch the output lines,
  100. 75,000 with OPT(2), 100,000+ with OPT(2) replaced with DEF(DEBUG). You
  101. need to allocate prefix.ZIP.C.OBJ (recfm=FB, lrecl=80) and
  102. prefix.ZIP.LOAD (recfm=U, blksize is site defined).
  103. //CBC JCLLIB ORDER=CBC.SCBCPRC
  104. //ZIP EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  105. // INFILE='prefix.ZIP.C(ZIP)',
  106. // OUTFILE='prefix.ZIP.C.OBJ(ZIP),DISP=SHR',
  107. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  108. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  109. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  110. //CRYPT EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  111. // INFILE='prefix.ZIP.C(CRYPT)',
  112. // OUTFILE='prefix.ZIP.C.OBJ(CRYPT),DISP=SHR',
  113. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  114. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  115. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  116. //TTYIO EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  117. // INFILE='prefix.ZIP.C(TTYIO)',
  118. // OUTFILE='prefix.ZIP.C.OBJ(TTYIO),DISP=SHR',
  119. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  120. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  121. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  122. //TREES EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  123. // INFILE='prefix.ZIP.C(TREES)',
  124. // OUTFILE='prefix.ZIP.C.OBJ(TREES),DISP=SHR',
  125. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  126. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  127. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  128. //DEFLATE EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  129. // INFILE='prefix.ZIP.C(DEFLATE)',
  130. // OUTFILE='prefix.ZIP.C.OBJ(DEFLATE),DISP=SHR',
  131. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  132. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  133. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  134. //FILEIO EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  135. // INFILE='prefix.ZIP.C(FILEIO)',
  136. // OUTFILE='prefix.ZIP.C.OBJ(FILEIO),DISP=SHR',
  137. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  138. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  139. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  140. //GLOBALS EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  141. // INFILE='prefix.ZIP.C(GLOBALS)',
  142. // OUTFILE='prefix.ZIP.C.OBJ(GLOBALS),DISP=SHR',
  143. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  144. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  145. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  146. //UTIL EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  147. // INFILE='prefix.ZIP.C(UTIL)',
  148. // OUTFILE='prefix.ZIP.C.OBJ(UTIL),DISP=SHR',
  149. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  150. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  151. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  152. //CRC32 EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  153. // INFILE='prefix.ZIP.C(CRC32)',
  154. // OUTFILE='prefix.ZIP.C.OBJ(CRC32),DISP=SHR',
  155. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  156. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  157. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  158. //CRCTAB EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  159. // INFILE='prefix.ZIP.C(CRCTAB)',
  160. // OUTFILE='prefix.ZIP.C.OBJ(CRCTAB),DISP=SHR',
  161. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  162. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  163. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  164. //ZIPFILE EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  165. // INFILE='prefix.ZIP.C(ZIPFILE)',
  166. // OUTFILE='prefix.ZIP.C.OBJ(ZIPFILE),DISP=SHR',
  167. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  168. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  169. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  170. //ZIPUP EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  171. // INFILE='prefix.ZIP.C(ZIPUP)',
  172. // OUTFILE='prefix.ZIP.C.OBJ(ZIPUP),DISP=SHR',
  173. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  174. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  175. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  176. //CMSMVS EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  177. // INFILE='prefix.ZIP.C(CMSMVS)',
  178. // OUTFILE='prefix.ZIP.C.OBJ(CMSMVS),DISP=SHR',
  179. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  180. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  181. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  182. //MVS EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
  183. // INFILE='prefix.ZIP.C(MVS)',
  184. // OUTFILE='prefix.ZIP.C.OBJ(MVS),DISP=SHR',
  185. // CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
  186. // CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
  187. //COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
  188. //PLINK EXEC PROC=EDCPL,
  189. // OUTFILE='prefix.ZIP.LOAD(ZIP),DISP=SHR',
  190. // PREGSIZ=6M,
  191. // PPARM='NONCAL,MAP,MEMORY',
  192. // LPARM='LIST,MAP,XREF'
  193. //PLKED.SYSIN DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(ZIP)
  194. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(CRYPT)
  195. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(TREES)
  196. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(DEFLATE)
  197. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(FILEIO)
  198. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(GLOBALS)
  199. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(UTIL)
  200. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(CRC32)
  201. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(CRCTAB)
  202. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(ZIPFILE)
  203. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(ZIPUP)
  204. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(MVS)
  205. // DD DISP=SHR,DSN=prefix.ZIP.C.OBJ(CMSMVS)
  206. //LKED.SYSLIB DD DISP=SHR,DSN=CEE.SCEELKED
  207. //SYSUT1 DD UNIT=SYSDA,SPACE=(CYL,(2,2))
  208. //
  209. Sample JCL to zip the mainframe .C and .H files as ASCII (-a). Delete
  210. any existing archive first, point the temporary file at a particular
  211. prefix (-b), use 'prefix.ARCHIVE.ZIP' for the archive file, read the
  212. list of files to zip from stdin (SYSIN).
  213. //DELETE EXEC PGM=IDCAMS
  214. //SYSPRINT DD SYSOUT=*
  215. //SYSIN DD *
  216. DELETE prefix.ARCHIVE.ZIP
  217. SET MAXCC = 0
  218. //ZIP EXEC PGM=ZIP,
  219. // PARM='/-a -v -b temppref ''prefix.ARCHIVE.ZIP'' -@'
  220. //STEPLIB DD DSN=prefix.ZIP.LOAD,DISP=SHR
  221. //SYSPRINT DD SYSOUT=*
  222. //SYSOUT DD SYSOUT=*
  223. //CEEDUMP DD SYSOUT=*
  224. //ZIPC DD DISP=SHR,DSN=prefix.ZIP.C
  225. //ZIPH DD DISP=SHR,DSN=prefix.ZIP.H
  226. //SYSIN DD *
  227. dd:zipc(api)
  228. dd:zipc(cms)
  229. dd:zipc(cmsmvs)
  230. dd:zipc(crctab)
  231. dd:zipc(crc32)
  232. dd:zipc(crypt)
  233. dd:zipc(deflate)
  234. dd:zipc(fileio)
  235. dd:zipc(globals)
  236. dd:zipc(mktime)
  237. dd:zipc(mvs)
  238. dd:zipc(trees)
  239. dd:zipc(ttyio)
  240. dd:zipc(util)
  241. dd:zipc(zip)
  242. dd:zipc(zipcloak)
  243. dd:zipc(zipfile)
  244. dd:zipc(zipnote)
  245. dd:zipc(zipsplit)
  246. dd:zipc(zipup)
  247. dd:ziph(api)
  248. dd:ziph(cmsmvs)
  249. dd:ziph(crypt)
  250. dd:ziph(cstat)
  251. dd:ziph(ebcdic)
  252. dd:ziph(mvs)
  253. dd:ziph(revision)
  254. dd:ziph(stat)
  255. dd:ziph(tailor)
  256. dd:ziph(ttyio)
  257. dd:ziph(zip)
  258. dd:ziph(ziperr)
  259. dd:ziph(zipup)