Internal Developing Model 204 from WSL: Difference between revisions
No edit summary |
No edit summary |
||
| Line 25: | Line 25: | ||
|- | |- | ||
| [[#Testing on z/OS with putmodzos and gitzosl|<code>putmodzos</code>]] || Upload the z/OS object deck that the z/OS binder uses to create the test load module | | [[#Testing on z/OS with putmodzos and gitzosl|<code>putmodzos</code>]] || Upload the z/OS object deck that the z/OS binder uses to create the test load module | ||
|- | |||
| [[#Running a local Online with Janus TNSERV|<code>c3270</code> / <code>s3270</code>]] || Connect directly to a Janus Telnet Server running under <code>emu204</code> | |||
|} | |} | ||
| Line 704: | Line 706: | ||
Then IPL CMS or start the configuration nickname again. | Then IPL CMS or start the configuration nickname again. | ||
== Running a local Online with Janus TNSERV == | |||
A Janus port of type <code>TNSERV</code> supplies direct TN3270 access to a Model 204 Online. It does not use OMNI, SDS, OPENSERV, VTAM, or <code>IODEV=7</code>: | |||
<pre> | |||
c3270 or s3270 | |||
| | |||
v | |||
localhost:7777 | |||
| | |||
v | |||
Janus TNSERV in Model 204 under emu204 | |||
</pre> | |||
The emulator's IUCV TCP/IP service turns the guest listener into a real workstation socket. The test described below was run successfully against the 8.1 module: <code>s3270</code> connected to port 7777, logged in, and <code>VIEW TNDEV</code> returned <code>TNDEV 21</code>. | |||
=== Install a TN3270 client === | |||
On Ubuntu or WSL: | |||
<pre> | |||
sudo apt update | |||
sudo apt install c3270 s3270 | |||
</pre> | |||
On macOS: | |||
<pre> | |||
brew install x3270 | |||
</pre> | |||
<code>c3270</code> is interactive. <code>s3270</code> accepts commands on standard input and is useful for repeatable tests. A plain line-oriented <code>telnet</code> client is not sufficient because TNSERV supports the TN3270 subset of Telnet. | |||
=== Build the local case === | |||
The tested case is in: | |||
<pre> | |||
~/em204-cases/m204-81-tnserv/ | |||
</pre> | |||
Its <code>emu204.jsonc</code> names the 8.1 module, sets <code>tcpVm</code> to the same <code>TCPIP</code> service-machine name used by Model 204, and supplies CCAIN, CCASTAT, audit, print, and snap DDs: | |||
<pre> | |||
{ | |||
"module": "/home/user/m204-81/obj/M204ONLN.MODULE", | |||
"lst": "/home/user/m204-81/lst", | |||
"cpuid": "FF379B789175", | |||
"jobName": "ULSPFQA", | |||
"tcpVm": "TCPIP", | |||
"parm": "SYSOPT=X'A0',LIBUFF=3072,LOBUFF=7168,SIRFUNC=X'01',SIRTUNE=0", | |||
"storage": "2G", | |||
"dd": { | |||
"CCAIN": {"path": "ccain.txt"}, | |||
"CCAPRINT": {"path": "out/ccaprint.txt"}, | |||
"CCAAUDIT": {"path": "out/ccaaudit.txt"}, | |||
"CCASTAT": {"path": "out/ccastat.binary", "blocked": true}, | |||
"CCASNAP": {"path": "out/ccasnap.txt", "sequence": true} | |||
} | |||
} | |||
</pre> | |||
The important CCAIN settings and commands are: | |||
<pre> | |||
NUSERS=8,SDAEMDEV=15,NSUBTKS=12,NSERVS=8, - | |||
SIRTERM=3,TNDEV=21,SERVSIZE=5000000,MAXDAEM=5 | |||
IODEV=15,NOTERM=7,DUPTERM=6,LINEND=X'0D' | |||
LOGIN | |||
LOGCTL A TNUSER NOEXPIRE | |||
M204TEST1,X'FF',HIGH | |||
M204TEST1 | |||
ALL | |||
JANUS DEFINE TNSERV 7777 TNSERV 5 WSFQUERY TCPKEEPALIVE - | |||
BINDADDR 127.0.0.1 | |||
JANUS START TNSERV | |||
HALT 48,MODEL 204 JANUS TELNET SERVER READY ON PORT 7777,3,EOD | |||
EOD | |||
HALT 33,ON-LINE USERS REQUESTED TO LOGOFF,3,EOJ | |||
EOJ | |||
</pre> | |||
<code>TNDEV=21</code> enables Janus Telnet sessions. <code>SIRTERM</code> and <code>WSFQUERY</code> support terminal screen geometry. <code>TCPKEEPALIVE</code> is appropriate for long-lived terminal connections. <code>BINDADDR 127.0.0.1</code> keeps this known-password development port local to the workstation. | |||
The <code>LOGCTL</code> dialogue creates a disposable local account because the minimal CCASTAT synthesized by <code>emu204</code> gives its automatic account an intentionally unknowable password. Change the example password if the case is used anywhere except an isolated development workstation. | |||
The numbers before the two HALT messages are exact message lengths, not timeouts. An incorrect count causes User 0 to continue reading CCAIN and can immediately reach <code>EOJ</code>. | |||
=== Start the Online === | |||
The case's <code>run.sh</code> removes the generated CCASTAT so that <code>LOGCTL A TNUSER</code> can recreate the test account on every run: | |||
<pre> | |||
cd ~/em204-cases/m204-81-tnserv | |||
./run.sh | |||
</pre> | |||
Wait for: | |||
<pre> | |||
MODEL 204 JANUS TELNET SERVER READY ON PORT 7777 | |||
</pre> | |||
From another terminal, confirm that the listener exists: | |||
<pre> | |||
nc -vz 127.0.0.1 7777 | |||
</pre> | |||
=== Connect and test === | |||
For an interactive session: | |||
<pre> | |||
c3270 127.0.0.1:7777 | |||
</pre> | |||
At the Model 204 prompt, log in with the disposable account created by CCAIN and run a test command: | |||
<pre> | |||
LOGIN TNUSER | |||
M204TEST1 | |||
VIEW TNDEV | |||
</pre> | |||
The password is entered in response to <code>M204.0347</code> and is not displayed. The expected result includes: | |||
<pre> | |||
M204.0353: TNUSER ... login | |||
TNDEV 21 IODEV number for TNSERV threads | |||
</pre> | |||
To automate the same check, pipe <code>Connect</code>, <code>String</code>, <code>Enter</code>, <code>Wait</code>, and <code>Ascii</code> actions to <code>s3270 -script</code>. Do not put a real password in a committed script or shell history. | |||
=== Shut down cleanly === | |||
For the quickest tested shutdown, issue <code>EOJ</code> from the privileged <code>TNUSER</code> session and answer <code>Y</code> when Model 204 asks for confirmation. The TN3270 connection closes and <code>emu204</code> reports normal Online termination. | |||
Alternatively, log out and quit the TN3270 client. At the <code>emu204</code> operator terminal, reply to the first HALT with: | |||
<pre> | |||
EOD | |||
</pre> | |||
After users have disconnected, reply to the second HALT with: | |||
<pre> | |||
EOJ | |||
</pre> | |||
Model 204 should report that all users are logged out and begin normal Online termination. | |||
== Working on the tools themselves == | == Working on the tools themselves == | ||
| Line 759: | Line 913: | ||
|- | |- | ||
| Need more emulator detail || Use <code>emu204 --help</code>, <code>emu204 --help=config</code>, and <code>emu204 --help=em</code>. | | Need more emulator detail || Use <code>emu204 --help</code>, <code>emu204 --help=config</code>, and <code>emu204 --help=em</code>. | ||
|- | |||
| Port 7777 closes immediately after startup || Check the HALT message lengths in CCAIN. They must exactly match the message text or User 0 can continue to <code>EOJ</code>. | |||
|- | |||
| TNSERV prompts for a password but the generated account cannot log in || Expected for the automatic CCASTAT account. Create a disposable account with <code>LOGCTL</code>, or provide an appropriate development CCASTAT. | |||
|- | |||
| A plain <code>telnet</code> client connects but does not produce a usable screen || Use a TN3270 client such as <code>c3270</code>; TNSERV requires TN3270 negotiation. | |||
|} | |} | ||
Revision as of 15:09, 5 November 2026
Developing Model 204 from WSL or macOS (internal)
The @rocket/m204-tools package makes it possible to edit, assemble, link, patch, and test Model 204 from WSL or macOS. The main commands are:
| Command | Purpose |
|---|---|
make204 |
Incrementally assemble Model 204 and link CMS and z/OS modules |
emu204 |
Run the real linked Model 204 module on the workstation |
testM204Qa |
Start Model 204 under emu204 and run a QA smoke test
|
prezap |
Create the header for a new maintenance ZAP |
scanzap |
Find the next available local and PTCH$ patch offsets
|
bldzap |
Compare two object decks and generate VER/REP statements |
putmod |
Upload a linked CMS module and map for mainframe testing |
putmodzos |
Upload the z/OS object deck that the z/OS binder uses to create the test load module |
c3270 / s3270 |
Connect directly to a Janus Telnet Server running under emu204
|
This page describes the Model 204 8.0 and 8.1 workflows. Release 8.0 is under ZAP maintenance, so its baseline and ZAP objects must be kept separate. Release 8.1 is under normal development and currently builds directly into obj/.
Workstation setup
The published tools support:
- WSL 2 or another x86-64 Linux environment; and
- macOS on Apple silicon.
The npm package does not currently include an Intel macOS emulator binary.
WSL
Use WSL 2 with a current Ubuntu distribution. Keep the Git repositories in the Linux filesystem, for example under ~/gitm204 and ~/m204-80, rather than under /mnt/c. Linux builds and Git operations are faster there and do not inherit Windows filename and permission behavior.
Install Git and Node.js/npm, and make sure npm has access to Rocket's registry.
macOS
Install Git and Node.js/npm. The command-line developer tools supplied by Xcode are sufficient for Git. Homebrew or nvm can be used for Node.js; use one installation consistently so an old global npm prefix does not remain earlier on PATH.
The CMS and z/OS passwords are stored in the macOS Keychain. No Linux keyring setup is needed.
The upload commands invoke an ftp command-line client. Modern macOS does not supply one, so verify command -v ftp. If it is absent, install a compatible client such as tnftp with Homebrew.
Install the tools
On either platform, install or update the complete tool suite:
npm install -g @rocket/m204-tools@latest hash -r
The single package supplies make204, hlasm, cmslink, zapobj, emu204, testM204Qa, the ZAP utilities, and the Imagine JavaScript runtime.
Verify the installation:
make204 --help emu204 --help testM204Qa --help type -a make204 emu204 testM204Qa prezap scanzap
All commands should normally come from the same npm installation. If the shell finds a mixture of commands under /usr/local/bin, an nvm directory, a Homebrew prefix, or another npm prefix, remove or update the obsolete installation. A split installation can make make204 use one package version while emu204 uses another.
If emu204 reports that @rocket/em204-linux-x64 is not installed, reinstall @rocket/m204-tools without --no-optional or --ignore-scripts.
This installation procedure was verified on WSL on 5 November 2026 with @rocket/m204-tools 1.1.167. Updating the nvm installation put make204, emu204, testM204Qa, Imagine, and the ZAP utilities under the same npm prefix. Older copies under /usr/local/bin remained present but no longer took precedence.
Repositories
The two repositories have different purposes:
~/gitm204contains the build tools, assembler, linker, emulator, and their tests.~/m204-80contains the ZAP-maintained Model 204 8.0 source.~/m204-81contains the Model 204 8.1 development source.
The Model 204 directory name matters. It must end in the two-digit release, such as m204-80 or m204-81, because the tools derive the release and CMS disk names from it.
Before beginning a change:
cd ~/m204-81 git status --short --branch git switch master git pull
Do not discard uncommitted work. Resolve or preserve it before changing branches.
First build and CMS libraries
From the Model 204 repository root:
cd ~/m204-81 make204 --force
For 8.0, use make204 --no-zap to create the baseline instead. On the first build, make204 downloads the macro and object libraries it needs from CMS. You need a CMS userid with FTP access. The userid defaults from $USER, truncated to eight characters. If the workstation login name is not the CMS userid, set M204_FTPVM_USERID in the shell.
On WSL, the tools can offer to install and configure gnome-keyring and libsecret-tools so the CMS password can be saved. If the keyring is not configured, the tools can still run but may ask for the password again. On macOS, they use the system Keychain.
Library fetches are recorded in .m204libs. If a fetch was interrupted, make204 recognizes the half-fetched library and downloads it again. An older tree that already has populated libraries but no note is accepted as-is. A large number of unknown assembler operations usually means that the macro library is incomplete.
Building with make204
Model 204 assembler source, copy members, macros, and ZAP files are under src/. Build outputs are ignored by Git:
| Directory | Contents |
|---|---|
obj/ |
Baseline object decks and linked modules |
lst/ |
Baseline assembly listings |
ref/ |
Baseline dependency information |
zapobj/ |
ZAP-build objects, per-module ZAPs, and linked modules |
zaplst/ |
ZAP-build listings |
zapref/ |
ZAP-build dependency information |
A typical edit/build loop is:
cd ~/m204-81 # Edit src/MODULE.ASSEMBLE, a COPY member, or a MACRO. make204 MODULE # assemble the named source and link if needed make204 # assemble everything that changed and link if needed
Useful options:
| Option | Meaning |
|---|---|
--force |
Reassemble everything, ignoring dependency timestamps |
--link |
Force a link even when no object appears to have changed |
--no-link |
Assemble without linking |
--stdout |
Show assembler output |
--errLines=N |
Show the first N diagnostic lines for each failed module |
--errMax=0 |
Continue after assembly failures instead of stopping at the first one |
--clear |
Empty the selected build directories before building |
make204 MODULE names an input source, not necessarily an output object. For example, one input may produce more than one output module.
Review the corresponding listing after an assembly:
less lst/MODULE.LST80
The default is controlled by m204.jsonc:
- 8.0 has
"zap": true. A baremake204builds underzapobj/; use--no-zapfor the baseline. - 8.1 has
"zap": false. A baremake204builds normally underobj/.
On the WSL test machine, make204 --force for 8.1 assembled the complete tree with no assembler warnings or errors and linked both M204ONLN.MODULE and M204ONLN.ZOSMOD. A second bare make204 correctly reported every module up to date and skipped the link.
The current 8.1 link prints warnings that no object was found for EVCP and that RSQL was not found in the search path. The link still succeeds. Treat additional missing objects or unresolved externals as errors rather than assuming every linker warning is expected.
Running and testing under emu204
emu204 runs the real z/OS Model 204 module locally. It is not a source-level reimplementation of Model 204.
Automated smoke test with testM204Qa
The simplest supported baseline smoke test is:
cd ~/m204-81 make204 testM204Qa --tree="$HOME/m204-81"
testM204Qa starts obj/M204ONLN.MODULE under emu204 and runs the UL*, REGEX*, and CMD* QA patterns. It takes roughly half a minute. Results are written under m204qa/out/ beside the Model 204 tree.
For 8.0, substitute m204-80 and build the unmodified baseline with make204 --no-zap. Do not run --no-zap on an 8.0 ZAP branch: it would replace the baseline objects with changed source and destroy the comparison that generates the ZAP.
Do not judge this run by the emulator return code. Tests deliberately provoke Model 204 errors, so a successful run can have a nonzero Model 204 return code. testM204Qa reads QARUN's output and checks that every pattern finished, ran tests, reported no failures, and produced no SNAP.
The 8.1 run on 5 November 2026 completed successfully with 647 tests reported passed. Model 204 ended with return code 32, which testM204Qa correctly identified as expected.
Two messages from that run were informational:
MSIR.1097reported that DFLTCC hardware compression was unavailable under the emulator.- Two
m204procfilenames differed only in case and both folded to procedureCA_DIGICERTGLOBALROOTCA;emu204reported the collision and ignored the second.
When run from an installed tool package, testM204Qa creates m204qa/out/ beside the Model 204 tree. In the current 8.1 tree the containing m204qa/ directory is not ignored, so git status shows it as untracked after the test. Remove it after preserving any print, audit, or SNAP files needed for diagnosis.
Building an emu204 case
For an interactive or specialized run, create a directory containing an emu204.jsonc configuration, CCAIN, and any files used by the run:
mkdir -p ~/em204-cases/mycase/{files,out}
cd ~/em204-cases/mycase
vi emu204.jsonc
vi ccain.txt
emu204
With no --config, emu204 reads emu204.jsonc in the current directory. Relative paths in the configuration are resolved against the directory containing the configuration, not against the shell's current directory. This makes the case directory movable.
The complete reference is:
emu204 --help emu204 --help=config emu204 --help=em
A useful starting configuration is:
{
"module": "/home/user/m204-81/obj/M204ONLN.MODULE",
"lst": "/home/user/m204-81/lst",
"cpuid": "FF379B789175",
"jobName": "EMU204ON",
"parm": "SYSOPT=X'A0',LIBUFF=3072,LOBUFF=7168,SIRFUNC=X'01',SIRTUNE=0",
"storage": "2G",
"dd": {
"SITEPARM": {"path": "siteparm.txt"},
"CCAIN": {"path": "ccain.txt"},
"CCAPRINT": {"path": "out/ccaprint.txt"},
"CCAAUDIT": {"path": "out/ccaaudit.txt"},
"CCASNAP": {
"path": "out/ccasnap.txt",
"sequence": true,
"cc": true
},
"CCASTAT": {
"path": "out/ccastat.binary",
"blocked": true
}
},
"ddDirs": [
{"path": "files", "suffix": "M204FILE", "m204file": true}
]
}
Change the module path to zapobj/M204ONLN.MODULE when the purpose of the case is to test a ZAP-linked module.
Identity and authorization
cpuid is the twelve hexadecimal digits reported by the emulated machine. Model 204 checks it against the authorization in the module, so it must be a CPU ID authorized by the development key.
jobName becomes the name in the TIOT header. A bare LOGIN is trusted as this user, so the name must exist in CCASTAT. If the configured CCASTAT path does not exist, emu204 creates a minimal table containing the configured job name. This is normally simpler than copying a password table from a mainframe.
If a real CCASTAT is used, download it with FTP block-mode framing intact and specify "blocked": true. A plain binary byte stream cannot preserve the record boundaries of its undefined-format records.
EXEC PARM, SYSOPT, and CCAIN
The configuration's parm value is the EXEC PARM presented when Model 204 is entered. It is where user-zero parameters such as SYSOPT, LIBUFF, and LOBUFF are normally supplied:
"parm": "SYSOPT=X'A0',LIBUFF=3072,LOBUFF=7168,SIRFUNC=X'01',SIRTUNE=0"
For the development cases:
- SYSOPT
X'80'enables the audit trail. - SYSOPT
X'20'includes RK lines in the audit trail. X'A0'enables both.- Do not add
X'02'unless CCAGRP is allocated. - Do not add
X'01'unless CCASYS is already available during initialization. - A security configuration requiring login must agree with the supplied CCASTAT and CCAIN login commands.
CCAIN is ordinary workstation text. emu204 translates it to EBCDIC and pads it to 80-byte card images. Model 204 reads only through column 72; a continued parameter line ends with a dash.
A small CCAIN might be:
HDRCTL=3,LVTBL=60000,LNTBL=18000,LSTBL=480000, - NFILES=200,NDCBS=200,NDIR=200,PAGESZ=6184,SPCORE=120000, - TEMPPAGE=20000,OUTMRL=80,NSERVS=8,SERVSIZE=5000000 LOGIN OPEN M204PROC OPEN QAPROC I QARUN MYTEST* EOJ
Use TEMPPAGE when an in-memory CCATEMP is sufficient. If the test specifically needs a disk-backed CCATEMP, allocate it as an m204file with new and pages instead.
Allocating existing Model 204 files
An m204file is a flat, untranslated sequence of 6184-byte Model 204 pages. For one file:
"PAYROLL": {
"path": "files/PAYROLL.M204FILE",
"m204file": true
}
The DDNAME is the JSON key (PAYROLL). For an existing file, omit pages; the allocated size is inferred from the number of pages in the host file.
To allocate every appropriately named file in a directory:
"ddDirs": [
{
"path": "files",
"suffix": "M204FILE",
"m204file": true
}
]
With this form, files/PAYROLL.M204FILE becomes DDNAME PAYROLL. The portion before the suffix must be a valid one-to-eight-character DDNAME. Files with the wrong suffix case or invalid DDNAMEs are reported rather than silently used.
The maximum number of pages available to an existing file is its host-file size divided by 6184. Verify a transferred page image before running:
bytes=$(wc -c < files/PAYROLL.M204FILE) test $((bytes % 6184)) -eq 0 && echo "$((bytes / 6184)) pages" || echo "not a whole number of Model 204 pages"
Creating a new or scratch Model 204 file
For a persistent file that does not exist yet, provide its extent with pages:
"NEWDATA": {
"path": "files/NEWDATA.M204FILE",
"m204file": true,
"pages": 1000
}
The host file is created when Model 204 opens it. CCAIN must still issue the normal Model 204 CREATE, OPEN, and INITIALIZE commands. Do not specify new for a persistent database file: new empties the host file at the first open of every emulator run.
For deliberately disposable storage:
"CCATEMP": {
"path": "out/ccatemp.pages",
"m204file": true,
"new": true,
"pages": 5000
}
This is suitable for CCATEMP or a test file that must start empty on every run.
Getting files from CMS or z/OS
emu204 does not log on to CMS or z/OS and fetch database files itself. Put the required files in the case directory before starting it.
For a physical z/OS Model 204 data set, download it in binary mode with no character translation. The resulting workstation file must be only the concatenated 6184-byte pages:
ftp zos-host binary get 'HLQ.PAYROLL' files/PAYROLL.M204FILE quit
FTP command syntax and quoting vary by client. After the transfer, verify that the byte count is a multiple of 6184. Do not mark a page image blocked; blocked is for record-oriented files transferred with FTP block-mode framing, not Model 204 database pages.
CMS Model 204 files may be on direct-access minidisks rather than represented as ordinary CMS files. Such a file cannot simply be fetched by CMS filename. Use the site's normal utility to make either:
- a physical sequential page image that can be downloaded without translation; or
- a Model 204 DUMP data set, which can be restored into a newly allocated local
m204file.
The same dump-and-restore method works when direct access to a z/OS data set is unavailable.
If the dump data set was downloaded with FTP MODE B, preserve its record framing:
"PAYDUMP": {
"path": "files/PAYROLL.DUMP",
"blocked": true
},
"PAYROLL": {
"path": "files/PAYROLL.M204FILE",
"m204file": true,
"pages": 10000
}
The target extent must be large enough for the restored file. The CCAIN stream can then create and initialize the target and restore the dump DD:
CREATE FILE (NOFORMAT) PAYROLL END OPEN FILE PAYROLL IN FILE PAYROLL INITIALIZE OPEN PAYROLL IN FILE PAYROLL RESTORE 192 FROM PAYDUMP
Use the site's established DUMP options and restore page size; 192 above is the value used by current Model 204 QA restore procedures, not a universal replacement for the source environment's dump procedure.
Using procedure directories
Source-controlled procedure directories can be presented as read-only Model 204 procedure files without exporting a binary procedure file:
"M204PROC": {
"path": "/home/user/m204-81/m204proc",
"procDir": true
},
"QAPROC": {
"path": "/home/user/m204-81/qaproc",
"procDir": true
}
Each host file becomes one procedure, with its filename folded to upper case. Subdirectories are searched and flattened. Duplicate procedure names are reported. The procedure image is rebuilt when Model 204 opens the file, so host edits are seen after every user has closed the procedure file and it is opened again.
Output files and interactive control
Text DDs such as CCAPRINT and CCAAUDIT are written as readable workstation text. Use "sequence": true for CCASNAP so that each open produces ccasnap1.txt, ccasnap2.txt, and so on instead of replacing the preceding dump.
While Model 204 runs, a console line beginning with # is an emulator command. A bare # stops the guest at the EM> prompt; BEGIN resumes it. Use #HELP or emu204 --help=em for display, traceback, trap, trace, and profiling commands.
ZAP-maintenance workflow
Refresh the unmodified baseline
Every generated ZAP is a comparison against the baseline objects in obj/. Build those objects from current, unmodified master:
cd ~/m204-80 git switch master git pull make204 --no-zap
This step is mandatory. A stale baseline can produce ZAPs for modules that were not changed. Rebuild it after master moves or after a change to the assembler, pinned build date, version settings, or other build configuration.
Create the maintenance branch with prezap
The branch name must match <release>Z<PDS-number>:
git switch -c 80Z9206 prezap
prezap creates src/80Z9206.ZAP. Edit its header to describe the symptom, fix, prerequisites, and any genuinely necessary special instructions. Leave the 80Zxxx placeholder in the header; the distribution build assigns the sequence.
Check whether the target can be generated automatically
SIRE2 and EWDP are excluded from automatic object comparison in the current 8.0 configuration. A source change in either module can assemble and link successfully while being absent from the branch ZAP. Such a fix must be cut by hand on CMS or shipped in a relinked module.
Check the target module before doing the implementation.
Find patch space with scanzap
For a change that uses a module's local patch area or PTCH$:
scanzap SCOMP scanzap SCOMP OTHERMOD
The output reports the next PTCH offset and the next local offset for each named module. Then edit the source under src/.
Build the ZAP with make204 and bldzap
Use a clean ZAP directory for the first build:
make204 --clear
Subsequent builds can be incremental:
make204
In ZAP mode, make204:
- assembles into
zapobj/,zaplst/, andzapref/; - compares each changed object with the baseline object in
obj/; - invokes
bldzapto create per-module NAME/VER/REP statements; - links
zapobj/M204ONLN.MODULEandzapobj/M204ONLN.ZOSMOD; and - appends the generated statements to
src/<branch>.ZAP.
A successful run reports a header and one or more generated ZAPs. Header only (no ZAPs) means that no object difference was found. The usual causes are an unchanged source, a baseline that already contains the fix, or a target excluded by m204.jsonc.
Review all three forms of the result:
less src/80Z9206.ZAP less zaplst/MODULE.LST80 git diff -- src/80Z9206.ZAP src/MODULE.ASSEMBLE
Prove the test and test the patched module
First prove that the test exposes the bug in the unpatched baseline:
putmod --no-zap
Recycle the CMS Online and run the test. It should fail or reproduce the reported BUG/SNAP.
Then upload the ZAP-applied build:
make204 --zap putmod --zap
For z/OS, upload the ZAP-build object deck:
putmodzos --zap
Run the z/OS bind described below, recycle the Online, and run the same test. To switch back:
putmod --no-zap putmodzos --no-zap
The standard testM204Qa command reads the normal object directory from hlasm.jsonc and therefore tests obj/M204ONLN.MODULE, not zapobj/M204ONLN.MODULE. Do not cite that smoke test as evidence that the generated ZAP was applied. Test the ZAP build explicitly on CMS/z/OS, or create a separate emu204 configuration whose module names the ZAP-linked module.
Final review
Before committing:
- Verify that the branch ZAP names only the modules expected for the fix.
- Verify every VER and REP block and the correct patch offsets.
- Check the prerequisite ZAP line; remove it if there is no prerequisite.
- Remove the template's special-instructions block unless it is required.
- Make sure the instructions name every load module that must be patched.
- Run
git status --shortand stage source paths explicitly. Do not stage build output or unrelated files.
Testing on CMS with putmod
putmod uploads the linked CMS MODULE and map to the build disk derived from the release and userid. In the Online's SETUP NAMES, set :tester. to the builder userid so the Online loads that user's module.
The normal recycle is:
EOJ IPL CMS
At the CMS Ready prompt, PROFILE EXEC normally starts the Online. Run the reproducing QA procedure after the Online is ready.
Procedure changes are separate from the module upload. Push modified procedure directories with:
gitproc push qaproc gitproc push m204proc
Testing on z/OS with putmodzos and gitzosl
The workstation linker produces a concatenated, fixed-80-byte z/OS object deck:
- baseline:
obj/M204ONLN.ZOSMOD - ZAP build:
zapobj/M204ONLN.ZOSMOD
putmodzos uploads that object deck to the PDSE member named by zos.jsonc. It does not create the executable z/OS load module by itself. The gitzosl job on the Builder runs the z/OS binder and creates the test load module.
Configuration
The Model 204 tree needs zos.jsonc containing the z/OS FTP host, userid, object library, and member:
{
"host": "...",
"user": "...",
"objlib": "...",
"member": "..."
}
Do not put the password in this file. putmodzos obtains it from the workstation credential store, prompting on first use.
Build and upload
For an unpatched baseline test:
cd ~/m204-80 make204 --no-zap putmodzos --no-zap
For a ZAP-maintenance test:
make204 --zap putmodzos --zap
The upload is binary into an FB 80 PDSE member. If putmodzos says the object deck is missing, run make204 first and confirm that the selected obj/ or zapobj/ directory contains M204ONLN.ZOSMOD.
Bind on z/OS
On the Builder, run:
gitzosl
The submitted job deletes the prior test load module, compresses the test load library, binds M204ONLN with IEWL, and applies the required ZAPs. Its output returns to the Builder's virtual reader through RSCS/NJE.
Use rl (RDRLIST), then PF11 to inspect the job output. A successful bind includes:
$HASP395 ONLINE ENDED - RC=0000
Do not start the test Online if the bind failed or if the expected object deck was not used.
Select the z/OS Online
On the Online's CMS console:
EOJ xedit setup names a
Change:
:opsys.CMS
to:
:opsys.MVS
The XEDIT command is:
c/:opsys.CMS/:opsys.MVS/ * file
Leave :tester. set to the builder userid. It still selects the test version of M204ONLN.
Start and test
Start with either a full CMS IPL or the configuration nickname:
IPL CMS
PROFILE EXEC builds and submits the startup JCL. The JES messages include receipt of the job and completion of the submission step with MAXCC=0000. Unlike a CMS Online, Model 204 is now running as a z/OS batch job; the CMS console returns to VM read instead of displaying the local ONLINE message.
Connect from the normal user session:
M204F suffix LOGIN OPEN QAPROC I QARUN pattern
Run the same reproducer used for the baseline. For a ZAP fix, keep evidence that the baseline failed and the ZAP build passed.
Return to CMS testing
Shut down the z/OS Online, edit SETUP NAMES, and change:
c/:opsys.MVS/:opsys.CMS/ * file
Then IPL CMS or start the configuration nickname again.
Running a local Online with Janus TNSERV
A Janus port of type TNSERV supplies direct TN3270 access to a Model 204 Online. It does not use OMNI, SDS, OPENSERV, VTAM, or IODEV=7:
c3270 or s3270
|
v
localhost:7777
|
v
Janus TNSERV in Model 204 under emu204
The emulator's IUCV TCP/IP service turns the guest listener into a real workstation socket. The test described below was run successfully against the 8.1 module: s3270 connected to port 7777, logged in, and VIEW TNDEV returned TNDEV 21.
Install a TN3270 client
On Ubuntu or WSL:
sudo apt update sudo apt install c3270 s3270
On macOS:
brew install x3270
c3270 is interactive. s3270 accepts commands on standard input and is useful for repeatable tests. A plain line-oriented telnet client is not sufficient because TNSERV supports the TN3270 subset of Telnet.
Build the local case
The tested case is in:
~/em204-cases/m204-81-tnserv/
Its emu204.jsonc names the 8.1 module, sets tcpVm to the same TCPIP service-machine name used by Model 204, and supplies CCAIN, CCASTAT, audit, print, and snap DDs:
{
"module": "/home/user/m204-81/obj/M204ONLN.MODULE",
"lst": "/home/user/m204-81/lst",
"cpuid": "FF379B789175",
"jobName": "ULSPFQA",
"tcpVm": "TCPIP",
"parm": "SYSOPT=X'A0',LIBUFF=3072,LOBUFF=7168,SIRFUNC=X'01',SIRTUNE=0",
"storage": "2G",
"dd": {
"CCAIN": {"path": "ccain.txt"},
"CCAPRINT": {"path": "out/ccaprint.txt"},
"CCAAUDIT": {"path": "out/ccaaudit.txt"},
"CCASTAT": {"path": "out/ccastat.binary", "blocked": true},
"CCASNAP": {"path": "out/ccasnap.txt", "sequence": true}
}
}
The important CCAIN settings and commands are:
NUSERS=8,SDAEMDEV=15,NSUBTKS=12,NSERVS=8, - SIRTERM=3,TNDEV=21,SERVSIZE=5000000,MAXDAEM=5 IODEV=15,NOTERM=7,DUPTERM=6,LINEND=X'0D' LOGIN LOGCTL A TNUSER NOEXPIRE M204TEST1,X'FF',HIGH M204TEST1 ALL JANUS DEFINE TNSERV 7777 TNSERV 5 WSFQUERY TCPKEEPALIVE - BINDADDR 127.0.0.1 JANUS START TNSERV HALT 48,MODEL 204 JANUS TELNET SERVER READY ON PORT 7777,3,EOD EOD HALT 33,ON-LINE USERS REQUESTED TO LOGOFF,3,EOJ EOJ
TNDEV=21 enables Janus Telnet sessions. SIRTERM and WSFQUERY support terminal screen geometry. TCPKEEPALIVE is appropriate for long-lived terminal connections. BINDADDR 127.0.0.1 keeps this known-password development port local to the workstation.
The LOGCTL dialogue creates a disposable local account because the minimal CCASTAT synthesized by emu204 gives its automatic account an intentionally unknowable password. Change the example password if the case is used anywhere except an isolated development workstation.
The numbers before the two HALT messages are exact message lengths, not timeouts. An incorrect count causes User 0 to continue reading CCAIN and can immediately reach EOJ.
Start the Online
The case's run.sh removes the generated CCASTAT so that LOGCTL A TNUSER can recreate the test account on every run:
cd ~/em204-cases/m204-81-tnserv ./run.sh
Wait for:
MODEL 204 JANUS TELNET SERVER READY ON PORT 7777
From another terminal, confirm that the listener exists:
nc -vz 127.0.0.1 7777
Connect and test
For an interactive session:
c3270 127.0.0.1:7777
At the Model 204 prompt, log in with the disposable account created by CCAIN and run a test command:
LOGIN TNUSER M204TEST1 VIEW TNDEV
The password is entered in response to M204.0347 and is not displayed. The expected result includes:
M204.0353: TNUSER ... login TNDEV 21 IODEV number for TNSERV threads
To automate the same check, pipe Connect, String, Enter, Wait, and Ascii actions to s3270 -script. Do not put a real password in a committed script or shell history.
Shut down cleanly
For the quickest tested shutdown, issue EOJ from the privileged TNUSER session and answer Y when Model 204 asks for confirmation. The TN3270 connection closes and emu204 reports normal Online termination.
Alternatively, log out and quit the TN3270 client. At the emu204 operator terminal, reply to the first HALT with:
EOD
After users have disconnected, reply to the second HALT with:
EOJ
Model 204 should report that all users are logged out and begin normal Online termination.
Working on the tools themselves
Use ~/gitm204 only when changing make204, emu204, the assembler/linker, or another tool:
cd ~/gitm204 npm install npx make npm test
Useful narrower checks are:
npm run testci npm run testmake npm run testm204 npm run testm204qa
To prove the working-tree tools can build and run Model 204:
npx make npx testM204Build --tree="$HOME/m204-80" npx testM204Qa --tree="$HOME/m204-80"
testM204Build empties obj/ and ref/ in the tree it is given. Do not point it at a working tree whose current build output must be preserved.
Troubleshooting
| Symptom | Action |
|---|---|
make204 is not found |
Reinstall @rocket/m204-tools, run hash -r, and inspect type -a make204.
|
emu204 says its platform package is missing |
Reinstall without --no-optional or --ignore-scripts; check for an older command earlier on PATH. Published binaries support x86-64 Linux and Apple-silicon macOS.
|
| Hundreds of unknown assembler operations | The macro libraries are probably absent or half-fetched. Run getmaclib --direct, then rebuild.
|
| Linker reports unresolved LE symbols | Fetch the required object library with getobjlib --direct.
|
| ZAP file has only its header | Confirm the source really differs from the baseline, refresh the baseline from unmodified master, and check whether the module is excluded from automatic ZAP generation. |
| ZAP unexpectedly contains many modules | The baseline or a pinned build setting is stale. Return to master and rebuild with make204 --no-zap.
|
| QA run has a nonzero return code | Read the testM204Qa verdict. The Model 204 return code is not the pass/fail result.
|
m204qa/ appears as untracked after a test |
The installed QA driver writes its case and output beside the Model 204 tree. Preserve anything needed from m204qa/out/, then remove the generated directory.
|
MSIR.1097 says hardware compression is unavailable |
Expected under the current emulator; it does not by itself fail the QA run. |
| Need more emulator detail | Use emu204 --help, emu204 --help=config, and emu204 --help=em.
|
| Port 7777 closes immediately after startup | Check the HALT message lengths in CCAIN. They must exactly match the message text or User 0 can continue to EOJ.
|
| TNSERV prompts for a password but the generated account cannot log in | Expected for the automatic CCASTAT account. Create a disposable account with LOGCTL, or provide an appropriate development CCASTAT.
|
A plain telnet client connects but does not produce a usable screen |
Use a TN3270 client such as c3270; TNSERV requires TN3270 negotiation.
|
Source references
gitm204/BUILD.mdgitm204/em204/README.mdm204-80/DEVELOPMENT.mdm204-80/ZAP-WORKFLOW.mdm204-80/.github/skills/building.mdm204-80/.github/skills/testing.mdm204-80/.github/skills/zos-crossbuild.mdm204-81/DEVELOPMENT.mdm204-81/.github/skills/building.mdm204-81/.github/skills/testing.md