summaryrefslogtreecommitdiff
path: root/cmsmvs/README.MVS.LE
blob: f7dcb8ac7794a7768d6566471bda38fe8f3cfa3a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
Notes on Zip under MVS Language Environment (LE).

First see README.MVS.  This note describes just one beta test on OS/390
V2R5 using IBM's C compiler (5647A01), V2R4.  The major difference is
the use of LE on the beta site, together with some MVS native mode
fixes.  Changes have not been tested on CMS.

Some of the notes are to clarify things that were not clear from the
MANUAL or README.MVS.

1.  By default, IBM C generates the same csect name for each input
    source.  The prelink stage does not rename them and the linkage
    editor throws away all but the first occurrence of each duplicate.
    Oops, my code just disappeared :(.

    To get around this "feature", compile with the CSECT option to
    force sensible names on the code and data sections of each csect.
    The name of the static data csect defaults to the source name in
    lower case, the code csect defaults to the source name in upper
    case.  These csect names still have to be unique, they cannot be
    the same as function names.  Of course, several csects have a
    function which is the same name as the source in lower case, not
    exactly an unusual occurrence.  Therefore to make the csect name
    unique, some of the sources have

    #ifdef MVS
    #  pragma csect(STATIC,xxxx_s)
    #endif

    Where xxxx is an abbreviation of the source name.  There has to be
    a better way!

2.  The prelink step always gets cond code 4.  It complains about
    unresolved references, ignore it unless the linker also complains.
    Prelink also complains about duplicate @@PPA2 sections and so does
    the linker, but it seems to do no harm.  Compile and link steps
    should get 0, just prelink gets 4.  See JCL at the bottom.

3.  Under MVS native mode (not Open Edition), tmpnam() returns a quoted
    name of 5 qualifiers.  The first is a HLQ chosen according to the
    MVS LE algorithm (see below), the other qualifiers are time stamps.
    If running on MVS and tmpnam() returns a quoted name with at leat
    one '.', it is only safe to let the user change the high level
    qualifier.  Therefore -b insists on a single qualifier without '.'
    in the MVS native environment.

4.  In Open Edition (OE) mode, the manual says that tmpnam() returns a
    fully qualified name in directory TMPDIR or /tmp if TMPDIR is not
    set.  There is no point in zip trying to override that name so -b
    is ignored in MVS OE mode (untested).  The user should specify
    environment variable TMPDIR instead.

5.  The MVS LE algorithm for choosing the high level qualifier for
    native filenames is interesting, as in "May you live in interesting
    times".  The HLQ varies according to the environment the program is
    running in, sometimes it is userid, sometimes it is TSO prefix.
    See OS/390 C/C++ Programming Guide, Using a Data Set Name,
    somewhere around section 2.9.

    If in doubt, use fully qualified and quoted names.  Instead of
    archive.zip, use 'prefix.archive.zip'.  For input files, instead of
    filename, use 'prefix.filename'.  For PARM= in JCL, double up the
    quotes.  You even have to quote filenames in stdin.

6.  If your PARM includes any '/', make sure the PARM starts with '/'.
    LE assumes anything before the first '/' is LE run time parameters.
    It does no harm to always code a leading '/' for LE parms.

7.  JCL limits a PARM= to 100 characters total with approx. 65 on a
    single line.  Alas the syntax for continuing PARM= always embeds an
    extra ',' somewhere in the parameters that the program finally
    gets.  No workaround, limit your PARM to a single line.  With the
    extra quotes around filenames, that does not leave much room.  In
    most cases, you will have to use '-@' to read the list of filenames
    from SYSIN (stdin), it will not fit on a single PARM line.

8.  Filenames can be dataset names or you can refer to a ddname with
    'DD:name', case insensitive for external files, case sensitive for
    OE files.  You can even specify 'dd:name(mem)'.  No wildcards, to
    zip a complete pds you have to specify each member individually.
    Directory recursion in OE does not appear to work at the moment.

9.  Zip attempts to map MVS filenames to Unix style names.  It did not
    work correctly for quoted names, fixed.  Although you can pick up
    an external (non-OE) file with a name using any case, be aware that
    the mapping to a Unix style name faithfully follows the case you
    supply.

10. The archive file was being created with recfm=V and lrecl=32760.
    32760 is not valid for recfm=V under MVS, I originally changed it
    to lrecl=32756.  Then zip broke trying to fseek() over a record
    boundary, I do not know whether this was a zip or LE bug.  Trial
    and error showed that recfm=U with byteseek seems to work on MVS.
    No BDW or RDW, just a byte stream.  The blocksize is always 6144.

    NOTE: This is an incompatible change from the previous beta,
          archive files used to be recfm=V.  That should not matter
          because we just transfer the data, ignoring BDW and RDW
          anyway.

11. Zip used to complain about preallocated but empty archives, wrong
    length records, no signature etc.  The usual IBM/360 problem of no
    end of file marker in a new, unopened dataset.  Fixed, see routine
    readzipfile in zipfile.c for the gory details.  PARM= works fine.

12. Several source files have records that are more than 80 bytes long.
    It works if you transfer to mainframe datasets with a larger lrecl,
    I used recfm=fb,lrecl=120 for the .C and .H files.  To compile with
    anything longer than 72 bytes, you need MVS C options NOMARGINS and
    NOSEQUENCE (NOMAR,NOSEQ).

13. cmsmvs was still using zname instead of name for open.  Fixed.

14. zip has to jump through a lot of hoops to see if an existing
    zipfile actually contains data.  A side effect of this is that
    creating a zipfile with the RLSE parameter is a waste of time.

Keith Owens <kaos@ocs.com.au>.  Not a maintainer, just a beta tester.
Mon Sep 14 19:31:30 EST 1998


Sample JCL to compile Zip under MVS LE.  You might need a large region,
I used REGION=128M on the job card.  Also watch the output lines,
75,000 with OPT(2), 100,000+ with OPT(2) replaced with DEF(DEBUG).  You
need to allocate prefix.ZIP.C.OBJ (recfm=FB, lrecl=80) and
prefix.ZIP.LOAD (recfm=U, blksize is site defined).

//CBC    JCLLIB ORDER=CBC.SCBCPRC
//ZIP EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(ZIP)',
//    OUTFILE='prefix.ZIP.C.OBJ(ZIP),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//CRYPT EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(CRYPT)',
//    OUTFILE='prefix.ZIP.C.OBJ(CRYPT),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//TTYIO EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(TTYIO)',
//    OUTFILE='prefix.ZIP.C.OBJ(TTYIO),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//TREES EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(TREES)',
//    OUTFILE='prefix.ZIP.C.OBJ(TREES),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//DEFLATE EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(DEFLATE)',
//    OUTFILE='prefix.ZIP.C.OBJ(DEFLATE),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//FILEIO EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(FILEIO)',
//    OUTFILE='prefix.ZIP.C.OBJ(FILEIO),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//GLOBALS EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(GLOBALS)',
//    OUTFILE='prefix.ZIP.C.OBJ(GLOBALS),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//UTIL EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(UTIL)',
//    OUTFILE='prefix.ZIP.C.OBJ(UTIL),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//CRC32 EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(CRC32)',
//    OUTFILE='prefix.ZIP.C.OBJ(CRC32),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//CRCTAB EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(CRCTAB)',
//    OUTFILE='prefix.ZIP.C.OBJ(CRCTAB),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//ZIPFILE EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(ZIPFILE)',
//    OUTFILE='prefix.ZIP.C.OBJ(ZIPFILE),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//ZIPUP EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(ZIPUP)',
//    OUTFILE='prefix.ZIP.C.OBJ(ZIPUP),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//CMSMVS EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(CMSMVS)',
//    OUTFILE='prefix.ZIP.C.OBJ(CMSMVS),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//MVS EXEC EDCC,COND=(0,NE),CREGSIZ='4M',
//    INFILE='prefix.ZIP.C(MVS)',
//    OUTFILE='prefix.ZIP.C.OBJ(MVS),DISP=SHR',
//    CPARM='LONG,NOTERM,LIST,XREF,SOURCE',
//    CPARM2='OPT(2),DEF(MVS),NOMAR,NOSEQ,CSECT'
//COMPILE.USERLIB DD DSN=prefix.ZIP.H,DISP=SHR
//PLINK   EXEC  PROC=EDCPL,
//    OUTFILE='prefix.ZIP.LOAD(ZIP),DISP=SHR',
//    PREGSIZ=6M,
//    PPARM='NONCAL,MAP,MEMORY',
//    LPARM='LIST,MAP,XREF'
//PLKED.SYSIN   DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(ZIP)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(CRYPT)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(TREES)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(DEFLATE)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(FILEIO)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(GLOBALS)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(UTIL)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(CRC32)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(CRCTAB)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(ZIPFILE)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(ZIPUP)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(MVS)
//              DD  DISP=SHR,DSN=prefix.ZIP.C.OBJ(CMSMVS)
//LKED.SYSLIB   DD  DISP=SHR,DSN=CEE.SCEELKED
//SYSUT1   DD  UNIT=SYSDA,SPACE=(CYL,(2,2))
//

Sample JCL to zip the mainframe .C and .H files as ASCII (-a).  Delete
any existing archive first, point the temporary file at a particular
prefix (-b), use 'prefix.ARCHIVE.ZIP' for the archive file, read the
list of files to zip from stdin (SYSIN).

//DELETE  EXEC PGM=IDCAMS
//SYSPRINT DD  SYSOUT=*
//SYSIN    DD  *
 DELETE prefix.ARCHIVE.ZIP
 SET MAXCC = 0
//ZIP     EXEC PGM=ZIP,
// PARM='/-a -v -b temppref ''prefix.ARCHIVE.ZIP'' -@'
//STEPLIB  DD  DSN=prefix.ZIP.LOAD,DISP=SHR
//SYSPRINT DD  SYSOUT=*
//SYSOUT   DD  SYSOUT=*
//CEEDUMP  DD  SYSOUT=*
//ZIPC     DD  DISP=SHR,DSN=prefix.ZIP.C
//ZIPH     DD  DISP=SHR,DSN=prefix.ZIP.H
//SYSIN    DD  *
dd:zipc(api)
dd:zipc(cms)
dd:zipc(cmsmvs)
dd:zipc(crctab)
dd:zipc(crc32)
dd:zipc(crypt)
dd:zipc(deflate)
dd:zipc(fileio)
dd:zipc(globals)
dd:zipc(mktime)
dd:zipc(mvs)
dd:zipc(trees)
dd:zipc(ttyio)
dd:zipc(util)
dd:zipc(zip)
dd:zipc(zipcloak)
dd:zipc(zipfile)
dd:zipc(zipnote)
dd:zipc(zipsplit)
dd:zipc(zipup)
dd:ziph(api)
dd:ziph(cmsmvs)
dd:ziph(crypt)
dd:ziph(cstat)
dd:ziph(ebcdic)
dd:ziph(mvs)
dd:ziph(revision)
dd:ziph(stat)
dd:ziph(tailor)
dd:ziph(ttyio)
dd:ziph(zip)
dd:ziph(ziperr)
dd:ziph(zipup)