MVSJCL.doc - Converting MVS JCL to Unix/Linux scripts - Contents

Note
  • In Jan 2017 this documentation was replaced with the following 4 documents:
 jclcnv1demo.htm - listings of demo JCLs & converted shell scripts
                   - operating instructions for JCL & COBOL conversions
                   - logs of conversions & executions of demo JCL/scripts
 jclcnv2real.htm - more concise instructions for JCL & COBOL conversions
                   - addressing more of the real world complexities
 jclcnv3aids.htm - conversion aids: cross-references of JCL,COBOL,& copybooks
                   - determining essential data files that need to be transferred
                   - test/debug tips & techniques
 jclcnv4gdg.htm  - Vancouver Utility GDG file handling system
                   - Enhancements go well beyond GDG processing on the mainframe

MVSJCL.doc (outdated) - Contents


Part_0 - Introduction & Summary of Major Benefits

Part_1 - Demo conversion using supplied Test files (JCL, COBOL,& DATA files)
- do these first & ensure your results match those listed
- helps you to understand these tools & ensure they work at your site
- use Part 4 to convert your own JCL (vs these supplied test/demo files)
- scripts to reconvert JCL - 1 at a time or all in directory
- scripts to reconvert COBOL copybooks & programs - 1 or all in dir

Part_2 - Testing & Debugging Aids
- Cross-References, Jobflow reports, job logging, etc
- many other scripts & utilities valuable during conversions
- several of these can be run using supplied test files
- get familiar with these, so you will know when they can save you time
- Micro Focus COBOL Error codes listed for your convenience

Part_3 - Conversion Support Files - profiles, functions, control files
- supplied versions are tuned for the Test/Demo conversions
- you may want to modify for Your conversions

Part_4 - intended to present a plan for you to follow in converting 'YOUR' JCL
  (vs the test/demo conversions illustrated in Part_1)
- Part 4 is a good roadmap for planning & executing the entire conversion
- use the step by step method for your '1st' conversion of all JCL
(for re-conversions, script jcl2ksh51A converts All JCL with 1 command)
- Part 4 also documents scripts to convert All COBOL & DATA, but you
  should use the step by step methods for the '1st' conversions
  as documented in MVSCOBOL.htm & MVSDATA.htm.

Part_5 - converting mainframe GDG files for Unix/linux
- some features surpass mainframe implementation
- new generations written to jobtmp, copied to $RUNDATA on Normal EOJ
  so Abterms do not create some new generations making reruns difficult
  but if you can restart at the step, you will be prompted to copy back
- Indexed control file provides for number of generations per file
- may update control file to process prior gens 1 time or by expiry date
- may update control file to increment thru a range of prior generations
- option to prompt operator to confirm gen# or enter an alternate gen#

Part_6 - documents optional jobs that might be required or desired at some sites
- assigning mainframe files to sub-dirs on unix/linux systems.
- use top-node of DSNs as a sub-dir, or store all files in data1/...
- see TOPNODES table in JCL conversion control file (jclunixop51).
- extra control files for sites without VSAM LISTCAT reports
- inputting datafile recsizes,keys,etc from Excel spreadsheets
- extract control cards (for dates, etc) from JCL to separate files
  (easier to update, without danger of modifying JCL unintentionally)
- jobparmx1/jobparms1 files date-stamped allow updates for future dates
- jclstrip1, utility job to cleanup converted JCL/scripts
- remove non-essential code & extraneous comments
- Manual changes for DDNAMEs required in scripts converted from JCL
  if DDNAME is a forward reference (multi-part files with INSTREAM data)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

MVSJCL.doc - Converting MVS JCL to Unix/Linux scripts - Contents


Part_7 - Operating Aids
- Console Logging captures all console messages,
  intended to assist operators & applications administrators
- Job Debug Logs capture the log for 1 job execution,
  intended to help programmers debug JCL/scripts
- Job Message Logs captures only VITAL & ERRor messages,
  intended to assist operators & applications administrators
- Illustrated demos of Console, Job Debug,& Job Message Logging
  (run jgl200.ksh 4 times, forcing GDG errors on run#2)

Part_8 - JCL/script Review, Modifying, Writing new scripts
- Quiz to test your understanding of profiles, environmental-variables
  console logging, capturing logs from jobs scheduled by cron
- modifying converted JCL/scripts (examples & exercises)
- writing new scripts to Vancouver Utility standards

Part_9 - scripts & uvcopy jobs used in MVS JCL conversion
Note
  • In Jan 2008, MVSJCL.doc was split into 2 documents (books)
  • Parts 6,7,8,9 were moved to a separate book MVSJCL2.doc
  • Parts 6,7,8,9 names changed to Parts 26,27,28,29 to avoid any confusion

MVSJCL2.doc


MVSJCL2.htm - separate document for special conversions
& extended capabilities
 MVSJCL2.htm#Part_26 - Special conversions for SORT/SYNCSORT, FTP, etc
         - Manual Changes Required for SORT/SyncSort
         - uvsort has all the powerful capabilities of SyncSort, but some
           of the more complex conversions may require manual correction.
         - Alternate solutions for SORTs with too many OMIT/INCLUDEs
         - Merging SyncSort converted parameters into VU JCL/scripts
         - FTP conversion examples
 MVSJCL2.htm#Part_27 - Scanning for Problems & Mass-Change Fix-ups
         - grep, sed, uvcopy scan1d, scan2d, rep1d, rep2d, etc
 MVSJCL2.htm#Part_28 - Special Considerations, Problems & Solutions
         - CONDition tests
         - Run a JCL/script when an input file is detected (ftrigger51)
         - detect FTP'd files & move/rename to a 2nd subdir to prevent overwrite
         - Convert mainframe JCL containing Cybermatics ESP scheduler coding
         - Process scripts converted from mainframe JCL containing BMC Control-M
           to allow testing on unix before unix version of control-M installed.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

MVSJCL.doc - Converting MVS JCL to Unix/Linux scripts - Contents

Mainframe Conversion Documentation Summary

Here is a brief review of the documentation relevant to mainframe conversions & accessible on the UV Software web site (www.uvsoftware.ca).


MVSJCL.htm - MVS JCL Conversion to Korn shell scripts <--- This Document
 MvsJclPerl.htm - MVS JCL Conversion to Perl scripts     <--- Alternate

VSEJCL.htm - VSE JCL Conversion

MVSCOBOL.htm - VSE COBOL Conversion

VSECOBOL.htm - MVS COBOL Conversion

MVSDATA.htm - Convert MVS EBCDIC Data to ASCII, preserving packed fields
- high volume (all files in directory)

VSEDATA.htm - Convert VSE EBCDIC Data to ASCII, preserving packed fields
- high volume (all files in directory)

DATAcnv1.htm - Basic DATA conversion (1 file at a time)

Copyright UV Software Inc. 1993-2013

Owen Townsend, UV Software, 4667 Hoskins Rd., North Vancouver BC, V7K2R3

 Tel: 604-980-5434 Fax: 604-980-5404

mailto:owen@uvsoftware.ca

http://www.uvsoftware.ca

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_0 MVS JCL Conversion - Major Features

MVSJCL.doc is the detailed step by step instructions for converting IBM MVS JCL to Unix/Linux, using the Vancouver Utilities from UV Software Inc.

MVS JCL Conversion - Major Features

  1. MVS JCL is automatically converted to Korn shell scripts to run on Unix, Linux, or Windows with SFU (Services for Unix). Mainframe file assignments for COBOL programs are converted to export the external name for Micro Focus COBOL. Mainframe DATA and SORT utilities are converted to the Vancouver Utility Unix/Linux equivalent (uvcp or uvsort). Note that the Unix/Linux/Windows system sort cannot be used for mainframe file types since it does not support fixed record lengths with no linefeeds.

  2. Converting the JCL to Korn shell scripts provides much more flexibility for future enhancements than the 'emulations' offered by some other conversion alternatives. Korn shell scripts allow you to use the full power of your unix/linux system. Korn shell scripts allow you to integrate other software desired, such as schedulers.

  3. JCL Converted scripts simplified. The JCL conversion has been designed to make the resulting Unix/Linux scripts as easy as possible to read, to debug, and to maintain in future. Steps are sequence numbered & step separator lines are inserted.

  4. The JCL converter inserts code to allow 'step restart' at any desired step. For example to restart the 'jar200' job at step2 the command line would be --> jar200.ksh STEP=S0020 (4 digit step#s incremented by 10).

  5. The JCL converter uses the 'logmsg1' function to ensure that all console messages are prefixed with date:time:jobid on the left side. Important messages such as 'Terminated Abnormally' are shown in reverse video & an acknowledgment is requested.

  6. The 'jobstop' script is provided to allow operators to pause jobs at the next step or at any desired step. 'jobstop' writes a control file that is tested by the 'stepctl' function which is inserted at the begining of each step by the JCL converter.

  7. The JCL conversion performs a 1 time expansion of PROC's before converting the JCL to Korn shell scripts. The JCL converter will replace mainframe '&variables' with their default values. We have found many mainframe jobs with dozens or hundreds of &variables (now $symbols in Korn shell scripts) that were in fact never used. Many of these were mainframe related (VSN's,cylinders,etc) with no applicability to Unix/Linux. Removing these means we have to re-insert the few that are in fact used, but removing the vast majority greatly simplifies debugging and future maintenance. Under MVS, variables could exist only in the PROCS, but under Unix/Linux we can have many $SYMBOLS in the Korn shell scripts.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

0A2. MVS JCL Conversion to Korn shell scripts - Major Features

  1. Cross-References of JCL/scripts & COBOL programs/copybooks. XREFjobs.htm documents a complete plan to provide: Inventory control lists of all filenames & line counts, Content listing of JCL/scripts before & after conversion, Copybook layout maps, COBOL File info reports,& JCL Job-Flow reports. These listings should be run after you have transferred & converted the JCL & COBOL programs, but before you begin testing & debugging. House these reports in 3-ring binders with index tabs for easy access during testing & debugging.

  2. Job-Flow reports extract File Info from both JCLs & COBOL programs. One line is printed for each datafile in each step. From the JCL we show: Step#, Program-name, DDname,& DSNname. From the matching COBOL program, we show: file Organization, Access-mode, Open-mode(I/O/E), Record-size,& Copybook-name. These reports are your essential guide to testing & debugging.

  3. Unix functions have been written to provide the essential functionality of the IBM cataloged generation files. Please see exportgen0 & exportgen1 which are discussed & listed in 'Part_5'.

  4. Directory Design. A lot of time and effort was invested to ensure the directory design would accommodate multiple separate systems, but allowing for interconnections. Program libraries and data are in separate file systems, which are each subdivided by the various applications. The design allows for 4 or 5 levels of sub-directories before files are assigned. This gives us more flexibility & better file protection. See ADMjobs.htm for a discussion of RAID & file system design.

  5. Separate logins for each system facilitates console logging. Operators can use multiple screens on 1 terminal and each screen displays only the jobs running for one system. This avoids confusion and allows us to collect console logs separately by system.

  6. Environmental variables RUNDATA & RUNLIBS allow programmers to operate on test data & test libraries while production personnel operate on production data & production libraries. RUNLIBS is defined in the profiles to control the PATH to JCL/scripts. All converted JCL/scripts call a common function (jobset51) which performs a 'change directory' to $RUNDATA at the beginning of the script. All file accesses are then relative to $RUNDATA which is either test data or production data depending on the user profile. This facility is vital if production & development are on the same machine, but still useful for separate machines. For example, different programmers can use different sets of data files &/or libraries.

  7. Protection from running the wrong JCL/script. Since operators login to the system to be run, they cannot accidentally run jobs belonging to other systems, because their profile PATH would search only the libraries for the intended system.

  8. No problem if COBOL programs named the same as JCL/scripts. Because the COBOL program library is not in the PATH, but rather is defined in the 'jobset51' function which is inserted by the JCL converter at the beginning of each JCL/script.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

0A3. MVS JCL Conversion to Korn shell scripts - Major Features

  1. Programmers may turn on debugging (animation) for COBOL simply by exporting a runtime variable (ANIM=+A for COBOL, UVCOPYROP=d for uvcopy), no need to modify JCL or recompile programs with debug options.

  2. Console Logging. This is a VITAL feature to replace the console logging systems provided by proprietary mainframe systems. Console Logging uses the Unix/Linux 'script' command inserted at the end of the profile to create a date/time stamped console log file which captures all console I/O until the operator logs off. Console log files must be processed (to remove screen control codes) before being viewed or printed & this is accomplished automatically when the user logs off & back on. He may then use the logview script to view or print the latest (or earlier) log file. See the sample console log created when the conversion test/demo jobs are executed later beginning on page '1S3'. Or see console logging in ADMjobs.htm. Note that you must uncomment the last 6 lines of the profile to activate console logging. See the profile listed at ADMjobs.htm#1C1. You must also setup a subdir in /home/appsadm/log1,2,3 matching userid. Console logging should be mandatory for operators, but can be optional for programmers (highly recommended for testing).

  3. 'uvsort' (A Vancouver Utility program) replaces mainframe SORT & SYNCSORT. Mainframe sorts must be converted to 'uvsort', because the Unix/Linux sort can not be used for mainframe type data files. The major problem is that the unix/linux system sort cannot sort files without LineFeeds. Mainframe files are usually fixed length records without line feeds. uvsort can also read & create indexed files which is not possible with the unix/linux system sort. uvsort includes SYNCSORT features such as record INCLUDE/OMIT, record reformatting INREC/OUTREC, etc. See the many examples given in MVSJCL2.htm#Part_6.

  4. IDCAMS replacement. IDCAMS 'REPRO' (file copy) is converted to the Vancouver Utility 'uvcp'. Most of the other IDCAMS functions are not required for MicroFocus COBOL on Unix/Linux/Windows systems. For example 'DEFINE CLUSTER' was required by the mainframe to create a VSAM file, but MicroFocus COBOL can create VSAM files simply by 'OPEN OUTPUT'.

However the IDCAMS DEFINE CLUSTER is converted to 'uvcp' which will create an empty file, in case the IDCAMS step is followed by a COBOL program that expects to ADD/UPDATE records to an empty existing file. The uvcp will create the file with any indexed keys specified.

  1. Replacements for mainframe Ditto, File-Aid, Easytrieve, QuikJob, DYL280, etc. The uvcopy & uvqrpg utilities can supply more functionality than many of these mainframe utilities.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

0A4. MVS JCL Conversion to Korn shell scripts - Major Features

  1. Tape Files. Jobs using tape files will need to be examined. COBOL programs can not read/write tape files on Unix/Linux systems.

Tape files will be redirected to a disc subdirectory to reduce the extensive tape handling that was common on mainframes. If the copy to tape was simply a backup it may be unnecessary on unix due to superior backup frequency (every night automatically scheduled by 'cron').

The disc file (tape equivalent) is date/time stamped in case of multiple runs between the backup cycles. You should remove the date/time stamp if not required - if it should always be the latest version & there is no need for prior versions. You should also remove the date/time stamp if the tape file was re-input on a subsequent job & make sure the filenames match.

You may still need tape files for data transfer with outside agencies. Unix/Linux systems do not natively support IBM standard labelled tapes but the Vancouver Utilities do include jobs (t9copy2, t9write1, etc) to read and write IBM/EBCDIC standard labeled tapes.

  1. Print Spooling for SYSOUT type files. The first job of the day creates a new subdirectory for all SYSOUT files created that day. For example /p2/proddata/sysout/030930 would hold reports for the act system created on September 30/2003. The sysout subdirectories are accumulated, but purged automatically by the nightly 'cron' job after 20 days (easily modified). Many SYSOUT files do not need to be automatically printed. It may be more convenient for programmers to view the report files with the editor and to print selectively.

  2. COBOL programs usually write important reports to disc files with assigned DSN names (not SYSOUT's). You could use a unix/linux spooling package (such as Easy Spooler) to spool & print these files. It is a simple matter to insert the spooling commands into the scripts at the appropriate points (after COBOL programs have created the disc files).

  3. The Vancouver Utilities provides several laser printing scripts that may be used to print the reports. Several customers have used these scripts for standard reports and use Easy Spooler for special forms. The laser printing scripts allow mainframe reports to be printed Landscape on 8 1/2 by 11 inch standard copy paper (preferably 3 hole punched). Several scripts are provided (see details in uvlist.htm.
     uvlpLS13 - prints Landscape Simplex at 13 cpi to fit 132 cols on 11" wide
              - prints at 8.1 lpi to fit 60 lines in 8 1/2 deep

uvlpLD13 - prints Landscape Duplex

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

0A5. MVS JCL Conversion to Korn shell scripts - Major Features

  1. We suggest you setup an 'applications administrator account' (appsadm). to handle administrative duties (common to various applications), such as console logging & backups. /home/appsadm contains the following subdirectories: a. log1/log2/log3 - console logs subdirs for today, this month, last month. b. sf (script files) - common to applications (backups, crontabs, etc) c. pf (uvcopy jobs) - common to applications d. logs - logs of nightly backups (run automatically by cron) - cpio stdout stores lists of files backed up - stderr appends to nightly log to collect history of backups & any error messages (should be reviewed periodically).

  2. Backups can be scheduled by 'cron' (unix/linux job scheduler). The backups are controlled by a 'crontab' file belonging to the 'appsadm' account. Crontab files can be customized for the various systems (accounting, manufacturing, etc).

  3. The Vancouver Utilities includes sample backup scripts such as /home/uvadm/sf/adm/nightly1. These scripts use cpio to stack multiple archives on DAT tape for the various systems. Multiple archives allow you to easily restore a desired system & retrieve desired files. Note that the Directory Design facilitates backup/restores by logical groups. You can backup production data & production libraries separately from test data & test libraries.

  4. Some customers use on-disc backups for the data before & after nightly batch jobs. The operator runs the before backups as the 1st step of the nightly batch, and the after backups are run automatically by cron at 3 AM (for all systems). Nightly on-disc backups are also made for the libraries which allow instant recovery from accidental erasures.

  5. Mainframe GDG (Generation) files are implemented via unix/linux Korn shell functions (exportgen0, exportgen1,& exportgenall). 'exportgen0' defines the current (highest gen#) of the file & 'exportgen1' defines the next (not yet existing gen#).

GDG files in MVS JCL are recognized by the suffixes (0), (+1), (-1).In the ksh scripts, the (0),(+1),(-1) is indicated by functions exportgen0/1 and a filename will be suffixed with an '_' underscore. The converted data files will be suffixed by '_######' (underscore & 6 digit gen#). Please see Part_5 for further discussion.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

0A6. MVS JCL Conversion

more than conversion tools

UV Software has the complete solution to batch conversions of JCL, COBOL,& DATA. The Vancouver Utility package supplies several additional items essential to the successful conversion & ongoing operation on Unix/Linux systems:

  1. Profiles define RUNLIBS & RUNDATA to allow multiple sets of test or production libraries & data on the same machine. See profiles listed & described at www.uvsoftware.ca/admjobs.htm#1B1

  2. Directory Design. It is essential to have a well thought out directory design within your RAID file systems. See RUNLIBS, RUNDATA, PRODLIBS, PRODDATA designs starting at ADMjobs.htm#2C0 or MVSJCL.htm#4C1. Environmental variables RUNLIBS/RUNDATA are set to testlibs/testdata or prodlibs/proddata in the profiles of programmers & operators, so you never have to change any JCL/scripts for use by programmers & operators. This also allows programmers to hve different sets of libraries & data.

  3. Backup systems described at www.uvsoftware.ca/admjobs.htm#Part_4 As well as backups to tape, this system takes advantage of the massive inexpensive disc systems now available to maintain date stamped zip file backups on-disc for the last 40 days, the last 15 end of month backups,& the last 7 end of year backups. Backups on disc are immediately available.

  4. Using cron to schedule nightly jobs, backups, etc See www.uvsoftware.ca/admjobs.htm#Part_5

  5. Console logging described at www.uvsoftware.ca/admjobs.htm#Part_6. Mainframes include a console logging system, but unix/linux systems do not. UV Software has developed a console logging system for unix/linux.

  6. Utilities to replace mainframe utilities for data file maintenance (SORT, IDCAMS, IEBGENER, DITTO, FILEAID, EasyTrieve, etc). Note that uvcopy, uvsort, uvcp can process mainframe indexed files with packed decimal fields, etc (normal unix utilities can not).

  7. The 'uvcopy' utilities are an essential part of the mainframe conversions because they can do many things not possible with the standard unix/linux utilities (such as processing packed decimal fields & handling Indexed files compatible with Micro Focus COBOL).

  8. uvcopy is a general purpose data manipulation utility which can be used to reformat files, modify records, and perform almost any imaginable data data conversion & translation that may be required or desired. It is especially useful when transferring files to new machines or converting record layouts to fit the requirements of new application packages.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

0A7. MVS JCL Conversion

Test/Demo files provided

Test/Demo JCL, PROCs, COBOL programs,& DATA files are provided, for you to run the conversion procedures & verify you results match the results listed in this documentation.

The Test/Demo conversion sessions will give you a clear understanding of these conversion procedures & make it easier for you to get started on your own conversions. If you are reading this on the web site (www.uvsoftware.ca), the test/demo documentation will make it easier for you to understand these conversion concepts.

If you have not yet purchased the Vancouver Utilities conversion package, UV Software invites you to send samples of your JCL for conversion & return by email attachments. Please be sure to include all referenced PROCs and any library members containing SORT keys, etc.

Running Conversion Test/Demos

You can run the test/demos without the extensive planning & file system setup recommended for your own conversions. After installing the Vancouver Utilities, the test/demo subdirs & files will be found in directory 'mvstest' (/home/uvadm/mvstest if installed as recommended).

We recommend you do not run the test/demos in /home/uvadm/mvstest, since any updated installation of Vancouver Utilities would wipe this out. So we advise you to setup a new user 'mvstest' (/home/mvstest), and setup the profile for mvstest as described in install.htm or ADMjobs.htm. Then copy the test/demo subdirs & files from /home/uvadm/mvstest/* to /home/mvstest/...

You could copy the 'mvstest' directory to a subdir within your home directory, if you modify your profile as described in install.htm or ADMjobs.htm. If you don't want to do that yet, setup user 'mvstest' for initial testing. When you decide to proceed with your own conversions, you can then modify your profile & the profiles of all programmers & operators involved.

Compile 'C' programs if not Linux

The Vancouver Utilities are distributed with the 'C' utility programs already compiled (into /home/uvadm/bin) using Red Hat 9.0. If you are running Linux, you should not have to recompile. If you are running Unix, please see install.htm for the compile instructions for the various flavors of Unix. If you are running on Windows with SFU (Services For Unix), please see WindowsSFU.htm for compile instructions.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

0A8. MVS JCL Conversion

Korn shell 1993 version recommended

The converted scripts are designed for the Korn Shell (ksh) and I recommend the 1993 version, which can be downloaded from http://www.kornshell.com.

Vancouver Utilities for Windows 95,98,NT,2000,XP

 The Vancouver Utilities & the conversion tools & scripts may now be run on
 Windows systems, using SFU, UWIN, or CYGWIN (unix emulators for windows).
 You can download SFU from http://www.microsoft.com/windows/sfu,
 UWIN from http://www.wipro.com/uwin,
 and CYGWIN from http://www.cygwin.com.

There is also a low cost version of Vancouver Utilities for native windows, but that package does not include the conversion tools since the conversions depend on many unix style scripts that can only be run on windows with the aid of an emulator such as SFU, UWIN, CYGWIN, or KMS Tools.

Please see WindowsSFU.htm for important notes on installing SFU & VU. Please see CygwinUwin.htm for important notes on installing UWIN & CYGWIN for the Vancouver Utilities.

The various JCL & COBOL conversions illustrated in this documentation have been tested on SFU, UWIN, & CYGWIN as well as on Unix & Linux. Notes are made where there is any difference.

SFU/UWIN/CYGWIN differences to Unix/Linux

COBOL compile scripts are different since the MicroFocus COBOL compiler is different (Server Express for Unix/Linux vs Net Express for Windows). The script to compile 1 program at a time is 'mfcbl1' for unix/linux, and 'mfnxcbl1' for SFU/UWIN/CYGWIN (see listings at MVSCOBOL.htm#5E0). To compile all programs in a directory the scripts are 'mfcblA' & 'mfnxcblA'.

JCL/scripts use functions (exportgen0 & exportgen1) to simulate mainframe generation files. Until June 2004, these complex functions required the 1993 version of the Korn shell & would not work under 'bash' (default shell for CYGWIN) or under 'pdksh' (public domain ksh), which is supplied with CYGWIN and UWIN (and aliased as 'ksh'). In June 2004, the exportgen functions were modified & tested for SFU (probably also OK for CYGWIN).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_1. MVS JCL Conversion to Korn shell scripts

Before you attempt to convert your own JCL, we recommend you perform the demo conversions illustrated in Part 1, using the supplied test JCLs & data files.

Part_1 will help you understand these tools & ensure they work at your site, but be sure to use Part_4 to convert your own JCL vs the test/demos in Part 1.

Part 1 Contents


1A1. Directory Design for test/demo JCL Conversion & Execution

1B1. Overview of test/demo JCL PROCs,& COBOL programs

1C1. JAR100 - simple 1 step JCL to execute a COBOL program

1D1. JAR200 - typical 2 step JCL (SORT + COBOL report).

1E1. JGL100 - demo conversion of PROCs & GDG files (1 step COBOL)

1F1. JGL200 - 2 step JCL (SORT+COBOL) using PROCs & GDG files

1G1. JGL300 - demo IEBGENER/IDCAMS & CONDition codes
1G3. JGL320 - demo IF/THEN/ENDIF
1G5. JGL360 - IDCAMS DEFINE CLUSTER converted to uvcp to init an Indexed file

1H1. JGL500 - demo IEFBR14 conversion
- to DELETE files (regular & GDG)

1I1. IKJEFT01 - demo conversion of TSO batch utility required to RUN mainframe
COBOL programs that accessed DB2 tables

1J1. FTPPUT1 - converting mainframe FTP to unix/linux ftp
- demo JCL you can execute after conversion to ksh script

1K1. MAILSMTP - convert mainframe IEBGENER sending mail via SYSOUT=(B,SMTP)
1K2. MAILDEMO - converting mainframe 'MAILTOLN' to unix/linux mail or mutt
- demo JCL you can execute after conversion to ksh script

1L1. ISRSUPC1 - converting SUPERC to unix/linux 'cmp' & VU 'uvcmp'
- demo JCL you can execute after conversion to ksh script

1P1. Preparations to convert test/demo JCL to Korn shell scripts
- setup user 'mvstest' & copy supplied test/demo files from 'uvadm/mvstest'

1P4. Alternative setup demo files in your homedir (vs setup new user mvstest).
If you prefer or if multiple programmers at your site to perform demos,
you can setup 'testlibs' & 'testdata' subdirs in your own homedir
& copy the supplied demo files to them.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part 1 MVS JCL Conversion to Korn shell scripts

Part 1 Contents - continued


1Q1. Operating Instructions to Convert the Test/Demo JCLs to scripts
- 10 pages of detailed instructions

1R1. Operating Instructions to Convert the Test/Demo COBOL programs
- required to execute the test/demo JCL/scripts

1S1. Operating Instructions to Execute the Test/Demo JCL/scripts

1T1. Checking Test/Demo Output Results

1U1. Re-run Test/Demo JCL/scripts with Console Logging

1V1. scripts to reconvert JCL - 1 at a time or All in directory
- jcl2ksh51 & jcl2ksh51A
1V2.  scripts to reconvert COBOL - 1 at a time or All in directory
- cnvMF51cpy & cnvMF51Acpy for copybooks, cnvMF51 & cnvMF51A for programs

1X1. Quick conversion for your JCL (vs test/demo JCL)
- I recommend you take the time to perform the test/demos in Part 1
- Then follow procedures in Part_4 for your own JCL conversions
- But if desired, here is a method of getting some quick results

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1A1. Directory Design for JCL Conversion

Directory-Design for UV test/demo JCL Conversion

 /home/mvstest         <-- setup user 'mvstest' & copy subdirs from uvadm/mvstest
 :-----testlibs
 :     :------Csub        - C subroutines for COBOL programs
 :     :--MF--cbl0        - COBOL programs ('*' means files present)
 :     :------cbl1        - cleaned up, cols 1-6 & 73-80 cleared, etc
 :     :------cbl2        - cnvMF5 converts mainframe COBOL to MicroFocus COBOL
 :     :------cbl3        - sysin1 converts instream ACCEPTs to READs from a file
 :     :------cbl4        - sysout1 converts DISPLAY on SYSOUT to WRITE to a file
 :     :---ux-cbls        - copy here (standard source library) before compiling
 :     :------cblst       - cobol source listings from compiles
 :     :------cblx        - compiled COBOL programs (.int's)
 :     :--MF--parm0       - control cards & includes (SORT FIELDS, etc)
 :     :------parms       - control cards with 73-80 cleared
 :     :--MF--cpy0        - for COBOL copybooks
 :     :------cpy1        - cleaned up, cols 1-6 & 73-80 cleared, etc
 :     :------cpy2        - cnvMF5 converts mainframe COBOL to MicroFocus COBOL
 :     :---ux-cpys        - copy here (standard copybook library)
 :     :--UV--ctl         - conversion control files (jclunixop5,datactl53I,etc)
 :     :------errs        - JCL converter writes ERROR reports here
 :     :--MF--jcl0        - test/demo JCLs supplied
 :     :------jcl1        - intermediate conversion 73-80 cleared
 :     :------jcl2        - PROCs expanded from procs
 :     :------jcl3        - JCLs converted to Korn shell scripts
 :     :---ux-jcls        - copy here manually 1 by 1 during test/debug
 :     :------maps        - 'cobmaps' record layouts generated from copybooks
 :     :------pf          - uvcopy jobs to replace utilities (easytrieve,etc)
 :     :--MF--proc0       - test/demo PROCs supplied
 :     :------procs       - will be merged with jcl1, output to jcl2
 :     :------sf          - for misc scripts you may wish to write
 :     :------tmp               - tmp subdir used by various conversions
 :     :------xref              - cross-references (see XREFjobs.htm)
 :-----testdata          - test/demo data files supplied
 :     :--MF--ap          - Accounts Payable
 :     :--MF--ar          - Accounts Receivable
 :     :--MF--gl          - General Ledger
 :     :--UV--ctl         - GDG control file
 :     :------jobtmp      - temporary files for SYSIN instream data
 :     :      :----030926 - jobtmp subdir created in jobset51 (script line 10)
 :     :------sysout      - SYSOUT printer files
 :     :------tmp         - tmp subdir for uvsort & misc use
 :     :------wrk         - interstep temporary work files
        --MF--  marks subdirs containing MainFrame files for conversion
                (COBOL programs, copybooks, parms, PROCs,& data)
        --UV--  marks control files supplied by UV Software
        ---ux-  marks the most important outputs of the conversion
                most other subdirs can go away after the conversion is complete

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1A2. Directory Design for JCL Conversion

Notes re: JCL/PROC test/demo subdirs provided

The sub directories illustrated on the previous page are included on the Vancouver Utility distribution media and after installation will be contained within /home/uvadm/mvstest (1 of about 20 directories in the package).

You will later be instructed to setup a test/demo userid/login 'mvstest' and copy the subdirs from /home/uvadm/mvstest to /home/mvstest. Please do not run tests within /home/uvadm because new distributions of Vancouver Utilities would destroy your test results.

The following pages will list several test/demo JCLs & PROCs provided and their converted equivalents (Korn shell scripts). Studying these examples will give you a good understanding of the JCL conversion process.

If you have just installed the package, you can run the conversion procedures (starting on page '1P1') and verify that you get the same results listed here. If you have not yet purchased the package, you are invited to send samples of your JCL & PROCs to UV Software for conversion & return.

Note that the directory design listed here is for test/demo convenience only. The recommended directory design for your own testing & production is illustrated later begining on page '4C2'. The big difference is that you should assign your data directories to a separate file system from the libraries.

setup required to run test/demo jobs

See the detailed operating instructions on page '1P1' ahead. These instructions review everything required (loading Vancouver Utilities, setting up users, etc).

setup required to convert your own JCL,COBOL,DATA

Please see Part_4 when you think you are ready to start converting your own JCL, COBOL,& DATA files. But be first run these test/demos in Part 1 (with supplied demo files) before you attempt to perform your own conversions.

setup for quick conversion of a few of your JCLs

See page '1X1' if you need to do a quick preliminary conversion of a few of your JCLs before you invest the time & effort that should be expended when you launch your mainframe conversion project.

Page '1X2' shows you how to use script 'mvslibsdirs' to create the (empty) sub-dirs (shown on the previous page). You could create a directory within your homedir (call it testlibs) to contain the subdirs required for conversion.

Page '1X2' also shows you script 'jcl2ksh51A' to perform all steps of JCL conversion, BUT we recommend you first use the step by step method (starting on page '1P1') to better understand the process.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1A3. Directory Design for JCL Conversion

RUNLIBS/RUNDATA & profiles

The Library & Data directories used by the converted JCL/scripts is determined by environmental variables 'RUNLIBS' & 'RUNDATA' defined in user profiles. See recommended profiles for these test/demos listed at ADMjobs.htm#1C1.

$RUNLIBS is used in the PATH to define where the JCL/scripts are to be found.

$RUNDATA is used in the jobset51 function called at the beginning of each script to perform a change directory to the data files super directory.

All data files are addressed relative to RUNDATA, which allows us to easily switch between test data & production data simply by changing the value of RUNDATA. This is done most reliably by providing different profiles to the programmers & the production personnel.

The stub_profile is copied/renamed as .profile for ksh & .bash_profile for bash. The stub_profile listed ADMjobs.htm#1C1 defines RUNLIBS & RUNDATA as follows:


 export RUNLIBS=$HOME/testlibs
 #============================
 export RUNDATA=$HOME/testdata
 #============================

If you setup separate user 'mvstest' for these tests, the expansions would be:


 export RUNLIBS=/home/mvstest/testlibs
 #====================================
 export RUNDATA=/home/mvstest/testdata
 #====================================

Alternatively, you could create a 'mvstest' subdir within your current HOME dir, in which case you would modify the exports as follows:


 export RUNLIBS=/home/userxx/testlibs
 #===================================
 export RUNDATA=/home/userxx/testdata
 #===================================

Note that setting up RUNLIBS & RUNDATA in a HOME dir is a convenience to get you started testing quickly. You would NOT do this for serious testing & definitely not for production.

See the recommendations for your serious testing & production described later on pages '4C2' thru '4C10'

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1B1. Sample Conversions of MVS JCL to Korn shell scripts

test/demo JCL PROCs,& COBOL

We will illustrate the original mainframe JCL & the converted Korn shell script equivalents for several test/demo JCLs. Then we present the Operating Instructions to Convert, Execute,& Check the results.

We will illustrate the conversion (before & after) of the following JCLs:

JAR100
  • Accounts Receivable master Name & Address listing
  • simple 1 step JCL executing 1 COBOL program (CAR100)
  • no PROCs, no GDG files, no instream data
JAR200
  • sort A/R sales details (by product code) & list
  • 2 step JCL (SORT + COBOL CAR200)
  • uses instream data for SORT FIELDS
JGL100
  • General Ledger Account Master listing
  • 1 step JCL executing 1 COBOL program (CGL100)
  • demonstrates PROCS & GDG files
JGL200
  • sort GL transactions & update the account master
  • 2 step JCL (SORT + COBOL CGL200)
  • demonstrates control card member for SORT FIELDS
JGL300
  • copies GL.ACCOUNT.MASTER to a work file & back
  • demos conversion of IEBGENER & IDCAMS to 'uvcp' & 'cp'
  • also demonstrates CONDition codes
JGL320
  • same as jgl300, but also demos IF, THEN, ENDIF

JAR100 & JAR200 are as simple as possible - no PROCs, no &SYMBOLS, no Generation (GDG) files, no instream data,& no control card members.

JGL100 & JGL200 are more typical of MVS JCL - including PROCs, &SYMBOLS, Generation (GDG) files, instream data,& control card members.

Our test/demo mainframe JCLs, PROCs, COBOL programs,& control card members are supplied in the 'mvstest' sub-directories illustrated on page '1A1'.

By convention, we have given these UPPER case names to reinforce their mainframe origins. The cleanup, PROC expansion,& conversion procedures will convert the UPPER case names to lower case names & append a .extension ('.jcl' for JCL, '.prc' for PROCs, '.ksh' for converted scripts,& '.cbl' for COBOL programs).

Note
  • proc extension '.proc' changed to '.prc' in May 2012.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1B2. Sample Conversions of MVS JCL to Korn shell scripts

test/demo DATA files

The test/demo JCLs reference the following data files:

  1. AR.CUSTOMER.MASTER
  2. AR.SALES.ITEMS
  3. GL.ACCOUNT.MASTER
  4. GL.ACCOUNT.TRANS

The JCL conversion will assume the 1st node (High Level Qualifier or HLQ) is to be a sub-directory containing data files (named from the remaining nodes). Filenames with only 1 node will be assigned to $DW or 'wrk'. See TOPDIRDEFAULT in the conversion control file listed later on page '3E1'.

We have supplied the test data files in /home/uvadm/mvstest/testdata. Later on page '1P1', you will be instructed to setup userid 'mvstest' & copy the testdata files to the following structure.

 /home/mvstest/
 :-----testdata/
 :     :-----data1
 :     :     :--ar.customer.master
 :     :     :--ar.sales.items
 :     :     :--gl.account.master
 :     :     :--gl.account.trans
 :     :     :--py.payroll.master
 :     :     :--py.time.cards

Our test/demo data files have already been converted from EBCDIC to ASCII, preserving packed fields & correcting zoned signed fields to MicroFocus COBOL standards. You can see the details of the data conversions in DATAcnv1.htm & MVSDATA.htm.

By our conventions, all converted filenames are in lower case. This eliminates a lot of confusion on Unix/Linux systems where filenames are case sensetive.

We will later (after converting JCL & compiling COBOL programs) be using these test data files to execute our converted JCLs & COBOL programs.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C1. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

Note that we will present the detailed operating instructions later on starting on page '1Q1'. First we will illustrate some sample JCL/script before/after to ensure you understand the desired conversions.

First we will present the simplest possible JCL conversion (no PROC's, no GDG files, no control card members).

The 1st procedure is to remove any obsolete sequence numbers from the right side of JCLs & PROCs, change filenames to lower case,& append extension to identify the files (.jcl).

jcl0/JAR100 - original Mainframe JCL

 //JAR100   JOB  'TEST MVS2UNIX CONVERSION',DATE=20080323                00000010
 //* CUSTOMER NAME & ADDRESS LIST (WITH DATE & RPT HDNGS)                00000020
 //STEP010  EXEC PGM=CAR100,PARM=2008                                    00000030
 //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER,DISP=SHR                           00000040
 //NALIST   DD DSN=AR.CUSTOMER.NAMEADRS.LIST100,DISP=(,CATLG,DELETE),    00000050
 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),                       00000060
 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)         00000070
 //SYSOUT   DD SYSOUT=*                                                  00000080

jcl1/jar100.jcl - after cleanup

 j#001 //JAR100   JOB  'TEST MVS2UNIX CONVERSION',DATE=20080323
 j#002 //* CUSTOMER NAME & ADDRESS LIST (WITH DATE & RPT HDNGS)
 j#003 //STEP010  EXEC PGM=CAR100,PARM=2008
 j#004 //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER,DISP=SHR
 j#005 //NALIST   DD DSN=AR.CUSTOMER.NAMEADRS.LIST100,DISP=(,CATLG,DELETE),
 j#006 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),
 j#007 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)
 j#008 //SYSOUT   DD SYSOUT=*

The 'cleanup' job removes any sequence#s from the right side. We have re-inserted a sequence# on the left side only to facilitate references. We will prefix JCL sequence#s with 'j#' and the Korn shell script sequence#s with 'k#'.

Any 'PROC's are expanded & any 'INCLUDE's are included by the 'jclproc51' utility as it copies from subdir 'jcl1' to subdir 'jcl2'. Our first sample JCL has no 'PROC's or 'INCLUDE's so it will be copied unchanged.

The next step is the actual JCL conversion to Korn shell script. Please see the results listed on the next page --->

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C2. jcl3/jar100.ksh - JCL after conversion

 k#001 #!/bin/ksh
 k#002 ##JAR100   JOB  'TEST MVS2UNIX CONVERSION',DATE=20080323
 k#003 export jobid2=jar100 JOBID2=JAR100; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$jobid1" ]]; then export jobid1=$jobid2; fi
 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#006 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
 k#008 autoload exportfile exportgen0 exportgen1 exportgen2 exportgenall exportgenx
 k#009 . $APPSADM/env/stub.ini  #<-- for control-M (see notes in env/stub.ini)
 k#010 jobset51    # call function for JCL/script initialization
 k#011 goto
 k#012 S0000=A
 k#013 # * CUSTOMER NAME & ADDRESS LIST (WITH DATE & RPT HDNGS)
 k#014 #1======================= begin step#S0010 CAR100 ========================
 k#015 S0010=A
 k#016 stepctl51;
 k#017 goto
 k#018 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#019 logmsg2 "******** Begin Step $JSTEP car100 (#$XSTEP) ********"
 k#020 ##STEP010  EXEC PGM=CAR100,PARM=2008
 k#021 export PROGID=car100
 k#022 export PARM="2008"
 k#023 exportfile  CUSTMAS data1/ar.customer.master
 k#024 exportfile  NALIST data1/ar.customer.nameadrs.list100
 k#025 exportfile SYSOUT $SYOT/${jobid2}_${JSTEP}_SYSOUT_$(date +%y%m%d_%H%M%S)
 k#026 logmsg2 "Executing--> cobrun $ANIM $CBLX/car100"
 k#027 #3----------------------------------------------------------------------
 k#028 cobrun $ANIM $CBLX/car100
 k#029 #4----------------------------------------------------------------------
 k#030 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0010R=1; alias goto="";
 k#031 if ((S0010C != 0))
 k#032    then logmsg2 "ERR: step#$JSTEP car100 abterm $SCC"
 k#033    alias goto="<<S9900=\A"; fi
 k#034 goto
 k#035 #8======================================================================
 k#036 S9000=A
 k#037 jobend51 #move any new GDG files from jobtmp to intended outdirs
 k#038 logmsg2 "JobEnd=Normal, JCC=$JCC, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 k#039 exit 0 #ver:20151023 a2b0c0d1e2f0g1h1i15j0k15l1m4n3o8p0q0r0s2t1u1v0w0x0y1z1
 k#040 #9======================================================================
 k#041 S9900=A
 k#042 jobabend51 #report GDGs NOT moved from jobtmp/GDG to data1
 k#043 logmsg2 "JobEnd=AbTerm, JCC=$JCC,Steps=$XSTEP/$JSTEP" RV ACK
 k#044 exit $JCC
Note
  • I have inserted a line# on the left side to aid following discussions

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C3. MVS JCL conversion to Unix/Linux Korn shell scripts

front end code in output script

The following block of front end code is inserted at the beginning of each Korn shell script (output from the JCL converter). This is the same for all jobs, except for the JOB name & description which is extracted from the // JOB card & inserted on lines 3 & 4 below.

 k#001 #!/bin/ksh
 k#002 ##JAR100   JOB  'TEST MVS2UNIX CONVERSION',DATE=20080323
 k#003 export jobid2=jar100 JOBID2=JAR100; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$jobid1" ]]; then export jobid1=$jobid2; fi
 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#006 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
 k#008 autoload exportfile exportgen0 exportgen1 exportgen2 exportgenall exportgenx
 k#009 . $APPSADM/env/stub.ini  #<-- for control-M (see notes in env/stub.ini)
       ========
 k#010 jobset51    # call function for JCL/script initialization
       ========
 k#011 goto
 k#012 S0000=A
 k#013 # * CUSTOMER NAME & ADDRESS LIST (WITH DATE & RPT HDNGS)
 k#014 #1======================= begin step#S0010 CAR100 ========================
 k#015 S0010=A
 k#016 stepctl51;
 k#017 goto
Note
  • 'jobset51' is a vital function that sets up the job environment
  • see much more discussion on the following few pages

JOBID1 & JOBID2

 k#003 export jobid2=jar100 JOBID2=JAR100; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$jobid1" ]]; then export jobid1=$jobid2; fi

$jobid2 & $JOBID2 always holds the name of the current job, which may have been called by a 'parent' job, whose name is probably held in $jobid1 & $JOBID1 which hold the name of the 1st job in a series of called jobs.

scriptpath & args

'$scriptpath' & '$args' will be displayed by the 'jobset51' function which is listed on page '1C5'.

"$0" & "$*" had to be saved as labelled variables, since a called function would receive numbered $arguments from the function call not the script call.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C4. MVS JCL conversion to Unix/Linux Korn shell scripts

JCL/script arguments

JCL/scripts may have 2 types of arguments, for example:


 #1. jobname.ksh start=S0020     <-- keyword argument (to restart at step2)
     =======================

 #2. jobname.ksh 123456789      <-- positional argument (arg1 might be SSN#)
     =====================

Keyword arguments must be 'export'ed to capture their values in the script but 'export'ing positional arguments (without '=' signs) would cause errors. This problem is solved by line#5 which examines each argument (for arg in $*) and exports only if it contains an '=' sign.


 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 =============================================================================

jobset51 function - explained

 You should understand the vital importance of the 'jobset51' function
 called on line 10 of all converted JCL/scripts. This is a powerful concept
 - having 1 common function called at the begining of all jobs.

You might use this to your advantage during your conversion. For example VSE sites could use 'partition standard labels' to define commonly used files for all jobs & omit these definitions from the JCL.

You could add 'export's for these commonly used files, at the end of the jobset51 function, to achieve the same effect as 'partition standard labels'.

jobset51 'extract' listing

I have extracted the more important lines of jobset51 onto the next 2 pages. I have sequence numbered the lines for reference in the following discussion. I have added an '*' on the right side of important lines discussed on the pages following the listing.

You can see the full listing of jobset51 on page '5K1'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C5. MVS JCL conversion to Unix/Linux Korn shell scripts

'jobset51' function - code extract from '5K1'

 js#001 # jobset51 - setup environment for UNIX scripts converted from MVS JCL
 js#002 #          - this KORN shell function stored in $APPSADM/sfun
 js#003 #          - called at the begining of each JCL/script
 js#004 #          - inserted by JCL converter from ctl/jclunixop51
 js#005 #          - uses $RUNLIBS & $RUNDATA (exported in prgmr/oprtr profiles)
 js#006 #            to define Libraries & Data dirs for 'test' or 'prod'uction
 js#007 #          - see more doc at: www.uvsoftware.ca/mvsjcl.htm
 js#008 # jobset51 - use for most Vancouver Utility installations
 js#009 # jobset53 - alternative for AIX/IMMD directory structure
 js#010 #
 js#011 #        - - - sample RUNLIBS/RUNDATA for programer testing - - -
 js#012 # export RUNLIBS=/home/mvstest/testlibs #<-- test/demo Libraries
 js#013 # export RUNDATA=/home/mvstest/testdata #<-- test/demo Data superdir
 js#014 #        - - - sample RUNLIBS/RUNDATA for production operators - - -
 js#015 # export RUNLIBS=/p2/apps/prodlibs           #<-- production libraries
 js#016 # export RUNDATA=/p2/apps/proddata           #<-- production Data superdir
 js#017 #
 js#018 # - JCL/scripts are found via $RUNLIBS/jcls in the profile PATH
 js#019 # - COBOL program subdir defined here in jobset51 as '$RUNLIBS/cblx'
 js#020 #   (this allows programs to have same names as JCL/scripts)
 js#021 #
 js#022 function jobset51
 js#023 {
 js#024 cd $RUNDATA              #change to working dir for production (or test)
 js#025 cdstatus=$?              # capture status of cd $RUNDATA
 js#026 #Oct20/14 - ensure reqquired subdirs present in $RUNDATA
 js#027 test -d jobctl   || mkdir jobctl
 js#028 test -d joblog   || mkdir joblog
 js#029 test -d jobmsgs  || mkdir jobmsgs
 js#030 test -d jobtimes || mkdir jobtimes
 js#031 if ((cdstatus))          # ERR if cdstatus not zero (OK)
 js#032    then logmsg2 "jobset51 ERR: cd \$RUNDATA ($RUNDATA) failed"
 js#033         logmsg2 "- investigate, RUNDATA definition in profiles"
 js#034         logmsg1 "- enter to exit"; read reply; exit 91; fi
 js#035 #
 js#036 # cd $RUNDATA means all files are referenced relative to $RUNDATA
 js#037 # - allows switching between production & test files by changing $RUNDATA
 js#038 # - COBOL programs are found via $CBLX/progname in JCL/scripts
 js#039 # - RPG   programs are found via $RPX/progname in JCL/scripts
 js#040 export CBLX=$RUNLIBS/cblx    # path for loading COBOL programs
 js#041 export RPX=$RUNLIBS/rpgx     # path for loading RPG programs
 js#042 #
 js#043 if [ -z "$ANIM" ]; then ANIM=-F; fi
 js#044 # 'ANIM=-F' inhibits non-numeric field checks (could change to +F ?)
 js#045 # - cobol programs are called via ---> cobrun $ANIM $CBLX/progname <---
 js#046 #
 js#047 # make subdirs for work files, instream data files,& GDG subdirs
 js#048 # define jobtmp/GDG for new GDG files
 js#049 umask 002  # ensure perms to create dirs/files 775/664 (group share)
 js#050 export JTMP=jobtmp/$jobid2
 js#051 export JGDG=$JTMP/GDG
 js#052 export GTMP=$JTMP/gtmp
 js#053 test -d $JTMP || mkdir $JTMP
 js#054 test -d $JGDG || mkdir $JGDG
 js#055 test -d $GTMP || mkdir $GTMP
 js#056 test -d $JTMP/tmp || mkdir $JTMP/tmp
 js#057 # $JTMP/...     - for work files & instream data files
 js#058 # $GTMP/...     - for exportgen0,1,etc 'ls' output files
 js#059 #                 GDG matching filenames readback to determine latest gen#
 js#060 # $JGDG/...     - store new GDGs for move back at Normal EOJ
 js#061 # $JTMP/tmp/... - for ADRDSSU DUMP INCLUDE/EXCLUDE, each ssuch step will:
 js#062 #               - clear $JTMP/tmp/*, copy to, remove from,
 js#063 #                 then move remaining files to output directory tape1/...
 js#064 #
 js#065 #Note - if multiple copies of same job could be run at same time:
 js#066 #       to avoid problems naming temp dirs using jobnames
 js#067 # solution#1
 js#068 #  - use the 'joblog2' script to run these jobs
 js#069 #  - joblog2 ensures any currently running same name job completes
 js#070 #    before scheduling the next same name job
 js#071 #  - this solution does not require any change here in jobset51
 js#072 # solution#2
 js#073 # - $JTMP subdir could be date/time stamped (or append process ID)
 js#074 #   export JTMP=jobtmp/${jobid2}$(date +%y%m%d%H%M%S) #<-- date/time stamp
 js#075 #   export JTMP=jobtmp/${jobid2}$$                    #<-- process ID
 js#076 # - If you do this, then 'rm -rf $RUNDATA/jobtmp/*' nightly by cron
 js#077 # - see crontab_appsadm1 & script cleantmps at ADMjobs.htm#5B1
 js#078 #
 js#079 #----------- SYOT/sysout definition ---------------
 js#080 export SYOT=sysout/$JOBID2
 js#081 # jclunix51 changed to generate SYSOUT files as follows:
 js#082 # exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_SYSOUT_$(date +%y%m%d_%H%M%S) J20
 js#083 # - should setup cron to remove sysout/... files older than 30 days ??
 js#084 # make subdir for SYSOUT files (or any file w/o DSN=...)
 js#085 if [[ ! -d $SYOT ]]; then mkdir $SYOT; fi
 js#086 #
 js#087 # $JTMP & $SYOT are vital - ensure created successfully else exit
 js#088 if [[ -d $JTMP && -d $SYOT ]]; then :
 js#089    else logmsg2 "jobset51 ERR: $JTMP &/or $SYOT failed creation"
 js#090         logmsg2 "- investigate: permissions,JTMP,SYOT dirnames changed?"
 js#091         logmsg1 "- enter to exit"; read reply; exit 92; fi
 js#092 #Note - in code above we create $JTMP & $SYOT if not already existing
 js#093 #     - will clean out any prior run $JTMP files (but not $SYOT files)
 js#094 # - BUT not on a 'RESTART', see following line of code below (near end)
 js#095 # ---> else rm -rf $JTMP/*; fi  <--- see below
 js#096 #
 js#097 # ensure nullfile present & empty, for use on DD DUMMY
 js#098 # - use /dev/null, but some unix variants had problems with that
 js#099 >tmp/nullfile    # ensure present & empty
 js#100 export NULLFILE=tmp/nullfile
 js#101 #Nov15/13 - setup JTMP1 file for miscellaneous uses
 js#102 #         - ICETOOL uses tmp1 as output file for COUNT function
 js#103 export JTMP1=$JTMP/tmp1
 js#104 #
 js#105 # Test for any files in $JGDG/subdirs at begin job
 js#106 # (prior run abend not moving GDG/subdir/files back to $RUNDATA/subdirs)
 js#107 # - will prompt operator to move back or not (rerun from begining)
 js#108 lsgdgs=$(ls $JGDG/* 2>/dev/null);  # capture filenames in GDG/subdirs
 js#109 if [[ -n "$lsgdgs" ]]; then
 js#110    logmsg2 "jobset51 WARN: files in jobtmp/GDG subdirs (prior AbTerm ERR?)"
 js#111    logmsg2 "---- files in $JGDG/*/* listed below:"
 js#112    echo    "$lsgdgs"
 js#113    logmsg2 "If NO restart by step#, GDG files in jobtmp/... will be cleared"
 js#114    logmsg2 "   - allows rerun from begin job with no worry about GDGs"
 js#115    logmsg2 "If RESTARTing by step#, example--> jobname.ksh start=S0050"
 js#116    logmsg2 "   - GDG files in jobtmp/... will NOT be cleared"
 js#117    logmsg2 "   - will be available to steps after restart step#"
 js#118    logmsg2 "   - will be restored to data1/... subdir at JobEnd=Normal"
 js#119    logmsg2 "enter/continue - will clear jobtmp/... if no restart"
 js#120    logmsg2 "enter/continue - will not clear jobtmp/... if start=..."
 js#121    read reply
 js#122 fi
 js#123 # initialize step counters
 js#124 export JSTEP=S0000 XSTEP=0
 js#125 integer JCC=0 SCC=0 LCC=0;
 js#126 #
 js#127 # Allow for RESTART at any step by start=... argument on command line:
 js#128 # --> jobname.ksh start=S0020   <-- restart at step 2
 js#129 #Oct20/14 - allow both start=... & restart=...
 js#130 test -n "$restart" && start="$restart"
 js#131 test -z "$start"   && export start=S0000
 js#132 if [[ $start != S[0-9][0-9][0-9][0-9] ]]; then
 js#133    logmsg2 "jobset51 ERR: start=$start invalid"; exit 94; fi
 js#134 alias goto="<<${start}=\A"
 js#135 #
 js#136 if [[ $start != S0000 ]]; then
 js#137    logmsg2 "WARN: **START** at start=$start";
 js#138 else
 js#139    # ensure $JGDG/subdirs exist to hold exportgen1 files until Normal EOJ
 js#140    # Normal EOJ will move $JGDG/subdir/files back to $RUNDATA/GDG/subdirs
 js#141    #Note - create user set of subdirs in 2 places, above for file test
 js#142    #     - and here after 'rm -fr $JTMP/*' for non-restart
 js#143    rm -fr $JTMP/*;
 js#144    test -d $JGDG || mkdir $JGDG
 js#145    test -d $GTMP || mkdir $GTMP
 js#146    test -d $JTMP/tmp || mkdir $JTMP/tmp
 js#147 fi
 js#148 #------------------------------------------------------------------------
 js#149 #Feb06/12 - add 'stop step' feature
 js#150 if [[ -n "$stop" ]]; then
 js#151    if [[ $stop != S[0-9][0-9][0-9][0-9] ]]; then
 js#152       logmsg2 "jobset51 ERR: stop=$stop invalid"; exit 95; fi
 js#153    exec 4>jobctl/$jobid2.ctl
 js#154    print -u4 "$jobid2.ksh start=$start stop=$stop $(date +%y%m%d_%H%M%S)"
 js#155    exec 4>&-;
 js#156    logmsg2 "WARN: **STOP** at: stop=$stop";
 js#157 fi
 js#158 #
 js#159 # Default RUNDATE to system date yyyymmdd, but allow cmd line override
 js#160 # --> jobname.ksh RUNDATE=20091120  <-- override system date for this job
 js#161 if [[ -z "$RUNDATE" ]]; then RUNDATE=$(date +%Y%m%d); fi; export RUNDATE
 js#162 export RUNDTTM=$(date +%y%m%d_%H%M%S)
 js#163 export YMD=$(date +%y%m%d)
 js#164 #------------------------------------------------------------------------
 js#165 # Display various information at begining of JCL/script execution
 js#166 # - for the console log, info may be useful to debug problems
 js#167 logmsg2 "Begin Job=$jobid2"
 js#168 logmsg1 "$scriptpath"
 js#169 logmsg1 "Arguments: $args"
 js#170 logmsg1 "ProcessID=$$"
 js#171 logmsg1 "RUNDATE=$RUNDATE"
 js#172 logmsg1 "RUNLIBS=$RUNLIBS"
 js#173 logmsg1 "RUNDATA=$RUNDATA"
 js#174 logmsg1 "JTMP=$JTMP"
 js#175 logmsg1 "SYOT=$SYOT"
 js#176 logmsg1 "LOGNAME=$LOGNAME TESTPROD=$TESTPROD"
 js#177 logmsg1 "HOSTNAME=$HOSTNAME"
 js#178 ## logmsg1 "OBSLOGDIR=$OBSLOGDIR"
 js#179 uvtime W1D0 jobbgn    # get start time for later elapsed time calc
 js#180 #Jan26/12 - arg2 filename disabled, no dummy
 js#181 return 0
 js#182 }
 js#183 #----------------------------- end jobset51 -----------------------------

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C6. MVS JCL conversion to Unix/Linux Korn shell scripts

jobset51 function - explained

 js#024 cd $RUNDATA              #change to working dir for production (or test)

js#040 export CBLX=$RUNLIBS/cblx # path for loading COBOL programs


   cobrun $ANIM $CBLX/progname
   ==========================

js#043 if [ -z "$ANIM" ]; then ANIM=-F; fi


   cobrun $ANIM $CBLX/progname   <-- scripts execute COBOL programs like this
   ==========================
   export ANIM="+A-F" <-- define switch "+A" to debug/animate
   ==================
 - $ANIM defaults to "-F" 'inhibit non-numeric field check'

js#050 export JTMP=jobtmp/$jobid2 js#051 export JGDG=$JTMP/GDG js#052 export GTMP=$JTMP/gtmp js#053 test -d $JTMP || mkdir $JTMP js#054 test -d $JGDG || mkdir $JGDG js#055 test -d $GTMP || mkdir $GTMP js#056 test -d $JTMP/tmp || mkdir $JTMP/tmp

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C7. MVS JCL conversion to Unix/Linux Korn shell scripts

jobset51 function explained (continued)

js#080 export SYOT=sysout/$JOBID2 js#085 if [[ ! -d $SYOT ]]; then mkdir $SYOT; fi

js#099 >tmp/nullfile # ensure present & empty

 js#130 test -n "$restart" && start="$restart"
 js#131 test -z "$start"   && export start=S0000
 js#132 if [[ $start != S[0-9][0-9][0-9][0-9] ]]; then
 js#133    logmsg2 "jobset51 ERR: start=$start invalid"; exit 94; fi
 js#134 alias goto="<<${start}=\A"

   payroll1.ksh start=S0030       <-- restart at step 3
   ========================
 js#161 if [[ -z "$RUNDATE" ]]; then RUNDATE=$(date +%Y%m%d); fi; export RUNDATE

   jobname.ksh RUNDATE=20060718
   ============================

js#167 logmsg2 "Begin Job=$jobid2" js#168 logmsg1 "$scriptpath" js#169 logmsg1 "Arguments: $args" js#170 logmsg1 "ProcessID=$$" js#171 logmsg1 "RUNDATE=$RUNDATE" js#172 logmsg1 "RUNLIBS=$RUNLIBS" js#173 logmsg1 "RUNDATA=$RUNDATA" js#174 logmsg1 "JTMP=$JTMP" js#175 logmsg1 "SYOT=$SYOT" js#176 logmsg1 "LOGNAME=$LOGNAME TESTPROD=$TESTPROD" js#177 logmsg1 "HOSTNAME=$HOSTNAME"

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C8. MVS JCL conversion to Unix/Linux Korn shell scripts

jobset51 & prompts for dates, etc

The PROC expansion resolves as many &symbols (which become $symbols in scripts) as possible because many sites had coded a lot of symbols that were in fact never used & the defaults were always used.

Another reason we resolved $symbols with defaults is that a common use for &symbols was to determine whether we were using 'test' files or 'prod' files.

The converted systems do not need those because test & production is determined by environment variables (RUNLIBS & RUNDATA) which are set in the profiles of programmers & operators and tested in 'jobset51' as explained on page '1C6'.

But of course you may need to add back some &variables (now $variables) for the (hopefully few) items that really do need to be modified at run time. Here is some sample coding that you might use:

example#1 - prompt for date if not entered on cmd line


 jobname.ksh date=20060718    <-- operator can specify date on command line
 =========================
 # if date not entered on command line - prompt for it now
 if [[ -z "$date" ]]                  # if $date Zero length
    then echo "enter date yyyymmdd"
         read date
 fi

example#2 - better way to prompt & verify a variable

 # if date not entered on command line - prompt until valid date entered
 until [[ -n "$date" ]]              # until $date Non-zero length
 do echo "enter date yyyymmdd"
    read date
 done

example#3 - even better way to prompt & verify a variable

 # if date not entered on command line - prompt until valid date entered
 while ((1))                          # while ((forever))
 do if [[ (${#date} -eq 8) && ($date == 20*) ]]; then break; fi
    echo "enter date yyyymmdd"
    read date
 done

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C9. MVS JCL conversion to Unix/Linux Korn shell scripts

sample conversion of 1 step COBOL JCL

Here is the input/output for just the COBOL EXEC step, extracted from the JCL & Korn shell script listed previously. This typical step is the basis for much discussion on the following pages.

sample COBOL step - in JCL

 j#03 //STEP010  EXEC PGM=CAR100,PARM=2003
 j#04 //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER,DISP=SHR
 j#05 //NALIST   DD DSN=AR.CUSTOMER.NAMEADRS.LIST100,DISP=(,CATLG,DELETE),
 j#06 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),
 j#07 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)
 j#08 //SYSOUT   DD SYSOUT=*

sample COBOL step - converted to ksh

 k#014 #1======================= begin step#S0010 CAR100 ========================
 k#015 S0010=A
 k#016 stepctl51;
 k#017 goto
 k#018 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#019 logmsg2 "******** Begin Step $JSTEP car100 (#$XSTEP) ********"
 k#020 ##STEP010  EXEC PGM=CAR100,PARM=2008
 k#021 export PROGID=car100
 k#022 export PARM="2008"
 k#023 exportfile  CUSTMAS data1/ar.customer.master
 k#024 exportfile  NALIST data1/ar.customer.nameadrs.list100
 k#025 exportfile SYSOUT $SYOT/${jobid2}_${JSTEP}_SYSOUT_$(date +%y%m%d_%H%M%S)
 k#026 logmsg2 "Executing--> cobrun $ANIM $CBLX/car100"
 k#027 #3----------------------------------------------------------------------
 k#028 cobrun $ANIM $CBLX/car100
 k#029 #4----------------------------------------------------------------------
 k#030 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0010R=1; alias goto="";
 k#031 if ((S0010C != 0))
 k#032    then logmsg2 "ERR: step#$JSTEP car100 abterm $SCC"
 k#033    alias goto="<<S9900=\A"; fi
 k#034 goto
Note
  • see following pages for discussion of:

1C10. JCL file defs 'DD's converted to 'exportfile's

1C11. JCL 'EXEC's converted to 'cobrun's (for Micro Focus COBOL .int or .gnt)

1C12. testing program return code for good/bad status

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C10. MVS JCL conversion to Unix/Linux Korn shell scripts

'DD' converted to 'exportfile'

 j#04 //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER,DISP=SHR
 j#05 //NALIST   DD DSN=AR.CUSTOMER.NAMEADRS.LIST100,DISP=(,CATLG,DELETE),
 j#06 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),
 j#07 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)

k#023 exportfile CUSTMAS data1/ar.customer.master k#024 exportfile NALIST data1/ar.customer.nameadrs.list100

'exportfile' is a function (see listing on page '3C1') that displays the filenames (for the console log), in addition to generating the korn shell 'export'. For the above examples, the 'export's would be:

The 'export's load the environmental variables for the 'Logical File Names' with the values for the 'Physical File Names'. These values are available to the COBOL programs, since the COBOL converter has inserted 'external' into the file 'select' clauses.

Note that the High Level Qualifier ('ar' in this case) becomes a subdir (within $RUNDATA) & the data files will be converted correspondingly. Any DISK SPACE EXTENT info is ignored (not applicable to unix/linux).

Note
  • see discussion of 'SYSOUT' on page '1C14'

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C11. MVS JCL conversion to Unix/Linux Korn shell scripts

COBOL EXECs converted to 'cobrun's

 j#03 //STEP010  EXEC PGM=CAR100,PARM=2003
 k#020 ##STEP010  EXEC PGM=CAR100,PARM=2008
 ..... ............. file exports here ................
 k#026 logmsg2 "Executing--> cobrun $ANIM $CBLX/car100"
 k#027 #3----------------------------------------------------------------------
 k#028 cobrun $ANIM $CBLX/car100
 k#029 #4----------------------------------------------------------------------

COBOL 'EXEC's converted to 'cobrun's for MicroFocus COBOL. 'cobrun' will execute/interpret the '.int' (car100.int in this example). '.int's are much smaller than executables & allows animation (debugging) without having to recompile or modify any JCL/script, for example:

 --> export ANIM=+A         <-- activate the Animation option
 --> jar100.ksh             <-- run the job (will animate COBOL programs)
 --> export ANIM=""         <-- deactivate Animation

The '.int's usually do not run significantly slower than executables. But if you had some programs doing a lot of memory table indexing, you can compile it to a .gnt (native code) or an executable

'.gnt's are faster & still quire small, but you have to recompile to .int when you need to animate.

Fully compiled executable COBOL programs are fastest, but huge (1 MB each) You would have to remove the 'cobrun $ANIM' from the script. When you need to animate you would have to restore the cobrun $ANIM & recompile to .int.

I recommend leaving all programs as '.int's. The convenience of being able to animate simply by exporting a value (& not having to change anything or recompile) far outweighs the usually insignificant difference in speed.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C12. MVS JCL conversion to Unix/Linux Korn shell scripts

testing program Return Condition

After each EXEC, code is inserted to test the program return status. The mainframe did this automatically, but unix/linux scripts must test success/fail after each program execution.

 j#03 //STEP010  EXEC PGM=CAR100,PARM='MARCH 10, 2005'
 k#027 #3----------------------------------------------------------------------
 k#028 cobrun $ANIM $CBLX/car100
 k#029 #4----------------------------------------------------------------------
 k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 k#031 if ((S0010C != 0))
 k#032    then logmsg2 "ERR: step#$JSTEP car100 abterm $SCC"
 k#033    alias goto="<<S9900=A"; fi
 k#034 goto

The Korn shell stores the program status in '$?'. Our converted script saves the status from this temporary variable to a dedicated variable constructed from the current step# (S0010C in example above).

If the status is non-zero, we display the 'abterm' message and we 'goto' the Abnormal termination (tag 'S9900=A') at the end of the program.

This code is a little complex since ksh does not have a real 'goto'. We are using redirected input to 'eat up' the script itself until we reach the stop pattern ('S9900=A' in the example above).

We assigned the redirected input statement to an alias 'goto' in case we needed a $variable in the stop pattern. The goto alias is initialized to null on line k#030 (goto=""), so that if the return code is 0, then the goto on line k#034 will do nothing.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C13. MVS JCL conversion to Unix/Linux Korn shell scripts

EOJ Terminated Normally/Abnormally

 k#035 #8======================================================================
 k#036 S9000=A
 k#037 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs
 k#038 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 k#039 exit 0 #jclunix51 ver:20111015 a1b0c0d3e2f3g1i1j0k3l20m4n3o0p0r0s0t1u1w0x0y1z0
 k#040 #9======================================================================
 k#041 S9900=A
 k#042 logmsg2 "JobEnd=AbTerm, JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
 k#043 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
 k#044 exit $JCC

If all step return codes were zero (normal), then we would reach 'Terminated Normally' & exit 0.

If any step return code was non-zero, then we would 'goto' the 'S9900=A' label (line k#041 above), display 'Terminated Abnormally',& exit 99.

If the JCL had any COND=EVEN steps, you would move them to this point.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1C14. MVS JCL conversion to Unix/Linux Korn shell scripts

'SYSOUT' assumed a printer file

COBOL programs can 'DISPLAY UPON SYSOUT' or they can 'WRITE' to a file. If they WRITE reports, the converter will treat the printer files the same as any other data file. The files would be assigned to a directory derived from the top level node in the MVS JCL data file name.

COBOL programs that 'DISPLAY UPON SYSOUT' did not need to declare a printer file, and the MVS JCL did not need to include a DSN for the printer file.

We assume that Micro Focus COBOL was used with option '-C OUTDD(SYSOUT)'. See the ctl/cobdirectives options file listed at MVSCOBOL.htm#5D1.

This option is similar to converting 'DISPLAY UPON SYSOUT' to 'WRITE's to a file which is inserted into the COBOL program (using select name 'SYSOUT').

We give special treatment to any file in the JCL without a DSN assigned. We code the directory as '$SYOT', which is assigned to the 'sysout' directory with a subdir coded as the jobname ($JOBID). Expansion examples follow:

SYSOUT filename expansions

j#08 //SYSOUT DD SYSOUT=*

k#025 exportfile SYSOUT $SYOT/${JSTEP}_SYSOUT

 k#025 exportfile SYSOUT sysout/JAR100/S0010_SYSOUT              <-- for testing
 k#025 exportfile SYSOUT sysout/JAR100_yymmddHHMMSS/S0010_SYSOUT <-- production

'SYOT' is assigned in the 'jobset51' function inserted at the begining of each script (see listing on page '5K1'). For testing I recommend 'sysout/$JOBID', but for production you might change to 'sysout/${JOBID}_$(date +%y%m%d%H%M%S)' to allow the job to be rerun without overwriting previous SYSOUTs.

Printing Options

Printer files might be sent to a spooling package to allow page restarts, etc. EasySpooler is a popular Unix/Linux spooling package.

For laser printers, you could use one of the 'uvlp' scripts provided by UV Software. For example, 'uvlpLD1' will print a mainframe style report (originally on 15x11 paper) Landscape & Duplex, reducing the cpi & lpi to fit on standard 8 1/2 by 11 (leaving margins for 3 hole punched paper).

The JCL conversion might be enhanced to send the printer files to the spooling package or a uvlp script at the Terminated Normally end of script.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1D1. Sample Conversions MVS JCL to Korn shell scripts

Here is a typical 2 step JCL (SORT + COBOL report).

ex#2 jcl0/JAR200 - original JCL

 j#001 //JAR200   JOB  (1234),'TEST/DEMO MVS JCL CONVERT'
 j#002 //* SORT AR.SALES.ITEMS BY PRODUCT CODE FOR LISTING
 j#003 //STEP010  EXEC PGM=SORT,REGION=2048K
 j#004 //SORTIN   DD DSN=AR.SALES.ITEMS,DISP=SHR
 j#005 //SORTOUT  DD DSN=&&TEMPSLS,DISP=(NEW,PASS),
 j#006 //            DCB=(LRECL=64,BLKSIZE=6400,RECFM=FB),
 j#007 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK
 j#008 //SYSIN    DD *
 j#009 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 j#010 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
 j#011 /*
 j#012 //* LIST AR.SALES.ITEMS IN PRODUCT CODE SEQUENCE
 j#013 //STEP020  EXEC PGM=CAR200,COND=(4,LT,STEP010),PARM=2006
 j#014 //SALEDTL  DD DSN=&&TEMPSLS,DISP=(OLD,PASS)
 j#015 //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER.INDEXED,DISP=SHR
 j#016 //SALELST  DD DSN=AR.SALES.LIST,DISP=(,CATLG,DELETE),
 j#017 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),
 j#018 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)

Please see the converted equivalent Korn shell script on the next page ---->

We have omitted the front end 12 lines & the back end 11 lines, since they are the same for all conversions & have already been illustrated for example #1 on page '1C2'.

Please see comments about the conversion of SORT to uvsort 2 pages ahead --->

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1D2. Sample Conversions MVS JCL to Korn shell scripts

ex#2 jcl3/jar200.ksh - converted equivalent


 k#013 # * SORT AR.SALES.ITEMS BY PRODUCT CODE FOR LISTING
 k#014 #1======================= begin step#S0010 SORT ========================
 k#015 S0010=A
 k#016 stepctl51;
 k#017 goto
 k#018 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#019 logmsg2 "******** Begin Step $JSTEP sort (#$XSTEP) ********"
 k#020 ##STEP010  EXEC PGM=SORT,REGION=2048K
 k#021 export PROGID=sort
 k#022 export PARM=""
 k#023 exportfile  SORTIN data1/ar.sales.items
 k#024 exportfile  SORTOUT $JTMP/t_tempsls
 k#025 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
 k#026 cat > $SYSIN <</*
 k#027 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 k#028 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
 k#029 /*
 k#030 logmsg2 "Executing--> uvsort \"fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTO..."
 k#031 #3----------------------------------------------------------------------
 k#032 uvsort "fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\
 k#033 ,keys=(30,6,e,a,0,6,e,a),del1=10(2c):65,del1=10(2c):85"
 k#034 #4----------------------------------------------------------------------
 k#035 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90));
 k#036 ((JCC|=LCC)); S0010R=1; alias goto="";
 k#037 if ((S0010C != 0)) #need to modify for COND step S0020
 k#038    then logmsg2 "ERR: step#$JSTEP sort abterm $SCC"
 k#039    alias goto="<<S9900=\A"; fi
 k#040 goto
 k#041 #/=* LIST AR.SALES.ITEMS IN PRODUCT CODE SEQUENCE
 k#042 #1======================= begin step#S0020 CAR200 ========================
 k#043 if ((S0010C >  4)); then   # COND=(4,LT,STEP010)
 k#044     alias goto="<<S9000=\A"; fi
 k#045 goto
 k#046 S0020=A
 k#047 stepctl51;
 k#048 goto
 k#049 export JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#050 logmsg2 "******** Begin Step $JSTEP car200 (#$XSTEP) ********"
 k#051 ##STEP020  EXEC PGM=CAR200,COND=(4,LT,STEP010),PARM=2006
 k#052 export PROGID=car200
 k#053 export PARM="2006"
 k#054 exportfile  SALEDTL $JTMP/t_tempsls
 k#055 exportfile  CUSTMAS data1/ar.customer.master.indexed
 k#056 exportfile  SALELST data1/ar.sales.list
 k#057 logmsg2 "Executing--> cobrun $ANIM $CBLX/car200"
 k#058 #3----------------------------------------------------------------------
 k#059 cobrun $ANIM $CBLX/car200
 k#060 #4----------------------------------------------------------------------
 k#061 LCC=$?; S0020C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0020R=1; alias goto="";
 k#062 if ((S0020C != 0))
 k#063    then logmsg2 "ERR: step#$JSTEP car200 abterm $SCC"
 k#064    alias goto="<<S9900=\A"; fi
 k#065 goto

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1D4. MVS JCL Conversion to Korn shell scripts - example #2

SORT conversion to uvsort

 j#003 //STEP010  EXEC PGM=SORT,REGION=2048K
 j#004 //SORTIN   DD DSN=AR.SALES.ITEMS,DISP=SHR
 j#005 //SORTOUT  DD DSN=&&TEMPSLS,DISP=(NEW,PASS),
 j#006 //            DCB=(LRECL=64,BLKSIZE=6400,RECFM=FB),
 j#007 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK
 j#008 //SYSIN    DD *
 j#009 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 j#010 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
 j#011 /*
 k#023 exportfile  SORTIN data1/ar.sales.items
 k#024 exportfile  SORTOUT $JTMP/t_tempsls
 k#025 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
 k#026 cat > $SYSIN <</*
 k#027 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 k#028 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
 k#029 /*
 k#030 logmsg2 "Executing--> uvsort \"fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTO..."
 k#031 #3----------------------------------------------------------------------
 k#032 uvsort "fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\
 k#033 ,keys=(30,6,e,a,0,6,e,a),del1=10(2c):65,del1=10(2c):85"
 k#034 #4----------------------------------------------------------------------

The original SORT control cards are seen in the converted script since all control streams are redirected into a tmp file & brought ahead of the program execution. The tmp file is not required for uvsort since the converter has already inserted the SORT FIELDS & RECORD SIZE into the uvsort command string. But listing the control stream allows you to check the SORT/uvsort conversion without referring back to the input.

The uvsort I/O files are declared by keywords 'fili1=...' & 'filo1=...'. The converter will define these using the $SYMBOLS ($SORTIN & $SORTOUT).

      exportfile SORTIN data1/ar.sales.items
      exportfile SORTOUT $JTMP/__tempsls
      ====================================================================
      uvsort "fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\

Note that the SORT FIELD displacements were one relative for the mainframe, but are zero relative for uvsort.

      SORT FIELDS=(31,6,CH,A,1,6,CH,A)
      OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
      ================================================================
      ,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1E1. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

JCL conversion #3 - demo PROCs & GDG files

This page lists the 2 components of sample JCL 'JGL100'(JCL) & 'PGL100'(PROC). The next page will list the JCL after PROC expansion and the following page will list the Korn shell script conversion result.

jcl0/JGL100 - JCL before PROC expansion

 //JGL100   JOB  (1234),'LIST GL MASTER CHART OF ACCOUNTS'               00000010
 //* MVS JCL CONVERSION DEMO - PROCs & GDG files                         00000020
 //STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003                              00000030

proc0/PGL100 - PROC called by JGL100

 //PGL100   PROC HLQ=GL,YEAREND=2002                                     00000010
 //* LIST G/L CHART OF ACCOUNTS FROM ACCOUNT.MASTER                      00000020
 //STEP010  EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND                   00000030
 //ACCTMAS  DD DSN=&HLQ..ACCOUNT.MASTER(0),DISP=SHR                      00000040
 //ACTLIST  DD DSN=&HLQ..ACCOUNT.ACNTLIST(+1),DISP=(,CATLG,DELETE),      00000050
 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),                       00000060
 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)         00000070
 //SYSOUT   DD SYSOUT=*                                                  00000080

Notes

See the step by step conversion instructions beginning on page '1Q1'.

The 1st procedure is to remove any obsolete sequence numbers from the right side of JCLs & PROCs, change filenames to lower case,& append extensions to identify the files (.jcl or .prc).

The 2nd procedure is the 1 time expansion of PROCs and the 3rd procedure will convert the expanded JCL to Korn shell scripts.

Please relate these conversions to the directories illustrated on page '1A1'

  1. strip seq#s: proc0 --> procs, jcl0 --> jcl1, parm0 --> parms

  2. expand procs: jcl1 + procs --> jcl2

  3. convert JCL: jcl2 + parms --> jcl3

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1E2. Sample Conversion of MVS JCL to Korn Shell Script

jcl2/jgl100.jcl - JCL after PROC expansion

 j#01 //JGL100   JOB  (1234),'LIST GL MASTER CHART OF ACCOUNTS'
 j#02 //* MVS JCL CONVERSION DEMO - PROCs & GDG files
 j#03 //*
 j#04 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003               #<-- PROC1 call
 j#05 //PGL100   PROC HLQ=GL,YEAREND=2002
 j#06 //*
 j#07 //STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003               #<-- PROC1 exp
 j#08 //* LIST G/L CHART OF ACCOUNTS FROM ACCOUNT.MASTER
 j#09 //STEP010  EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND
 j#10 //ACCTMAS  DD DSN=GL.ACCOUNT.MASTER(0),DISP=SHR
 j#11 //ACTLIST  DD DSN=GL.ACCOUNT.ACNTLIST(+1),DISP=(,CATLG,DELETE),
 j#12 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),
 j#13 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)
 j#14 //SYSOUT   DD SYSOUT=*
 j#15 ##PEND1 PGL100

Notes

  1. This is the result of expanding the PROCs while copying from jcl1 to jcl2. See the input listings on the previous page.
    jcl1/jgl100.jcl + procs/pgl100.jcl --> jcl2/jgl100.jcl
  1. Note that any symbol values on the PROC declaration are overridden by symbol values on the PROC call. 'YEAREND=2002' is overridden by 'YEAREND=2003', so the value of '&YEAREND' (on //STEP010) will be '2003'.

  2. The next page will list the result of converting this expanded JCL (jcl2/jgl100.jcl) to a Korn shell script (jcl3/jgl100.ksh).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1E3. Sample Conversion of MVS JCL to Korn Shell Script

jcl3/jgl100.ksh - JCL after conversion to ksh script


 k#013 # * MVS JCL CONVERSION DEMO - PROCs & GDG files
 k#014 #0========================== begin proc PGL100 ============================
 k#015 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003                     #<-PROC1call
 k#016 ##PGL100   PROC HLQ=GL,YEAREND=2002                            #<-PROC1
 k#017 HLQ="GL";YEAREND="2002";
 k#018 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003                      #<-PROC1exp
 k#019 HLQ="GL";YEAREND="2003";
 k#020 #1======================= begin step#S0010 CGL100 ========================
 k#021 S0010=A
 k#022 stepctl51;
 k#023 goto
 k#024 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#025 logmsg2 "******** Begin Step $JSTEP cgl100 (#$XSTEP) ********"
 k#026 ##STEP010  EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND,PN=STEPA
 k#027 export PROGID=cgl100
 k#028 export PARM="2003"
 k#029 exportgen0 0 ACCTMAS data1/gl.account.master_
 k#030 exportgen1 +1 ACTLIST data1/gl.account.acntlist_
 k#031 #exportgen1 GDGs written to jobtmp/$jobid2 restored to outdir at Normal EOJ
 k#032 exportfile SYSOUT $SYOT/${jobid2}_${JSTEP}_SYSOUT_$(date +%y%m%d_%H%M%S)
 k#033 ##PEND1 PGL100
 k#034 logmsg2 "Executing--> cobrun $ANIM $CBLX/cgl100"
 k#035 #3----------------------------------------------------------------------
 k#036 cobrun $ANIM $CBLX/cgl100
 k#037 #4----------------------------------------------------------------------
 k#038 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0010R=1; alias goto="";
 k#039 if ((S0010C != 0))
 k#040    then logmsg2 "ERR: step#$JSTEP cgl100 abterm $SCC"
 k#041    alias goto="<<S9900=\A"; fi
 k#042 goto

We have omitted the front end 11 lines & the back end 10 lines, since they are the same for all conversions & have already been illustrated for example #1 on page '1C2'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1E4. Sample Conversion of MVS JCL to Korn Shell Script

JCL conversion #3 - demo PROCs & GDG files

Here are the data file definitions extracted from the previous JCL & the corresponding converted equivalents from the Korn shell script.

 j#08 //ACCTMAS  DD DSN=GL.ACCOUNT.MASTER(0),DISP=SHR
 j#09 //ACTLIST  DD DSN=GL.ACCOUNT.ACNTLIST(+1),DISP=(,CATLG,DELETE),
 j#10 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),
 j#11 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)
 k#029 exportgen0 0 ACCTMAS data1/gl.account.master_           #<-- current generation
 k#030 exportgen1 +1 ACTLIST $JGDG/data1/gl.account.acntlist_  #<-- next generation

One of the main objectives of this demo #3 was to illustrate the conversion of Generation (GDG) files to Korn shell functions (exportgen0 & exportgen1).

You can see exportgen0 & exportgen1 listed ahead on pages '5J1' & '5J2'. Also see Part_5 for more discussion including features that go well beyond the GDG implementation on the mainframe.

Note that the '(0)' suffix on an MVS DSN indicates the current generation & '(+1)' indicates the next generation.

GDG filename examples

data1/gl.account.master_000001 <-- 1st generation of GDG file after conversion data1/gl.account.master_000002 data1/gl.account.master_000003

The data conversion procedures should append '_000001' to any GDG filenames.

See data conversion procedures in MVSDATA.htm. Page 4E1+ & 4G1 describes making a data conversion control file from the LISTCAT info. Page 4G5 gives the operating instructions to generate 'uvcopy jobs' from the COBOL copybooks to translate character fields from EBCDIC to ASCII while preserving any packed fields & correcting any zoned signs.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1F1. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

This page lists the 3 components of sample JCL 'JGL200' (JCL, PROC,& a library member for the SORT keys). The next page will list the JCL after PROC expansion and the following page will list the Korn shell script conversion result.

ex#4 jcl0/JGL200 - JCL before PROC expansion

 //JGL200   JOB  (1234),'TEST/DEMO MVS JCL CONVERSION'                   00000010
 //* SORT TRANSACTIONS & UPDATE GL ACCOUNT MASTER                        00000020
 //* - demo GDG processing, write gltrans(+1) & read back as (+1)        00000030
 //STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003                              00000040

proc0/PGL200 - PROC called by JGL200

 //PGL200   PROC HLQ=GL,YEAREND=2002                                     00000010
 //* SORT GL TRANSACTIONS BEFORE UPDATING ACCOUNT MASTER                 00000020
 //STEP010  EXEC PGM=SORT,REGION=2048K                                   00000030
 //SORTIN   DD DSN=&HLQ..ACCOUNT.TRAN1,DISP=OLD                          00000040
 //SORTOUT  DD DSN=&HLQ..ACCOUNT.TRANS(+1),DISP=(,CATLG,DELETE),         00000050
 //            DCB=(LRECL=80,BLKSIZE=8000,RECFM=FB),                     00000060
 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK                        00000070
 //SYSIN    DD DSN=&HLQ..PARMS(PGL200S1)                                 00000080
 //* UPDATE ACCOUNT.MASTER WITH TRANSACTION DETAIL                       00000090
 //STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND            00000100
 //GLTRANS  DD DSN=&HLQ..ACCOUNT.TRANS(+1),DISP=OLD                      00000110
 //GLMSOLD  DD DSN=&HLQ..ACCOUNT.MASTER(0),DISP=OLD                      00000120
 //GLMSNEW  DD DSN=&HLQ..ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE),        00000130
 //            UNIT=DISK,SPACE=(TRK,(50,50),RLSE),                       00000140
 //            DCB=(MODEL.DSCB,LRECL=80,BLKSIZE=6118,RECFM=FBA)          00000150

parm0/PGL200S1 - library member called by PGL200

 SORT FIELDS=(1,18,CH,A,69,12,CH,A)

Notes

  1. See the step by step conversion instructions beginning on page '1Q1'.

  2. The 1st procedure is to remove any obsolete sequence numbers from the right side of JCLs & PROCs, change filenames to lower case,& append extensions to identify the files (.jcl or .prc).

  3. The 2nd procedure is the 1 time expansion of PROCs and the 3rd procedure will convert the expanded JCL to Korn shell scripts.

  4. Please relate these conversions to the directories illustrated on page '1A1'
      strip seq#s:  proc0 --> procs, jcl0 --> jcl1, parm0 --> parms
      expand procs: jcl1 + procs + parms --> jcl2
      convert JCL:  jcl2 --> jcl3

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1F2. Sample Conversion of MVS JCL to Korn Shell Script

ex#4 jcl2/jgl200.jcl - JCL after PROC expansion

 j#001 //JGL200   JOB  (1234),'TEST/DEMO MVS JCL CONVERSION'
 j#002 //* SORT TRANSACTIONS & UPDATE GL ACCOUNT MASTER
 j#003 //* - demo GDG processing, write gltrans(+1) & read back as (+1)
 j#004 //*
 j#005 ##STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003                     #<-PROC1call
 j#006 //PGL200   PROC HLQ=GL,YEAREND=2002                            #<-PROC1
 j#007 //*
 j#008 //STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003                      #<-PROC1exp
 j#009 //*
 j#010 //STEP010  EXEC PGM=SORT,REGION=2048K,PN=STEPA
 j#011 //SORTIN   DD DSN=GL.ACCOUNT.TRAN1,DISP=OLD
 j#012 //SORTOUT  DD DSN=GL.ACCOUNT.TRANS(+1),DISP=(,CATLG,DELETE),
 j#013 //            DCB=(LRECL=80,BLKSIZE=8000,RECFM=FB),
 j#014 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK
 j#015 //SYSIN    DD DSN=GL.PARMS(PGL200S1)
 j#016 /=*
 j#017 //*============================ step# 0020 ============================
 j#018 //STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
 j#019 //GLTRANS  DD DSN=GL.ACCOUNT.TRANS(+1),DISP=OLD
 j#020 //GLMSOLD  DD DSN=GL.ACCOUNT.MASTER(0),DISP=OLD
 j#021 //GLMSNEW  DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE),
 j#022 //            UNIT=DISK,SPACE=(TRK,(50,50),RLSE),
 j#023 //            DCB=(MODEL.DSCB,LRECL=128,BLKSIZE=6118,RECFM=FBA)
 j#024 ##PEND1 PGL200

Please compare this jgl200.jcl conversion with the previous jar200.jcl. Both are 2 step jobs executing a SORT & a COBOL program. This job is intended to illustrate the following:

  1. PROC expansions and &SYMBOL substitutions.

  2. Generation (GDG) files. Note lines j#16 & j#17 above. The '(0)' suffix on GL.ACCOUNT.MASTER(0) signifies the current generation, while '(+1)' causes the 'next' generation to be created.

  3. In the output scripts GDG files are implemented via functions exportgen0 & exportgen1. See these functions listed on pages '5J1' & '5J2' in Part_5.

  4. Generation data files are suffixed with a 6 digit generation#. Later on page '1S4', you will be able to execute this job & observe the incrementing of the generation#.

  5. Note the control card library member which contains the SORT FIELDS. This will be explained in detail on page '1F4' ahead.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1F3. jcl3/jgl200.ksh - JCL after conversion to ksh script

 k#013 # * SORT TRANSACTIONS & UPDATE GL ACCOUNT MASTER
 k#014 # * - demo GDG processing, write gltrans(+1) & read back as (+1)
 k#015 #0========================== begin proc PGL200 ============================
 k#016 ##STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003                     #<-PROC1call
 k#017 ##PGL200   PROC HLQ=GL,YEAREND=2002                            #<-PROC1
 k#018 HLQ="GL";YEAREND="2002";
 k#019 ##STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003                      #<-PROC1exp
 k#020 HLQ="GL";YEAREND="2003";
 k#021 #1======================= begin step#S0010 SORT ========================
 k#022 S0010=A
 k#023 stepctl51;
 k#024 goto
 k#025 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#026 logmsg2 "******** Begin Step $JSTEP sort (#$XSTEP) ********"
 k#027 ##STEP010  EXEC PGM=SORT,REGION=2048K,PN=STEPA
 k#028 export PROGID=sort
 k#029 export PARM=""
 k#030 exportfile  SORTIN data1/gl.account.tran1
 k#031 exportgen1 +1 SORTOUT data1/gl.account.trans_
 k#032 #exportgen1 GDGs written to jobtmp/$jobid2 restored to outdir at Normal EOJ
 k#033 exportfile  SYSIN $RUNLIBS/parms/pgl200s1
 k#034 #2-------------------------- parms/pgl200s1 ---------------------------
 k#035 # SORT FIELDS=(1,8,CH,A,69,12,CH,A)
 k#036 logmsg2 "Executing--> uvsort \"fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTO..."
 k#037 #3----------------------------------------------------------------------
 k#038 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\
 k#039 ,keys=(0,8,e,a,68,12,e,a)"
 k#040 #4----------------------------------------------------------------------
 k#041 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90));
 k#042 ((JCC|=LCC)); S0010R=1; alias goto="";
 k#043 if ((S0010C != 0)) #need to modify for COND step S0020
 k#044    then logmsg2 "ERR: step#$JSTEP sort abterm $SCC"
 k#045    alias goto="<<S9900=\A"; fi
 k#046 goto
 k#047 #1======================= begin step#S0020 CGL200 ========================
 k#048 if ((S0010C >  4)); then   # COND=(4,LT,STEP010)
 k#049     alias goto="<<S9000=\A"; fi
 k#050 goto
 k#051 S0020=A
 k#052 stepctl51;
 k#053 goto
 k#054 export JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#055 logmsg2 "******** Begin Step $JSTEP cgl200 (#$XSTEP) ********"
 k#056 ##STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
 k#057 export PROGID=cgl200
 k#058 export PARM="2003"
 k#059 exportgen1 +1 GLTRANS data1/gl.account.trans_
 k#060 #exportgen1 GDGs written to jobtmp/$jobid2 restored to outdir at Normal EOJ
 k#061 exportgen0 0 GLMSOLD data1/gl.account.master_
 k#062 ##PEND1 PGL200
 k#063 exportgen1 +1 GLMSNEW data1/gl.account.master_
 k#064 logmsg2 "Executing--> cobrun $ANIM $CBLX/cgl200"
 k#065 #3----------------------------------------------------------------------
 k#066 cobrun $ANIM $CBLX/cgl200
 k#067 #4----------------------------------------------------------------------

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1F4. Sample Conversion of MVS JCL to Korn Shell Script

control card library members

jgl200.jcl illustrates a SYSIN control card library member, which contains the 'SORT FIELDS'. Note that the previous jar200.jcl included the SORT FIELDS as embedded '//SYSIN DD *' instream data, but PROCs are not allowed to contain instream data, so control card library members are used.

SYSIN control card member conversion

j#13 //SYSIN DD DSN=GL.CTLCDLIB(PGL200S1)

 k#033 exportfile  SYSIN $RUNLIBS/parms/pgl200s1
 k#034 #2-------------------------- parms/pgl200s1 ---------------------------
 k#035 # SORT FIELDS=(1,8,CH,A,69,12,CH,A)
 k#036 logmsg2 "Executing--> uvsort \"fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTO..."
 k#037 #3----------------------------------------------------------------------
 k#038 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\
 k#039 ,keys=(0,8,e,a,68,12,e,a)"
 k#040 #4----------------------------------------------------------------------

Notes

  1. For the conversion you must store the control card members in subdir 'parms'. When the converter encounters 'SYSIN DD DSN=GL.CTLCDLIB(PGL200S1)' it will look for file 'parms/pgl200s1' in the conversion library $RUNLIBS. The subdir will be changed to .../parms/..., for example 'GL.CTLCDLIB(PGL200S1)' will be changed to 'data1/gl.parms/pgl200s1'

  2. Storing the control cards in subdir parms/... was required by the converter for the many SYSINs for SORT FIELDS, etc, But this will also work for your COBOL programs that read SYSIN control cards. This assumes that you are OK with having all SYSIN control card modules in 1 common directory (parms).

  3. Note that the converter will always show the control card member contents as #comments within the converted script.

  4. In the SORT case, the #comments may help you to verify the conversion to uvsort, especially for more complex SORTs with INCLUDEs, OMITs, etc (see several examples later in MVSJCL2.htm#Part_6).

  5. After conversion, you could remove the file definition for 'parms' & the embedded #comments if you wish, since the SORT FIELDS have been inserted into the 'uvsort' converted equivalent.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1G1. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

jcl2/jgl300.jcl - demo IEBGENER/IDCAMS & CONDition codes

 j#01 //JGL300   JOB  (1234),'TEST MVS JCL CONVERSION'
 j#02 //* DEMO CONVERSION OF IEBGENER (TO UVCP) & IDCAMS (TO CP)
 j#03 //* COPY GL.ACCOUNT.MASTER TO A TEMP/WORK FILE & BACK (GEN# +1)
 j#04 //* - demos CONDition code testing (also see JGL320 IF/THEN/ENDIF)
 j#05 //STEP010  EXEC PGM=IEBGENER
 j#06 //SYSUT1   DD   DSN=GL.ACCOUNT.MASTER(0),DISP=SHR
 j#07 //SYSUT2   DD   DSN=&&TEMPGLM,DISP=(NEW,PASS),DCB=(LRECL=80)
 j#08 /=*
 j#09 //*============================ step# 002 ============================
 j#10 //STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 j#11 //TEMPGLM  DD   DSN=&&TEMPGLM,DISP=(OLD,PASS)
 j#12 //ACNTMAS  DD   DSN=GL.ACCOUNT.MASTER(+1),DISP=(NEW,CATLG),LRECL=80
 j#13 //SYSIN    DD   *
 j#14   REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS) RECORDSIZE(80)
 j#15 /*
  1. See the converted output Korn shell script on the next page --->

  2. 'JGL300' illustrates how IEBGENER & IDCAMS are converted to uvcp. It simply copies the account.master file to a temporary file & back. Note that the '&&TEMPCM' file will be assigned to the 'wrk' subdir in the converted JCL/script.

  3. The '(0)' suffix of 'account.master(0)' indicates a generation file. When you later execute this job (on page '1S5'), you will notice that 'account.master_000003' (the latest generation) will be selected by the 'exportgen0' function. When copied back to data1/gl.account.master(+1), the 'exportgen1' function will create a new generation as 'account.master_000004'. See much more about the VU GDG system in 'Part_5'.

  4. We have omitted the front end 11 lines & the back end 10 lines, since they are the same for all conversions & have already been illustrated for example #1 on page '1C2'.

  5. This JCL also illustrates the conversion of 'CONDition code testing. 'COND=(4,LT,STEP010)' on line J#09 above is converted to 'if ((S0010C > 4))' and 'goto S9000' on lines k#038&k#039. Note that satisfied CONDitions 'shut off' step execution. Satisfied unix 'if' conditions enable execution. This reversal is compensated for by the reversed operands on the 'if'.

  6. To test the COND 'failure' condition, you could simply change the name of the input filename to something that will not be found.

  7. See more 'COND' discussion at MVSJCL2.htm#28F1

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1G2. Sample Conversion of MVS JCL to Korn Shell Script

jcl3/jgl300.ksh - JCL/script

 k#013 # * DEMO CONVERSION OF IEBGENER (TO UVCP) & IDCAMS (TO CP)
 k#014 # * COPY GL.ACCOUNT.MASTER TO A TEMP/WORK FILE & BACK (GEN# +1)
 k#015 # * - demos CONDition code testing (also see JGL320 IF/THEN/ENDIF)
 k#016 #1======================= begin step#S0010 IEBGENER ========================
 k#017 S0010=A
 k#018 stepctl51;
 k#019 goto
 k#020 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#021 logmsg2 "******** Begin Step $JSTEP iebgener (#$XSTEP) ********"
 k#022 ##STEP010  EXEC PGM=IEBGENER
 k#023 export PROGID=iebgener
 k#024 export PARM=""
 k#025 exportgen0 0 SYSUT1 data1/gl.account.master_
 k#026 exportfile  SYSUT2 $JTMP/t_tempglm
 k#027 logmsg2 "Executing--> uvcp \"fili1=$SYSUT1,typ=RSF,rcs=128,filo1=$SYSUT2..."
 k#028 #3----------------------------------------------------------------------
 k#029 uvcp "fili1=$SYSUT1,typ=RSF,rcs=128,filo1=$SYSUT2,typ=RSF,rcs=128"
 k#030 #4----------------------------------------------------------------------
 k#031 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90));
 k#032 ((JCC|=LCC)); S0010R=1; alias goto="";
 k#033 if ((S0010C != 0)) #need to modify for COND step S0020
 k#034    then logmsg2 "ERR: step#$JSTEP iebgener abterm $SCC"
 k#035    alias goto="<<S9900=\A"; fi
 k#036 goto
 k#037 #1======================= begin step#S0020 IDCAMS ========================
 k#038 if ((S0010C >  4)); then   # COND=(4,LT,STEP010)
 k#039     alias goto="<<S9000=\A"; fi
 k#040 goto
 k#041 S0020=A
 k#042 stepctl51;
 k#043 goto
 k#044 export JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#045 logmsg2 "******** Begin Step $JSTEP idcams (#$XSTEP) ********"
 k#046 ##STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 k#047 export PROGID=idcams
 k#048 export PARM=""
 k#049 exportfile  TEMPGLM $JTMP/t_tempglm
 k#050 exportgen1 +1 ACNTMAS data1/gl.account.master_
 k#051 #exportgen1 GDGs written to jobtmp/$jobid2 restored to outdir at Normal EOJ
 k#052 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
 k#053 cat > $SYSIN <</*
 k#054   REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS) RECORDSIZE(80)
 k#055 /*
 k#056 logmsg2 "Executing--> uvcp \"fili1=$TEMPGLM,typ=RSF,rcs=80,filo1=$ACNTMA..."
 k#057 #3----------------------------------------------------------------------
 k#058 uvcp "fili1=$TEMPGLM,typ=RSF,rcs=80,filo1=$ACNTMAS,typ=RSF,rcs=128";
 k#059 LCC=$?; ((SCC|=LCC)); ((JCC|=LCC));
 k#060 #4----------------------------------------------------------------------
 k#061 S0020C=$SCC; ((SCC<8)) && ((SCC+=90)); ((JCC|=SCC)); S0020R=1; alias goto="";
 k#062 if ((S0020C != 0))
 k#063    then logmsg2 "ERR: step#$JSTEP idcams abterm $SCC"
 k#064    alias goto="<<S9900=\A"; fi
 k#065 goto

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1G3. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

jcl2/jgl320.jcl - demo IF/THEN/ENDIF

 j#01 //JGL320   JOB  (1234),'TEST MVS JCL CONVERSION'
 j#02 //* DEMO CONVERSION OF IEBGENER (TO UVCP) & IDCAMS (TO CP)
 j#03 //* COPY GL.ACCOUNT.MASTER TO A TEMP/WORK FILE & BACK (GEN# +1)
 j#04 //* - demos IF/THEN/ENDIF (vs CONDition codes in JGL320)
 j#05 //* - change input filename (step1 will fail) & step2 will be skipped
 j#06 //STEP010  EXEC PGM=IEBGENER
 j#07 //SYSUT1   DD   DSN=GL.ACCOUNT.MASTER(0),DISP=SHR
 j#08 //SYSUT2   DD   DSN=&&TEMPGLM,DISP=(NEW,PASS),DCB=(LRECL=80)
 j#09 //*
 j#10 // IF (RC = 0) THEN
 j#11 //STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 j#12 //TEMPGLM  DD   DSN=&&TEMPGLM,DISP=(OLD,PASS)
 j#13 //ACNTMAS  DD   DSN=GL.ACCOUNT.MASTER(+1),DISP=(NEW,CATLG),LRECL=80
 j#14 //SYSIN    DD   *
 j#15    REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS)
 j#16 /*
 j#17 // ENDIF

Notes

  1. This job is the same as jgl300.jcl with the addition of IF/THEN/ENDIF to make step 2 conditional on successful Return Code from step 1.

  2. The CONDition code tests already do this, but this was a convenient JCL to test/demo IF/THEN/ENDIF.

  3. See the converted script on the next page & note that the equivalent of IF & ENDIF on lines k#038 & k#068.

  4. jgl320 has added the IF/ENDIF tests in addition to the 'COND' tests already described in jgl300 above. More likely you would remove the 'COND' tests if you were adding IF/ENDIF tests.

  5. To test the IF 'failure' condition, you could simply change the name of the input filename to something that will not be found.

  6. Note the condition code test at the end of step 1 on line k#034 You need to change from the usual 'if ((S0010C != 0))' to 'if ((S0010C > 4))' to allow us to reach the 'COND' test.

  7. uvcp returns 99 on failure which would be detected by the normal return code test, vs the IF/THEN test which follows.

  8. See more 'IF' discussion at MVSJCL2.htm#28G1

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1G4. jcl3/jgl320.ksh - demo IF/THEN/ENDIF

 k#013 # * DEMO CONVERSION OF IEBGENER (TO UVCP) & IDCAMS (TO CP)
 k#014 # * COPY GL.ACCOUNT.MASTER TO A TEMP/WORK FILE & BACK (GEN# +1)
 k#015 # * - demos IF/THEN/ENDIF (vs CONDition codes in JGL320)
 k#016 # * - change input filename (step1 will fail) & step2 will be skipped
 k#017 #1======================= begin step#S0010 IEBGENER ========================
 k#018 S0010=A
 k#019 stepctl51;
 k#020 goto
 k#021 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#022 logmsg2 "******** Begin Step $JSTEP iebgener (#$XSTEP) ********"
 k#023 ##STEP010  EXEC PGM=IEBGENER
 k#024 export PROGID=iebgener
 k#026 exportgen0 0 SYSUT1 data1/gl.account.master_
 k#027 exportfile  SYSUT2 $JTMP/t_tempglm
 k#028 logmsg2 "Executing--> uvcp \"fili1=$SYSUT1,typ=RSF,rcs=128,filo1=$SYSUT2..."
 k#029 #3----------------------------------------------------------------------
 k#030 uvcp "fili1=$SYSUT1,typ=RSF,rcs=128,filo1=$SYSUT2,typ=RSF,rcs=128"
 k#031 #4----------------------------------------------------------------------
 k#032 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90));
 k#033 ((JCC|=LCC)); S0010R=1; alias goto="";
 k#034 if ((S0010C != 0)) #need to modify for COND step S0020
 k#035    then logmsg2 "ERR: step#$JSTEP iebgener abterm $SCC"
 k#036    alias goto="<<S9900=\A"; fi
 k#037 goto
 k#038 if ((S0010C == 0)); then #IF (RC = 0) THEN #J001(1)
 k#039 #1======================= begin step#S0020 IDCAMS ========================
 k#040 if ((S0010C >  4)); then   # COND=(4,LT,STEP010)
 k#041     alias goto="<<S9000=\A"; fi
 k#042 goto
 k#043 S0020=A
 k#044 stepctl51;
 k#045 goto
 k#046 export JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#047 logmsg2 "******** Begin Step $JSTEP idcams (#$XSTEP) ********"
 k#048 ##STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 k#049 export PROGID=idcams
 k#051 exportfile  TEMPGLM $JTMP/t_tempglm
 k#052 exportgen1 +1 ACNTMAS data1/gl.account.master_
 k#053 #exportgen1 GDGs written to jobtmp/$jobid2 restored to outdir at Normal EOJ
 k#054 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
 k#055 cat > $SYSIN <</*
 k#056   REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS) RECORDSIZE(80)
 k#057 /*
 k#058 logmsg2 "Executing--> uvcp \"fili1=$TEMPGLM,typ=RSF,rcs=80,filo1=$ACNTMA..."
 k#059 #3----------------------------------------------------------------------
 k#060 uvcp "fili1=$TEMPGLM,typ=RSF,rcs=80,filo1=$ACNTMAS,typ=RSF,rcs=128";
 k#061 LCC=$?; ((SCC|=LCC)); ((JCC|=LCC));
 k#062 #4----------------------------------------------------------------------
 k#063 S0020C=$SCC; ((SCC<8)) && ((SCC+=90)); ((JCC|=SCC)); S0020R=1; alias goto="";
 k#064 if ((S0020C != 0))
 k#065    then logmsg2 "ERR: step#$JSTEP idcams abterm $SCC"
 k#066    alias goto="<<S9900=\A"; fi
 k#067 goto
 k#068 fi  #ENDIF #J001(1) #IF (RC = 0) THEN #J001(1)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1G5. sample MVS JCL Conversions to Korn shell scripts

jgl360.jcl IDCAMS DEFINE CLUSTER - Create VSAM

 j#01 //JGL360   JOB  'TEST MVS JCL IDCAMS DEFINE CLUSTER CONVERSION'
 j#02 //* CREATE VSAM INDEXED FILE (INIT EMPTY FILE FOR RANDOM UPDATES)
 j#03 //STEP010  EXEC PGM=IDCAMS
 j#04 //SYSPRINT DD   SYSOUT=*
 j#05 //SYSIN    DD   *
 j#06    DELETE (GL.ACCOUNT.MASTER2) PURGE CLUSTER CATALOG (USERCAT5)
 j#07    DEFINE CLUSTER (NAME (GL.ACCOUNT.MASTER2) -
 j#08                    RECORDSIZE(80) -
 j#09                    KEYS(6 0) )
 j#10 /*
 j#11 //

See the 'uvcp' equivalent of IDCAMS listed on the next page --->

Most of the IDCAMS functions are not required for MicroFocus COBOL on Unix/Linux/Windows systems. For example 'DEFINE CLUSTER' was required by the mainframe to create a VSAM file, but MicroFocus COBOL can create VSAM files simply by 'OPEN OUTPUT'.

However the IDCAMS DEFINE CLUSTER is converted to 'uvcp' which will create an empty file, in case the IDCAMS step is followed by a COBOL program that expects to ADD/UPDATE records to an empty existing file. The uvcp will create the file with any indexed keys specified.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1G6. sample MVS JCL Conversions to Korn shell scripts

jgl360.ksh IDCAMS DEFINE CLUSTER converted to uvcp

The front end 11 lines & the back end 10 lines are omitted since they are the same for all jobs (except for jobname & any JCL comments).


 k#013 # * CREATE VSAM INDEXED FILE (INIT EMPTY FILE FOR RANDOM UPDATES)
 k#014 #1======================= begin step#S0010 IDCAMS ========================
 k#015 S0010=A
 k#016 stepctl51;
 k#017 goto
 k#018 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#019 logmsg2 "******** Begin Step $JSTEP idcams (#$XSTEP) ********"
 k#020 ##STEP010  EXEC PGM=IDCAMS
 k#021 export PROGID=idcams
 k#022 export PARM=""
 k#023 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
 k#024 cat > $SYSIN <</*
 k#025    DELETE (GL.ACCOUNT.MASTER2) PURGE CLUSTER CATALOG (USERCAT5)
 k#026    DEFINE CLUSTER (NAME (GL.ACCOUNT.MASTER2) -
 k#027                    RECORDSIZE(80) -
 k#028                    KEYS(6 0) )
 k#029 /*
 k#030 logmsg2 "Executing--> rm -f data1/gl.account.master2.dat"
 k#031 #3----------------------------------------------------------------------
 k#032 rm -f data1/gl.account.master2.dat
 k#033 rm -f data1/gl.account.master2.idx
 k#034 uvcp "fili1=/dev/null,typ=RSF,rcs=80,filo1=data1/gl.account.master2,typ=IDXf1\
 k#035 ,rcs=80,isk1=0(6)"
 k#036 LCC=$?; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90)); ((JCC|=SCC));
 k#037 #4----------------------------------------------------------------------
 k#038 S0010C=$SCC; ((SCC<8)) && ((SCC+=90)); ((JCC|=SCC)); S0010R=1; alias goto="";
 k#039 if ((S0010C != 0))
 k#040    then logmsg2 "ERR: step#$JSTEP idcams abterm $SCC"
 k#041    alias goto="<<S9900=\A"; fi
 k#042 goto

Most of the IDCAMS functions are not required for MicroFocus COBOL on Unix/Linux/Windows systems. For example 'DEFINE CLUSTER' was required by the mainframe to create a VSAM file, but MicroFocus COBOL can create VSAM files simply by 'OPEN OUTPUT'.

However the IDCAMS DEFINE CLUSTER is converted to 'uvcp' which will create an empty file, in case the IDCAMS step is followed by a COBOL program that expects to ADD/UPDATE records to an empty existing file. The uvcp will create the file with any indexed keys specified.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1H1. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

Deleting Files - Regular & GDG

IEFBR14 steps were often used to DELETE files. Here is a demo job to illustrate deleting files - both regular & GDG (all members of a generation file set).

jcl2/jgl500.jcl - demo file DELETEs

 j#01 //JGL500   JOB  'test DELETE files - regular & GDG (all members)'
 j#02 //STEP010  EXEC PGM=IEFBR14
 j#03 //ACTEXPT  DD   DSN=GL.ACCOUNT.EXPORT,DISP=(OLD,DELETE)
 j#04 //ACTLIST  DD   DSN=GL.ACCOUNT.ACNTLIST,DISP=(OLD,DELETE)

jcl3/jgl500.ksh - script equivalent

 k#013 #1======================= begin step#S0010 IEFBR14 ========================
 k#014 S0010=A
 k#015 stepctl51;
 k#016 goto
 k#017 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#018 logmsg2 "******** Begin Step $JSTEP iefbr14 (#$XSTEP) ********"
 k#019 ##STEP010  EXEC PGM=IEFBR14
 k#020 export PROGID=iefbr14
 k#021 export PARM=""
 k#022 exportfile  ACTEXPT data1/gl.account.export
 k#023 exportgenall  ACTLIST data1/gl.account.acntlist_
 k#024 logmsg2 "Executing--> rm -f $ACTEXPT"
 k#025 #3----------------------------------------------------------------------
 k#026 rm -f $ACTEXPT
 k#027 rm -f ${ACTLIST}[0-9][0-9][0-9][0-9][0-9][0-9]
 k#028 #4----------------------------------------------------------------------
 k#029 :  # dummy step set cc 0 for status tests
 k#030 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90));
 k#031 ((JCC|=LCC)); S0010R=1; alias goto="";
 k#032 if ((S0010C != 0))
 k#033    then logmsg2 "ERR: step#$JSTEP iefbr14 abterm $SCC"
 k#034    alias goto="<<S9900=\A"; fi
 k#035 goto

Regular file DELETE - JCL & script equivalent

j#03 //ACTEXPT DD DSN=GL.ACCOUNT.EXPORT,DISP=(OLD,DELETE)

k#022 exportfile ACTEXPT data1/gl.account.export k#026 rm -f $ACTEXPT

GDG file DELETE - JCL & script equivalent

j#04 //ACTLIST DD DSN=GL.ACCOUNT.ACNTLIST,DISP=(OLD,DELETE)

 k#023 exportgenall ACTLIST data1/gl.account.acntlist_
 k#027 rm -f ${ACTLIST}[0-9][0-9][0-9][0-9][0-9][0-9]

The Regular file delete is straitforward, but the GDG file delete deserves some explanation. How does the converter know that 'GL.ACCOUNT.ACNTLIST' is a GDG file ? - since it does not have the usual identifying suffix (0) (1).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1H2. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

Control file to supply recsizes, ID GDG files, etc

Before the 1st JCL conversion, job 'jcldata51' reads thru all JCLs, extracting all file definitions, sorting,& dropping duplicates. An output file is written to 'ctl/datactl53I' which is read by the JCL converter as an Indexed file or stored in a memory table. The JCL converter can then lookup this file to determine which files are GDG & get record sizes, keys, etc if not in JCL.

Here are a few lines from the control file. You can see the entire test/demo file listed later on page '3F1'.

sample datajcl51

Note
  • 12 lines of output records are shown twice (split to left & right sides)
  • because the lines are longer than allowed by printed documentation
  • the 2nd list omits filename & cntf so you can see all keywords on right
  • you can match lines using the inserted 2 digit sequence#

 #01 &&TEMPGLM                    cntf=0016 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL1
 #02 AR.CUSTOMER.MASTER           cntf=0010 rca=00000 rcm=00000 typ=RSF src=J___________ job=jar100 prg=CAR100
 #03 AR.CUSTOMER.NAMEADRS.LIST100 cntf=0002 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jar109 prg=CAR100
 #04 GL.ACCOUNT.ACNTLIST(+1)      cntf=0001 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100
 #05 GL.ACCOUNT.MASTER            cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14
 #06 GL.ACCOUNT.MASTER(+1)        cntf=0014 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL2
 #07 GL.ACCOUNT.MASTER(0)         cntf=0020 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl100 prg=CGL100
 #08 GL.ACCOUNT.MASTER2           cntf=0002 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6)
 #09 GL.ACCOUNT.TRANS(+1)         cntf=0005 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl211 prg=SORT
 #10 PY.PARMS(PPY200S1)           cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy200 prg=SORT
 #11 PY.TIME.&DAY..&MONTH..&YEAR  cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy910 prg=IEFBR14
 #12 PYTEST.PAYROLL.MASTER        cntf=0006 rca=00200 rcm=00200 typ=ISF src=Jk__________ job=jpy400 prg=IDCAMS key=(0,8)

sample datajcl51 - right side (filename omitted)


 #01 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL1
 #02 rca=00000 rcm=00000 typ=RSF src=J___________ job=jar100 prg=CAR100
 #03 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jar109 prg=CAR100
 #04 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100
 #05 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14
 #06 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL2
 #07 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl100 prg=CGL100
 #08 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6)
 #09 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl211 prg=SORT
 #10 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy200 prg=SORT
 #11 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy910 prg=IEFBR14
 #12 rca=00200 rcm=00200 typ=ISF src=Jk__________ job=jpy400 prg=IDCAMS key=(0,8)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1H3. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

Control file to supply recsizes, ID GDG files, etc

Prior to May 2007, all GDG files defaulted to a system wide value for the number of generations maintained - unless you modified by coding 'gdg=..' in this control file for datafiles you wanted different from the default.

As of May 2007, an indexed file (ctl/gdgctl51I) now holds the 'gdg=..' info. This file is looked up by exportgen1 to get the gdg=.. value. This is a big improvement since you can make changes in 1 place to affect all references to each datafile.

See much more about the enhanced GDG system in 'Part_5' of this MVSJCL.doc.

Also note that ctl/datactl53I is used to determine references to an entire set of GDG files when there is no (0) or (+1) suffix on the reference, but the control file knows it is a GDG file from other references in the JCL. In this case the converter generates the 'exportgenall' function which concatenates all members of the file.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1I1. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

IKJEFT01 - TSO Batch job for DB2

The mainframe required IKJEFT01 to execute COBOL programs that access DB2 tables. Microfocus COBOL on Unix/Linux/Windows(SFU) does not require this, so the converter retrieves the COBOL program name from the SYSTSIN control cards, and formats the cobrun command to execute the COBOL program directly.

jcl2/ikjeft01.jcl - demo IKJEFT01 conversion

 //IKJEFT01 JOB (MXP,WXS91),'sample job to demo IKJEFT01 conversion'
 //STEP0010 EXEC PGM=IKJEFT01,DYNAMNBR=20
 //SYSTSIN  DD  DSN=MXPLIB(IKJDEMO1),DISP=SHR
 //*note - for demo simplicity all files commented out except SYSTSIN
 //*SYSTSPRT DD  SYSOUT=&SYSOUT1
 //*SYSOUT,SYSPRINT,SYSABOUT,SYSDBOUT,SYSUDUMP,PRT(all similar SYSTSPRT)
 //*SXH      DD  DSN=MXP.PSXH.KSVSAM.MAST,DISP=SHR

parms/ikjdemo1 - SYSTSIN control cards for IKJEFT01

 DSN SYSTEM(DB2P)
 RUN PROGRAM(IKJPROG1) PLAN(IKJPROG1) LIB('MEPP.WXS91.LOADLIB')
 END

jcl3/ikjeft01.ksh - converted script

 k#013 #1======================= begin step#S0010 IKJEFT01 ========================
 k#014 S0010=A
 k#015 stepctl51;
 k#016 goto
 k#017 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#018 logmsg2 "******** Begin Step $JSTEP ikjeft01 (#$XSTEP) ********"
 k#019 ##STEP0010 EXEC PGM=IKJEFT01,DYNAMNBR=20
 k#020 export PROGID=car100
 k#021 export PARM=""
 k#022 exportfile  SYSTSIN $RUNLIBS/parms/ikjdemo1
 k#023 #2-------------------------- parms/ikjdemo1 ---------------------------
 k#024 # DSN SYSTEM(DB2P)
 k#025 # RUN PROGRAM(CAR100) PLAN(IKJPROG1) LIB('MEPP.WXS91.LOADLIB')
 k#026 # PARMS('parmsdata added on IKJEFT01 demo Aug28/07')
 k#027 # END
 k#028 export PARM="parmsdata added on IKJEFT01 demo Aug28/07"
 k#029 logmsg2 "Executing--> cobrun $ANIM $CBLX/car100"
 k#030 #3----------------------------------------------------------------------
 k#031 cobrun $ANIM $CBLX/car100
 k#032 #4----------------------------------------------------------------------
 k#033 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90));
 k#034 ((JCC|=LCC)); S0010R=1; alias goto="";
 k#035 if ((S0010C != 0))
 k#036    then logmsg2 "ERR: step#$JSTEP ikjeft01 abterm $SCC"
 k#037    alias goto="<<S9900=\A"; fi
 k#038 goto
 k#039 #/=*.ote - for demo simplicity all files commented out except SYSTSIN

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1J1. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

FTP test/demo conversion

After converting the test/demo JCL, you can run the converted script. The demo JCL specifies TCP/IP adrs as '127.0.0.1' which is the unix/linux host. The demo assumes you have setup test users mvstest/vsetest and FTP's from 'mvstest' & logs in the 'vsetest' on the same machine.

FTP demo JCL - jcl0/FTPPUT1.jcl

 //FTPPUT1  JOB 'test FTP conversion'
 //FTPSTEP1 EXEC PGM=FTP,PARM='127.0.0.1'
 //INPUT    DD   *
 vsetest vsetest00
 put GL.ACCOUNT.TRANS(0)            <-- Note - GDG files are handled
 quit
 /*

converted JCL/script - jcl3/ftpput1.ksh

 k#013 #1======================= begin step#S0010 FTP ========================
 k#014 S0010=A
 k#015 stepctl51;
 k#016 goto
 k#017 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#018 logmsg2 "******** Begin Step $JSTEP ftp (#$XSTEP) ********"
 k#019 ##FTPSTEP1 EXEC PGM=FTP,PARM='127.0.0.1'
 k#020 export PROGID=ftp
 k#021 export PARM="127.0.0.1"
 k#022 exportfile INPUT1 $JTMP/${JSTEP}_${PROGID}_INPUT1
 k#023 cat > $INPUT1 <</*
 k#024 mvstest mvstest00
 k#025 cd testdata
 k#026 binary
 k#027 put GL.ACCOUNT.TRANS(0)
 k#028 quit
 k#029 /*
 k#030 #----------- INPUT from parms/ -----------
 k#031 #--------- end INPUT from parms/ ---------
 k#032 exportgen0 0 FTPPUT01 data1/gl.account.trans_
 k#033 exportfile FTPTMP2 $JTMP/${JSTEP}_${PROGID}_FTPTMP2
 k#034 cat > $FTPTMP2 <</*FTP2
 k#035 open 127.0.0.1
 k#036 user mvstest mvstest00
 k#037 cd testdata
 k#038 binary
 k#039 put $FTPPUT01
 k#040 quit
 k#041 /*FTP2
 k#042 logmsg2 "Executing--> ftp -i -n -u -v <$FTPTMP2"
 k#043 #3----------------------------------------------------------------------
 k#044 ftp -i -n -u -v <$FTPTMP2
 k#045 #4----------------------------------------------------------------------

 ftpdemo1.ksh   <-- execute FTP demo (after conversion)
 ============     - see console log on the next page

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1J2. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

console log from FTP test/demo

 090314:135607:FTPPUT1: Begin Job=FTPPUT1
 090314:135607:FTPPUT1: /home/mvstest/testlibs/jcls/ftpput1.ksh
 090314:135607:FTPPUT1: Arguments:
 090314:135607:FTPPUT1: RUNLIBS=/home/mvstest/testlibs
 090314:135607:FTPPUT1: RUNDATA=/home/mvstest/testdata
 090314:135607:FTPPUT1: JTMP=/home/mvstest/testdata/jobtmp/FTPPUT1 SYOT=/home/mvstest/testdata/sysout/FTPPUT1
 090314:135607:FTPPUT1: RUNDATE=20090314
 090314:135607:FTPPUT1: ******** Begin Step S0010 ftp (#1) ********
 090314:135607:FTPPUT1: file: INPUT1=/home/mvstest/testdata/jobtmp/FTPPUT1/S0010_ftp_INPUT1 bytes=66
 090314:135607:FTPPUT1: EOF fili01 rds=5 size=120: /home/mvstest/testdata/jobtmp/FTPPUT1/gtmp/0010I_gl_account.trans_
 090314:135607:FTPPUT1: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:135607:FTPPUT1: EOF filo02 wrts=1 size=51: /home/mvstest/testdata/jobtmp/FTPPUT1/gtmp/0010G0_gl_account.trans_
 090314:135607:FTPPUT1: gen0: FTPPUT01=data1/gl.account.trans_000005 insize=1600
 090314:135607:FTPPUT1: file: FTPTMP2=/home/mvstest/testdata/jobtmp/FTPPUT1/S0010_ftp_FTPTMP2 bytes=
 090314:135607:FTPPUT1: Executing--> ftp -i -n -u -v </home/mvstest/testdata/jobtmp/FTPPUT1/S0010_ftp_FTPTMP2
 Connected to 127.0.0.1.
 220 (vsFTPd 2.0.5)
 331 Please specify the password.
 230 Login successful.
 250 Directory successfully changed.
 200 Switching to Binary mode.
 local: data1/gl.account.trans_000005 remote: data1/gl.account.trans_000005
 550 Permission denied.
 Passive mode refused.  Turning off passive mode.
 200 PORT command successful. Consider using PASV.
 150 Ok to send data.
 226 File receive OK.
 1600 bytes sent in 4.5e-05 seconds (3.5e+04 Kbytes/s)
 221 Goodbye.
 090314:135607:FTPPUT1: Job Times: Begun=13:56:07 End=13:56:07 Elapsed=00:00:00
 090314:135607:FTPPUT1: EOF filr01 rds=5 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:135607:FTPPUT1: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1K1. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

MAILSMTP.jcl

j#001 //MAILSMTP JOB 'test/demo SMTP MAIL convert to sendmail' j#003 //STEP010 EXEC PGM=IEBGENER j#004 //SYSUT2 DD SYSOUT=(B,SMTP) j#005 //SYSUT1 DD * j#006 TO: appsadm j#007 FROM: mvstest j#008 SUBJECT: testing SMTP/sendmail to other unix logins j#009 j#010 Hello: appsadm, sending this mail from batch job MAILSMTP (a test) j#011 Note: the blank line between SUBJECT: & message is mandatory j#012 Similar mail might be used to alert you of problems in batch jobs ? j#013 This mail from 1 unix login to another unix login j#014 Not sure if we can send to an internet email address yet ? j#015 (may need to install more software ?) j#016 /*

 k#013 #1======================= begin step#S0010 IEBGENER ========================
 k#014 S0010=A
 k#015 stepctl51;
 k#016 goto
 k#017 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#018 logmsg2 "******** Begin Step $JSTEP iebgener (#$XSTEP) ********"
 k#019 ##STEP010  EXEC PGM=IEBGENER
 k#020 export PROGID=iebgener
 k#021 export PARM=""
 k#022 exportfile SYSUT2 $SYOT/${jobid2}_${JSTEP}_SYSUT2_$(date +%y%m%d_%H%M%S)
 k#023 exportfile SYSUT1 $JTMP/${JSTEP}_${PROGID}_SYSUT1
 k#024 cat > $SYSUT1 <</*
 k#025 TO: owen@uvsoftware.ca
 k#026 FROM: mvstest
 k#027 SUBJECT: testing SMTP/sendmail to internet email address
 k#028
 k#029 Hello: owen@uvsoftware.ca
 k#030 - testing sending mail from batch job MAILSMT2 to internet email address
 k#031 Note: the blank line between SUBJECT: & message is mandatory
 k#032 Similar mail might be used to alert you of problems in batch jobs ?
 k#033 /*
 k#034 logmsg2 "Executing--> sendmail -t <$SYSUT1"
 k#035 #3----------------------------------------------------------------------
 k#036 sendmail -t <$SYSUT1
 k#037 #4----------------------------------------------------------------------
 k#038 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90));
 k#039 ((JCC|=LCC)); S0010R=1; alias goto="";
 k#040 if ((S0010C != 0))
 k#041    then logmsg2 "ERR: step#$JSTEP iebgener abterm $SCC"
 k#042    alias goto="<<S9900=\A"; fi
 k#043 goto
 mailsmtp.ksh     <-- execute (as mvstest)
 Login appsadm    <-- Login as appsadm (mail addressee)
 mail             <-- read mail (sent from mvstest)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1K2. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

converting mainframe 'MAILTOLN' to 'mutt'

Here are listings of mainframe MAILTOLN & the converted 'mutt' JCL/script, that you can run after conversion.

test/demo JCL - jcl0/MAILDEMO.jcl

 //MAILDEMO JOB  'test/demo MAIL conversion to linux mutt'
 //* demo conversion of mainframe 'MAILTOLN' to linux 'mutt'
 //STEP010  EXEC PGM=MAILTOLN
 //PARMFILE DD *
 TO: uvadm
 SUBJECT: current generation of GL.ACCOUNT.TRANS file attached
 //MAIL   DD  DISP=SHR,DSN=GL.ACCOUNT.TRANS(0)
 k#014 #1======================= begin step#S0010 MAILTOLN ========================
 k#015 S0010=A
 k#016 stepctl51;
 k#017 goto
 k#018 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#019 logmsg2 "******** Begin Step $JSTEP mailtoln (#$XSTEP) ********"
 k#020 ##STEP010  EXEC PGM=MAILTOLN
 k#021 export PROGID=mailtoln
 k#022 export PARM=""
 k#023 exportfile PARMFILE $JTMP/${JSTEP}_${PROGID}_PARMFILE
 k#024 cat > $PARMFILE <</*
 k#025 TO: uvadm
 k#026 SUBJECT: current generation of GL.ACCOUNT.TRANS file attached
 k#027 /*
 k#028 exportgen0 0 MAIL data1/gl.account.trans_
 k#029 logmsg2 "Executing--> mutt -s \"current generation of GL.ACCOUNT.TRANS f..."
 k#030 #3----------------------------------------------------------------------
 k#031 mutt -s "current generation of GL.ACCOUNT.TRANS file attached"\
 k#032      -a $MAIL uvadm <$PARMFILE
 k#033 #4----------------------------------------------------------------------
 k#034 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90));
 k#035 ((JCC|=LCC)); S0010R=1; alias goto="";
 k#036 if ((S0010C != 0))
 k#037    then logmsg2 "ERR: step#$JSTEP mailtoln abterm $SCC"
 k#038    alias goto="<<S9900=\A"; fi
 k#039 goto

 maildemo.ksh      <-- execute test/demo JCL/script (after conversion)
 ============

This demo JCL/script assumes you will be logged in as 'mvstest' & will mail to user 'uvadm'. Note the attachment is '$MAIL' which is a GDG file defined by 'exportgen0'. It is addressed in subdir 'data1/' since all JCL/scripts call function 'jobset51' (on line 10 not shown here) which changes directory to $RUNDATA. RUNDATA will be /home/mvstest/testdata/ if logged in as mvstest using the profile listed at ADMjobs.htm#1C1.

See the resulting 'mbox' for 'uvadm' listed on the next page.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1K3. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

mbox result from maildemo.ksh

From mvstest@uvsoft3.uvsoft.ca Mon Jul 30 13:11:42 2007 Return-Path: <mvstest@uvsoft3.uvsoft.ca> Received: from uvsoft3.uvsoft.ca (uvsoft3.uvsoft.ca [127.0.0.1]) by uvsoft3.uvsoft.ca (8.12.10/8.12.10) with ESMTP id l6UKBgdd009858 for <uvadm@uvsoft3.uvsoft.ca>; Mon, 30 Jul 2007 13:11:42 -0700 Received: (from mvstest@localhost) by uvsoft3.uvsoft.ca (8.12.10/8.12.10/Submit) id l6UKBf1U009856 for uvadm@localhost.localdomain; Mon, 30 Jul 2007 13:11:41 -0700 Date: Mon, 30 Jul 2007 13:11:41 -0700 From: MVSTEST <mvstest@uvsoft3.uvsoft.ca> To: UVADM <uvadm@uvsoft3.uvsoft.ca> Subject: current generation of GL.ACCOUNT.TRANS file attached Message-ID: <20070730201141.GA9851@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline User-Agent: Mutt/1.4.1i Status: RO

--Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline

TO: uvadm SUBJECT: current generation of GL.ACCOUNT.TRANS file attached

--Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="account.trans_000005"

 00011100T Bank Fee                      000000100} 1234BJ      040428
 00011100T EMJ Sony Tape Drive           000012314J 1234BC000871040428
 00011100T Telephone                     000000559Q 1234BC000882040428
 00011100T FEDEX                         000000109J 1234BC000870040428
 00011100T VISA payment                  000040000} 1234BC000884040428
 00011100T Staples office supplies       000001227N 1234BC000874040428
 00011100T Datex office rent             000003210} 1234BC000885040428
 00011200T VISA payment                  0000400000 1234BC000884040428
 00011200T Dollar rent a car             000014177O 1234VS      040428
 00033700T EMJ Sony Tape Drive           0000008056 1234BC000871040428
 00033700T Telephone                     0000000344 1234BC000882040428
 00033700T FEDEX                         0000001091 1234BC000870040428
 00033700T Staples office supplies       0000000754 1234BC000874040428
 00033700T Datex office rent             0000002100 1234BC000885040428
 00061500T EMJ Sony Tape Drive           0000115085 1234BC000871040428
 00062200T Staples office supplies       0000011521 1234BC000874040428
 00063300T Dollar rent a car             0000141776 1234VS      040428
 00074100T Bank Fee                      0000001000 1234BJ      040428
 00075100T Datex office rent             0000030000 1234BC000885040428
 00075300T Telephone                     0000005254 1234BC000882040428

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1L1. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

ISRSUPC conversion to 'cmp' & 'uvcmp'

The 'ISRSUPC' (SUPERC) file comparison utility is converted to unix/linux 'cmp' and to the Vancouver Utility 'uvcmp1' utilties.

'cmp' is used to set the condition code for any following 'IF', often the only purpose of the ISRSUPC step. 'uvcmp' creates a report in SYSOUT in case you do need the file comparison report (see sample report on the next page).

Here are listings of the JCL (ISRSUPC.jcl) & converted script (isrsupc1.ksh) provided to demo SUPERC conversion (relevant lines only).

test/demo jcl0/ISRSUPC1.jcl

 //ISRSUPC1 JOB 'test ISRSUPC (file compare) July 2007'
 //STEP010 EXEC PGM=ISRSUPC,PARM=(CHNGL,LINECMP,'','')
 //NEWDD  DD DSN=GL.ACCOUNT.TRANS(0),DISP=SHR         <-- GDG current generation
 //OLDDD  DD DSN=GL.ACCOUNT.TRANS(-1),DISP=SHR        <-- GDG previous generation
 //OUTDD  DD SYSOUT=(A)
 //SYSIN  DD *
 CMPCOLM 1:80
 DPLINE  'HDR1',1
 /*
 // IF STEP010.RC=0 THEN
 // ...................

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1L2. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

converted to cmp/uvcmp - jcl3/isrsupc.ksh

 k#013 #1======================= begin step#S0010 ISRSUPC ========================
 k#014 S0010=A
 k#015 stepctl51;
 k#016 goto
 k#017 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#018 logmsg2 "******** Begin Step $JSTEP isrsupc (#$XSTEP) ********"
 k#019 ##STEP010 EXEC PGM=ISRSUPC,PARM=(CHNGL,LINECMP,
 k#020 # '';'')
 k#021 export PROGID=isrsupc
 k#022 export PARM="CHNGL,LINECMP,'';''"
 k#023 exportgen0 0 NEWDD data1/gl.account.trans_
 k#024 exportgen0 -1 OLDDD data1/gl.account.trans_
 k#025 exportfile OUTDD $SYOT/${jobid2}_${JSTEP}_OUTDD_$(date +%y%m%d_%H%M%S)
 k#026 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
 k#027 cat > $SYSIN <</*
 k#028 CMPCOLM 1:80
 k#029 DPLINE  'HDR1',1
 k#030 /*
 k#031 logmsg2 "Executing--> uvcopy uvcmp1,fili1=$OLDDD,fili2=$NEWDD,filo3=$OUT..."
 k#032 #3----------------------------------------------------------------------
 k#033 uvcopy uvcmp1,fili1=$OLDDD,fili2=$NEWDD,filo3=$OUTDD,rop=r0,uop=q0s5r80
 k#034 #NB - ISRSUPC conversion sets condition (via cmp below) for following IF
 k#035 #   - uvcopy uvcmp1 above creates SYSOUT/OUTDD report
 k#036 #   - need to modify record size 'r80' in uop=q0s5r80 above
 k#037 #   - any CMPCOLM & DPLINE ignored as of July 2007
 k#038 cmp $OLDDD $NEWDD
 k#039 #4----------------------------------------------------------------------
 k#040 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90));
 k#041 ((JCC|=LCC)); S0010R=1; alias goto="";
 k#042 #if ((S0010C != 0))
 k#043 #   then logmsg2 "ERR: step#$JSTEP isrsupc abterm $SCC"
 k#044 #   alias goto="<<S9900=\A"; fi
 k#045 #goto
 k#046 if ((S0010C == 0)); then #IF STEP010.RC=0 THEN #J001(1)
 k#047 logmsg1 "comparison EQUAL"
 k#048 logmsg1 "enter to continue"
 k#049 read reply
 k#050 else #ELSE #J001(1) #IF STEP010.RC=0 THEN #J001(1)
 k#051 logmsg1 "comparison NOT EQUAL"
 k#052 logmsg1 "enter to continue"
 k#053 read reply
 k#054 fi  #ENDIF #J001(1) #IF STEP010.RC=0 THEN #J001(1)

You might not need to modify the converted JCL/script, if the only purpose was to set the condition code for al following 'IF' statement.

If you want the 'uvcmp' report, you will need to correct the record size option from the default 'r80' (at the end of the 'uvcopy uvcmp1' line above),

'CMPCOLM' & 'DPLINE' are not yet supported as of July 2007.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1L3. Sample Conversion of MVS JCL to Unix/Linux Korn Shell Script

demo ISRSUPC conversion - sample report

After converting the test/demo JCLs, you can run the 'isrsupc1.ksh' demo script as follows & you should get the report listed below:


 isrsupc1.ksh       <-- execute the ISRSUPC test/demo provided
 ============         - output report (in SYSOUT) shown below:
 uvcmp1 - compare 2 files "*" diffs (uops=q1e0p30r256s5t500000v2x0q0s5r80)
 recsize  reccount   file-size  typ  filename sysout/ISRSUPC1/S0010_OUTDD_A
 1:   80        20       1,600  RSF  data1/gl.account.trans_000004
 2:   80        20       1,600  RSF  data1/gl.account.trans_000005
 2007/07/30_08:29:54   1         2         3         4         5         6
 f#rec#byte# 0123456789012345678901234567890123456789012345678901234567890123
 ============================================================================
 1    3    0 00011100T Telephone XX                  000000559Q 1234BC0008820
             3333333352566676666255222222222222222222333333333523333443333333
             000111004045C508FE5088000000000000000000000000559101234230008820
                                 **
          64 40499          ^
             3333322222222220
             404990000000000A
                **
 2    3      00011100T Telephone                     000000559Q 1234BC0008820
             3333333352566676666222222222222222222222333333333523333443333333
             000111004045C508FE5000000000000000000000000000559101234230008820
                                 **
          64 40428          ^
             3333322222222220
             404280000000000A
                **
 2007/07/30_08:29:54   1         2         3         4         5         6
 f#rec#byte# 0123456789012345678901234567890123456789012345678901234567890123
 ============================================================================
 1   18    0 00074100T Bank Fee XX                   0000001099 1234BJ      0
             3333333352466624662552222222222222222222333333333323333442222223
             000741004021EB065508800000000000000000000000001099012342A0000000
                                **                           **
          64 40428          ^
             3333322222222220
             404280000000000A
 2   18      00074100T Bank Fee                      0000001000 1234BJ      0
             3333333352466624662222222222222222222222333333333323333442222223
             000741004021EB065500000000000000000000000000001000012342A0000000
                                **                           **
          64 40428          ^
             3333322222222220
             404280000000000A
 ======================= EOF or stop count reached ==========================
 Total=000020,read=000020,mismatches=000002,stop=000005,term=500000

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1P1. Converting Test/Demo JCL to Unix/Linux scripts

Preparations for JCL test/demo conversions

Here are the preparations required for you to run the conversions for the supplied test/demo JCLs, some of which have been listed previously beginning on page '1C1'. The operating Instructions for your own JCL conversions will be presented later in Part_4. We recommend you perform the following before proceeding.


 #1. Install the Vancouver Utilities as documented in install.htm.

 #2. Download & installed the Korn shell from http://www.kornshell.com
     if not supplied with your system or if it is the old 1988 version (vs 1993).
     We recommend 'bash' for interactive use, but 'ksh' is better for batch
     scripts. The JCLs are converted for the Korn shell (1st line #!/bin/ksh).

 #3. Setup 'appsadm' & modify profiles as documented in Part 1 of ADMjobs.htm.

You must have installed the Vancouver Utilities, you must have the Korn shell, and we highly recommend setting up 'appsadm' & modifying the profiles, as instructed in ADMjobs.htm.

If desired you could delay setting up 'appsadm' & performing the actions in ADMjobs.htm, until you complete the test/demos here in Part 1 (of MVSJCL.doc), and are ready to begin your own conversions in Part_4.

setup 'mvstest' - plan/overview

  1. Setup a user login account for the test/demo. Please make it 'mvstest' so the test/demo conversions will work without having to modify any control files (profile, jobset51, jclunixop5, etc). We recommend the 'bash' shell if available, else specify 'ksh'.

  2. Copy the supplied profile (from /home/uvadm/env/stub_profile) to the unix/linux system profile (/home/mvstest/.bash_profile). See instructions at the beginning of the supplied profile listed at ADMjobs.htm#1C1.

  3. Modify the supplied profile appropriately for your Unix/Linux site. If you have followed the recommendations so far, I think the only changes required (for the test/demos) is to define your laser printer & modify COBDIR (depending on where you installed COBOL).

    alternative - setup demo files in your homedir

If you prefer or if there are multiple programmers at your site who wish to perform these demos, you can setup the 'testlibs' & 'testdata' subdirs in your own homedir & copy the supplied demo files to them.

See alternative setup in your homedir on page '1P4' --->

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1P2. Converting Test/Demo JCL to Unix/Linux scripts

setup 'mvstest' - Op. Instrns

The following instructions presume the 'bash' profile. If you do not have bash, please see the alternatives for 'ksh' in Part 1 of ADMjobs.htm.


 #1. login as 'root'

 #2. groupadd apps        <-- setup group 'apps', if not already setup
     =============            (when uvadm was setup in install.htm)

 #3. useradd -m -g apps -s /bin/bash mvstest  <-- setup 'mvstest' for bash
     =======================================

 #3a. useradd -m -g apps -s /bin/ksh mvstest  <-- alternative for 'ksh'
      ======================================

 #4. passwd mvstest    <-- set password for mvstest
     ==============

 #5. cp -p /home/uvadm/env/stub_profile /home/mvstest/.bash_profile
     ==============================================================
     - copy supplied 'stub' profile to mvstest homedir & rename for bash

 #5a. cp -p /home/uvadm/env/stub_profile /home/mvstest/.profile
      =========================================================
      - alternative if you are using 'ksh' (vs bash)
Note
  • stub profile calls common_profile
  • stored at /home/uvadm/env/... or /home/appsadm/env/...
  • modify the common_profile if not already performed when
    installing Vancouver Utilities or setting up 'appsadm'.

 #6. vi /home/uvadm/common_profile        <-- modify common_profile
     =============================

      export COBDIR=/opt/microfocus/cobol <-- change COBDIR for your site
      ===================================
      export UVLPDEST="-dlp0"             <-- change 'lp0' to your laser printer
      =======================
      export UVLPDEST="-dLPT1"            <-- for Windows SFU
      =======================

 #7. Logout of Root & login as 'mvstest', on the next page --->

You should realize that the above are the minimum setups for mvstest & not the most efficient method if you later proceed to setup your own additional programmers & operators. Setting up 'appsadm' & modifying the profiles as described in Part 1 of ADMjobs.htm is more efficient because you would avoid duplication.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1P3. Converting Test/Demo JCL to Unix/Linux scripts

copy demo files to your mvstest home dir


 #1. login: mvstest --> /home/mvstest
     ================================

 #2. cp -r /home/uvadm/mvstest/* /home/mvstest
     =========================================
     - copy supplied test/demo files from uvadm to mvstest home dir
       /home/mvstest should now contain the subdirs & files listed on page '1A1'.
       The more relevant subdirs for the JCL conversions are:
       ctl, parm0, parms, proc0, procs, jcl0, jcl1, jcl2,& jcl3.
Note
  • Before you begin these procedures, be sure you understand the
    directory structure illustrated on page '1A1'

scripts for your own conversions (vs test/demos)

If you later want to create these subdirs for your own use (without demo files) you can use the the following scripts. You might set them up in your home dir or you might create another user (mvstest2, etc).


 #1. Login as yourself or vsetest2, etc --> homedir

 #2. vsetestdirs   <-- create conversion superdirs (testlibs, testdata, cnvdata)
     ===========

 #3a. cdl --> alias 'cd $RUNLIBS' --> $HOME/testlibs/

 #3b. vselibsdirs  <-- create empty set of testlibs (cbl0,cbl1,etc)
      ===========

 #3c. vsetestlibsinit  <-- clear testlibs subdirs for retesting
      ===============    - cbl1,cbl2,cbls, jcl1,jcl2,jcl3,jcls, etc
                         - not the '0' subdirs or ctl/...

 #4a. cdd --> alias 'cd $RUNDATA' --> $HOME/testdata/

 #4b. vsedatadirs  <-- create empty set of testdata subdirs (ar,gl,jobtmp,etc)
      ===========

 #4c. testdatainit      <-- clear testdata subdirs for retesting
      ============       - jobtmp, joblog, tmp, wrk, rpts, etc
                         - not the master data in ar, gl, mstr, tape, etc

converting your own JCL ? (vs test/demos)

We strongly recommend you 1st work thru these test/demos before trying to convert your own JCL & then to study Part_4 carefully before attempting to convert your own JCL.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1P4. Converting Test/Demo JCL to Unix/Linux scripts

shortcuts to convert your own JCL ? (vs test/demos)

We strongly recommend you 1st work thru these test/demos before trying to convert your own JCL & then to study Part_4 carefully before attempting to convert your own JCL.

BUT see page '1X1', if you need to do a quick preliminary conversion of a few of your JCLs before you invest the time & effort that should be expended when you launch your mainframe conversion project.

Page '1X2' shows you how to use the scripts above & also 'jcl2ksh51A' to perform all steps of JCL conversion.

BUT again, we strongly recommend you first use the step by step method (here in Part 1) to better understand the process.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1P5. Converting Test/Demo JCL to Unix/Linux scripts

alternative - setup demo files in your homedir

The previous pages setup userid 'mvstest' & copied the test/demo files to the mvstest homedir, in preparation for the JCL demo conversions documented on the following pages.

If you prefer or if there are multiple programmers at your site who wish to perform these demos, you can setup the 'testlibs' & 'testdata' subdirs in your own homedir & copy the supplied demo files to them.

If you do not already have a login, see ADMjobs.htm#Part_1 to setup your account & copy the supplied 'stub_profile' to your homedir.

The following assumes you already have a login, but it has not yet been updated with the 'stub_profile' required to perform the JCL conversions.


 #1. Login as youself --> your homedir
     ================

 #2. vi .bash_profile    <-- edit your .bash_profile for Linux bash shell
     ================      - OR .profile for Unix Korn shell

 #2a. G                  <-- Go to the end of your existing profile
      ===

 #2b. :r /home/uvadm/env/stub_profile
      ===============================
      - read supplied stub_profile onto the end of your existing profile

 #3. logout & log back in   <-- to activate the new profile
     ====================

 #4. mkdir testlibs testdata  <-- make subdirs within your homedir
     =======================      to receive the supplied demo files

 #5. cp -r /home/uvadm/mvstest/testlibs/* testlibs
     =============================================
     - copy supplied demo libraries to testlibs/... in your homedir
       (JCL,COBOL,etc)

 #6. cp -r /home/uvadm/mvstest/testdata/* testdata
     =============================================
     - copy supplied demo data-files to testdata/... in your homedir
Note
  • now you are ready to perform the test/demo JCL/COBOL conversions
  • whereever you see a reference to 'mvstest', just THINK your HOMEDIR.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1Q1. Converting Test/Demo JCL to Unix/Linux scripts

JCL conversion overview

These operating instructions will convert all files in a directory, outputting to a 2nd directory. The instructions for all files are actually simpler than for 1 file at a time & almost as fast (especially for the test/demo files). Some instructions such as the PROC expansion only work with all files in the directory.

script to perform all JCL conversion steps

'jcl2ksh51A' will perform all steps of the JCL conversion - the same as the 'step by step' procedures documented on pages 1Q2 thru 1Q5. The script is easier than the step by step method, but you might not gain as much understanding.

You should use the 'step by step' method the 1st time you convert your own JCL (as documented in Part_4), because you will be able to detect & fix problems that may occur in your JCL conversions (vs the proven test/demos here in Part 1).

jcl2ksh51A procedures illustrated

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      manual copy
 proc0 -------> procs     parm0 -------> parms
       cleanup                 cleanup

 #1. jcl2ksh51A all    <-- convert JCL thru all steps, as illustrated above
     =============      - reply null (take default) at all prompts
                        - or reply 'y' for prompts that demand a y/n response

 #2. cp jcl3/* jcls   <-- copy JCL/scripts to jcls (in PATH)
     ==============     - ONLY for the test/demos here in Part 1
                        - since they have already been tested & debugged
Note
  • you should NEVER copy all jcl3/* to jcls for 'your own' JCL conversions
  • you should copy 1 by 1 immediately before you are ready to test/debug
  • BUT, OK for these test/demo conversions
Note
  • also see scripts 'cnvMF51Acpy' & 'cnvMF51A' on pages '1R1' thru 1R4
  • to convert all copybooks & all COBOL programs

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1Q2. Converting Test/Demo JCL to Unix/Linux scripts

step by step JCL conversion

The next few pages document the 'step by step' procedures for JCL conversion (vs the jcl2ksh51A 'script' documented on the previous page).

It is much easier to use the jcl2ksh51A script than the step by step procedures, but you might not get as much understanding from it.

You should use the 'step by step' method the 1st time you convert your own JCL (as documented in Part_4), because you will be able to detect & fix problems that may occur in your JCL conversions (vs the proven test/demos here in Part 1).

step by step JCL conversion procedures

cleanup mainframe JCL, PROCs,& Control Cards

The 1st 3 procedures will cleanup the demo mainframe code, clearing cols 73-80, translating filenames to lower case,& assigning filename extensions (.jcl or .prc or nothing).


 #1a. uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl  <-- cleanup mainframe JCL
      ================================================
      - strip any CR's, clear cols 73-80,& shorten back to last nonblank
      - ensure output filenames are translated to lower case
      - assign filename extension '.jcl'

 #1b. uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.prc  <-- cleanup PROCs
      ===================================================
      - strip any CR's, clear cols 73-80,& shorten back to last nonblank
      - ensure output filenames are translated to lower case
      - assign filename extension '.prc'

 #1c. uvcopyx cleanup parm0 parms uop=q0i7g8n5 <-- control cards & includes
      ========================================
      - strip any CR's, clear cols 73-80,& shorten back to last nonblank
      - ensure output filenames are translated to lower case
      - includes combined with parms (include0/include1 subdirs dropped May2006)
Note
  • the 'cleanup' job has many more options than used here (uop=q0i7g8n1)
  • Please see all options listed on page CNVaids.htm#2D1.
  • You may find other problems in the mainframe files that can be solved
    by using the various options available.

expand PROCs in all JCL


 #2.  jclpx51 jcl1 jcl2 procs parms
      =============================
      - copy all jcl from jcl1 to jcl2, expanding PROCs & including INCLUDEs
      - 'jclpx1' is a script that calls the 'jclproc51' utility for each file
        found in the directory

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1Q3. Converting Test/Demo JCL to Unix/Linux scripts

Creating the DataFile Info control file


 #3.  jcldata51A all  <-- generate datafile info control file for JCL converter
      =============
      - extracts datafilenames from all JCL, sorts, & drops duplicates
      - collects file info (record sizes, file types, key locations/lengths, etc)
      - encoding on keywords (rca=... typ=... key=...) on right side of filename
      - combines with other file info (LISTCAT, Excel spreadsheets, etc)
      - loads Indexed file 'datactl53I' for look up by JCL converter

'jcldata51A' reads all JCL & gathers datafile info for use by the JCL converter. Record sizes, indexed keys, etc are collected onto 1 entry per unique datafilename. See sample ctl/datactl53 listed on page '3F5'.

The Datafile Info control file is vital to conversions of your JCL, but we can delay these considerations until Part_4 where we discuss conversions of 'YOUR' JCL versus the test/demo JCL conversions illustrated here in Part 1.

For the JCL converter test/demos here in Part 1, you can just run 'jcldata51A' to create 'datactl53I' used by the JCL converter. In Part 4, we will explain how you would create datactl53I for your own JCL conversions from up to six sources.

  1. datajcl51/52 - datafile info extracted from all JCL - this is the only mandatory datafile info source - create null files for any files below not available

  2. datacat51/52 - datafile info extracted from LISTCAT (mainframe report) - optional, if absent create null file >ctl/datacat52

  3. dataxl151/52 - datafile info extracted from Excel spreadsheet #1 - optional, if absent create null file >ctl/dataxl152

  4. dataxl251/52 - datafile info extracted from Excel spreadsheet #2 - optional, if absent create null file >ctl/dataxl252

  5. dataedt52 - datafile info created manually with editor - may supply info not available from other 5 sources - optional, if absent create null file >ctl/dataedt52

  6. datacnv51/52 - datafile info created by scanning the EBCDIC datafiles - currently indicates only if packed/binary fields present - optional, if absent create null file >ctl/datacnv52

Note that we have supplied some sample data in most of these files that you can see in /home/uvadm/mvstest/ctl/... or /home/mvstest/testlibs/ctl (if you followed test/demo setup instructions begining on page '1P1'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1Q4. Converting Test/Demo JCL to Unix/Linux scripts

Modifying JCL conversion options - unix/linux

Before you run the actual JCL/script conversion (step #5 on the next page), you may need to modify the options in the control file ctl/jclunixop51. See the sample JCL options control file listed on page '3E1'.

You will not have to modify for these test/demos (here in Part 1), but you may need to modify options for your own JCL conversions (documented in Part 4).

Modifying JCL conversion options - Windows

If you are using Windows SFU, Cygwin, or Uwin, you must change option 'r' in the control file (ctl/jclunixop5), before you run the JCL converter. See the control file listed on page '3E1' further ahead.

You must change option 'r0' to 'r1' on line 1 of ctl/jclunixop5. The control file is supplied with option 'r0' to generate 'cobrun' for MicroFocus COBOL Server Express on Unix/Linux systems. 'r1' will cause the converter to generate 'cobw' which is the equivalent for MicroFocus COBOL Net Express on Windows.


 #4. vi ctl/jclunixop51        <-- edit change only for Windows SFU/Cygwin/Uwin
     ==================

 jclunixop5:d0g10j1n0p0r0u1x0y0  #<-- option defaults for JCL converter
 ======================r1======   <-- change r0 to r1

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1Q5. Converting Test/Demo JCL to Unix/Linux scripts

Convert ALL JCLS in directory


 #5. jclxx51 jcl2 jcl3    <-- convert all JCL in jcl2 to scripts in jcl3
     =================

'jclxx51' is a script that executes the 'jclunix51' conversion program for each file found in input subdir & copy results to output subdir.

jclxx51 requires control files: ctl/jclunixop5, ctl/datactl53I, parms/... The control files may need changes. See discussion on the next page.

Note
  • you will get some errors (intentional)
  • please see the console log & explanation on page '1Q6' ---->

 #6. vi jcl3/*           <-- investigate your results
     =========

Your results should match those listed previously. For example the original JCL for the first demo job (jar100.jcl) is listed on page '1C1', and the expected results (jar100.ksh) are listed on page '1C2'.

Before you can execute the sample jobs, you must convert & compile the COBOL programs as shown begining on page '1R1'. Then see the script executions starting on page '1S1'.

copy converted scripts to execution subdir


 #7. cp jcl3/* jcls      - copy all converted JCL/scripts to subdir jcls
     ==============        (since jcls is in the PATH, but not jcl3)
Note
  • This is done only for the test/demos, You should NEVER do this
    for your conversions, testing,& production because:
  1. If you need to reconvert (after improving tables in jclunixop5), the converter converts all JCL from jcl2 to jcl3 (never to jcls). Then you will manually copy desired jobs from 'jcl3' to 'jcls'.

  2. This protects you from destroying jobs in 'jcls', which may have had considerable effort invested in debugging & manual improvements.

  3. Copying 1 job at a time as we test/debug also provides with a means to track our progress - just listing the contents of jcls shows us the jobs already tested & debugged.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1Q6. Converting Test/Demo JCL to Unix/Linux scripts

JCL Conversion Errors

Here is the console display you should get when you run the jclxx51 script.


 jclxx51 jcl2 jcl3   <-- convert all JCL in jcl2 to Korn shell scripts in jcl3
 =================
 script to convert mainframe JCLs to UNIX scripts
 jclunix51 jcl2/jar100.jcl
 jclunix51 jcl3/jar100.ksh     8 in,   55 out,    0 errs
 jclunix51 jcl2/jar200.jcl
 jclunix51 jcl3/jar200.ksh    16 in,   79 out,    0 errs
 jclunix51 jcl2/jgl100.jcl
 jclunix51 jcl3/jgl100.ksh    12 in,   64 out,    0 errs
 jclunix51 jcl2/jgl200.jcl
 jclunix51 jcl3/jgl200.ksh    20 in,   87 out,    0 errs
 jclunix51 jcl2/jgl300.jcl
 jclunix51 jcl3/jgl300.ksh    14 in,   79 out,    0 errs
 jclunix51 jcl2/jgl320.jcl
 jclunix51 jcl3/jgl320.ksh    17 in,   83 out,    0 errs
 jclunix51 jcl2/jpy200.jcl
 ERR: SYSIN parms/member not found: parms/ppy200s1
 ERR@ in#13 out#43 file: jpy200.jcl
 jclunix51 jcl3/jpy200.ksh    20 in,   88 out,     1 errs
 jclunix51 jcl2/splitsl1.jcl
 jclunix51 jcl3/splitsl1.ksh   21 in,   68 out,    0 errs
 9 IBM MVS JCLs converted from jcl2 to UNIX KORN shell scripts in jcl3

ERR: SYSIN parms/member not found: parms/ppy200s1 ERR@ in#13 out#43 file: jpy200.jcl

This is a common error (missing control card library members for SORT FIELDS, etc). In this case we intentionally caused the error by mismatching the name of the control card member in the parms subdir vs the name coded in the JCL.


 ls -l parms       <-- display control card members
 ============
 -rw-rw-r--    1 poha     users          46 May 11 16:40 pap100s1
 -rw-rw-r--    1 poha     users          34 May 11 16:40 pgl200s1
 -rw-rw-r--    1 mvstest  users          34 May 13 12:49 ppy200s2

 vi jcl2/jpy200.jcl    <-- inspect JCL for SYSIN control card member name
 ==================
 //JPY200   JOB
   - - - many lines omitted - - -
 //SYSIN    DD DSN=PY.CTLCDLIB(PPY200S1)

Note the mismatched names; the JCL calls 'PPY200S1', but the closest member in the library is 'ppy200s2'. If you wish, change the member name to 'ppy200s1' & rerun the 'jclxx51' script. The error should go away.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1Q7. Converting Test/Demo JCL to Unix/Linux scripts

JCL Conversion Error Log

The previous page illustrated the console display created by 'jclxx51'. The JCL converter also creates an error log file in the 'tmp' subdir containing just the error messages & omitting all successful conversions.


 vi tmp/jclunix51.err          <-- inspect JCL conversion Error Log
 ====================

ERR: SYSIN parms/member not found: parms/ppy200s1 ERR@ in#13 out#43 file: jpy200.jcl Errs=1, In=20, Out=88, File=jcl3/jpy200.ksh


 uvlp12 tmp/jclunix51.err      <-- print the JCL conversion Error Log
 ========================

We recommend you print the JCL conversion Error Log to serve as your guide in correcting the JCL conversion problems. Please see later discussions of how best to correct/test/debug your JCL in Part 4 (pages '4M1' to '4M4').

In the early stages of conversion, you should not make any manual corrections, but rather find & correct any common problems that will be eliminated by reconverting. Missing control card library members is such a problem.

Part 4 also shows you how to setup search/replace table entries in the JCL conversion control file (ctl/jclunixop5) to improve re conversions.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1Q8. Converting Test/Demo JCL to Unix/Linux scripts

Convert 1 job at a time

Normally you would use the script method on the previous pages to convert all JCL's in the directory. Converting 1 job at a time might be used to re-convert new jobs brought over from the mainframe. As an example, here are the conversion instructions for demo job 'jgl200'.


 #0.  login: mvstest --> /home/mvstest
      relevant subdirs --> proc0, procs, jcl0, jcl1, jcl2, jcl3, jcls.

 #1a. uvcopy cleanup,fili1=jcl0/JGL200.jcl,filo1=jcl1/jgl200.jcl,uop=g8n1
      ===================================================================
      - cleanup mainframe JCL
      - strip CR's, clear cols 73-80,& shorten back to last nonblank
      - output filenames are lower case & have extension '.jcl' added.

 #1b. uvcopy cleanup,fili1=proc0/PGL200,filo1=procs/pgl200.prc,uop=g8n1
      ==================================================================
      - cleanup PROCs
      - strip CR's, clear cols 73-80,& shorten back to last nonblank

 #1c. uvcopy cleanup,fili1=parm0/PGL200S1,filo1=parms/pgl200s1,uop=g8n1
      =================================================================
      - cleanup Control Card library modules (SORT FIELDS, etc)
      - strip CR's, clear cols 73-80,& shorten to last nonblank
Note
  • might also need to run cleanup on any 'INCLUDE' modules
  • but there are no INCLUDE modules in our demo job jgl200.jcl

 #2.  jclproc51 jcl1/jgl200.jcl jcl2/jgl200.jcl procs parms
      =====================================================
      - expand PROCs & INCLUDEs as we copy jcl from subdir jcl1 to subdir jcl2

 #3. Note that you must run the 'convert all files in directory' procedures
     first, before you can convert 1 JCL at a time, because the converter
     needs the data info control file (to get recsizes, keys, ID GDG files, etc)
     See the procedures to generate 'ctl/datactl53I' on page '1Q3'.
     Those procedures process the entire directory (not just 1 jcl).

 #4. jclunix51 jcl2/jgl200.jcl jcl3/jgl200.ksh  <-- convert 1 JCL (jgl200)
     =========================================
     - using jgl200 as an example of converting 1 jcl at a time:

 #5. cp jcl3/jgl200.ksh jcls  <-- copy converted script to test/production lib
     =======================      before any changes, testing, debugging

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1Q9. Converting Test/Demo JCL to Unix/Linux scripts

scripts to convert JCL

JCL conversion scripts are listed in Part_9:


9A1. jcl2ksh51 - convert 1 MVS JCL thru all stages
- cleanup, PROC/INCLUDE expansion, JCL conversion, copy to jcls
- jcl0 ---> jcl1 ---> jcl2 ---> jcl3 ---> jcls

9A2. jcl2ksh51A - convert all JCL from jcl0 thru jcl3

Note that it is much more efficient to convert all JCL's in the directory as documented previously on pages '1Q1' thru '1Q6', or with the 'jcl2ksh51A' script. Script 'jcl2ksh51' would be most useful for JCL's subsequently transferred due to changes on the mainframe.

This assumes that all PROCs & control card library members are already present in procs & parms.

jcl2ksh51A includes the following scripts which might be used separately in some circumstances. If you modify the JCL options control file, you would only need to rerun 'jclxx51' to reconvert jcl2/* to jcl3 (vs jcl2ksh51A).


9A3. jcldata51A - create ctl/datactl53I control file to supply recsizes,
key loc/lth, ID GDGs, etc

9A4. jclpx51 - expand PROCs & INCLUDEs while copying JCL from jcl1 to jcl2

9A5. jclxx51 - convert all JCLs from jcl2 --> jcl3

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1R1. Converting Test/Demo JCL to Unix/Linux scripts

Converting Mainframe COBOL to Unix/Linux

We have just converted our demo JCL to Korn shell scripts, and we would now like to execute the scripts and show you the results (console displays).

But, we must also have converted & compiled the demo COBOL programs called by the JCL. COBOL conversion & compile is documented in MVSCOBOL.htm, but in case you have skipped directly to this JCL conversion (MVSJCL.doc), we will briefly repeat the COBOL conversion & compile instructions here. You must of course have MicroFocus COBOL installed to compile & execute the COBOL programs, but if you do not, you can still do everything except the 'mfcblA' compiles (#5 on page '1R3'). You can even execute the 'jar200.ksh' demo job. The 1st step will work since it is a SORT.

script to perform all COBOL conversion steps

'cnvMF51Acpy' will perform all steps of the copybook conversion & 'cnvMF51A' will perform all steps of the COBOL program conversion - the same as the 'step by step' procedures documented on pages 1R2 thru 1R5. The script is easier than the step by step method, but you might not gain as much understanding.

You should use the 'step by step' method the 1st time you convert your own COBOL (as documented in Part_4), because you will be able to detect & fix problems that may occur in your COBOL conversions (vs the proven test/demos here in Part 1).

converting All Copybooks & COBOL programs

 cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys
       cleanup         convert         copy(cp)
 cbl0-------->cbl1-------->cbl2------->cbl3------->cbl4------->cbls-------->cblx
      cleanup      convert      sysin1     sysout1       copy       compile
                               |--------optional-------|

 #1. cnvMF51Acpy all <-- convert copybooks thru all steps, as illustrated above
     ============   - reply null (take defaults) or reply 'y' if y/n demanded

 #2. cnvMF51A all  <-- convert COBOL programs thru all steps, as illustrated above
     ===========    - reply null (take defaults) or reply 'y' if y/n demanded
                    - 1 exception, reply 'n' when asked to run 'cobfil55'

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1R2. Converting Test/Demo JCL to Unix/Linux scripts

step by step procedures for COBOL conversion

Converting Mainframe COBOL CopyBooks to Unix/Linux

First we will convert the CopyBooks, then the COBOL Programs (on the next page). Our test/demo mainframe copybooks are stored in subdir 'cpy0'. We recommend the following procedure:

 cpy0--------->cpy1---------->cpy2------->cpys
      cleanup       convert        copy

 #1. Cleanup copybooks from mainframe (may have extraneous CR's from FTP)
     - remove CR's, clear cols 1-6 & 73-80, translate to lower (not in quotes)
     - shorten text back to last non-blank, ensure output filenames in lowercase
     - cpy0 filenames UPPER case indicates mainframe,
       but all subsequent subdirs must have filenames in lowercase

 #1. uvcopyx cleanup cpy0 cpy1 uop=q0i7c5e15g8j1k1l1n1s8t1,arg1=.cpy
     ===============================================================
Note
  • See page CNVaids.htm#2D1 for an explanation of options coded above.
  • You only need 's8g8n1' for these demo copybooks.

 #2.  uvcopy cnvMF5,fild1=cpy1,fild2=cpy2,fili3=ctl/cnvcob5.tbl,uop=q0i7m2
      ====================================================================
            - convert COBOL CopyBooks for Unix/Linux MicroFocus compiler

 #3.  cp cpy2/* cpys        - copy converted copybooks to standard library
      ==============
Note
  • For the demo copybooks, only the 1st step above is required so we could
    skip steps 2 & 3 and simply copy cpy1 to cpys.

       cp cpy1/* cpys       <-- alternative to steps #2a, #2b,& #3
       ==============

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1R3. Converting Test/Demo JCL to Unix/Linux scripts

Converting Mainframe COBOL to Unix/Linux Micro Focus COBOL

These instructions will convert & compile ALL programs in the directory. Three demo programs (CAP100, CAR100,& CGL100) are supplied in subdir cbl0. The conversions & compile progress thru several subdirs as follows:

 cbl0-------->cbl1-------->cbl2------->cbl3------->cbl4------->cbls-------->cblx
      cleanup      convert      sysin1     sysout1       copy       compile
                               |--------optional-------|

 #1. Cleanup copybooks from mainframe (may have extraneous CR's from FTP)
     - remove CR's, clear cols 1-6 & 73-80, translate to lower (not in quotes)
     - shorten text back to last non-blank, ensure output filenames in lowercase
     - cpy0 filenames UPPER case indicates mainframe,
       but all subsequent subdirs must have filenames in lowercase

 #1. uvcopyx cleanup cbl0 cbl1 uop=q0i7c5e15g8j1k1l1n1s8t1,arg1=.cbl
     ===============================================================

 #2. uvcopy cnvMF5,fild1=cbl1,fild2=cbl2,fili3=ctl/cnvcob5.tbl,uop=q0i7m1
     ====================================================================
            - convert COBOL programs for Unix/Linux Micro Focus compiler
            - for demo programs, only important change is to add 'external'
              onto the file assignments.

Optional sysin1 & sysout1


 #3.  uvcopyx sysin1 cbl2 cbl3 uop=q0i7    <-- optional, see NOTE below
      =================================
            - convert ACCEPT's from control streams to READ's from a file

 #4.  uvcopyx sysout1 cbl3 cbl4 uop=q0i7   <-- optional, see NOTE below
      ==================================
            - convert DISPLAY's upon SYSOUT to WRITE's to a file

Note re sysin1 & sysout1 above

You will NOT need to do #3 & #4 above if you have MicroFocus COBOL which has options INDD & OUTDD to cause 'ACCEPTs from SYSIN' & 'DISPLAYs upon SYSOUT' to use external files defined by exports for SYSIN & SYSOUT. Please see the options file ctl/cobdirectives & a test/demo program & JCL in MVSCOBOL.htm begining on page 2G1.

For customers that do not have MicroFocus COBOL, the Vancouver Utilities includes uvcopy utility jobs 'sysin1' & 'sysout1' which will insert file definitions into the COBOL source programs.

sysin1 will convert 'accepts from sysin' to 'reads' from a real file with external name SYSIN. sysout1 will convert 'displays upon sysout' to 'writes' to a real file with external name SYSOUT.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1R4. Converting Test/Demo JCL to Unix/Linux scripts

copy converted programs to compile library


 #5. cp cbl2/* cbls   - copy converted programs to standard source library
     ==============     expected by the compile script (mfcblA)

 #5a. cp cbl3/* cbls  - copy from cbl3/* for optional conversion
      ==============    accept/SYSIN to read from file

 #5b. cp cbl4/* cbls  - copy from cbl4/* for optional conversion
      ==============    display on SYSOUT to write to a file

 #6. mfcblA all       - compile all programs for unix/linux
     ==========         (input source from cbls & output .int/.idy to cblx)

compiling COBOL programs on Unix/Linux

mfcblA started 050320:1514

#compile #1 - car100.cbl start compile of: car120.cbl

#compile #2 - car120.cbl start compile of: car130.cbl

   - - - etc, 8 clean compiles & 1 Intentional Failure - - -
 #compile #9 - cpy100.cbl
 *                  copy "paymas.cpy".
 *   8-S*****************************                                   (   0)**
 **    Unknown COPY file paymas.cpy specified
 * 256-S***********                                                     (   1)**
 **    Preceding record has zero length
     18 fd  nalist record contains 120 characters.
 * 205-S**                                                              (   1)**
 **    RECORD missing or has zero size
 #compile #9 - cpy100.cbl - *FAILED*
 *** 1 compiles failed, of 9 attempts of 9 total ***
 programs compiled from cbls to cblx
 compile options file=/home/mvstest/ctl/cobdirectives
 mfcblA started 050320:1514, ended 050320:1514

Print Compile Error Reports


 #7. uvlpd1p cblx .err      <-- print 1st page of compile failure reports
     =================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1R5. Converting Test/Demo JCL to Unix/Linux scripts

Note re MicroFocus COBOL

You must of course have MicroFocus COBOL installed to compile & execute the COBOL programs, but if you do not, you can still do everything except the 'mfcblA' compiles above. You can even execute the 'jar200.ksh' demo job. The 1st step will work since it is a SORT, before bombing out on step 2.

For the 'mfcblA' COBOL compiles to work, you will probably have to modify the COBDIR definition in the common_profile, depending on where COBOL is installed at your site. The supplied profile (listed at ADMjobs.htm#1C2) defines COBDIR as follows:


 export COBDIR=/opt/microfocus/cobol     <-- COBDIR install default
 ===================================

compiling under SFU/UWIN/CYGWIN on Windows


 #6a. mfnxcblA all   - compile all programs to .int/.idy for SFU/UWIN/CYGWIN
     =============     (input source from cbls & output .int/.idy to cblx)

 #6b. mfnxcblB all   - compile all programs to executables for SFU/UWIN/CYGWIN
     =============     (input source from cbls & output .exe's to cblx)

COBOL compile scripts are different since the MicroFocus COBOL compiler is different (Server Express for Unix/Linux vs Net Express for Windows). The script to compile 1 program at a time is 'mfcbl1' for unix/linux, and 'mfnxcbl1' for SFU/UWIN/CYGWIN (or 'mfnxcbl2' to compile to executables). See listings at MVSCOBOL.htm#5E0.

COBOL compile console logs

 mfnxcblA started 040609:1549
 MicroFocus Net Express V4
 Version 4.0.38 Copyright (C) 1984-2003 MicroFocus International Ltd.
 * Checking complete with no errors - starting code generation
 * Generating car100
 * Data:        2000     Code:        1424     Literals:         484
 #compile #1 - car100.cbl
   - - - etc, 8 clean compiles & 1 Intentional Failure - - -

9 programs compiled from cbls to cblx 1 compiles failed, of 9 attempts mfnxcblA started 040609:1549, ended 040609:1549

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1S1. Executing the Test/Demo JCL/scripts

Operating Instructions to Execute the Test/Demo JCL/scripts

Now we are ready to execute the demo JCL/scripts. Note that RUNLIBS & RUNDATA (vital environmental variables in the profile) control which libraries are searched & which data directories will be accessed. The following illustrates only the subdirs that are actually required for the demo JCL/script execution and omits the various conversion subdirs illustrated previously.

export RUNLIBS=/home/mvstest/testlibs

 /home/mvstest
 :-----testlibs        <-- $RUNLIBS
 :     :-----cblx        - compiled COBOL programs (.int's)
 :     :-----jcls        - copy here manually 1 by 1 during test/debug

export RUNDATA=/home/mvstest/testdata

 /home/mvstest
 :-----testdata        <-- $RUNDATA
 :     :-----ap          - Accounts Payable
 :     :-----ar          - Accounts Receivable
 :     :-----gl          - General Ledger
 :     :-----ctl         - GDG control file
 :     :-----jobctl      - for jobstop stop at begin each step for debug
 :     :-----jobtmp      - temp files for SYSIN instream data
 :     :-----jobmsgs     - job progress msgs (step begin, end Normal/AbTerm)
 :     :-----sysout      - SYSOUT printer files
 :     :-----tmp         - tmp subdir for uvsort
 :     :-----wrk         - interstep temporary work files

Executing the test/demo JCL/scripts

The pages ahead will present the commands to execute the following JCL/scripts:

jar100.ksh
  • simple 1 step COBOL (no PROCs, no GDG files, no instream data)
jar200.ksh
  • 2 steps (SORT+COBOL), uses instream data for SORT FIELDS
jgl100.ksh
  • 1 step COBOL, demos: PROCS & GDG files
jgl200.ksh
  • 2 steps (SORT+COBOL), demos control card member for SORT FIELDS
jgl300.ksh
  • demos conversion of IEBGENER & IDCAMS to 'uvcp' & 'cp'
  • demonstrates CONDition codes
jgl320.ksh
  • same as jgl300, but also demos IF, THEN, ENDIF

After each execute command, we will illustrate the console display expected. Please confirm that you get the same results.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1S2. Executing the Test/Demo JCL/scripts

BEFORE attempting to Test/Debug YOUR JCL/scripts

Before you begin to test/debug, I strongly recommend that you study XREFjobs.htm & run the test/demo Inventory Listings, Cross-References, COBOL File Info reports,& JCL Job-Flow reports.

This would be vital if you were about to start testing & debugging your own JCL & COBOL programs. For these demos it would not matter whether you studied & ran them BEFORE or AFTER you execute the supplied JCL & COBOL programs. But, please be sure to run these reports for your own JCL & COBOL programs BEFORE you begin your own testing & debugging.

Here is a summary of the types of reports documented in XREFjobs.htm.


 #1. Inventory lists & counts of all filenames in all directories of relevance.
     ==========================================================================

 #2. Contents listings of JCLs, scripts, control-cards,& copybook maps.
     ==================================================================

 #3. Cross-References of COBOL programs & JCL/scripts.
     =================================================
     - copybooks vs programs, datafiles vs Jobnames, Programs vs Jobnames

 #4. COBOL File Information reports (1 line per datafile)
     ====================================================
     - externalname, Org & Access, Open mode, record-size, copybook, internalname

 #5. JobFlow reports - combine file info from the JCL with the COBOL info above
     ==========================================================================
     - step#, programname, DDname, COBOL info(above), DSNname

These will be explained in more detail in XREFjobs.htm with Operating Instructions to generate them using the test/demo files supplied. You will also need to have an organized way of housing them for easy access when required.

Three Ring Binders with Index Tabs

Before you start your conversion, be sure to obtain a good supply of 3-hole pre-punched paper, 3 ring binders & index tabs. The 3 ring binders should have the clear plastic pockets on the spines & covers so you can insert content identifications. The index tabs should be the 'Avery worksaver BIG TAB insertable dividers'.

Keeping your listings in 3 ring binders with Tabs to identify contents is far superior to the alternative (piles of loose paper all over the place). Note that the listings (of JCL, scripts, copybooks, etc) will appear in alphabetical sequence since unix maintains alpha sequence within directories.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1S3. Executing the Test/Demo JCL/scripts

Execute demo scripts & observe console displays


 jar100.ksh        <-- execute test/demo JCL/script 'jar100'
 ==========
 151027:145710:jar100: Begin Job=jar100
 151027:145710:jar100: /home/mvstest/testlibs/jcls/jar100.ksh
 151027:145710:jar100: Arguments: jar100.ksh
 151027:145710:jar100: ProcessID=20307
 151027:145710:jar100: RUNDATE=20151027
 151027:145710:jar100: RUNLIBS=/home/mvstest/testlibs
 151027:145710:jar100: RUNDATA=/home/mvstest/testdata
 151027:145710:jar100: JTMP=jobtmp/jar100
 151027:145710:jar100: SYOT=sysout/JAR100
 151027:145710:jar100: LOGNAME=mvstest TESTPROD=T000
 151027:145710:jar100: HOSTNAME=uvsoft5.uvsoftware.ca
 151027:145710:jar100: ******** Begin Step S0010 car100 (#1) ********
 151027:145710:jar100: file: CUSTMAS=data1/ar.customer.master fsize=8K
 151027:145710:jar100: file: NALIST=data1/ar.customer.nameadrs.list100 fsize=4K
 151027:145710:jar100: file: SYSOUT=sysout/JAR100/jar100_S0010_SYSOUT_151027_145710 fsize=0K
 151027:145710:jar100: Executing--> cobrun -F /home/mvstest/testlibs/cblx/car100
 151027:145710:JAR100: StepTimes: S0010 car100 Begun=14:57:10 End=14:57:10 Elapsed=00:00:00
 151027:145710:JAR100: Job Times: Begun=14:57:10 NormalEnd=14:57:10 Elapsed=00:00:00
 151027:145710:jar100: JobEnd=Normal, JCC=0, StepsExecuted=1, LastStep=S0010

Notes re Console Displays

  1. Please see the JCL/scripts (previously listed beginning on page '1C1'), if you wish to relate the console displays to the originating lines in the converted scripts.

  2. Values of $RUNLIBS & $RUNDATA are displayed at 'JOB begin', to avoid any possible confusion between test libs/data & production libs/data.

  3. 'begin step' messages identify the step# & program executed.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1S4. Executing the Test/Demo JCL/scripts


 jar200.ksh        <-- execute JCL/script 'jar200'
 ==========
 151027:145717:jar200: Begin Job=jar200
 151027:145717:jar200: /home/mvstest/testlibs/jcls/jar200.ksh
 151027:145717:jar200: Arguments: jar200.ksh
 151027:145717:jar200: ProcessID=20371
 151027:145717:jar200: RUNDATE=20151027
 151027:145717:jar200: RUNLIBS=/home/mvstest/testlibs
 151027:145717:jar200: RUNDATA=/home/mvstest/testdata
 151027:145717:jar200: JTMP=jobtmp/jar200
 151027:145717:jar200: SYOT=sysout/JAR200
 151027:145717:jar200: LOGNAME=mvstest TESTPROD=T000
 151027:145717:jar200: HOSTNAME=uvsoft5.uvsoftware.ca
 151027:145717:jar200: ******** Begin Step S0010 sort (#1) ********
 151027:145717:jar200: file: SORTIN=data1/ar.sales.items fsize=4K
 151027:145717:jar200: file: SORTOUT=jobtmp/jar200/t_tempsls fsize=0K
 151027:145717:jar200: file: SYSIN=jobtmp/jar200/S0010_sort_SYSIN fsize=0K
 151027:145717:jar200: Executing--> uvsort "fili1=data1/ar.sales.items,typ=RSF,rcs=64,filo1=...
 151027:145717:JAR200: uvsort fili1=data1/ar.sales.items,filo1=jobtmp/jar200/t_tempsls
 151027:145717:JAR200: EOF fili01 20 rds, 1280 size; data1/ar.sales.items
 151027:145717:JAR200: sort phase complete, used 512 megabytes, sort output begin
 151027:145717:JAR200: EOF filo01 16 wrts, 1024 size; jobtmp/jar200/t_tempsls
 151027:145717:JAR200: StepTimes: S0010 sort Begun=14:57:17 End=14:57:17 Elapsed=00:00:00
 151027:145717:jar200: ******** Begin Step S0020 car200 (#2) ********
 151027:145717:jar200: file: SALEDTL=jobtmp/jar200/t_tempsls fsize=4K
 151027:145717:jar200: file: CUSTMAS=data1/ar.customer.master.indexed fsize=12K
 151027:145717:jar200: file: SALELST=data1/ar.sales.list fsize=4K
 151027:145717:jar200: Executing--> cobrun -F /home/mvstest/testlibs/cblx/car200
 151027:145717:JAR200: StepTimes: S0020 car200 Begun=14:57:17 End=14:57:17 Elapsed=00:00:00
 151027:145717:JAR200: Job Times: Begun=14:57:17 NormalEnd=14:57:17 Elapsed=00:00:00
 151027:145717:jar200: JobEnd=Normal, JCC=0, StepsExecuted=2, LastStep=S0020

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1S5. Executing the Test/Demo JCL/scripts


 jgl100.ksh        <-- execute JCL/script 'jgl100'
 ==========
 151027:145729:jgl100: Begin Job=jgl100
 151027:145729:jgl100: /home/mvstest/testlibs/jcls/jgl100.ksh
 151027:145729:jgl100: Arguments: jgl100.ksh
 151027:145729:jgl100: ProcessID=20446
 151027:145729:jgl100: RUNDATE=20151027
 151027:145729:jgl100: RUNLIBS=/home/mvstest/testlibs
 151027:145729:jgl100: RUNDATA=/home/mvstest/testdata
 151027:145729:jgl100: JTMP=jobtmp/jgl100
 151027:145729:jgl100: SYOT=sysout/JGL100
 151027:145729:jgl100: LOGNAME=mvstest TESTPROD=T000
 151027:145729:jgl100: HOSTNAME=uvsoft5.uvsoftware.ca
 151027:145729:jgl100: ******** Begin Step S0010 cgl100 (#1) ********
 151027:145729:jgl100: gen0 ACCTMAS=data1/gl.account.master_000004 insize=16K
 151027:145729:jgl100: gen+1 ACTLIST=/home/mvstest/testdata/data1/gl.account.acntlist_ gens=7
 151027:145729:jgl100: file: SYSOUT=sysout/JGL100/jgl100_S0010_SYSOUT_151027_145729 fsize=0K
 151027:145729:jgl100: Executing--> cobrun -F /home/mvstest/testlibs/cblx/cgl100
 151027:145729:jgl100: moving /home/mvstest/testdata/jobtmp/jgl100/GDG/files back to intended directories
 /home/mvstest/testdata/data1/gl.account.acntlist_000005
 151027:145729:JGL100: StepTimes: S0010 cgl100 Begun=14:57:29 End=14:57:29 Elapsed=00:00:00
 151027:145729:JGL100: Job Times: Begun=14:57:29 NormalEnd=14:57:29 Elapsed=00:00:00
 151027:145729:jgl100: JobEnd=Normal, JCC=0, StepsExecuted=1, LastStep=S0010

Generation files in jgl100 & jgl200

  1. Non-GDG files are displayed, prefixed by 'file:' (jar100/200 on prior page). These displays are created by the 'exportfile' function. Note the calls to exportfile in scripts jar100/jar200 previously listed on page '1C2' & '1D2'. See the exportfile function listed later on page '3C1'.

  2. GDG files are displayed, prefixed by 'gen0:' or 'gen+1:' (jgl100/200 above). These displays are created by functions 'exportgen0' & 'exportgen1'. Note the calls to exportgen0/exportgen1 in scripts jgl100/jgl200 listed previously on pages '1E3' & '1F3'. See these functions listed later on beginning on page '5J1'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1S6. Executing the Test/Demo JCL/scripts


 jgl200.ksh        <-- execute JCL/script 'jgl200'
 ==========
 151027:145736:jgl200: Begin Job=jgl200
 151027:145736:jgl200: /home/mvstest/testlibs/jcls/jgl200.ksh
 151027:145736:jgl200: Arguments: jgl200.ksh
 151027:145736:jgl200: ProcessID=20534
 151027:145736:jgl200: RUNDATE=20151027
 151027:145736:jgl200: RUNLIBS=/home/mvstest/testlibs
 151027:145736:jgl200: RUNDATA=/home/mvstest/testdata
 151027:145736:jgl200: JTMP=jobtmp/jgl200
 151027:145736:jgl200: SYOT=sysout/JGL200
 151027:145736:jgl200: LOGNAME=mvstest TESTPROD=T000
 151027:145736:jgl200: HOSTNAME=uvsoft5.uvsoftware.ca
 151027:145736:jgl200: ******** Begin Step S0010 sort (#1) ********
 151027:145736:jgl200: file: SORTIN=data1/gl.account.tran1 fsize=4K
 151027:145736:jgl200: gen+1 SORTOUT=/home/mvstest/testdata/data1/gl.account.trans_ gens=7
 151027:145736:jgl200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 fsize=4K
 151027:145736:jgl200: Executing--> uvsort "fili1=data1/gl.account.tran1,typ=RSF,rcs=80,filo1=...
 151027:145736:JGL200: uvsort fili1=data1/gl.account.tran1,filo1=jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans
 151027:145736:JGL200: EOF fili01 20 rds, 1600 size; data1/gl.account.tran1
 151027:145736:JGL200: sort phase complete, used 512 megabytes, sort output begin
 151027:145736:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans_000005
 151027:145736:JGL200: StepTimes: S0010 sort Begun=14:57:36 End=14:57:36 Elapsed=00:00:00
 151027:145736:jgl200: ******** Begin Step S0020 cgl200 (#2) ********
 151027:145736:jgl200: gen+1 GLTRANS=/home/mvstest/testdata/data1/gl.account.trans_ gens=7
 151027:145736:jgl200: gen0 GLMSOLD=data1/gl.account.master_000004 insize=16K
 151027:145736:jgl200: gen+1 GLMSNEW=/home/mvstest/testdata/data1/gl.account.master_ gens=7
 151027:145736:jgl200: Executing--> cobrun -F /home/mvstest/testlibs/cblx/cgl200
 151027:145736:jgl200: moving /home/mvstest/testdata/jobtmp/jgl200/GDG/files back to intended directories
 /home/mvstest/testdata/data1/gl.account.master_000005
 /home/mvstest/testdata/data1/gl.account.trans_000005
 151027:145736:JGL200: StepTimes: S0020 cgl200 Begun=14:57:36 End=14:57:36 Elapsed=00:00:00
 151027:145736:JGL200: Job Times: Begun=14:57:36 NormalEnd=14:57:36 Elapsed=00:00:00
 151027:145736:jgl200: JobEnd=Normal, JCC=0, StepsExecuted=2, LastStep=S0020

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1S7. Executing the Test/Demo JCL/scripts


 jgl320.ksh        <-- execute JCL/script 'jgl320'
 ==========
 151027:145744:jgl320: Begin Job=jgl320
 151027:145744:jgl320: /home/mvstest/testlibs/jcls/jgl320.ksh
 151027:145744:jgl320: Arguments: jgl320.ksh
 151027:145744:jgl320: ProcessID=20645
 151027:145744:jgl320: RUNDATE=20151027
 151027:145744:jgl320: RUNLIBS=/home/mvstest/testlibs
 151027:145744:jgl320: RUNDATA=/home/mvstest/testdata
 151027:145744:jgl320: JTMP=jobtmp/jgl320
 151027:145744:jgl320: SYOT=sysout/JGL320
 151027:145744:jgl320: LOGNAME=mvstest TESTPROD=T000
 151027:145744:jgl320: HOSTNAME=uvsoft5.uvsoftware.ca
 151027:145744:jgl320: ******** Begin Step S0010 iebgener (#1) ********
 151027:145744:jgl320: gen0 SYSUT1=data1/gl.account.master_000005 insize=16K
 151027:145744:jgl320: file: SYSUT2=jobtmp/jgl320/t_tempglm fsize=0K
 151027:145744:jgl320: Executing--> uvcp "fili1=data1/gl.account.master_000005,typ=RSF,rcs=128,filo1=jobtmp/jgl320/t_tempglm...
 151027:145744:JGL320: uvcp fili1=data1/gl.account.master_000005,filo1=jobtmp/jgl320/t_tempglm
 151027:145744:JGL320: EOF fili01 109 rds, 13952 size; data1/gl.account.master_000005
 151027:145744:JGL320: EOF filo01 109 wrts, 13952 size; jobtmp/jgl320/t_tempglm
 151027:145744:JGL320: StepTimes: S0010 iebgener Begun=14:57:44 End=14:57:44 Elapsed=00:00:00
 151027:145744:jgl320: ******** Begin Step S0020 idcams (#2) ********
 151027:145744:jgl320: file: TEMPGLM=jobtmp/jgl320/t_tempglm fsize=16K
 151027:145744:jgl320: gen+1 ACNTMAS=/home/mvstest/testdata/data1/gl.account.master_ gens=7
 151027:145744:jgl320: file: SYSIN=jobtmp/jgl320/S0020_idcams_SYSIN fsize=0K
 151027:145744:jgl320: Executing--> uvcp "fili1=jobtmp/jgl320/t_tempglm,typ=RSF,rcs=80,filo1=...
 151027:145744:JGL320: uvcp fili1=jobtmp/jgl320/t_tempglm,filo1=jobtmp/jgl320/GDG/@home@mvstest@testdata@data1@gl.account.master
 151027:145744:JGL320: EOF fili01 175 rds, 13952 size; jobtmp/jgl320/t_tempglm
 151027:145744:JGL320: EOF filo01 175 wrts, 22400 size; jobtmp/jgl320/GDG/@home@mvstest@testdata@data1@gl.account.master_000006
 151027:145744:jgl320: moving /home/mvstest/testdata/jobtmp/jgl320/GDG/files back to intended directories
 /home/mvstest/testdata/data1/gl.account.master_000006
 151027:145744:JGL320: StepTimes: S0020 idcams Begun=14:57:44 End=14:57:44 Elapsed=00:00:00
 151027:145744:JGL320: Job Times: Begun=14:57:44 NormalEnd=14:57:44 Elapsed=00:00:00
 151027:145744:jgl320: JobEnd=Normal, JCC=90, StepsExecuted=2, LastStep=S0020

jgl300 & jgl320 are intended to demonstrate CONDition (Return Code) testing. You could create a failure in step#1 & observe that step#2 would be inhibited. An easy way to cause step#1 to fail is to change the input data filename or to change the filename definition in the script.

jgl300 & jgl320 are almost the same (see listings on pages '1G2' & '1G4'). The difference is that jgl320 illustrates IF/THEN/ENDIF in addition to the CONDition codes (see notes with previous listings).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1T1. Checking Test/Demo Output Results

Checking Test/Demo Results

On the previous few pages, we executed the converted jcl/scripts & observed the console displays. The next few pages will illustrate the data inputs & the expected report outputs.

First we will review the directories directly involved in the execution of the jcl/scripts. Compared to the complete list on page '1A2', you will notice we have omitted several other directories not required for execution (original source JCL/COBOL & various subdirs required for conversion)

We have coded the datafiles with '--I--' to identify a supplied test data file or '--O--' to identify a file created during our test/demo executions (output reports, sort work files, etc).

subdirs & I/O files used in execution

 /home/mvstest
 :-----testlibs            <-- super directory for test libs subdirs
 :     :-----cblx          <-- executable (compiled) COBOL programs
 :     :-----jcls          <-- JCLs converted to Korn shell scripts
 :-----testdata            <-- super directory for test/data subdirs & files
 :     :-----ar
 :     :     :--I--customer.master
 :     :     :--O--customer.namelist     <-- report created by jar100.ksh
 :     :     :--I--sales.items
 :     :-----data1
 :     :     :--O--gl.account.acntlist      <-- report created by jgl100.ksh
 :     :     :--I--gl.account.master_000001
 :     :     :--I--gl.account.master_000002
 :     :     :--I--gl.account.master_000003
 :     :     :--O--gl.account.master_000004 <-- updated master from jgl200.ksh
 :     :     :--O--gl.account.master_000005 <-- new generation from jcl300.ksh
 :     :     :--O--gl.account.master_000006 <-- new generation from jcl320.ksh
 :     :     :--I--gl.account.trans
 :     :-----jobtmp                      <-- temp files for SYSIN instream data
 :     :     :--O--JAR200_1_sort_SYSIN   <-- instream data stored by jar200.ksh
 :     :     :--O--JGL200_1_sort_SYSIN   <-- instream data stored by jgl200.ksh
 :     :-----sysout
 :     :     :-----040429                <-- subdir for today's SYSOUT files
 :     :     :     :-----SYSOUT.files... <-- no SYSOUTs created in these tests
 :     :-----tmp                         <-- temp files for uvsort & misc use
 :     :-----wrk
 :     :     :--O--JAR200_tempsls        <-- sorted sales.items from jar200.ksh
 :     :     :--O--JGL200_tempglt        <-- sorted GLtransctns from jgl200.ksh
 :     :     :--O--JGL300_tempglm        <-- copy out backup from jgl300.ksh
 :     :     :--O--JGL320_tempglm        <-- copy out backup from jgl320.ksh

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1T2. Checking Test/Demo Output Results

Check I/O for jar100.ksh


 #1. cd testdata      <-- change into testdata super-directory
     ===========

 #1a. cdd             <-- shorter alias, very handy for production data
      ===               - usually in separate filesystem with long pathnames

 #2. uvhd data1/ar.customer.master r256 <-- investigate input to jar100.ksh
     =================================   - 1st record shown below
                                         - cant use uvhd due to packed & no LFs
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANA
             3333332222454545444244545524542222233332445442544422222222224444
             130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1
          64 IMO          BC V9S1H1    250-754-5531 LARRY WRENCH     ..4V|...
             4442222222222442535343222233323332333324455525544442222201357000
             9DF00000000002306931810000250D754D55310C12290725E38000000246C000
         128 .........W0....`........)X}..f3.....\.................4V}...f...
             0000000005300016000000002570063100095000000000000000013570016000
             0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00
         192 ...............................f.....<........f.C 19950531
             0000008900000000880000000018000680001300000000694233333333222222
             00C0026C0000C0023C0000C0083C0056D0012C0000C0016D3019950531000000
 rec#=1 rcount=32 rsize=256 fsize=8192 data1/ar.customer.master
 null=next,r#=rec,s=search,u=update,p=print,i=iprint,w=write,t=tally,c=checkseq
 ,R#=Recsize,h1=char,h2=hex,q=quit,?=help --> q  <-- quit program
Note
  • the 1st record of the input datafile is shown above
  • we must use 'uvhd' because of the packed decimal fields
  • uvhd displays data in vertical hexadecimal 64 byte segments
  • each segment displayed on 3 lines (characters, zones, digits)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1T3. Checking Test/Demo Output Results

jar100/car100 - sample output report


 #3. vi data1/ar.customer.nameadrs.list100
     ====================================

CAR100: CUSTOMER NAME & ADDRESS LIST 080322

 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANAIMO          BC V9S1H1
 132588    GEECOE GENERATOR SERVICESUNIT 170 - 2851 SIMPSON  RICHMOND         BC V6X2R2
 139923    JOHNSTONE BOILER & TANKS 1250 EAST PENDER STREET  VANCOUVER        BC V5L1W1
 142175    LILLY ELECTRIC (1973) LTD16809 - 24TH AVENUE      SURREY           BC V4B5E7
 145264  D MAGRATH SUPPLIES LTD.    1939 KIRSCHNER ROAD      KELOWNA          BC V1Y4N7
 147615  X O'CONNER R.V. CENTRE     44430 YALE ROAD WEST     CHILLIWACK       BC V2P6J1
 149304    POINT GREY GOLF & COUNTRY3350 S.W. MARINE DRIVE   VANCOUVER        BC V6N3Y9
 150825    RIGGERS INDUSTRIAL       960 - 6TH AVENUE         HOPE             BC
 152355    SHAW, JOHN               477 CARIBOO CRES.        PORT COQUITLAM   BC V3M1X1
 154688    TAURUS RESOURCES         1110 - 625 HOWE STREET   VANCOUVER        BC V6C2T6
 157352  D WHYTE, W.                1150 LODGE ROAD          NORTH VANCOUVER  BC V7R1W8
 173320  X ZENITH TRANSPORT         2381 ROGERS AVE          COQUITLAM        BC V3K5Y2
 201120    ALLTYPE RENTAL LTD.      BOX 1819                 DRAYTON VALLEY   AL T0E0M0
 204700    CASE POWER EQUIPMENT     12611-100 ST             GRANDE PRAIRIE   AL T8V4H2
 208060    E&L TRUCKING             LAND & CATTLE LTD        WARBURG          AB T0C2T0
 211140  D FORD NEW HOLLAND         BOX 1, 440 ELLIS ROAD    WINTERBURN       AB T0E2N0
 223240  X NICHOLSON CHEVROLET LTD. 7215 ARGYLL ROAD         EDMONTON         AL T6C4J2
 224700    OTTO MOBILES WESTERN LTD.8441 CORONET ROAD        EDMONTON         AL T6E4N7
 231550    SPARROW ELECTRIC CO. LTD.BOX 88                   NISKU            AL T0C2G0
 234300    TERRITORIAL REWIND       BPX 1648                 YELLOWKNIFE      NW X1A2P2
 237286    WEBER, TOM               BOX 5503                 FORT MCMURRAY    AL T9H3G5
 301120  D ALBERTA GAS CHEMICALS LTD3RD. FLOOR, 11456 JASPER EDMONTON         AL T5K0M1
 306959  X 356582 ALBERTA LTD.      DEVITT NURSERY           CALGARY          AL T2T5N1
 308685    FOOTHILLS ELECTRIC       3932 - 3A ST. N.W.       CALGARY          AL T2E6R4
 313720    MONITREX ENGINEERING LTD 7-2280-39 AVE, N.E.      CALGARY          AL T2E6P7
 315512    PARTS PLUS               BOX 510 MAIN ST          THREE HILLS      AB T0M2A0
 318833    TOP NOTCH CONSTRUCTION   BOX 308, STN J           CALGARY          AL T2A4X6
 400002    ACKLANDS LTD             945 -2ND AVE             PRINCE GEORGE    BC V2L3A7
 401210    COAST RANGE CONSTRUCTION 1103-207 W. HASTINGS ST  VANCOUVER        BC V6B1H7
 402875    HULL, DON & SONS LTD.    BOX 1297                 PRINCE GEORGE    BC V2L4V3
 403887  D MILNER, LARRY            BOX 28 RAU ROAD R.R.8    QUESNEL          BC V2J5E6
 406082    PRECAM RENTALS LTD:      10116-94TH AVE           FORT ST. JOHN    BC V1G5G6

We can use 'vi' to inspect the output report because the COBOL program defines report files as 'ORGANIZATION LINE SEQUENTIAL' which appends Carriage-Returns & Line-Feeds. The 'CRs' are displayed as '^M' by vi. ('LF's are not displayed since they are standard in unix/linux text files)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1T4. Checking Test/Demo Output Results

Check I/O for jcls/jar200.ksh

'jar200' sorts data1/ar.sales.items by product code & lists the detail records with final totals of quantity & amount.

Although there are no packed fields in this file, we still cannot use 'vi' (or more,page,lp,etc) because the records have no LineFeeds & the entire file looks like 1 long record to vi. Here is the 1st record shown by uvhd:


 #1. uvhd data1/ar.sales.items r64h2 <-- display 64 byte records in hexadecimal
     ==============================   - 1st of 20 (all listed below by listrec2)
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 130140    21 940802 IN111001  HAM001  000020 0000001 000000020
             3333332222332333333244333333224443332233333323333333233333333322
             130140000021094080209E1110010081D0010000002000000001000000002000

We can use 'listrec2' (uvcopy pre-programmed job) to list files w/o LineFeeds


 #2. uvcopy listrec2,fili1=data1/ar.sales.items,uop=r64 <-- list file no LineFeeds
     =================================================
                    ,filo1=tmp/sales.items.lst    <-- output report default name
 listrec2 - list (100 bytes/line) file=data1/ar.sales.items 2004/04/29_18:18:26
           1         2         3         4         5         6
 0123456789012345678901234567890123456789012345678901234567890123
 130140 2  21 940802 IN111001  HAM001  000020 0000001 000000020
 130140 2  21 940802 IN111001  SCR012  000021 0001001 000021021
 130140 2  21 940802 IN111001  CHR001  000022 0002001 000044022
 139923 2  35 950802 IN111002  TAB013  000023 0003001 000069023
 139923 2  35 950807 IN111002  TAB013  000024 0004001 000096024
 150825 2  44 960804 IN1122    HAM001  000025 0005001 000125025
 150825 2  44 960804 IN1122    HAX129  000026 0006001 000156026
 201120 2  44 970807 CR5234    WHIP75  000027 0007001 000189027
 223240 2  65 980816 CR955     HAM001  000028 0008001 000224028
 223240 2  65 980816 IN441     BBQ001  000029 0009001 000261029
 308685 2  21 990812 IN6605    SAW051  00001p 0000001 00000001p
 308685 2  21 990812 IN6605    WHIP75  00001q 0001001 00001101q
 308685 2  21 990812 CR8835    TAB013  00001r 0002001 00002401r
 315512 2  44 000805 IN2251    HAM001  00001s 0003001 00003901s
 315512 2  44 000805 IN2251    SAW051  00001t 0004001 00005601t
 315512 2  44 000805 IN2255    WHIP75  00001u 0005001 00007501u
 400002 2  85 010812 CR245     HAX129  00001v 0006001 00009601v
 406082 2  35 020815 IN33001   BBQ001  00001w 0007001 00011901w
 406082 2  35 020815 IN33001   TAB013  00001x 0008001 00014401x
 406082 2  65 020816 IN441     HAM001  00001y 0009001 00017101y
 ==============================================================
 cust#   slsmn date  invoice   product  qty    price    amount

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1T5. Checking Test/Demo Output Results

run jar200.ksh & inspect Output


 #3. jar200.ksh        <-- run job to sort, update,& execute COBOL car200.cbl
     ==========

 #4. vi data1/ar.sales.list  <-- use vi to inspect report created by car200.cbl
     =====================
 406082 PRECAM RENTALS LTD:     35 020815 IN33001  BBQ001      17-    70.01     1,190.17-
 130140 EVERGREEN MOTORS LTD.   21 940802 IN111001 CHR001      22     20.01       440.22
 130140 EVERGREEN MOTORS LTD.   21 940802 IN111001 HAM001      20       .01          .20
 150825 RIGGERS INDUSTRIAL      44 960804 IN1122   HAM001      25     50.01     1,250.25
 315512 PARTS PLUS              44 000805 IN2251   HAM001      13-    30.01       390.13-
 150825 RIGGERS INDUSTRIAL      44 960804 IN1122   HAX129      26     60.01     1,560.26
 308685 FOOTHILLS ELECTRIC      21 990812 IN6605   SAW051      10-      .01          .10-
 315512 PARTS PLUS              44 000805 IN2251   SAW051      14-    40.01       560.14-
 130140 EVERGREEN MOTORS LTD.   21 940802 IN111001 SCR012      21     10.01       210.21
 139923 JOHNSTONE BOILER & TANK 35 950802 IN111002 TAB013      23     30.01       690.23
 139923 JOHNSTONE BOILER & TANK 35 950807 IN111002 TAB013      24     40.01       960.24
 308685 FOOTHILLS ELECTRIC      21 990812 CR8835   TAB013      12-    20.01       240.12-
 406082 PRECAM RENTALS LTD:     35 020815 IN33001  TAB013      18-    80.01     1,440.18-
 201120 ALLTYPE RENTAL LTD.     44 970807 CR5234   WHIP75      27     70.01     1,890.27
 308685 FOOTHILLS ELECTRIC      21 990812 IN6605   WHIP75      11-    10.01       110.11-
 315512 PARTS PLUS              44 000805 IN2255   WHIP75      15-    50.01       750.15-
                                                               78               2,320.78
  1. The output file has been sorted into product code sequence (bytes 30-35) and total quantity & amount are printed at EOF.

  2. Four records were dropped due to 'OMIT's for slsmn 65 & 85 (see JCL/script listing on page '1D4')

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1T6. Checking Test/Demo Output Results

data1/gl.account.master_ GDG file

data1/gl.account.master_ is a GDG file with packed fields, so must use 'uvhd':


 #1. uvhd data1/gl.account.master_000001 r128 <-- display 128 byte records in hex
     =======================================
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0  11100       11100Royal Bank Lynn Valley        ....b.20090131
             2333332222222333335676624666247662566667222222220010683333333322
             0111000000000111002F91C021EB0C9EE061CC590000000000972C2009013100
          64
             2222222222222222222222222222222222222222222222222222222222222222
             0000000000000000000000000000000000000000000000000000000000000000
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
         128  11200       11200VISA settlement               .....\20090131
             2333332222222333335454276776666672222222222222220000853333333322
             011200000000011200693103544C5D5E400000000000000000197C2009013100
          64
             2222222222222222222222222222222222222222222222222222222222222222
             0000000000000000000000000000000000000000000000000000000000000000
                      10        20        30        40        50        60
 r#        3 0123456789012345678901234567890123456789012345678901234567890123
         256  11500       11500Investments RBMF              ..4.1.20090131
             2333332222222333334676776667725444222222222222220039313333333322
             0115000000000115009E6534D5E43022D60000000000000001421C2009013100
          64
             2222222222222222222222222222222222222222222222222222222222222222
             0000000000000000000000000000000000000000000000000000000000000000

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1T7. Checking Test/Demo Output Results

run jgl00.ksh & inspect Output


 #2. jgl100.ksh     <-- run job to execute COBOL cgl100.cbl
     ==========

 #3. vi data1/gl.account.acntlist_000000 <-- inspect report created by cgl100.cbl
     ==================================

data1/gl.account.acntlist_000000

  11100    Royal Bank Lynn Valley             19,076.28   20090331
  11200    VISA settlement                     1,098.75   20090331
  11500    Investments RBMF                  134,923.11   20090331
  11600    RBMF - capital gains db             3,486.06   20090331
  11610    RBMF capital gains 100%             3,486.06   20090331
  11620    RBMF CG 66%                         5,713.24   20090331
  11630    RBMF CG 50%                         1,446.71   20090331
  11700    RBMF - interest                     3,419.60   20090331
  12100    Accounts Receivable                11,900.00   20090331
  12200    Allowance for Bad Debts                  .00   20090331
        - - - - - 1st 10 lines only of 109 total - - - - -

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1U1. Re-run Test/Demo JCL/scripts with Console Logging

Previous pages illustrated executing the demo JCL/scripts & capturing the console display via redirection or using 'tee'. A better way is to use the Unix/Linux 'script' command to capture console logs into date/time stamped files. Console Logging is extensively documented in ADMjobs.htm but here is the short version.

UV Console Logging Features

  1. Collects everything that happens during the operators login session (not just the JCL/script messages). This will include any unix/linux commands entered between the various JCL/script executions.

  2. Console Log files are collected in 1 central location for all users who wish to participate. Mandatory for operators, but advantageous for programmers debugging jobs.

  3. Console logs collected into date/time stamped files within a subdir for each user. This is made automatic by uncommenting the last few lines provided in the recommended profile (listed at ADMjobs.htm#1C1). The critical line is reproduced here:

    exec script $LOGDIR/log1/$LOGNAME/$(date +%y%m%d:%H%M%S)
    ========================================================
  1. We recommend setting up an 'applications administrator' account (appsadm), to administer console logging along with other administrative functions that may span multiple applications.

    Console Log Collection subdirs

 /home/appsadm
 :-----log1                        <-- log1 superdir for logs in progress
 :     :-----user1                 <-- subdir for each userid to be logged
 :     :-----user2
 :     :-----mvstest
             :------030925:080115  <-- sample logfile in progress
             :
 :-----log2                        <-- log2 superdir for current month
 :     :-----user1
 :     :-----user2
 :     :-----mvstest
             :------030921:102652   <-- logfiles for current month
             :------030922:130116     - date/time stamped YYMMDD:HHMMSS
             :------030923:074559     - processed from log1 on logoff/logon
             :------030924:074559       (screen control codes removed)
             :
 :-----log3                        <-- prior month logfiles
 :     :-----user1                   - copied from log2 at end month (by cron)
 :     :-----user2                     (then log2 subdirs cleared out)
 :     :-----mvstest

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1U2. Re-run Test/Demo JCL/scripts with Console Logging

Activate Console Logging & Re-run demos

  1. Setup the 'appsadm' login account using the same profiles as for mvstest (but with console logging disabled for appsadm itself).

  2. Setup the log1, log2, log3 superdirs as shown on the prior page. Within each of log1,log2,log3, and for each user account to be logged, setup a subdir matching their login userid ($LOGNAME). For our demos userid 'mvstest' is the only one required.

  3. Now uncomment the last few lines in the profile of the 'mvstest' login. The critical line was shown on the previous page.

  4. Logout & back into 'mvstest' to start collecting the logs. Logging back in will fail if the subdir matching the userid is not found within the superdir (/home/appsadm/log1).

  5. Re-run the JCL/script demos (we will illustrate the following 3):

 5a. jar100.ksh
     ==========

 5b. jgl100.ksh
     ==========

 5c. jgl200.ksh
     ==========
  1. Logoff & back on to process the logfile from log1/mvstest to log2/mvstest (as illustrated on the previous page).

  2. You may display any prior logfile using the 'logview' script provided (and print if desired).

 7a. logview   <-- display list of date/time stamped logfiles in current month
     =======
 -rw-rw-r--    1 mvs      users      495823 Sep 21 13:01 030921:102652
 -rw-rw-r--    1 mvs      users       69075 Sep 22 07:11 030922:130116
 -rw-rw-r--    1 mvs      users      253990 Sep 23 09:02 030923:074559
 -rw-rw-r--    1 mvs      users      178428 Sep 24 10:26 030924:221341
 enter 1,2,3,etc to vi logfile (counting backwards) q to quit
  - may follow file# with -dprinterdest to print
 --> 1             <-- to see the latest logfile (uses vi editor)

--> 1 -dprinter1 <-- to print the latest logfile

Logview prompts for the file# desired (1 is the latest & usually what you want to see). You may follow the file# with a printer destination. Or you could login as appsadm & print the file from the 'log2/mvstest' subdir.

Please see the next page for the console log result of running the 2 demo jobs.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1U3. Re-run Test/Demo JCL/scripts with Console Logging

Console Log from demo JCL/scripts

Script started on Mon 17 Jul 2006 07:47:16 PM PDT

 <@:mvstest:/home/mvstest> jar100.ksh
 080827:155517:JAR100: Begin Job=JAR100
 080827:155517:JAR100: /home/mvstest/testlibs/jcls/jar100.ksh
 080827:155517:JAR100: Arguments:
 080827:155517:JAR100: RUNLIBS=/home/mvstest/testlibs
 080827:155517:JAR100: RUNDATA=/home/mvstest/testdata
 080827:155517:JAR100: JTMP=jobtmp/JAR100 SYOT=sysout/JAR100
 080827:155517:JAR100: RUNDATE=20080827
 080827:155517:JAR100: Begin Step S0010 car100 (#1)
 080827:155517:JAR100: file: CUSTMAS=data1/ar.customer.master bytes=8192
 080827:155517:JAR100: file: NALIST=data1/ar.customer.nameadrs.list100 bytes=2858
 080827:155517:JAR100: file: SYSOUT=sysout/JAR100/S0010_SYSOUT bytes=0
 080827:155517:JAR100: Job Times: Begun=15:55:17 End=15:55:17 Elapsed=00:00:00
 080827:155517:JAR100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

..... other logs omitted (only 1st & last shown) .....

 <@:mvstest:/home/mvstest> jgl320.ksh
 080827:155938:JGL320: Begin Job=JGL320
 080827:155938:JGL320: /home/mvstest/testlibs/jcls/jgl320.ksh
 080827:155938:JGL320: Arguments:
 080827:155938:JGL320: RUNLIBS=/home/mvstest/testlibs
 080827:155938:JGL320: RUNDATA=/home/mvstest/testdata
 080827:155938:JGL320: JTMP=jobtmp/JGL320 SYOT=sysout/JGL320
 080827:155938:JGL320: RUNDATE=20080827
 080827:155938:JGL320: Begin Step S0010 iebgener (#1)
 080827:155938:JGL320: gen0: SYSUT1=data1/gl.account.master_000005 insize=8720
 080827:155938:JGL320: file: SYSUT2=jobtmp/JGL320/__tempglm bytes=0
 080827:155938:JGL320: uvcp fili1=data1/gl.account.master_000005,filo1=jobtmp/JGL320/__tempglm
 080827:155938:JGL320: EOF fili01 109 rds, 8720 size; data1/gl.account.master_000005
 080827:155938:JGL320: EOF filo01 109 wrts, 8720 size; jobtmp/JGL320/__tempglm
 080827:155938:JGL320: Begin Step S0020 idcams (#2)
 080827:155938:JGL320: file: TEMPGLM=jobtmp/JGL320/__tempglm bytes=8720
 080827:155938:JGL320: gen+1: ACNTMAS=jobtmp/JGL320/GDG/data1/gl.account.master_000006 gens=10
 080827:155938:JGL320: file: SYSIN=jobtmp/JGL320/S0020_idcams_SYSIN bytes=84
 080827:155938:JGL320: uvcp fili1=jobtmp/JGL320/__tempglm,filo1=jobtmp/JGL320/GDG/data1/gl.account.master_000006
 080827:155938:JGL320: EOF fili01 109 rds, 8720 size; jobtmp/JGL320/__tempglm
 080827:155938:JGL320: EOF filo01 109 wrts, 0 size; jobtmp/JGL320/GDG/data1/gl.account.master_000006
 080827:155938:JGL320: DISAMdat: recs=109,rcsz=80,keys=1; jobtmp/JGL320/GDG/data1/gl.account.master_000006
 080827:155938:JGL320: Job Times: Begun=15:59:38 End=15:59:38 Elapsed=00:00:00
 080827:155938:JGL320: moving jobtmp/JGL320/GDG/subdir/files back to $RUNDATA/subdirs/
 `jobtmp/JGL320/GDG/data1/gl.account.master_000006.dat' -> `data1/gl.account.master_000006.dat'
 `jobtmp/JGL320/GDG/data1/gl.account.master_000006.idx' -> `data1/gl.account.master_000006.idx'
 080827:155938:JGL320: JobEnd=Normal, StepsExecuted=2, LastStep=S0020

<@:mvstest:/home/mvstest> exit

Script done on Mon 17 Jul 2006 07:47:53 PM PDT

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1V1. Reconvert Test/Demo JCL/scripts

reconverting JCL - 1 at a time


 jcl2ksh51 jcl0/JAR100.jcl   <-- reconvert 1 JCL thru all steps
 =========================       jcl0 --> jcl1 --> jcl2 --> jcl3 ?--> jcls
                               - prompts to copy to jcls or not ?

--> y <-- reply y if OK to copy to jcls overwriting prior version

Note
  • reply 'n' if you have spent a lot of time modifying script in jcls
  • might reconvert to pick up some features of converter enhancements ?
  • reply 'n', then cut & paste desired new parts with customized old parts ?

reconverting JCL - All JCL in directory


 jcl2ksh51A all    <-- reconvert All JCL in directory
 =============        jcl0 --> jcl1 --> jcl2 --> jcl3 ?--> jcls
                    - prompts to continue at various points

--> cleanup PROCs, INCLUDEs,& control-cards ? --> y <-- usually reply 'y' unless very large numbers & only JCL needs reconvert

 --> recreate ctl/datactl53I
 --> n <-- reply 'n' if you have not changed any input JCLs, or the other 2
           inputs for datafile info (LISTCAT & Excel spreadsheet)
 --> copy to jcls (overwriting existing jcl/scripts) or not ?
 --> n <-- reply 'n' if you have spent considerable time editing & debugging
      - reply 'y' only early in conversion & testing
      - when enhancements are made to JCL converter & control files
      - before many JCL/scripts have been modified/tested/debugged

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1V2. Reconvert/Recompile Test/Demo COBOL copybooks/programs

reconvert COBOL copybook - 1 at a time


 cnvMF51cpy cpy0/CAR100.cpy   <-- reconvert 1 COBOL copybook thru all steps
 ========================       cpy0 --> cpy1 --> cpy2 --> ?--> cpys
                              - prompts to copy to cpys ?
 --> y <-- reply y if OK to copy to cpys overwriting prior version
 --> n <-- reply 'n' if you have spent a lot of time modifying copybook in cpys
         - might reconvert to pick up some features of converter enhancements ?
         - or improving search/replace tables
         - cut & paste to combine new parts with old parts

reconvert COBOL copybooks - All in directory


 cnvMF51Acpy all    <-- reconvert All copybook in directory
 ============        cpy0 --> cpy1 --> cpy2 --> ?--> cpys
                   - prompts to continue at various points
 --> copy UNIXWORK1 & UNIXPROC1 from /home/uvadm/mvstest/cpy0 ?
 --> y <-- reply y if 1st time conversion of this directory

--> cleanup complete, enter to convert --> y <-- reply y to continue

 --> copy All copybooks from cpy2 to cpys
 --> y <-- reply 'y' if OK to overwriting prior versions
         - when enhancements are made to COBOL converter & search/replace tables
         - before many copybooks have been modified/tested/debugged
 --> n <-- reply 'n' if you have spent a lot of time modifying copybooks in cpys

reconvert & recompile COBOL - 1 program at a time


 cnvMF51 cbl0/CAR100.cbl   <-- reconvert 1 COBOL program thru all steps
 =======================       cbl0 --> cbl1 --> cbl2 --> cbl3 ?--> cbls
                             - prompts to copy to cbls & recompile
 --> y <-- reply y if OK to copy to cbls overwriting prior version
 --> n <-- reply 'n' if you have spent a lot of time modifying program in cbls
         - might reconvert to pick up some features of converter enhancements ?
         - or improving search/replace tables
         - cut & paste to combine new parts with old parts

reconvert & recompile COBOL - All programs in directory


 cnvMF51A all    <-- reconvert All programs in directory
 ===========        cbl0 --> cbl1 --> cbl2 --> cbl3 ?--> cbls
                  - prompts to continue at various points
 --> cleanup complete, enter to convert
 --> y <-- reply y to continue
 --> copy All programs from cbl2 to cbls & recompile ?
 --> y <-- reply 'y' if OK to overwrite prior versions & recompile all
         - when enhancements are made to COBOL converter & search/replace tables
         - before many programs have been modified/tested/debugged
 --> n <-- reply 'n' if you have spent a lot of time modifying programs in cbls

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1X1. Quick conversion for your JCL vs test/demos

Expedient vs Recommended

I recommend you follow the procedures documented in part 1 of MVSJCL.doc before attempting to convert your own JCL. Page '1P1' & '1P2' instruct you to setup user 'mvstest' & copy the test/demo JCLs,Procs,etc to /home/mvstest/... from /home/uvadm/mvstest/... and then run the conversions starting on page '1Q1'.

You can then execute the converted JCL/scripts starting on page '1S3'. This will give you a good understanding of how these conversions work, before starting your own conversions as documented in Part_4. Part 4 recommends you take the time to setup 'appsadm', modify profiles,& setup your own directories as documented in ADMjobs.htm.

The procedures documented here are for customers who want a quick way to to convert some of their JCL without a lot of setup required. The minimum is to setup a userid, profile, and then use the 'mvslibsdirs' script to setup the required conversion subdirs (listed on page '1A1').

The following is a modified version of the setups shown on page '1P2'. For illustration we will assume userid 'userxx' running Korn shell (vs bash). For SUN systems you may need to code '/export/home' wherever I code '/home' in the following instructions.


 #1. login as 'root'

 #2. groupadd apps        <-- setup group 'apps', if not already setup
     =============            (when uvadm was setup in install.htm)

 #3. useradd -m -g apps -s /bin/ksh userxx  <-- setup user 'userxx'
     =====================================

 #4. passwd userxx01       <-- prompts for password (userxx01 for example)
     ===============

 #5. cp -p /home/uvadm/env/stub_profile /home/userxx/.profile
     ========================================================
     - copy supplied 'stub' profile to userxx homedir & rename for ksh

 #6. Logout from root

Now login as userxx & perform your conversions as shown on next page --->

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1X2. Quick conversion for your JCL vs test/demos

converting your JCL under userxx


 #1. login: userxx --> /home/userxx
     ==============================

 #1a. OR, login under your existing userid --> /home/yourhomedir
      ==========================================================

 #2. mkdir testlibs testdata cnvdata tmp
     ===================================
     - make superdirs to hold subdirs
     - you only need 'testlibs' to convert JCL/COBOL only
       (vs converting data & executing JCL/scripts)

 #3. cd testlibs  <-- change into testlibs (before making subdirs)
     ===========    - testlibs must be defined in profiles
                      by env-var $RUNLIBS

 #4. mvslibsdirs  <-- create an empty set of the conversion subdirs
     ===========    - see subdirs illustrated on page '1A1'
     - relevant subdirs for JCL conversion only are:
       ctl, parm0, parms, proc0, procs, jcl0, jcl1, jcl2,& jcl3.

 #5a. cp /home/uvadm/mvstest/ctl/* ctl    <-- copy supplied control files
      ================================
      - required for JCL & COBOL converters

 #6. copy YOUR JCLs, PROCs,& Parms into jcl0, proc0,& parm0

 #6a. cp /???/yourjcls/* jcl0
 #6b. cp /???/yourprocs/* proc0
 #6c. cp /???/yourparms/* parm0

 #7. jcl2ksh51A all        <-- run All JCL conversions
     =============

See the script listed on page '9A2' & stored at /home/uvadm/sf/IBM/jcl2ksh51A.

If you have problems, I recommend you revert to the 'step by step' method as illustrated on pages '1Q1' thru '1Q8'.

Note
  • before you can execute you must setup appsadm & copy the functions
    jobset51, exportgen0/1, etc to /home/appsadm/sfun
    because the profile has 'export FPATH=/home/appsadm/sfun'
  • see setting up appsadm at ADMjobs.htm#1D1 thru 1D4.

 #8. cp /home/uvadm/sfun/* /home/appsadm/sfun  <-- copy supplied functions
     ========================================
     - required to execute JCL/scripts

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

1X3. Quick conversion for your JCL vs test/demos

using 'runlibs' not in $HOME

The profiles are designed to facilitate JCL conversions & script executions under 2 conditions:

  1. You have defined RUNLIBS in any homedir ($HOME), since the stub_profile provided in /home/uvadm/env/... defines RUNLIBS as follows:

    export RUNLIBS=$HOME/testlibs
    =============================
  1. For serious conversions (vs investigation), you should define runlibs in a separate file system for access by the conversion team, for example:

    export RUNLIBS=/p1/apps/apps/testlibs
    =====================================

All this is explained at ADMjobs.htm#1D1 thru 1D7.

Actually the conversion scripts will work in any directory containing the subdirs documented on page '1A1', but the executions will not work unless RUNLIBS is defined as specified above.

The recommended definitions are much more flexible since it allows your various programmers to each have their own RUNLIBS or more importantly, their own RUNDATA since:


 export RUNLIBS=$HOME/testlibs
 =============================

 export RUNDATA=$HOME/testdata
 =============================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_2 JCL/COBOL/DATA Conversion Aids

Conversion Aids

Note
  • the conversion aids are in a separate document CNVaids.htm, which
    should be useful to JCL, COBOL,& DATA conversions
  • references below are all links into the common CNVaids.htm

Introduction & Overview

This document is intended to make you aware of the many conversion, testing, & debugging aids supplied by the Vancouver Utilities, that should help you to convert mainframes to unix/linux.

I believe you will find many of these aids essential to the success of your conversion, testing,& debugging.

These aids were originally in several documents (MVSJCL,MVSCOBOL,MVSDATA,etc). In January 2008, a separate document (CNVaids) was created to avoid the duplications in the original documents, which now have links to CNVaids.htm.

Many of these aids are illustrated using supplied test/demo files & you can run many of these once you have installed the Vancouver Utilities. These 'practice sessions' will help you when you start working on your own conversions of JCL, COBOL,& DATA files.

Links to other documents

The intention is to give you a short introduction to the various utilities available, and then give you a link to the complete documentation which could be in various other books.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids

Unix/Linux Aids - Contents

CNVaids.htm#1A1 Profiles

stub_profile
  • modify & copy to user homedirs
common_profile
  • called by 'stub_profile'

CNVaids.htm#1B1 aliases

CNVaids.htm#1C1 Rename scripts

CNVaids.htm#1D1 dtree

CNVaids.htm#1E1 llr

CNVaids.htm#1F1 statdir1

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Unix/Linux Aids - Contents

CNVaids.htm#1G1 diff

CNVaids.htm#1G2 alldiff

CNVaids.htm#1H1 grep

CNVaids.htm#1I1 dos2unix

CNVaids.htm#1I1 unix2dos

CNVaids.htm#1J1 Vancouver Utility backup scripts scheduled by cron

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids

Vancouver Utility General Purpose Aids - Contents

CNVaids.htm#2A1 uvlp__

CNVaids.htm#2B1 listall

CNVaids.htm#2C1 spreadA

CNVaids.htm#2D1 cleanup

CNVaids.htm#2E1 verifytext

CNVaids.htm#2F1 grepsum1

CNVaids.htm#2G1 scan/replace

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids

Cross-References - COBOL & JCL/scripts

CNVaids.htm#3A1 cross-refs summary

CNVaids.htm#3B1 - xrefall generate ALL Cross-Ref reports

CNVaids.htm#3B2 - xref... generate any 1 Cross-Ref report

COBOL Cross-Ref sample reports

 CNVaids.htm#3C1 - xcobcopy1 list all COPYBOOKS in any 1 PROGRAM
 CNVaids.htm#3C1 - xcobcopy2 crossref all PROGRAMS copying any 1 COPYBOOK
 CNVaids.htm#3C2 - xcobcall1 list of all CALLED-PROGRAMs in each PROGRAM
 CNVaids.htm#3C2 - xcobcall2 crossref all PROGRAMS calling any 1 CALLED-PROGRAM
 CNVaids.htm#3C3 - xcobfile2 crossref all PROGRAMS using each external-file
 CNVaids.htm#3C4 - xcobsql1 list all SQL Includes in any 1 PROGRAM
 CNVaids.htm#3C4 - xcobsql2 crossref all PROGRAMS using any 1 SQL Include

JCL Cross-Ref sample reports

CNVaids.htm#3D1 - xkshfile1 list all DATAFILES used in any 1 ksh SCRIPT CNVaids.htm#3D1 - xkshfile2 crossref show all SCRIPTs using any 1 DATAFILE CNVaids.htm#3E1 - xkshprog1 list all PROGRAMs executed in any 1 ksh SCRIPT CNVaids.htm#3E1 - xkshprog2 crossref show all SCRIPTS executing any 1 PROGRAM

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids

Table Summaries & Statistics - Contents

CNVaids.htm#4B1

statallmvs1
  • table summaries of COBOL, MVS JCL,& Korn shell scripts
statallvse1
  • same, but for VSE JCL
statmvsjcl1
  • table summarize mainframe JCL programs & files
  • counts each program & top-node used in all JCLs
statvsejcl1
  • same, but for VSE JCL
statksh1
  • table summarize converted scripts programs & files
  • counts each program & top-node used in all scripts

CNVaids.htm#4C1 - statlogin1

CNVaids.htm#4D1 - table2

CNVaids.htm#4D2 - table3d

CNVaids.htm#4E1 - tblext1

CNVaids.htm#4F1 - recsizes1

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids

COBOL aids - Contents

CNVaids.htm#3A1 - COBOL cross-refs documented with JCL/script cross-refs

CNVaids.htm#5B1 - statcbl1

CNVaids.htm#5C1 - cobfil51

CNVaids.htm#5C1 - Animation

CNVaids.htm#5D1 - cobmap1

CNVaids.htm#5F1 - Micro Focus COBOL 'file status' error codes

CNVaids.htm#5F2 - Micro Focus COBOL 'run time' error codes

http://supportline.microfocus.com/Documentation/books/sx40sp1/smpubb.htm

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids

JCL/script Test/Debug Aids - Contents

CNVaids.htm#6A1 - jobflow51

CNVaids.htm#6B1 - joblog

CNVaids.htm#6C1 - separate datafiles

CNVaids.htm#6D1 - lastgenr

CNVaids.htm#6E1 - getEtime

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids

Data File Aids - Contents

CNVaids.htm#7A1 uvhd

CNVaids.htm#7B1 uvhdcob

CNVaids.htm#7B2 uvhdc

CNVaids.htm#7C1 uvcp

CNVaids.htm#7D1 uvcpF2L

CNVaids.htm#7D2 uvcpL2F

CNVaids.htm#7E1 CMPjobs

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids continued

Data File Aids - Contents (continued)

CNVaids.htm#7F1 listrec2

CNVaids.htm#7F2 listhex2

CNVaids.htm#7G1 gentest1

CNVaids.htm#7H1 vtocr1

 - create VTOC report for files converted from mainframe
 - provides record counts, indexed keys, etc
 (information not displayed by the usual unix/linux tools)
 - see sample report & operating instructions in MVSDATA.htm

CNVaids.htm#7I1 uvsort

CNVaids.htm#7J1 uxcp

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids

Pre-Programmed uvcopy jobs

CNVaids.htm#Part_8 pre-programmed jobs (written in uvcopy code)

CNVaids.htm#8B1 - tabfix1

CNVaids.htm#8C1 - tolower

CNVaids.htm#8D1 - toascii

CNVaids.htm#8E1 - scand2

CNVaids.htm#8F1 - acum1

CNVaids.htm#8G1 - cmrpt1

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids

CNVaids.htm#8H1 - selectf1

CNVaids.htm#8J1 - splitjclproc1

CNVaids.htm#8K1 - splitcblcpy1

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

CNVaids.doc Vancouver Utility Conversion Aids

Tips for users new to Unix/Linux - Contents

CNVaids.htm#9A1 vi editor tutorial for users new to unix/linux

CNVaids.htm#9B1 Work in your working directory & address files thru subdirs

CNVaids.htm#9B2 setup a 'tmp/' subdir in your working directories

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_3. Conversion Support Files - profiles, functions, control files, etc

Part3 - Conversion Support Files


3A1. Conversion support files - Overview

3A2. Vancouver Utilities 'uvadm' directories & contents

3B1. Profiles - profiles & related files in /home/uvadm/env/...
- listed begining at ADMjobs.htm#1C1
 stub_profile - copied to homedirs, renamed as .bash_profile or .profile
  - defines RUNLIBS & RUNDATA
 common_profile - defines PATHs using RUNLIBS/RUNDATA
 bashrc/kshrc - required if console logging to define aliases

3B2. modifying stub_profiles for your site

3C0. Functions used in converted JCL/scripts
- job functions (jobset51,jobend51,jobabend51) moved to Part 5 '5K1'+
- GDG functions (exportgen0,exportgen1,etc) moved to Part 5 '5J1'+

3C1. logmsg1 - display console messages with date:time:JOBID

3C2. logmsg2 - display console messages with date:time:JOBID
- for more critical messages: begin job/step, end job, errors
- also writes to jobmsgs file

3C3. stepctl51 - step control function, providing pause/go facility
- JCL converter inserts this function at begin each step
- also see scripts jobstop/jobclear used by operator to
write/clear jobctl records tested by this function
- jobstop to stop at next step or at a specified step#
- see jobstop & jobclear listed on pages '9A6' & '9A7'
(with the scripts, not here with the functions)

3E1. jclunixop51 - options for the JCL/script converter

3E2. GDGmkdirs - script to make subdirs for GDG files

3E3. Customizing the JCL converter options file for your site

3F0. control files for the JCL converter
- created from up to 6 sources

3F1. datajcl51,52 - control file extracted from ALL JCLs

3F2. datacat51,52 - control file extracted from mainframe LISTCAT report

3F3. dataxl151,52 - control file from Excel spreadsheet#1
dataxl151,52 - control file from Excel spreadsheet#1

3F4. dataedt52 - control file created with editor to supply missing info

3F5. datacnv51,52 - control file extracted from datafile scans

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3A1. Conversion Support Files - profiles, functions, control files, etc

conversion support files - Overview

There are several 'conversion support files' that you should be aware of and that you may possibly need to modify to obtain optimum conversions.

I have categorized them into the groups shown above (profiles, functions, GDG functions, control files, scripts, uvcopy jobs).

Here in Part 3 we will list or give references to the more important control files that you may have to modify to optimize your conversion.

In Part_9 we will list or give references to the scripts, uvcopy jobs,& C programs, that you should not have to modify. If you think you need changes to these, please contact UV Software.

The next page illustrates the contents of the Vancouver Utilities distribution & identifies the subdirectories housing these groups.

There are certainly other important subdirs & file groups (such as src & bin, where the JCL converter is found), but you should not have to modify them.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3A2. Conversion Support Files - profiles, functions, control files, etc

Vancouver Utilities - contents after install

 /home/uvadm
 :-----batDOS
 :-----bin
 :-----cobs
 :-----ctl            <-- '3E0' control files used in JCL conversion
 :-----dat1
 :-----doc
 :-----dochtml
 :-----env            <-- environmental profiles ADMjobs.htm#1C1
 :-----hdr
 :-----htmlcode
 :-----lib
 :-----pf            <-- '9B0' uvcopy jobs used by JCL conversion (& much more)
 :     :-----adm
 :     :-----demo
 :     :-----IBM
 :     :-----util
 :-----sf            <-- '9A0' scripts used by JCL conversion (& much more)
 :     :-----adm
 :     :-----demo
 :     :-----IBM
 :     :-----util
 :-----sfun           <-- '3C0','5J0','5K0' functions for JCL/scripts & GDG files
 :-----src
 :-----srcf
 :-----tf
 :-----tmp
 :-----mvstest
 :     :-----testlibs
 :     :     :-----archive
 :     :     :-----cbl0
 :     :     :-----cpy0
 :     :     :-----Csub
 :     :     :-----ctl
 :     :     :-----jcl0
 :     :     :-----pf
 :     :     :-----proc0
 :     :     :-----sf
 :     :-----tmp
 :     :-----xref
 :     :-----testdata
 :     :     :-----ar, gl,
 :     :     :-----jobctl, joblog, jobtmp
 :     :     :-----rpts, sysout, tmp, wrk

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3B1. Conversion support files - profiles

'profiles' provided in /home/uvadm/env

 /home/uvadm/env      <--- profiles provided here
 :-----stub_profile      - copy/rename to .profile (ksh) or .bash_profile (bash)
 :                       - defines RUNLIBS/RUNDATA for programmers & operators
 :-----common_profile    - common profile (called by stub_profile)
 :                         defines PATH's etc using $RUNLIBS/$RUNDATA
 :-----root_profile      - profile for root, copy to /root/.bash_profile (RedHat)
 :                         to access Vancouver Utility scripts & uvcopy jobs
 :
 /home/appsadm/env    <--- setup user 'appsadm' & copy from /home/uvadm/env/*
 :-----stub_profile      - customize & copy to homedirs .profile or .bash_profile
 :-----common_profile    - common profile (called by stub_profile)

Mainframe conversion sites should setup an application administrator userid 'appsadm', copy /home/uvadm/env/* to /home/appsadm/env,& customize profiles there depending on the locations of their libraries & data.

Do NOT customize profiles in /home/uvadm/env/... because they would be overwritten when a new version of Vancouver Utilities is installed.

We recommend the concept of 'stub' & 'common' profiles. The shell profile in each user's homedir is a 'stub' that calls 'common_profile' which are stored in /home/appsadm/env/...

  1. The supplied 'stub_profile' is copied to homedirs, renamed as '.bash_profile' for bash shell (Linux) & '.profile' for Korn shell (Unix), and then modified depending on whether the user is a programmer or operator. - defines RUNLIBS as testlibs/prodlibs for programmers/operators - defines RUNDATA as testdata/proddata for programmers/operators

  2. 'common_profile' then defines the 'PATH's using $RUNLIBS,$COBDIR,$UV,etc For example: export PATH=$PATH:$RUNLIBS/jcls (converted JCL/scripts). Defines software superdirs (uvadm, COBDIR, ORACLE_BASE, ORACLE_HOME, etc)

  3. '$RUNDATA' determines data-file locations indirectly as follows: $RUNDATA defines the superdir housing all data-files. All JCL/scripts call a common function 'jobset51' which changes directory to $RUNDATA (cd $RUNDATA). The JCL converter inserts jobset51 at the begining of all converted JCL/scripts and then addresses all data files relative to $RUNDATA.

Note that stub profiles must call 'common_profile' using '.' (dot execution), which means the 'export's made in the common_profile will still be effective on return to the users profile.

This system is a big advantage for any site with multiple users, it means the sysadmin can update common_profile once in 1 place & those changes are effective for all users.

See more explanations at: http://www.uvsoftware.ca/admjobs.htm#1B2

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3B2. profiles for Vancouver Utilities on Unix/Linux

 ADMjobs.htm#1C1 - stub_profile
      - distributed in /home/uvadm/env/...
      - copy (to user homedirs) & rename depending on the desired shell
        (.bash_profile for bash, .profile for ksh)
      - modify RUNLIBS/RUNDATA differently for programmers or operators
        define RUNLIBS as testlibs for programmers OR prodlibs for operators
        define RUNDATA as testdata for programmers OR proddata for operators
      - contains user aliases, preferences, console logging on or off
      - modify TERM & 'stty erase' character depending on user's terminal
      - modify UVLPDEST to define a laser printer near the user
      - calls common_profile
 ADMjobs.htm#1C2 - common_profile, called by stub_profile
      - defines search PATHs to libraries & data based on $RUNLIBS & $RUNDATA
      - distributed in /home/uvadm/env/...
      - you should copy to /home/appsadm/env/ & customize there
        (to avoid overwriting when new versions of VU installed)
      - contains most items, allows updates in 1 place for all
      - modify TERM & 'stty erase' character depending on user's terminal
        (distribution has TERM=linux & stty erase '^?')
      - the common_profile should be correct for the majority of users
        & the stub profiles can be modified for the exceptions
      - change 'COBDIR' depending on where you have installed Micro Focus COBOL
 ADMjobs.htm#1C6 - bashrc
      - 'rc file' distributed in /home/uvadm/env/...
      - copy (to user homedirs) & rename depending on the desired shell
        (.bashrc for bash, .kshrc for ksh)
      - master version supplied without the '.' for visibility
      - required if you invoke another shell level (console logging script)
      - carries aliases & umask which get lost on another shell level
      - you should customize & store in /home/appsadm/env/...

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3B3. conversion support files - profiles

customizing the profile for Unix/Linux conversions

  1. Modify TERM & 'stty erase' character depending on user's terminal (distribution has TERM=linux & stty erase '^?')

      export TERM=linux       # TERM - modify depending on your terminal
      #================       # (vt100,xterm,at386,ansi,etc)
      stty erase '^?'         # erase char - modify depending on your terminal
      #==============         #  '^?' for linux/at386, '^H' for vt100,ansi,xterm
  1. Change the laser printer name defined by 'UVLPDEST' (environmental variable used by uvlist (file list scripts uvlp12, etc), and by uvhd (hexdump file investigation utility).

      export UVLPDEST="-dlp0"     <-- change 'lp0' to your laser printer
      =======================
Note
  • TERM,erase,& UVLPDEST are defined in both stub_profile & common_profile
  • change them both, users may then change their stubs if required
  1. Change 'COBDIR', the environmental variable defining where Micro Focus COBOL is installed on your system (see common_profile ADMjobs.htm#1C2).

      export COBDIR=/opt/microfocus/cobol  <-- change for your site
      ===================================

setting up profiles in /home/appsadm/env

Please see ADMjobs.htm re setting up profiles in /home/appsadm/env. ADMjobs.doc recommends setting up an 'appsadm' account to store the profiles so they do not get overwritten when a new version of Vancouver Utilities is installed.

ADMjobs.htm recommends copying /home/uvadm/env/* to /home/appsadm/env/... Then make any site specific modifications in appsadm/env. One significant change is to modify the stub profiles to call the common profile from appsadm not uvadm. See the details in ADMjobs.htm.

You can run the test/demo JCL conversions & executions in Part_1 without setting up appsadm, but you definitely should setup appsadm & modify profiles before starting your own JCL conversions.

The most important thing would be to modify RUNLIBS & RUNDATA depending on where you decide to store your Libraries & Data for Testing & Production.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C0. conversion support functions - for JCL/scripts

Note
  • these Korn shell functions are stored in /home/appsadm/sfun/...
  • separate from VU Korn shell scripts stored in subdir 'sf'
  • or JCL/scripts stored in subdir 'jcls'
  • ksh function path is defined by the 'FPATH' variable in the profile
    export FPATH=/home/appsadm/sfun

GDG functions moved to Part 5


5J0. exportgen_ functions to emulate GDG files on unix/linux
5J1. exportgen0 - get the latest generation for input
5J2. exportgen1 - get the next generation for output
5J3. exportgenall - get all generations for input

jobset51,jobend51,jobabend51 moved to Part 5


5K1. jobset51 - setup job environment for scripts converted from IBM MVS JCL
- JCL converter inserts a call to this function at begin script
- changes directory to $RUNDATA, sets up subdirs, etc

5K2. jobend51 - display GDG files moved from jobtmp/GDG/
back to $RUNDATA/data1/ (so they show on console log)

5K3. jobabend51 - display GDG files NOT moved from jobtmp/GDG/
because of job Terminated Abnormally

5J5. exportfile - function to export Logical-FileName=Physical-FileName
(for non-GDG files, see GDG files in Part 5)
- for the following COBOL program (select external LFN)
- also displays filename for the console log (using logmsg1)

3C1. logmsg1 - display console messages with date:time:JOBID2: stamps
- this function used instead of 'echo's

3C2. logmsg2 - display console messages with date:time:JOBID2: stamps
- this function used instead of 'echo's

3C3. stepctl51 - step control function, providing pause/go facility
- JCL converter inserts this function at begin each step
- also see scripts jobstop/jobclear used by operator to
write/clear jobctl records tested by this function
- jobstop to stop at next step or at a specified step#
- see jobstop & jobclear listed on pages '9A6' & '9A7'
(with the scripts, not here with the functions)

3C4. Customizing the Korn shell functions

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C1. conversion support functions - logmsg1

logmsg1 - display with date:time:JOBID2: stamps

 # logmsg1 - function to prefix echo/print messages with jobname & date/time
 #         - calling script must have defined symbol "jobid2"
 #         - 2 versions of logmsg (as of Oct 11/2005)
 #*logmsg1 - prints only to the screen (stdout)
 # logmsg2 - prints to screen & appends to $RUNDATA/jobmsgs/yymmdd/ymd_HMS_jobid
 #
 #Aug19/14 - change $JOBID2 to $jobid2 (see cmts in jobset51)
 #
 # logmsg1 "x---message---x"           <-- sample command in calling JOBXXX
 # 051011:124700:JOBXXXXX x---msg---x  <-- sample output (at 12:47 Oct 11/05)
 #
 # logmsg1 "x---message---x" RV        <-- arg2/3 "RV" for Reverse Video
 # logmsg1 "x---message---x" ACK       <-- arg2/3 "ACK" to force acknowledge y/n
 # logmsg1 "x---message---x" RV ACK    <-- arg2/arg3 either sequence
 #
 # export LOGMSGACK=y  <-- profiles set LOGMSGACK=y to activate acknowledgement
 # - default in common_defines could be overridden in user profiles
 # - running JCL/scripts by cron automatically disables operator prompts
 #
 function logmsg1
 {
 REV='\033[7m'; OFF='\033[0m'; reply=x; rc=0;
 #
 if [[ "$2" = "RV" || "$3" = "RV" ]]
    then msg="$REV$(date +%y%m%d:%H%M%S):$jobid2: ${1}$OFF"
    else msg="$(date +%y%m%d:%H%M%S):$jobid2: $1"
 fi
 #
 if [[ ("$2" = "ACK" || "$3" = "ACK") && ("$LOGMSGACK" = "y") ]]
    then until [[ "$reply" = "y" || "$reply" = "n" ]]
         do print -r "$msg y/n?"
            tty -s || break  # test login terminal, break if run by cron
            read reply
         done
     else print -r "$msg"
 fi
 # return 1 if reply y, else 0
 if [[ "$reply" = "y" ]]; then return 1; else return 0; fi
 }

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C2. conversion support functions - logmsg1

 # logmsg2 - function to prefix echo/print messages with jobname & date/time
 #         - calling script must have defined symbol "jobid2"
 #Aug19/14 - change $JOBID2 to $jobid2 (see cmts in jobset51)
 #Aug02/2008 - $RUNDTTM on filenames (RUNDTTM exported by jobset51 in script)
 #Jan25/2012 - change jobmsgs/yymmdd/yymmdd_HHMMSS_jobid2
 #                to  jobmsgs/yymmdd/HHMMSS_jobid2
 #
 # logmsg1 - prints only to the screen (for infomsgs vs errmsgs)
 #*logmsg2 - prints to the screen & appends to 2 files (for errmsgs vs infomsgs)
 #         - $RUNDATA/jobmsgs/yymmdd:HHMMSS_$jobid2
 #         - $APPSADM/jobmsgs/yymmdd/yymmdd:HHMMSS_$jobid2
 # - use cron to remove $RUNDATA/jobmsgs/* files every day before batch shift
 # - use cron to remove $APPSADM/jobmsgs/... subdirs older than 10 days ?
 #
 # logmsg2 "x---message---x"           <-- sample command in calling JOBXXX
 # 051011:124700:JOBXXXXX x---msg---x  <-- sample output (at 12:47 Oct 11/05)
 #
 # logmsg2 "x---message---x" RV        <-- arg2/3 "RV" for Reverse Video
 # logmsg2 "x---message---x" ACK       <-- arg2/3 "ACK" to force acknowledge y/n
 # logmsg2 "x---message---x" RV ACK    <-- arg2/arg3 either sequence
 #
 # export LOGMSGACK=y  <-- profiles set LOGMSGACK=y to activate acknowledgement
 # - default in common_defines could be overridden in user profiles
 # - running JCL/scripts by cron automatically disables operator prompts
 #
 function logmsg2
 {
 REV='\033[7m'; OFF='\033[0m'; reply=x; rc=0;
 DTTM="$(date +%y%m%d:%H%M%S)"
 YMD="$(date +%y%m%d)"
 if [[ "$HMS" = "" ]]; then HMS="$(date +%H%M%S)"; fi
 # HMS="$(date +%H%M%S)"  #<-- defined in jobset51
 # HMS defined in jobset51, not here, else would change every logmsg2 in job
 if [[ "$2" = "RV" || "$3" = "RV" ]]
    then msg="$REV$DTTM:$jobid2: ${1}$OFF"
    else msg="$DTTM:$jobid2: $1"
 fi
 if [[ ("$2" = "ACK" || "$3" = "ACK") && ("$LOGMSGACK" = "y") ]]
    then until [[ "$reply" = "y" || "$reply" = "n" ]]
         do print -r "$msg y/n?"
            tty -s || break  # test login terminal, break if run by cron
            read reply
         done
     else print -r "$msg"
 fi
 # append msg to jobmsgs in $RUNDATA
 # - $RUNDATA/jobmsgs/yymmdd:HHMMSS_$jobid2
 # make subdir if it does not yet exist
 test -d $RUNDATA/jobmsgs/$YMD || mkdir $RUNDATA/jobmsgs/$YMD
 print -r "$msg" >>$RUNDATA/jobmsgs/$YMD/${HMS}_$jobid2
 #
 # return 1 if reply y, else 0
 if [[ "$reply" = "y" ]]; then return 1; else return 0; fi
 }

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C3. conversion support functions - stepctl51

stepctl51 - JCL/script step control pause/go

 #!/bin/ksh
 # stepctl51 - step control function
 #           - for UNIX scripts converted from IBM MVS JCL
 #           - this KORN shell function stored in $APPSADM/sfun
 #           - see more doc at: www.uvsoftware.ca/mvsjcl.htm
 #
 # A call to this function (stepctl51) is inserted at begining of each step
 # - to provide operators with a means to pause multi-step jobs
 # - at begining of the next step, or at a specified step# (programmer debug?)
 # - scripts 'jobstop' & 'jobclear' are provided to pause & restart jobs
 #
 # jobstop jobname.ksh        <-- pause specified JCL/script at begin next step
 # ===================          - writes control file (tested by JCL/script)
 #                              - step# dflt S0000 meaning pause at all steps
 #                              - will wait wait for oprtr 'go' or 'clear'
 # jobstop jobname.ksh S0050  <-- pause job at step S0050 (step 5, inc by 10)
 # =========================    - will wait wait for oprtr 'go' or 'clear'
 #                              - 'go' does not clear, so rerun will pause again
 # jobclear jobname.ksh        <-- clear the control file (same as clear response)
 # ====================
 #
 # Step Control files are written to $RUNDATA/jobctl/...
 # - named same as JCL/script but with extension '.ctl' (vs .ksh)
 # - jobstop writes 1 line in the control file with: jobname.ksh step# date_time
 # - step# is the step# specified by oprtr as arg#2 on jobstop script command
 # - step# is S0000 if no step# spcfd on jobstop (indicates stop at all steps)
 #
 #             ** update history (latest 1st) **
 #
 #Jan02/13 - insert '\' escape in goto end pattern goto="<<S9000=\A"
 #         - to inhibit processing gdgmgr calls in bypassed code on AIX
 #
 #Feb05/12 - change replies to: cont(inue), clear, endok, endab
 # - jobset51 now allows stop step#, for example 'stop=S0050'
 # - writes jobctl/jobname.ctl S0050
 # - causes stepctl at S0050+ to display: cont,clear,endok,endab
 #Jan14/11 - call uvtime in stepctl51 to calculate StepTimes
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

function stepctl51 { #Jan14/11 - call uvtime in stepctl51 (to save a line in JCL/scripts) uvtime W1D2 steptimes #Jan26/12 - arg2 filename disabled, now dummy # - JCL converter modified to report prior step for JObTimes report # - for pause, would need to specify prior step OK?

 # begin loop to open stepctlfile, read 1st line,& test step#
 # if open succesful and:
 # - if step# S0000, display paused msg & wait for oprtr reply
 # - if step#>S0000 & matches current step#, display pause msg & wait reply
 # - else no msg, no pause, return immediately
 alias goto="";   # ensure goto cleared in case reply endok/endab
 while ((1))
 do if [[ ! -f jobctl/$jobid2.ctl ]]; then break; fi
    exec 3< jobctl/$jobid2.ctl   # open step control file
    openstat=$?                  # capture open file status
    if (($openstat)); then break; fi
    read -u3 job start2 stop2 date
    exec 3<&-                    # close step control file
    stop=${stop2##stop=}
    if [[ $stop != S[0-9][0-9][0-9][0-9] ]]; then break; fi
    if [[ $JSTEP < $stop ]]; then break; fi
    logmsg1 "$jobid2.ksh paused by job control file: jobctl/$jobid2.ctl"
    logmsg1 "- job control record: $job $stop $date"
    logmsg1 "- waiting for reply: cont(inue), clear, endok, endab"
    read reply1; logmsg2 "stepctl51: reply1=$reply1"
    if [[ "$reply1" == "endok" ]]; then alias goto="<<S9000=\A"; break; fi
    if [[ "$reply1" == "endab" ]]; then alias goto="<<S9900=\A"; break; fi
    if [[ "$reply1" == "cont" ]]; then break; fi
    if [[ "$reply1" == "clear" ]]; then
       mv jobctl/$jobid2.ctl jobctl/$jobid2.ctl_old; break; fi
    sleep 1
 done
 return 0
 }

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3C4. conversion support functions - customizing

Customizing Korn shell functions

Here are some important notes re the proper use of Korn shell functions.

These functions reside in /home/appsadm/sfun defined to the Unix/Linux KORN shell by the 'FPATH' variable in your profile, for example:


 export FPATH=/home/appsadm/sfun
 ===============================

This is separate from the Unix/Linux KORN shell 'PATH' variable which is used to find normal scripts (in jcls & sf) for example:


 export PATH=$PATH:$RUNLIBS/jcls:$RUNLIBS/sf
 ===========================================

'RUNLIBS' is defined in the profile prior to PATH or FPATH. For the 'mvstest' demos this was:


 export RUNLIBS=/home/mvstest
 ============================

But for YOUR conversion & testing/production RUNLIBS might be:


 export RUNLIBS=/p1/apps/testlibs     <-- for Your Testing
 ================================
 export RUNLIBS=/p2/apps/prodlibs     <-- for Your Production
 ================================

These functions must be defined as 'autoload' in the calling scripts. Note that the JCL converter inserts the following about line #10 of each converted JCL/script.


 autoload jobset51 logmsg1 exportfile stepctl51
 ==============================================
Note
  • as of 2007, most functions are now listed begining at '5J1'
  • exportgen0,exportgen1,exportgenall,jobset51,jobend51,jobabend51

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3E1. conversion support files - ctl/jclunixop5

ctl/jclunixop51 JCL Conversion control file


 jclprocop51:h1q1  #<-- options for jclproc51 (comon to MF & AIX COBOL)
 #===============
 # ctl/jclunixop51 <-- this file used by both jclunix51.c & jclproc51.c
 # jclunix51.c uses options on line 8
 # jclproc51.c uses options on line 1
 # jclunix53.c uses separate file jclunixop53
 #
 jclunixop51:a2b0c0d1e2f0g1h1i15j0k15l1m4n3o8p0q0r0s2t1u1v0w0x0y1z1 #<- demo options
 #           ======================================================
 #  a1                           - EXEC *ABEND* will goto S9900 Abterm
 #  a2                           - minimize ABEND step code (Aug18/13)
 #  a4                           - inhibit ABEND steps (EXEC #commented)
 #  a8                           - inhibit IEFBR14 steps with no DD's (Jun01/12)
 #    b1                         - remove '$$' from '$$SYMBOL$$'s in filenames
 #      c1                       - program names UPPER case
 #      c2                       - filenames UPPER case (also uop=l2 jcldata52)
 #      c4                       - control card modulenames UPPER case
 #        d1                     - drop DDNAMES that begin/end with LOAD/LIB
 #        d2                     - drop DSNAMES that begin/end with load/lib
 #          e1                   - echo run command to test script w/o programs
 #          e2                   - option '-v' on cp & mv echo to console log
 #            f0                 - default file typ=RSF (allows packed/binary)
 #            f1                 - default uvsort/uvcp file typ=LST
 #            f2                 - default uvsort/uvcp file typ=LSTt
 #                               - over-ridden by ctl/datactl53I (if filename match)
 #                               - jcldatafileinfo option f1 typ=LST if no Pack/Binary
 #              g0               - new GDGs data1/, use exportgen2 vs exportgen1
 #              g1               - new GDGs jobtmp/, move to data1/ at Normal EOJ
 #              g2               - new GDGs $RUNDATA/jobtmp/, move to data at EOJ
 #                               - g0g1g2 warnings only, see jobset51/exportgen1
 #               h0              - NO replace for &SYMBOLs in :NOREPLACE: table
 #                                 all other &SYMBOLS replaced if value available
 #               h1              - DO replace the &SYMBOLs in :NOREPLACE: table
 #                                 generate data ctl file with expanded filenames
 #                 i0            - lookup datactl53I for rcs,typ,key (always 2014+)
 #                 i1            - update datactl53I input recsizes from outsizes
 #                 i2            - lookup cobfil55bI for recsize, updt datactl53I if 0
 #                 i4            - update datactl53I w cobfil55bI recsize even if non-zero
 #                 i8            - update datactl53I typ=LSTt if L/46 cobfil55bI
 #                 i16           - update datactl53I input rcs from out even if non-zero
 #                 i32           - set typ=LSTt if recsize 132/133 on SORT,IEBGENER,etc
 #                 i64           - updt data=pb,typ=RSF if input pb & output not (or vv)
 #                   j1          - generate cmd line for JAVA (vs COBOL)
 #                   j2          - include -DDDNAME=$DDNAME for each file in step
 #                   j4          - special convert IKJEFT01, see MVSJCL.doc
 #                     k1        - FTP: insert 'open' prior to 1st line if IP#
 #                     k2        - FTP: insert 'user' prior 1st word if not cmd
 #                     k4        - copy FTP commands from lib module to instream
 #                     k8        - use FTP option '-u' to inhibit authorization
 #                       l1      - set recsize from MODELL.RL9999 & MODELL.FBA999
 #                          m0   - generate exportfile modules original filename
 #                          m1   - redirect modules to $RUNDATA vs $RUNLIBS dflt
 #                          m2   - redirect SYSIN modules to $RUN____/parms/...
 #                          m4   - redirect ALL modules to $RUN____/parms/...
 #                          m8   - show original filename prior to $RUN____/parms
 #                            n0 - unrecognized JCL passed thru as is
 #                            n1 - unrecognized JCL cmntd out with '#?' cols 1-2
 #                            n2 - if any '=' present, convert any ','s to ';'s
 #                            n3 - if n2 & no '=', cmnt out with '#?' cols 1-2
 #                            n4 - convert unrecognized JCL to instream data
 #                          o8   - expand all &/$symbols in EXEC keyword=values
 #                        p#     - not used
 #                      q1       - drop //* comments in code from PROCs (Dec2014)
 #                      q2       - drop //* comments in code from JCL (not yet)
 #                    r0         - gen cobrun, executes .int's & allows animation
 #                    r1         - gen runw for .ints NetExpress/Windows
 #                    r2         - assume executable programs either unix/windows
 #                    r4         - assume executables in PATH (progname only)
 #                    r8         - generate 'findexec' Multi-Level program search
 #                    r16        - generate 'unikixvsam $CBLX/COBOLX'
 #                    r32        - generate Natural call (natsec batch ...)
 #                  s1           - convert SORT for SYNCSORT (not uvsort)
 #                  s2           - convert sort field 'c' to 'e' (Ebcdic seq)
 #                t1             - disabled, see TOPNODE table & TOPDIRINSERT
 #              u1               - use uvcp for IEBGENER/IDCAMS REPRO (vs cp)
 #            v1                 - comment #rm DELETE via IDCAMS DELETE
 #            v2                 - comment #rm DELETE via DISP=(OLD/SHR/MOD,DEL)
 #          w1                   - generate 'unikixbld -i -d $KIXDATA/filename'
 #          w2                   - insert $RUNDATA on exportfile/gen for unikix
 #          w4                   - unikixvsam $CBLX/dsnutilb vs dsnutilb <$SYSIN
 #        x#                     - make all indexed output files IDXf# (1,3,4,8)
 #      y1                       - generate oprtr prompt to acknowledge Abterms
 #    z1                         - append 1 on COBOL reserved word DDNAMES
 #    z2                         - 2 blanks sep before comments vs 1 (in parjcl)
 # ----------------------------------------------------------------------------
 # Note re w2 - use sfun/jobset52 if you use w2
 #            - $RUNDATA/... inserted on export JTMP, RPTS,& SYOT
 # ------------------------------------------------------------------------
 # uvadm/ctl/jclunixop51 - control file for MVS JCL to Korn shell converter
 # - must copy/modify to ctl/ subdir where jclunix converter executed
 # ------------------------------------------------------------------------
 # Following lines will be inserted in scripts until :ENDINSERT
 # Aug19/14 - change $JOBID2 to $jobid2
 # - except for '# ' comment (col1 '#', col2 ' ' blank)
 # '#!/.......' is 1st line output - usually '#!/bin/ksh' or '#!/bin/ksh93'
 #!/bin/ksh
 export jobid2=jobidx JOBID2=JOBIDX; scriptpath="$0"; args="$*"
 if [[ -z "$jobid1" ]]; then export jobid1=$jobid2; fi
 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
 autoload exportfile exportgen0 exportgen1 exportgen2 exportgenall exportgenx
 . $APPSADM/env/stub.ini  #<-- for control-M (see notes in env/stub.ini)
 jobset51    # call function for JCL/script initialization
 goto
 S0000=A
 :ENDINSERT: - above non #comment lines inserted at begin output scripts
 # jobset51 inserted at begin each script
 # - sets up job environment: export subdirs, setup printer subdir/date
 # - RUNDATA & RUNLIBS must have been exported (in .profile or in shell)
 # - .profile must "export FPATH=$APPSADM/sfun" to find functions
 # - autoload declares functions called by jcl/scripts
 # - stores any restart step# in alias 'goto' (last line inserted above)
 #
 #------------------ general purporse search/replace tables ------------------
 # REPTBL1 - replace any pattern on any INPUT (JCL before conversion to script)
 # - entries must be tidle filled & table ended by a line of all tildes
 # 01-30=search pattern, 31-60=replace pattern, 61-80=qualifier pattern
 #
 :REPTBL1:     search/replace table for input IBM JCL
 oldpattern~~~~~~~~~~~~~~~~~~~~newpattern~~~~~~~~~~~~~~~~~~~~qualifier~~~~~~~~~~~
 .DSN=~~~~~~~~~~~~~~~~~~~~~~~~~.,DSN=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 <<HIQUAL>>.<<ENVIRON>>~~~~~~~~app_files~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 HIQUAL.ENVIRON~~~~~~~~~~~~~~~~app_files~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # REPTBL2 - replace any pattern on any OUTPUT (after conversion to script)
 :REPTBL2:     search/replace table for output UNIX script
 oldpattern~~~~~~~~~~~~~~~~~~~~newpattern~~~~~~~~~~~~~~~~~~~~qualifier~~~~~~~~~~~
 %%MDY~~~~~~~~~~~~~~~~~~~~~~~~~$(date +%m%d%y)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 YMD($C_JOBDT)~~~~~~~~~~~~~~~~~$(date +%Y%m%d)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # __~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #Jan20/15 - remove $$ (on Korah filenames - $$alluser$$ etc
 # - for easier testing before reconversion & use of scheduler
 #Feb08/15 - option 'b1' also removes '__' so filenames will match datactl53I
 # - to restore $$SYMBOL$$ - set 'b0' & replace above __~~~~~ with __~~..$$~~ (below)
 # __~~~~~~~~~~~~~~~~~~~~~~~~~~$$~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 #--------------------- filename search/replace table ---------------------
 # 01-30=search pattern, 31-60=replace pattern, 61-80=qualifier pattern
 # - entries must be tidle filled & table ended by a line of all tildes
 #
 :FILEREP1:     filename search/replace table for input JCL DSNs
 oldpattern~~~~~~~~~~~~~~~~~~~~newpattern~~~~~~~~~~~~~~~~~~~~qualifier~~~~~~~~~~~
 <<HIQUAL>>.<<ENVIRON>>~~~~~~~~app_files~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 HIQUAL.ENVIRON~~~~~~~~~~~~~~~~app_files~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 #----------------------- control table --------------------------------
 :CTLTBL:
 TOPDIRDEFAULT~~~~~~~~~~~~~~~~~data1~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINSERT~~~~~~~~~~~~~~~~~~data1~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINSTAPE~~~~~~~~~~~~~~~~~tape1~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # TOPDIRDEFAULT - inserted if only 1 node (no High Level Qualifier) in DSN
 #               - recommend 'wrk' (1 node files likely temp files)
 # TOPDIRINSERT - if specified, will be inserted above HLQ, retaining all '.'s
 #              - some sites code this as 'mstr'
 #              - TOPNODES table would be irrelevant if TOPDIRINSERT specified
 # TOPDIRINSTAPE - added June11/14, used if UNIT=CTAPE found on output DD
 #
 # If TOPDIRs not specified, existing top-node used as a subdir within $RUNDATA
 #   use TOPNODES table to allow desired topnodes & convert unwanteds to 'misc'
 # - could use FILEREP1 table to convert any part of filenames before above
 #
 #------------------------ TOPNODES table ------------------------------
 # table of TOPNODES allowed & replacements (optional)
 # 01-30 - topnodes allowed
 # 31-60 - topnode replacements (if col 31 not '~')
 # - if 01-30 of last entry 'ALLOTHER', any others replaced by 31-60
 # - use statmvsjcl1 to create summary table of topnodes used in all JCL
 # - see www.uvsoftware.ca/mvsjcl.htm#6A2
 # - code in lower case since applied at output time(script) vs input(JCL)
 :TOPNODES:
 data1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tape1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ALLOTHERS~~~~~~~~~~~~~~~~~~~~~data1~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #Note1 - you must also code valid top-nodes in $RUNLIBS/ctl/GDGmkdirs
 #      - called by jobset51 to setup subdirs for new generations of GDG files
 #      - see listing at MVSJCL.htm#4E5
 #Note2 - above TOPNODES table used for mvstest demo conversions
 #      - verifies topnodes listed & converts others to 'misc'
 #      - you could also change existing topnodes, for example:
 # c900pali~~~~~~~~~~~~~~~~~~~~~~ali~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # c900pfhb~~~~~~~~~~~~~~~~~~~~~~fhb~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # c900etc~~~~~~~~~~~~~~~~~~~~~~~etc~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~
 #      - above mainframe topnodes are being shortened to 3 chars from 8
 #      - since 1st 5 chars always 'c900p'
 #
 # comment lines in INput script by search patterns & qualifiers
 # - inserts '# ' in cols 1 & 2 if search & qualifier patterns present
 :CMTTBL1:
 cmtsearch~~~~~~~~~~~~~~~~~~~~~cmtqualifier~~~~~~~~~~~~~~~~~~
 BTCHSCHED~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # comment lines in OUTput script by search patterns & qualifiers
 # - inserts '# ' in cols 1 & 2 if search & qualifier patterns present
 :CMTTBL2:
 cmtsearch~~~~~~~~~~~~~~~~~~~~~cmtqualifier~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # CMTTBL0 - effective for jclproc51 vs jclunix51
 #         - for PROC expansion before JCL conversion to script
 :CMTTBL0:
 cmtsearch~~~~~~~~~~~~~~~~~~~~~cmtqualifier~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 :DROPDDN:    drop DDnames on input //DDname DD
 CEEDUMP~~~~~~~~~~~~~~~~~~~~~~~
 DFSRESLB~~~~~~~~~~~~~~~~~~~~~~
 DMMSGFIL~~~~~~~~~~~~~~~~~~~~~~
 DMNETMAP~~~~~~~~~~~~~~~~~~~~~~
 DMPRINT~~~~~~~~~~~~~~~~~~~~~~~
 DMPUBLIB~~~~~~~~~~~~~~~~~~~~~~
 ESYLIB~~~~~~~~~~~~~~~~~~~~~~~~
 JOBLIB~~~~~~~~~~~~~~~~~~~~~~~~
 PROCLIB~~~~~~~~~~~~~~~~~~~~~~~
 RESLIB~~~~~~~~~~~~~~~~~~~~~~~~
 SORTLIB~~~~~~~~~~~~~~~~~~~~~~~
 SORTWK*~~~~~~~~~~~~~~~~~~~~~~~
 STEPLIB~~~~~~~~~~~~~~~~~~~~~~~
 SYSABEND~~~~~~~~~~~~~~~~~~~~~~
 SYSABOUT~~~~~~~~~~~~~~~~~~~~~~
 SYSDBOUT~~~~~~~~~~~~~~~~~~~~~~
 SYSLIB~~~~~~~~~~~~~~~~~~~~~~~~
 SYSOUX~~~~~~~~~~~~~~~~~~~~~~~~
 SYSUDUMP~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #Oct20/15 - need SYSPROC to ID REXX steps
 # - if DDN SYSPROC with 'rexx' in the DSN
 # SYSPROC~~~~~~~~~~~~~~~~~~~~~~~
 #
 :DROPDDNSAS:  drop DDnames on SAS... steps
 DSN=$(ssid2Dsn DSNC) UID=$DB2UID PWD="$DB2PWD" SCHEMA=TUPROD~~~~~~~~~~~~~~~~~~~~
 SASAUTOS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 SASCLOG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 SASLOG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 SASLIST~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 SASMSG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 SASPARM~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TKMVSENV~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #Oct05/2015 1st line in DROPDDNSAS table replaces SSID=... on LIBNAME ... in SYSIN data
 #
 # Table of DSNnames to drop if pattern matched anywhere in filename
 # - optionally qualified by EXECname in cols 31-38
 :DROPDSN:
 CATALOG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 COBOLMVS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 EMER.LOAD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 JCL.LIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 JCLLIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 LINKLIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 LOADLIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 LOADRUN~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 PROD.JCL~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 PROD.LOAD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 SORTWK~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 STREAMW~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TEST.LOAD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 USERCAT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # Table of STEP names of utilities
 # - jclunix54 considers anything else COBOL
 #   & appends cft=QSAM etc on exportfile,gen0,gen1,genall
 :UTILITIES:
 ABEND~~~~~~~~~~~~~~~~~~~~~~~~~
 ACPMAIN~~~~~~~~~~~~~~~~~~~~~~~
 ADUUMAIN~~~~~~~~~~~~~~~~~~~~~~
 AMUUMAIN~~~~~~~~~~~~~~~~~~~~~~
 BTQMAIN~~~~~~~~~~~~~~~~~~~~~~~
 CFCONDRV~~~~~~~~~~~~~~~~~~~~~~
 CFPRSDRV~~~~~~~~~~~~~~~~~~~~~~
 DFSRRC00~~~~~~~~~~~~~~~~~~~~~~
 DFSUCUM0~~~~~~~~~~~~~~~~~~~~~~
 DFSULTR0~~~~~~~~~~~~~~~~~~~~~~
 DMBATCH~~~~~~~~~~~~~~~~~~~~~~~
 DSNUPROC~~~~~~~~~~~~~~~~~~~~~~
 DSNUTILB~~~~~~~~~~~~~~~~~~~~~~
 EZTPA~~~~~~~~~~~~~~~UV~~~~~~~~
 FASTLOAD~~~~~~~~~~~~~~~~~~~~~~
 FDRABR~~~~~~~~~~~~~~~~~~~~~~~~
 FILEAID~~~~~~~~~~~~~UV~~~~~~~~
 FTP~~~~~~~~~~~~~~~~~~~~~~~~~~~
 HRNBATCH~~~~~~~~~~~~~~~~~~~~~~
 ICEGENER~~~~~~~~~~~~UV~~~~~~~~
 ICEMAN~~~~~~~~~~~~~~UV~~~~~~~~
 ICETOOL~~~~~~~~~~~~~UV~~~~~~~~
 IDCAMS~~~~~~~~~~~~~~UV~~~~~~~~
 IEBCOPY~~~~~~~~~~~~~UV~~~~~~~~
 IEBGENER~~~~~~~~~~~~UV~~~~~~~~
 IEFBR14~~~~~~~~~~~~~UV~~~~~~~~
 IKJEFT~~~~~~~~~~~~~~~~~~~~~~~~
 ISRSUPC~~~~~~~~~~~~~UV~~~~~~~~
 KWIKKEY~~~~~~~~~~~~~~~~~~~~~~~
 KWIKLOD~~~~~~~~~~~~~~~~~~~~~~~
 MAIL~~~~~~~~~~~~~~~~~~~~~~~~~~
 MLOAD~~~~~~~~~~~~~~~~~~~~~~~~~
 NDMWAIT~~~~~~~~~~~~~~~~~~~~~~~
 OCOPY~~~~~~~~~~~~~~~~~~~~~~~~~
 OIVBE~~~~~~~~~~~~~~~~~~~~~~~~~
 ORA~~~~~~~~~~~~~~~~~~~~~~~~~~~
 PMBMTCH~~~~~~~~~~~~~~~~~~~~~~~
 QMFBATCH~~~~~~~~~~~~~~~~~~~~~~
 QUIKJOB~~~~~~~~~~~~~UV~~~~~~~~
 REXX~~~~~~~~~~~~~~~~~~~~~~~~~~
 SAS81~~~~~~~~~~~~~~~~~~~~~~~~~
 REXX~~~~~~~~~~~~~~~~~~~~~~~~~~
 SORT~~~~~~~~~~~~~~~~UV~~~~~~~~
 SYNCGENR~~~~~~~~~~~~~~~~~~~~~~
 TPQUTIL~~~~~~~~~~~~~~~~~~~~~~~
 TSLIST~~~~~~~~~~~~~~~~~~~~~~~~
 TXT2PDF~~~~~~~~~~~~~~~~~~~~~~~
 VSAMINIT~~~~~~~~~~~~~~~~~~~~~~
 WTO~~~~~~~~~~~~~~~~~~~~~~~~~~~
 XMITIP~~~~~~~~~~~~~~~~~~~~~~~~
 XPORT~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # table of DDN's to drop if on UV UTILITY step
 # - see 'UV' coded on some entries in :UTILITIES: table
 :UTILDDNDROP:
 SYSPRINT~~~~~~~~~~~~~~~~~~~~~~
 SYSTSPRT~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # Table of $SYMBOLs not to substituted
 # controlled by option h0/h1 on line 1 above
 # h1 - all &SYMBOLs replaced with values if available
 #      (ie - this table ignored)
 #    - 1st convert to generate data file control table
 # h0 - 2nd+ convert for ksh scripts with $SYMBOLs (not replaced)
 #    - for expansion when script executed
 #Jun11/14 - &ENV for IMMD
 #         - may add others as desired ?
 :NOREPLACE:
 ENV~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # Table of symbols whose value is to be translated to lower case
 :LOWERCASE:
 APPLID~~~~~~~~~~~~~~~~~~~~~~~~
 FLEV~~~~~~~~~~~~~~~~~~~~~~~~~~
 DPC~~~~~~~~~~~~~~~~~~~~~~~~~~~
 PE~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 #--------------------------------------------------------------
 #Oct28/2010 - add table of Connect:Direct code
 # export NDMAPICFG=$CDNDM/cfg/cliapi/ndmapi.cfg
 # - above NDMAPICFG will be defined in profile
 # - will replace PROCESSNAME with $jobid2_$STEP_CD
 # - Inode --> pnode if copy from mainframe(unix) to NT, else snode
 # - Onode --> snode if copy from mainframe(unix) to NT, else pnode
 #Nov09/10 - direct option '-s' removed for debug ?
 :CONNECTDIRECT:
 logmsg1 "/search for any CD ERROR codes in \$CDNDM/cfg/msgfile.cfg"
 $CDNDM/bin/direct $CDOPTNS << EOJ
 submit maxdelay=0 PROCESSNAME
  process snode=$CDSERVER
   step1 copy from (file=$INFILE Inode)
              to   (file=$OUTFILE Onode)
  pend ;
 EOJ
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #Nov14/10 - 'snode=CD.ZAOMNT02' replaced by 'snode=$CDSERVER'
 #         - 'export CDSERVER=CD.ZAOMNT02' added to comon_profile
 #Dec28/14 - replace INFILE/OUTFILE with DSN1/DSN2 for CDBATCH vs DMBATCH
 #  step1 copy from (file=$DSN1 Inode)
 #             to   (file=$DSN2 Onode)
 #------------------------ end jclunixop51 ---------------------------

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3E2. conversion support files - ctl/jclunixop5

GDGmkdirs - script to make subdirs for GDG files

Note
  • GDGmkdirs is now obsolete, GDG processing enhanced in Fall 2014
  • so not now required
 # GDGmkdirs - make subdirs for new versions of GDG files
 #             saved in jobtmp/subdirs/... until Normal EOJ
 #           - by Owen Townsend, UV Software, Aug 25/2008
 #
 #Apr16/2009 - this script moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/
 #           - to allow multiple $RUNDATA's to have different GDG controls
 #
 # script in $RUNDATA/ctl/... called by jobset51 (called by all JCL/scripts)
 # exportgen1 creates new GDG files in $RUNDATA/$JGDG/subdirs/...
 # - where: JGDG=$RUNDATA/jobtmp/$JOBID2/GDG/
 # - at normal EOJ, GDG files are moved to intended subdirs (NOT if Abterm)
 #
 # user must code names of his site's data file subdirs here
 # - matching the TOPNODEs table in $RUNLIBS/ctl/jclunixop51
 # - following subdirs are for the demo JCL/scripts
 #   (at www.uvsoftware.ca/mvsjcl.htm#Part_1)
 #
 #Mar14/09 - JCL converter option g1 inserts $JGDG/... on new GDGs exportgen1
 # - new option 'g0' omits $GDG/ so new GDGs in same subdir as old
 # - this GDGmkdirs script must still exist (since called by jobset51)
 #   BUT, subdirs created will not be used, since no files redirected to $JGDG/
 #
 if [[ ! -d $JTMP ]]; then
    echo "JTMP not defined or not in \$RUNDATA"; exit 81; fi
 #
 # make $JGDG/ for gdg subdirs
 # also make $GTMP/ for exportgen0/1 'ls' outputs to determine latest gen#s
 if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi
 if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi
 #
 # You MUST code mkdirs for the subdirs desired at your site
 #==========================================================================
 if [[ ! -d $JGDG/data ]]; then mkdir $JGDG/data; fi
 #Aug29/2011 - consolidated all datafiles into 1 directory (data1/...)
 # old subdirs ar/ gl/ py/ #cmtd out, now top level node, for example:
 # $RUNDATA/ar/customer.master --> $RUNDATA/data1/ar.customer.master
 #-------- old mkdirs below replaced by the 1 mkdir data above ----------
 # if [[ ! -d $JGDG/ar ]]; then mkdir $JGDG/ar; fi
 # if [[ ! -d $JGDG/gl ]]; then mkdir $JGDG/gl; fi
 # if [[ ! -d $JGDG/py ]]; then mkdir $JGDG/py; fi
 # if [[ ! -d $JGDG/mstr ]]; then mkdir $JGDG/mstr; fi
 # if [[ ! -d $JGDG/data ]]; then mkdir $JGDG/data; fi
 # if [[ ! -d $JGDG/tape ]]; then mkdir $JGDG/tape; fi
 exit 0

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3E3. conversion support files - ctl/jclunixop5

Customizing the JCL Conversion control file

The files listed above is correct for the 'mvstest' system & will not need any changes to convert & execute the demo scripts & programs provided. However you will need to modify for your own JCL conversions. You should 1st run the 'mvstest' conversions beginning on page '1Q1' (& verify the results match the listings in section 1C1), before modifying for your own JCL conversions.

This file (ctl/jclunixop5) controls various activities performed by the jclunix51 conversion program. Several options are specified on line 1:


 jclunixop51:b0c0d1g31e1f0i1j0k1l20m1n3o0p0r0s0t1u1w0x0y1z0 #<-- options
 ==========================================================

See explanations in the full listing above on page '3E1'.

Note the search/replace tables to modify conversion for site variances you can use REPTBL2 to modify the directory name taken from the top-node of DSNs.

you can use the DROPDDN & DROPDSN tables to get rid of mainframe file definitions that have no relevance to unix/linux scripts (such as PROCLIB, STEPLIB, JOBLIB, etc)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3F0. Control Files for JCL Converter

datafile information sources for JCL converter

The JCL converter looks up an Indexed file 'ctl/datactl53I' to get information about the data-files (record-size, file-type, key-location/length, GDG or not). This info is required for SORTs, IDCAMS, IEBGENER, etc that are converted to uvsort & uvcp.

The mainframe JCL did not necessarily specify record-size etc, since this info could be obtained from the mainframe VTOC or LISTCAT. But there is no VTOC or LISTCAT on unix/linux, so we will supply that info to the JCL converter via an Indexed file (ctl/datactl53I). We can collect datafile info from 6 sources as described below.

 We show the uvcopy utility jobnames below the -------> lines. For example
 uvcopy job 'jcldata51' is used to create 'ctl/datajcl51', which is then
 processed/resorted by 'jcldata52' to create 'ctl/datajcl52'.

 #1. JCL -----------> ctl/datajcl51 -----------> ctl/datajcl52
          jcldata51                  jcldata52
     - datafile info extracted from all JCL
     - this is the primary & only mandatory datafile info source
     - create null files for any files below not available

 #2. LISTCAT -----------> ctl/datacat51 -----------> ctl/datacat52
              catdata51                  catdata52
     - info extracted from LISTCAT (mainframe report)
     - optional, if absent create null file >ctl/datacat52

 #3. Excel spreadsheet#1 -----------> ctl/dataxl151 ----------> ctl/dataxl152
                          xl1data51                  xldata52
     - info extracted from Excel spreadsheet #1
     - optional, if absent create null file >ctl/dataxl152

 #4. Excel spreadsheet#2 -----------> ctl/dataxl251 -----------> ctl/dataxl252
                          xl2data51                  xl2data52
     - info extracted from Excel spreadsheet #2
     - optional, if absent create null file >ctl/dataxl252

 #5. ----------> ctl/dataedt52
      editor
     - info created manually with editor (no uvcopy job involved)
     - may supply info not available from other 5 sources
     - optional, if absent create null file >ctl/dataedt52

 #6. EBCDIC datafiles -----------> ctl/datacnv51 -----------> ctl/datacnv52
                       cnvdata51                  cnvdata52
     - info created by scanning the EBCDIC datafiles
     - currently indicates only if packed/binary fields present
     - optional, if absent create null file >ctl/datacnv52

 #7. Six ...52 files above -----------> ctl/datactl53 -----------> ctl/datactl53I
                            ctldata53                  uvcp (load Indexed file)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3F1. Control Files for JCL Converter

sample datajcl51

Note
  • 12 lines of output records are shown twice (split to left & right sides)
  • because the lines are longer than allowed by printed documentation
  • the 2nd list omits filename & cntf so you can see all keywords on right
  • you can match lines using the inserted 2 digit sequence#

 #01 &&TEMPGLM                    cntf=0016 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL1
 #02 AR.CUSTOMER.MASTER           cntf=0010 rca=00000 rcm=00000 typ=RSF src=J___________ job=jar100 prg=CAR100
 #03 AR.CUSTOMER.NAMEADRS.LIST100 cntf=0002 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jar109 prg=CAR100
 #04 GL.ACCOUNT.ACNTLIST(+1)      cntf=0001 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100
 #05 GL.ACCOUNT.MASTER            cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14
 #06 GL.ACCOUNT.MASTER(+1)        cntf=0014 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL2
 #07 GL.ACCOUNT.MASTER(0)         cntf=0020 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl100 prg=CGL100
 #08 GL.ACCOUNT.MASTER2           cntf=0002 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6)
 #09 GL.ACCOUNT.TRANS(+1)         cntf=0005 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl211 prg=SORT
 #10 PY.PARMS(PPY200S1)           cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy200 prg=SORT
 #11 PY.TIME.&DAY..&MONTH..&YEAR  cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy910 prg=IEFBR14
 #12 PYTEST.PAYROLL.MASTER        cntf=0006 rca=00200 rcm=00200 typ=ISF src=Jk__________ job=jpy400 prg=IDCAMS key=(0,8)

sample datajcl51 - right side (filename omitted)


 #01 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL1
 #02 rca=00000 rcm=00000 typ=RSF src=J___________ job=jar100 prg=CAR100
 #03 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jar109 prg=CAR100
 #04 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100
 #05 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14
 #06 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL2
 #07 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl100 prg=CGL100
 #08 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6)
 #09 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl211 prg=SORT
 #10 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy200 prg=SORT
 #11 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy910 prg=IEFBR14
 #12 rca=00200 rcm=00200 typ=ISF src=Jk__________ job=jpy400 prg=IDCAMS key=(0,8)

sample datajcl52 (jcldata51 filenames lowercased)


 #02 ar.customer.master               rca=00000 rcm=00000 typ=RSF src=J___________ job=jar100 prg=CAR100
 #03 ar.customer.nameadrs.list100     rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jar109 prg=CAR100
 #04 gl.account.acntlist_             rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100
 #05 gl.account.master                rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14
 #06 gl.account.master2               rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6)
 #07 gl.account.master_               rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL2
 #08 gl.account.master_               rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14
 #09 gl.account.trans_                rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl211 prg=SORT
 #10 py.parms@ppy200s1                rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy200 prg=SORT
 #11 py.time.${DAY}.${MONTH}.${YEAR}  rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy910 prg=IEFBR14
 #12 pytest.payroll.master            rca=00200 rcm=00200 typ=ISF src=Jk__________ job=jpy400 prg=IDCAMS key=(0,8)
Note
  • jcldata52 processes & resorts ctl/datajcl51 to ctl/datajcl52
  • changing filenames from Mainframe standards to VU unix script standards
  • filenames translated to lowercase, &SYMBOLS converted to ${SYMBOLS}, etc
  • GDG file indicators (0),(+1),etc changed to trailing '_' for VU scripts
  • any PDS library(member) is converted to library@member
  • any temp files (&&TEMPGLM) are dropped

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3F2. Control Files for JCL Converter

Secondary control files for JCL converter

The primary datafile info source for the JCL converter is ctl/datajcl51 which was shown on the previous page. There are 5 other sources which are illustrated below. If you don't have them, just create null files so the conversions run OK.

The files shown here were created for the 'mvstest' demos in Part_1. You can see some more realistic examples in Part 4 where we document the procedures for converting YOUR JCL (vs the test/demo JCL).

From the summary on page '3F0' you will know that most of the 6 sources are created in 2 stages. For example LISTCAT info is 1st extracted to ctl/datacat51, which is further processed to ctl/datacat52, which is then combined with the other 5 sources to create ctl/datactl53.

For most of the 5 secondary sources, we will show only the ...51 file. The main difference is that the ...52 files are converted from mainframe standards to VU ksh script standards (lowercase, &symbols to ${SYMBOLS}, etc).

ctl/datacat51 - info from LISTCAT

 PY.PAYROLL.MASTER        rca=00128 rcm=00239 typ=IDXf8v cntr=15946788 src=__Lk________ key=(0000,0016)
 PY.TIME.CARDS            rca=00080 rcm=00080 typ=RSF    cntr=00000102 src=__Lr________
 PYTEST.PAYROLL.MASTER    rca=00256 rcm=00384 typ=IDXf8v cntr=00000537 src=__Lk________ key=(0010,0022)
 PYTEST.PAYROLL.MASTER2   rca=00128 rcm=00256 typ=IDXf8v cntr=00006597 src=__Lk________ key=(0000,0011)

ctl/datacat52 - info from LISTCAT

 py.payroll.master      rca=00128 rcm=00239 typ=IDXf8v  src=__Lk________ key=(0000,0016)
 py.time.cards          rca=00080 rcm=00080 typ=RSF     src=__Lr________
 pytest.payroll.master  rca=00256 rcm=00384 typ=IDXf8v  src=__Lk________ key=(0010,0022)
 pytest.payroll.master2 rca=00128 rcm=00256 typ=IDXf8v  src=__Lk________ key=(0000,0011)
  1. LISTCAT may be the best of the 5 secondary sources of datafile information. You probably will not need any of the others if you can transfer the LISTCAT report from the mainframe & convert it as described in Part_4.

  2. LISTCAT reports include all required info (record-sizes, etc) for VSAM files, but NOT for non-VSAM files. That is 1 reason for the other 4 info sources.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3F3. Control Files for JCL Converter

ctl/dataxl151 - info from Excel spreadsheet#1

 AR.CUSTOMER.MASTER      cpy=____________ rca=00256 rcm=00256 src=____Xr______
 PY.PAYROLL.MASTER       cpy=____________ rca=00320 rcm=00320 src=____Xr______
 PY.TIME.CARDS           cpy=____________ rca=00088 rcm=00088 src=____Xr______
 PYTEST.PAYROLL.MASTER   cpy=____________ rca=00384 rcm=00384 src=____Xr______
  1. This Excel spreadsheet info was available at a site where LISTCAT was not, so UV Software wrote the xl1data51,52 & xl2data51,52 jobs to extract the information & combine with the other JCL & LISTCAT info to create the ctl/datactl53I info file used by the JCL converter.

  2. Therefore, this is not directly transferrable to other sites, but if you have similar Excel spreadsheets, UV Software might modify the jobs to process your particular Excel spreadsheet formats.

  3. Note that the copybook info 'cpy=____________' was captured here for use by the DATA conversion tools - see MVSDATA.htm#Part_4.

    ctl/dataxl251 - info from Excel spreadsheet#2

 AR.ACCOUNT.MASTER       src=______Yi____ prg=IKJEFT01
 GL.ACCOUNT.MASTER       src=______Yi____ prg=PDM00800
  1. This 2nd Excel was another existing spreadsheet with several other fields that we ignored. Primarily we wanted to extract the fact that this was an 'input file that we needed to convert (vs many other inter-step work files that we did not need to convert).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3F4. Control Files for JCL Converter

ctl/dataedt52 - info created with the editor

 py.payroll.master     rca=00249 rcm=00249 typ=ISF key=(0,22)
 py.time.cards_        rca=00080 rcm=00080 typ=RSF
  1. ctl/dataedt52 may be created with the editor to supply info that is not available from any of the automated sources.

  2. Just create a null file for your 1st conversion. For subsequent conversions you can add info here especially for high volume files with missing info (record sizes, etc).

  3. You can edit the info here in 1 place & on reconversion it will get coded on all occurrences of that file in all your JCLs, which is better than having to manually correct many separate JCL/scripts.

    ctl/datacnv51 - info from EBCDIC datafiles

 gl.account.trans_000001                      src=__________A_
 ar.customer.master                           src=__________Ap
 gl.account.acntlist_000001                   src=__________Ap
 ar.nameadrs.list100                          src=__________Ap

ctl/datacnv52 - info from EBCDIC datafiles

 ar.customer.master                           src=__________Ap
 ar.nameadrs.list100                          src=__________Ab
 gl.account.acntlist_                         src=__________Ap
 gl.account.trans_                            src=__________A_
  1. ctl/datacnv51 was included only to indicate which files had 'p'acked or 'b'inary fields. This was used more for the datafile conversions than for the JCL conversions.

  2. 'cnvdata51' scans the datafiles for packed/binary fields. Note that GDG filenames will have suffix '_000001' for conversion. 'cnvdata52' will modify to agree with the conventions used in the JCL/scripts to reference GDG datafiles (replace '_000001' with just a trailing '_').

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

3F5. Control Files for JCL Converter

ctl/datactl53 - 6 datafile info sources combined


 #02 ar.customer.master             rca=00256 rcm=00256 typ=RSF    src=J___Xr____Ap job=jar100   prg=CAR100
 #03 ar.customer.nameadrs.list100   rca=00133 rcm=00133 typ=RSF    src=Jr________Ap job=jar109   prg=CAR100
 #04 gl.account.acntlist_           rca=00133 rcm=00133 typ=RSF    src=Jr__________ job=jgl100   prg=CGL100
 #05 gl.account.master              rca=_____ rcm=_____ typ=RSF    src=J___________ job=jgl900   prg=IEFBR14
 #06 gl.account.master2             rca=00080 rcm=00080 typ=ISF    src=Jk__________ job=jgl360   prg=IDCAMS   key=(0,6)
 #07 gl.account.master_             rca=00080 rcm=00080 typ=RSF    src=Jr__________ job=jgl900   prg=COBOL24
 #08 gl.account.trans_              rca=00080 rcm=00080 typ=RSF    src=Jr__________ job=isrsupc1 prg=SORTUPC
 #09 py.parms@ppy200s1              rca=_____ rcm=_____ typ=RSF    src=J___________ job=jpy200   prg=SORT
 #10 py.time.${DAY}.${MONTH}.${YEAR} rca=_____ rcm=_____ typ=RSF    src=J___________ job=jpy910   prg=IEFBR14
 #11 pytest.payroll.master          rca=00384 rcm=00384 typ=IDXf8v src=JkLkXr______ job=jpy400   prg=IDCAMS   key=(0010,0022)

ctl/datactl53a - omitting filenames to show right side


 #02 rca=00256 rcm=00256 typ=RSF    src=J___Xr____Ap job=jar100   prg=CAR100
 #03 rca=00133 rcm=00133 typ=RSF    src=Jr________Ap job=jar109   prg=CAR100
 #04 rca=00133 rcm=00133 typ=RSF    src=Jr__________ job=jgl100   prg=CGL100
 #05 rca=_____ rcm=_____ typ=RSF    src=J___________ job=jgl900   prg=IEFBR14
 #06 rca=00080 rcm=00080 typ=ISF    src=Jk__________ job=jgl360   prg=IDCAMS   key=(0,6)
 #07 rca=00080 rcm=00080 typ=RSF    src=Jr__________ job=jgl900   prg=COBOL24
 #08 rca=00080 rcm=00080 typ=RSF    src=Jr________A_ job=isrsupc1 prg=SORTUPC
 #09 rca=_____ rcm=_____ typ=RSF    src=J___________ job=jpy200   prg=SORT
 #10 rca=_____ rcm=_____ typ=RSF    src=J___________ job=jpy910   prg=IEFBR14
 #11 rca=00384 rcm=00384 typ=IDXf8v src=JkLkXr______ job=jpy400   prg=IDCAMS   key=(0010,0022)
  1. ctl/datactl53 is the final result of 6 possible sources sorted together collecting keyword info on the right side of 1 entry per unique filename.

  2. ctl/datactl53 is a valuable list of all datafiles & their attributes. I suggest you list it for handy reference during & after conversion. You might use the 'uvlp14LD' script for Landscape Duplex.

    uvlp14LD ctl/datactl53
    ======================
  1. ctl/datactl53 is loaded into Indexed file ctl/datactl53I for use by the JCL converter. Script 'jcldata51A' is the easiest way to load the Indexed file. It runs jcldata51, jcldata52, ctldata53,& a uvcp to load the Indexed file. You must have created the other 5 data...52 info files OR made null files.

    jcldata51A all
    =============
  1. jcldata51A is called by 'jcl2ksh51A' the script that performs all steps of converting all JCL, PROCs, parms to Korn shell scripts.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_4 Converting 'YOUR' MVS JCL to Korn shell scripts

Part 4 Contents


4A1. Introduction & Overview

4B1. Plan Your conversion (vs the 'test/demo' conversions in Part_1)
- also see the 25 point preparation summary in uvprices.htm#G1.
- the Vancouver Utilities makes the conversions fast,
- but you must test all JCL/scripts & COBOL programs
- we suggest allowing 6 months to 1 year for the conversion project
- we suggest 4 to 8 weeks of UV Software onsite training
  & conversion assistance
- install unix/linux O/S software (Red Hat, SUN, AIX, HP, etc)
- setup userid 'uvadm' for the Vancouver Utilities
- setup userid 'appsadm' (administrator for your applications)

4B2. Install the Vancouver Utilities

4B3. Setup the 'profiles' for uvadm, appsadm,& your conversion team members
- common_profile, 'rc' files in /home/appsadm/env
- stub_profiles in each user homedir (overwrite .profile or .bash_profile)

4C1. Design/setup optimum directory structure for Your site
- for conversion, testing,& production
- see several alternative designs at ADMjobs.htm#Part_2

4D1. Copy Vancouver Utility supplied control files & functions
- control files supplied in /home/uvadm/ctl, copy to your $RUNLIBS/ctl/...
  (jclunixop51,cobdirectives,extfh.cfg,cnvcob5.tbl)
- functions supplied in /home/uvadm/sfun, copy to your $APPSADM/sfun/...
  (jobset51 logmsg1 exportfile,exportgen0,exportgen1,exportgenall,etc)
4D2.  script to copy supplied control files & functions to your subdirs

4E1. JCL converter control file options - modify for your site
4E2.  control file search/replace tables for TopNode/subdirs
4E3.  Customize JCL conversion by modifying the control file ctl/jclunixop51
4E4. full-PATH or relative-PATH data filenames
4E5.  Running 'statmvsjcl1' to create a table summary of Top-Nodes in your JCL
- modify the TOPNODES table to change &/or consolidate topnodes
  (which are usually used as sub-directories for data files)
4E7.  ctl/GDGmkdirs - script to make topnode/subdirs for new generations of GDGs
- must be updated with your TopNode/subdirs

4F1. Transfer JCL, COBOL,& DATA files from the mainframe for initial testing
- suggest zipping all files of the same type
- transfer any PROC's, SLI's, INCLUDE's, Parms, etc
- run LISTCAT on mainframe & transfer to unix to assist datafile convert

4G1. Convert All COBOL copybooks & All COBOL programs
- COBOL conversion is the easiest & it makes sense to do it first
- Initial conversion All programs must be performed as per MVSCOBOL.htm
- script cnvMF51A provided for re-conversions during conversion period

4G2. Convert 1 COBOL copybook & 1 COBOL program at a time
- scripts cnvMF51cpy & cnvMF51

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part 4 Converting 'YOUR' MVS JCL to Korn shell scripts

Part 4 Contents (continued)


4H1. Create the data conversion control file (ctl/datacnv54) from LISTCAT
- record sizes, indexed keys, file types
- need to manually edit the copybook corresponding to each data file

4I1. Convert Your DATA files (at least enough for some initial testing)
- converting DATA before JCL makes sense because the LISTCAT info
  is required 1st for DATA conversion & then for JCL conversion
- see complete details in MVSDATA.htm

4I2. You must follow MVSDATA.htm#Part_4 to generate DATA conversion jobs

4I3. $CNVDATA subirs required to generate & execute data conversion jobs

4I4. Re-executing the jobs to convert ALL datafiles (refreshed from mainframe)
- may need to do 2 or 3 times during 1 year conversion/test period

4I5. Copying converted data files to $RUNDATA (test or production)
- creating subdirs for topnodes (using script 'copy2nodes')

4I6. Convert 1 datafile at a time, in $CNVDATA,& copying to $RUNDATA

4J1. Initial conversion of All Your JCL (directories involved)
4J2. Review preparations for conversion (4A1-4F1 above)
4J3. jcl2ksh51A (do everything script) vs step by step method below (4K1-4K5)

4K1. step by step conversion
cleanup mainframe JCL, PROCs, Parms,& expand PROCs

4K2. create the JCL conversion data control file from up to 6 sources
- info extracted from JCL, LISTCAT, spreadsheets,& edited info
- result loaded to Indexed file ctl/datactl53I accessed by JCL converter

4K5. final step convert JCL with expanded procs to Korn shell scripts
- guided by data control file & JCL converter options file

4L0. Preparations Required Before you can begin testing/debugging your scripts

4L1. Create GDG control file (used to get no of generations for GDG files)
- see complete details in Part_5.
- could initially create empty Indexed file so you test non-GDG jobs

4L2. Operating Instructions to create GDG control file

4L3. Cross References for COBOL & JCL/scripts are a big help for test/debug.
Generate & print the cross-references now before you begin test/debug.

4L4. Job-Flow reports are also a big help for test/debug.
- show the datafile I/O from step to step
- generate all reports in subdir jobflow/... & print as needed

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part 4 Converting 'YOUR' MVS JCL to Korn shell scripts

Part 4 Contents (continued)


4L5. Extract control cards from JCL to separate files
- optional jobs to extract control cards from all JCLs so you can update
  them separately form the JCL/scripts.
- control card files are date-stamped to allow updates for future dates.

4M1. Test/Debug a few JCL/scripts & use this experience to fine tune the
JCL/script conversion options & control files.
Aids to assist test/debug of JCL/scripts
4M2. 'testdatatinit' script to clear temp files to highlight new files created
4M3. joblog - capture console log from job being debugged
4M4. jobstop - activate stepctl51 to stop at begin each step until go/clear

4N1. Reconvert 1 JCL at a time as you modify & test/debug the scripts
- script 'jcl2ksh51' to reconvert 1 JCL

4N2. Reconvert All JCL to capture fine tuning benefits
- script 'jcl2ksh51A' reconverts All jcl0->jcl1->jcl2->jcl3
- JCL/scripts are copied 1 at a time from the converted subdir (jcl3)
  to the active-PATH subdir (jcls) only when programmer ready to test/debug

4N4. Assign JCLs to various conversion team members for test/debug

4O1. Aids & Techniques to assist test/debug
- set up testdata in your homedir to avoid conflicts with other programmers

4O2. using uvhd & uvhdcob to display your files with packed & binary fields
- uvhd already documented
- uvhdcob displays COBOL copybook fieldnames beside data field contents

4P1. Determine conversion solutions for 3rd party software such as
DITTO, EASYTRIEVE, etc.
The JCL converter does convert SORT, IDCAMS, IEBGENER, and some DITTOs.
An Easytrieve to uvcopy converter is provided for the simpler jobs.
You may have to write COBOL programs for with more complex Easytrieves.

4Q1. Setup Your backup scripts now to protect your programmers from 'oops'
- see several backup scripts in ADMjobs.htm#Part_4
- setup appsadm 'crontabs' to backup cnvdata, testdata,& testlibs
  every night to both tape & disc (see ADMjobs.htm#Part_5
- can have 1 or 2 days backups on disc for immediate recoveries

4R1. Setup console logging (essential for production)
- programmers can use the 'joblog' script for debugging
- good idea to setup on the test machine to try it out before production

4S1. Run parallels with mainframe when you have enough JCL/scripts debugged
Re-transfer mainframe JCL,COBOL,& DATA a few times during conversion period
 Setup the production machine & Go live (over a weekend usually)
 Need to re-transfer all data files on the 'Go Live' weekend, but JCL
 & programs should not need re-transfer/reconvert at this point

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4A1. Converting YOUR MVS JCL to Korn shell scripts

Introduction & Overview

Part 4 is intended to present a plan for you to follow in converting 'YOUR' JCL (vs the test/demo conversions illustrated in Part_1.

Your JCL conversion will be the primary focus in Part 4, but we will refer you to other parts of the documentation for the many other procedures required to make the entire conversion successful.

In fact this (Part 4 of MVSJCL.doc) is probably your best roadmap to follow when planning & executing your conversion.

Note that you must follow the step by step method for your 'first' conversion of all JCL, but for subsequent conversion you may use the handy scripts provided to convert all JCL with 1 command.

Part 4 also gives the operating instructions for the scripts to re-convert All COBOL,& DATA files, but you must use the step by step method for the 'first' conversions as documented in MVSCOBOL.htm & MVSDATA.htm.

before digging in to Part 4

Before you dig into this very detailed conversion plan, I recommend you review the very concise '25 point preparation plan' presented in uvprices.htm#G1.

Also review the 'optional conversions' described at uvprices.htm#K0.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4B1. Converting YOUR MVS JCL to Korn shell scripts

Planning Your conversion

Part 4 is intended to present a plan for you to follow in converting 'YOUR' JCL (vs the test/demo conversions illustrated in Part_1.

The Vancouver Utilities makes the conversions fast. But since you must test all JCL/scripts & COBOL programs, you should allow from 6 months to 1 year for the conversion project.

We recommend having UV Software personnel onsite for training & conversion assistance. We suggest an initial 4 weeks & perhaps another 3 or 4 weeks 2 or 3 months later.

setup hardware & install unix/linux

We recommend Red Hat Enterprise Linux, but the Vancouver Utilities will run under most popular unix systems (SUN, AIX, HP, etc).

Please see ADMjobs.htm#Part2 for some suggestions about setting up your unix/linux system (RAID arrays, disc partitioning, etc).

We strongly recommend Micro Focus COBOL and please ensure that your unix/linux O/S is certified by Micro Focus COBOL.

Setup users & groups for programmers & operators

  1. You might setup group 'apps' for all users involved in the conversion project. You need a common group so users can work on a common set of JCL/scripts & programs. Security is extended to the group level (directories 775 & files 664).

  2. Setup userids for your programmers & operators (all with group 'apps')

  3. Also setup userid 'uvadm' for the Vancouver Utilities administrator & setup userid 'appsadm' for your applications administrator.

  4. We are not setting up profiles until the Vancouver Utilities are installed (next page), because the recommended profiles are included on the VU distribution media.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4B2. Converting YOUR MVS JCL to Korn shell scripts

Installing the Vancouver Utilities

Please see install.htm for detailed instructions to install the Vancouver Utilities from the distribution CD & to compile the C programs on your machine.

setup 'profiles' for uvadm,appsadm,& your team

The profiles are supplied in /home/appsadm/env/... & consist of multiple parts.

  1. stub_profile - copy to user homedirs overwriting .profile or .bash_profile - defines RUNLIBS as testlibs for programmers OR prodlibs for operators - defines RUNDATA as testdata for programmers OR proddata for operators

  2. common_profile - called by 'stub_profile' - defines search PATHs to libraries & data based on $RUNLIBS & $RUNDATA

  3. 'rc' files (.bashrc/.kshrc) - copy to user homedirs. 'rc' files reestablish aliases, that are disabled if console logging is activated.

See the profiles listed begining at ADMjobs.htm#1B1

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4B3. Converting YOUR MVS JCL to Korn shell scripts

profiles

Profiles are split to 2 parts (stub_profile & common_profile). Profiles are supplied in /home/uvadm/env/... but should be copied to /home/appsadm/env/... & modified there depending on site requirements.

Note that the 'stub_profile' is copied to each users homedir & renamed as .bash_profile for Linux & .profile for unix. You must then modify the stub_profile definitions of RUNLIBS & RUNDATA depending on whether the user is a programmer or an operator.

Please see the profile listings at ADMjobs.htm#1C1 but here are some examples of critical definitions extracted from common_defines & stub_profile.

common_defines

      export TESTLIBS=/p1/apps/testlibs
      export TESTDATA=/p1/apps/testdata
      export PRODLIBS=/p2/apps/prodlibs
      export PRODDATA=/p2/apps/proddata
      export CNVDATA=/p4/apps/cnvdata

stub_profile

RUNLIBS, RUNDATA,& CNVDATA are assigned in the .profile or .bash_profile of programmers & operators. see the stub_profile listed at ADMjobs.htm#1C1. stub_profiles should use only the $symbols defined in common_defines.

 export RUNLIBS=/p1/apps/testlibs     <-- for programmers
 export RUNDATA=/p1/apps/testdata
 export CNVDATA=/p1/apps/cnvdata
 export RUNLIBS=/p2/apps/prodlibs     <-- for operators
 export RUNDATA=/p2/apps/proddata
 export RUNLIBS=$HOME/testlibs   <-- for programmers, who wish to test
 export RUNDATA=$HOME/testdata       in their homedir, only for education
 export CNVDATA=$HOME/cnvdata        & exception testing (no development)
Note
  • if you modify RUNLIBS,RUNDATA,CNVDATA in your profile:
  • you must logout & back in to make the changes effective
  • $RUNLIBS,$RUNDATA used in many places in PATH

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4C1. Converting YOUR MVS JCL to Korn shell scripts

Directories for test/demo conversions in Part_1

Up to this point the directory design was intended only to test/demo the UV conversion procedures using the supplied JCL & PROCs. In Part_1 we setup our test/demo directories in homedir (mvstest) for convenience & simplicity.

 /home
 :----user1
 :----user2
 :-----etc-
 :----mvstest
 :    :----testlibs     <-- $RUNLIBS for demo JCL conversions in Part_1
 :    :    :----cbls
 :    :    :----jcls
 :    :    :-----etc-
 :    :----testdata     <-- $RUNDATA for demo JCL conversions in Part_1
 :    :    :----data1/    - all files in 1 subdir
 :    :    :----ar
 :    :    :----gl        - OR use topnode as subdir
 :    :    :----etc

You should not use homedirs for your actual conversion, testing,& production for several reasons which will be explained below.

I recommend separate file systems for test-libraries, test-data, production-libraries, & production-data. This gives you a lot more flexibility for backups and any required restores. Separate file systems protects other file systems in case of runaway programs filling up the data file system. Other file systems are also protected against corruption in any 1 file system.

We have already explained how RUNLIBS & RUNDATA are defined in the profiles to control the locations of the active libraries (test or production) and the locations of the active data (test or production). From the following pages you can see that RUNLIBS & RUNDATA for programmers & production personnel might be:

export RUNLIBS=/p1/apps/testlibs <-- testlibs/testdata for programmers

export RUNDATA=/p1/apps/testdata

export RUNLIBS=/p2/apps/prodlibs <-- prodlibs/proddata for operators

export RUNDATA=/p2/apps/proddata

/p1, /p2, /p3, /p4 are file system mount points, which could be different on your system, but all our conversion scripts & generated JCL/scripts will work without change, since they all depend on RUNLIBS & RUNDATA, which are defined in the profiles of programmers & operators.

The next few pages will illustrate the details of testlibs/testdata & prodlibs/proddata, and also describe the uses of /p3 for backup/restore, and /p4 for data conversions.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4C2. Converting YOUR MVS JCL to Korn shell scripts

Directories for YOUR Conversion,Testing,& Production

 /root
 /...              <-- unix/linux O/S directories
 /...
 /home             <-- home directories
 :----user1
 :----user2
 :----etc---
 :
 /p1/apps               <-- /p1 file system mount point
 :----testlibs       - test-libraries & test-data
 :----testdata
 /p2/apps               <-- /p2 file system mount point
 :----prodlibs       - production-libraries & production-data
 :----proddata
 /p3/apps               <-- /p3 file system mount point
 :----backup         - backup & restore directories
 :----restore
 /p4/apps               <-- /p4 file system mount point
 :----cnvdata        - data conversion directories

Note that this file design is the first practical design that you would want to use for your development & production. The earlier test/demos used home directories (/home/mvstest) which should not be used for your development & production because:

  1. The /home file system would not usually have sufficient space allocated for your large data files.

  2. You should have separate file systems to protect against runaway COBOL programs filling up the entire file system, rather than just the data file system. Other file systems are also protected against corruption in any 1 file system.

  3. You should have separate file systems designed to facilitate your backup & restore procedures. You should be able to do backup/restores separately for testlibs, testdata, prodlibs,& proddata.

  4. Separate file systems facilitate writing backup tapes with multiple archives. The restore script allows you to restore just the desired archive, rather than the entire tape, saving time & disc space.

    Alternative File System Designs

The next few pages will present the details of this 1st practical yet simple file system design. Also see alternative file designs in ADMjobs.htm#Part_2 that discuss provisions for multiple companies &/or multiple separate applications. ADMjobs also gives a brief description of using RAID for your O/S & applications.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4C3. Converting YOUR MVS JCL to Korn shell scripts

Libraries for Your Conversion & Testing

Please understand the preceding notes about these directory structures.

       '--MF--' marks subdirs transferred from your MainFrame for conversion
       '--UV--' marks control files & functions supplied by UV Software
 /p1/apps
 :-----testlibs        <-- RUNLIBS=/p1/apps/testlibs
 :     :------Csub       - C subroutines for COBOL programs
 :     :--MF--cbl0       - your COBOL programs transferred from mainframe
 :     :------cbl1       - cleaned up, cols 1-6 & 73-80 cleared, etc
 :     :------cbl2       - cnvMF5 converts mainframe COBOL to Micro Focus COBOL
 :     :------cbl3       - optional to convert accept sysin to read from a file
 :     :------cbls       - copy here (standard source library) before compiling
 :     :------cblst      - cobol source listings from compiles
 :     :------cblx       - compiled COBOL programs (.int's)
 :     :--MF--cpy0       - for COBOL copybooks
 :     :------cpy1       - cleaned up, cols 1-6 & 73-80 cleared, etc
 :     :------cpy2       - cnvMF5 converts mainframe COBOL to Micro Focus COBOL
 :     :------cpys       - copy here (standard copybook library)
 :     :------ditto0     - DITTO jobs from MainFrame
 :     :------ditto1     - DITTO jobs cleaned up
 :     :------dittos     - DITTO jobs converted to uvcopy
 :     :------ezt0       - EasyTrieve jobs from MainFrame
 :     :------ezt1       - EasyTrieve jobs cleaned up
 :     :------ezts       - EasyTrieve jobs converted to uvcopy
 :     :------ftp        - subdir for FTP transfers
 :     :--UV--ctl        - conversion control files (jclunixop51, datactl53I)
 :     :------include1   - optional (PROC expansion allows include files)
 :     :--MF--jcl0       - your JCLs transferred from mainframe
 :     :------jcl1       - intermediate conversion 73-80 cleared
 :     :------jcl2       - PROCs expanded from procs
 :     :------jcl3       - JCLs converted to Korn shell scripts
 :     :------jcls       - copy here manually 1 by 1 during test/debug
 :     :------jobparmx1  - datacards extracted from JCL/scripts (date-stamped)
 :     :------jobparmx2  - datacards extracted from JCL/scripts (no datestamps)
 :     :------maps       - 'cobmaps' record layouts generated from copybooks
 :     :------pf         - uvcopy jobs to replace utilities (easytrieve,etc)
 :     :--MF--proc0      - your PROCs transferred from mainframe
 :     :------procs      - will be merged with jcl1, output to jcl2
 :     :------sf         - for misc scripts you may wish to write
 :     :------tmp        - tmp subdir used by various conversions
 :     :------xref       - cross-references (see XREFjobs.htm)

 mvslibsdirs       <-- script to create above subdirs
 ===========

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4C4. Converting YOUR MVS JCL to Korn shell scripts

DATA Directories for Your Testing

 /p1/apps
 :-----testdata             <-- RUNDATA=/p1/apps/testdata
 :     :-----data1/           - all files in 1 subdir
 :     :-----ar
 :     :-----gl               - option to use top-node as subdir
 :     :-----py
 :     :-----ctl               - GDG control file
 :     :-----jobctl            - for jobstop stop at begin each step for debug
 :     :-----joblog            - Job Debug logs stored here (by joblog script)
 :     :-----jobmsgs           - progress msgs (step begin, end Normal/AbTerm)
 :     :-----jobparms1         - current datacards from $RUNLIBS/jobparmx1 at 6PM
 :     :-----jobparms2         - datacards from $RUNLIBS/jobparmx2 at 6PM
 :     :-----jobtmp            - job temporary files
 :     :-----mstr              - could put all datafiles in 1 subdir
 :     :-----pf                - user written uvcopy jobs
 :     :-----rpts            <-- reports
 :     :-----sf                - user written Korn shell scripts
 :     :-----sysout            - COBOL DISPLAY upon SYSLST reports
 :     :-----tape            <-- tape files reassigned to disc by JCL converter
 :     :-----tmp               - misc temp files & sort work files
 :     :-----wrk             <-- work files (inter-step)

 mvsdatadirs       <-- script to create above subdirs
 ===========
Note
  • the 'dtree' script shows only 'directory' names
  • also see the next page where we have added a few 'filenames'
  • to give you a better understanding of these 'data directories'

shortcuts to convert a few JCL ? (preliminary)

See page '1X1', if you need to do a quick preliminary conversion of a few of your JCLs before you invest the time & effort that should be expended when you launch your mainframe conversion project.

You could setup the 'testlibs' superdir in a new user homedir or within your own homedir & use script 'mvslibsdirs' to setup the required subdirs. Page '1X2' uses script 'jcl2ksh51A' to perform all steps of JCL conversion.

BUT again, we strongly recommend you follow these detailed procedures in here in Part 4, to perform any serious mainframe conversion project.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4C5. Converting YOUR MVS JCL to Korn shell scripts

DATA Directories for Your Testing

Note
  • the 'dtree' script shows only 'directory' names (as on page above)
  • on this page, we have added a few 'filenames'
  • to give you a better understanding of these 'data directories'
 /p1/apps
 :-----testdata             <-- RUNDATA=/p1/apps/testdata
 :     :-----data1/           - all files in 1 subdir
 :     :     :-----customer.master
 :     :     :-----sales.items
 :     :-----gl               - option to use top-node as subdir
 :     :     :-----gl.account.master
 :     :     :-----gl.account.trans
 :     :-----py
 :     :     :-----payroll.master
 :     :     :-----time.cards
 :     :-----ctl               - GDG control file
 :     :-----joblog            - Job Debug logs stored here (by joblog script)
 :     :-----jobmsgs           - vital/error messages here (date/time stamped)
 :     :-----jobparms1         - current datacards from $RUNLIBS/jobparmx1 at 6PM
 :     :-----jobparms2         - datacards from $RUNLIBS/jobparmx2 at 6PM
 :     :-----jobtmp            - job temporary files
 :     :     :-----jobname     - subdir by jobset51 function
 :     :     :     :-----S0080_E212540C  - for job temp files (SYSINs, GDGs)
 :     :-----pf
 :     :-----rpts              - reports
 :     :     :-----070218      - subdir for today's reports
 :     :     :-----070219      - created by function jobset51 on 1st run of day
 :     :     :     :-----JAR200_S0050_E212540C_074648
 :     :-----sf
 :     :-----sysout
 :     :-----tape              - tape files reassigned to disc by JCL converter
 :     :     :-----070218      - subdir for today's tape file outputs
 :     :     :-----070219
 :     :-----tmp
 :     :-----wrk               - work files (inter-step)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4C6. Converting YOUR MVS JCL to Korn shell scripts

Libraries for Your Production

 /p2/apps
 :-----prodlibs          <-- RUNLIBS=$PRODLIBS=/p2/apps/prodlibs
 :     :-----cbls          - end point for converted COBOL programs
 :     :-----cblst         - cobol source listings from compiles
 :     :-----cblx          - compiled COBOL programs (.int's)
 :     :-----cpys          - converted, ready for compiles
 :     :-----jcl3          - JCLs converted to Korn shell scripts
 :     :-----jcls          - copy here manually 1 by 1 during test/debug
 :     :-----jobparmx1     - datacards extracted from JCL/scripts (date-stamped)
 :     :-----jobparmx2     - datacards extracted from JCL/scripts (no datestamps)
 :     :-----pf            - uvcopy jobs to replace utilities (easytrieve,etc)
 :     :-----sf            - for misc scripts you may wish to write
 :     :-----tmp           - tmp subdir used by various conversions

Please compare these production libraries to the conversion & testing libraries on the preceding page. Note that many original mainframe & intermediate conversion subdirs have been dropped, retaining only the fully converted subdirs of COBOL programs, copybooks,& JCL(now Korn shell scripts).

DATA Directories for Your Production

 /p2/apps
 :-----proddata             <-- RUNDATA=$PRODDATA=/p2/apps/proddata
 :     :----data1/            - all files in 1 subdir
 :     :     :-----customer.master
 :     :     :-----sales.items
 :     :-----gl               - OR option to use top-node as subdir
 :     :     :-----gl.account.master
 :     :     :-----gl.account.trans
 :     :-----ctl               - GDG control file
 :     :-----joblog            - Job Debug logs stored here (by joblog script)
 :     :-----jobmsgs           - vital/error messages here (date/time stamped)
 :     :-----jobparms1         - current datacards from $RUNLIBS/jobparmx1 at 6PM
 :     :-----jobparms2         - datacards from $RUNLIBS/jobparmx2 at 6PM
 :     :-----jobtmp            - job temporary files
 :     :     :-----jobname1    - subdir jobname created at job init by jobset51
 :     :-----mstr              - master files (or topnode subdirs as above)
 :     :-----pf
 :     :-----rpts              - reports
 :     :     :-----070218      - subdir for today's reports
 :     :-----sf
 :     :-----sysout
 :     :-----tape              - tape files reassigned to disc by JCL converter
 :     :     :-----070218      - subdir for today's tape file outputs
 :     :-----tmp
 :     :-----wrk               - work files (inter-step)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4C7. Converting YOUR MVS JCL to Korn shell scripts

Backup/Restore Directories

 /p3/apps/backup
 :-----homedirs             <-- $HOMEDIRS backup from last night
 :     :-----appsadm          - showing only 1 user to save lines
 :     :     :-----ctl          & showing only a few subdirs in 1st user
 :     :     :-----env
 :     :     :-----logs
 :     :     :-----...
 :-----homedirs-1           <-- $HOMEDIRS backup from 2 nights ago
 :     :-----...same as above...
 :-----proddata             <-- $PRODDATA backup from last night
 :     :-----ap
 :     :-----ar
 :     :-----gl
 :     :-----rpts
 :     :-----wrk
 :-----proddata-1           <-- $PRODDATA backup from 2 nights ago
 :     :-----...same as above...
 :-----prodlibs             <-- $PRODLIBS backups from last night
 :     :-----cbls
 :     :-----cpys
 :     :-----ctl
 :     :-----jcls
 :     :-----parms
 :-----prodlibs-1           <-- $PRODLIBS backup from 2 nights ago
 :     :-----...same as above...
 :-----zip                  <-- last nights backup (only)
 :     :-----homedirs_070529_0301.zip
 :     :-----proddata_070529_0302.zip  <-- sample for May 29/2007
 :     :-----prodlibs_070529_0303.zip
 :     :-----...
 :-----Day                  <-- Daily backups in .zip files for last 40 days
 :     :-----homedirs_070419_0301.zip
 :     :-----proddata_070419_0302.zip  <-- 40 days ago = April 19/2007
 :     :-----prodlibs_070419_0303.zip
 :     :-----...(39 sets not shown)
 :-----Month                <-- Monthly backups in .zip files for last 15 months
 :     :-----homedirs_060201_0301.zip
 :     :-----proddata_060201_0302.zip  <-- 15 months ago = Feb 1/2006
 :     :-----prodlibs_060201_0303.zip
 :     :-----...(14 sets not shown)
 :-----Year                 <-- Yearly backups in .zip files for last 7 years
 :     :-----homedirs_000501_0301.zip
 :     :-----proddata_000501_0302.zip  <-- 7 years ago = Jan 1/2000
 :     :-----prodlibs_000501_0303.zip
 :     :-----...(6 sets not shown)
Note
  • we show only directories under homedirs, proddata,& prodlibs
  • we do show some files under zip, Day, Month,& Year
  • (inserted manually since the 'dtree' script does not show files)
  • we show zip, Day, Month,& Year out of sequence
  • to better illustrate our backup strategy

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4C8. Converting YOUR MVS JCL to Korn shell scripts

Data Conversion Directories

 /p4/apps
 :-----cnvdata            - $CNVDATA=/tax/cnvdata ($symbol for PATH independence)
 :     :------archive     - copy unwanted files here for later deletion
 :     :--MF--cpys      <-- COBOL copybooks
 :     :--MF--ctl       <-- control files (LISTCAT from the mainframe)
 :     :--MF--d0        <-- data files FTP'd from mainframe (variable length)
 :     :------d0ebc       - filenames lower case, '.clus.vseprd' dropped
 :     :------d1ebc       - converted to fixed length for conversion
 :     :------d2asc       - converted to ASCII (packed/binary preserved)
 :     :------d3ebc       - possible convert back to EBCDIC to verify
 :     :------errs        - error reports from conversion utilities
 :     :------maps        - copybooks converted to record layouts
 :     :------pf          - misc uvcopy jobs
 :     :------pfv1        - uvcopy jobs to convert varlth to fixlth
 :     :------pfv2        - copied here for execution
 :     :------pfx1        - uvcopy skeleton jobs generated from 'maps'
 :     :------pfx1a       - uvcopy instructions extracted from pfx1 jobs
 :     :------pfx2        - uvcopy jobs completed, datafilenames (vs cpybknms)
 :     :------pfx3        - uvcopy jobs copied here for modify/execute
 :     :------pfx3.bak    - backup before regens to recover modified R/T code
 :     :------pfx4        - optional jobs to convert back to EBCDIC for verify
 :     :------sf          - misc scripts
 :     :------sfload      - scripts to copy/sort/load d2asc/... to $RUNDATA/data1
 :     :------sfloadalt   - alternates (must be only 1 script per file in sfload)
 :     :------stats       - reports to assist multi record type file conversions
 :     :------tmp         - misc files here (keep working dir clean, rm daily)
 :     :------tmp1        - misc files (remove weekly vs daily)
       '--MF--' indicates subdirs receiving files from the mainframe

 cnvdatadirs     <-- script to create subdirs shown above
 ===========

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4C9. Converting YOUR MVS JCL to Korn shell scripts

Programmer & Operator Logins

The preceding pages have discussed our file design, which might be summarized as follows:

 /home             <-- home directories
 :----prgmr1
 :----prgmr2
 :----oper1
 :----oper2
 :
 /p1/apps                 <---- /p1/apps file system mount point
 :-----testlibs        <-- RUNLIBS=/p1/apps/testlibs
 :     :-----cbls        - COBOL programs
 :     :-----jcls        - JCL/scripts
 :     :---etc---        - see other subdirs at ADMjobs.htm#2B1
 :-----testdata      <---- RUNDATA=/p1/apps/testdata
 :     :-----mstr        - data files (or use topnodes as subdirs)
 :     :-----jobtmp      - job temporary files
 :     :---etc---        - see other subdirs at ADMjobs.htm#2B2
 :
 /p2/apps                 <---- /p2/apps file system mount point
 :-----prodlibs        <-- RUNLIBS=$PRODLIBS=/p2/apps/prodlibs
 :     :-----cbls        - COBOL programs (production)
 :     :-----jcls        - JCL/scripts (production)
 :     :---etc---
 :-----proddata
 :     :-----mstr        - data files (or use topnodes as subdirs)
 :     :-----jobtmp      - job temporary files
 :
 /p3/apps                 <---- /p3/apps file system mount point
 :-----backup            - backup & restore directories
 :-----restore
 :
 /p4/apps                 <---- /p4/apps file system mount point
 :-----cnvdata           - data conversion directories
 :     :----d1ebc        - EBCDIC data files from mainframe
 :     :----d2asc        - converted to ASCII (preserving packed)

RUNLIBS/RUNDATA defs in 'stub_profiles'

export RUNLIBS=/p1/apps/testlibs <-- stub_profile_test for programmers export RUNDATA=/p1/apps/testdata

export RUNLIBS=/p2/apps/prodlibs <-- stub_profile_prod for operators export RUNDATA=/p2/apps/proddata

aliases in profiles for quick change

alias cdl='cd $RUNLIBS' <-- /p1/apps/testlibs(prgmr) or /p2/apps/prodlibs(oprtr) alias cdd='cd $RUNDATA' <-- /p1/apps/testdata(prgmr) or /p2/apps/proddata(oprtr)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4D1. Converting YOUR MVS JCL to Korn shell scripts

Copying VU control files & functions to Your $RUNLIBS

You must copy some control files (supplied with Vancouver Utilities) over to your $RUNLIBS/ctl. Here is a cut-down version of the testlibs dtree shown on page '4C3'. We have omitted most subdirs & to highlight the 'ctl' subdirs.

 /p1/apps
 :-----testlibs       <-- RUNLIBS=/p1/apps/testlibs
 :     :-----cbl0
 :     :-----cpy0
 :     :--*--ctl      <-- control files (cobdirectives,datactl53I,jclunixop51)
 :     :-----jcl0
 :     :
 :-----testdata       <-- RUNDATA=/p1/apps/testdata
 :     :-----ar
 :     :--*--ctl      <-- control files (gdgctl53,gdgctl53I.dat,gdgctl53I.idx)
 :     :-----gl
 :     :-----jobtmp
 :     :-----wrk

Copying VU ctl/... to Your $RUNLIBS


 #1. Login as yourself or appsadm --> your homedir or /home/appsadm

 #2. cdl  --> $RUNLIBS

 #3. mvslibsdirs   <-- setup LIBRARY subdirs for JCL & COBOL conversions
     ===========     - if not already setup (see page '4C3')

 #4. cdd  --> $RUNDATA

 #5. mvsdatadirs   <-- setup DATA subdirs for JCL/COBOL executions
     ===========     - if not already setup (see page '4C3')

 #6. copymvsctls   <-- copy supplied control files to $RUNLIBS/ctl/...
     ===========     - see the 'copymvsctls' script listed on the next page:

setup appsadm profiles & functions


     export FPATH=/home/appsadm/sfun
     ===============================

 #7. cp /home/uvadm/sfun/* /home/appsadm/sfun <-- copy supplied functions
     ========================================   - required to execute JCL/scripts

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4D2. Converting YOUR MVS JCL to Korn shell scripts

script to copy supplied control files & functions

 # copymvsctls - copy Vancouver Utility control files & functions
 #               required to convert mainframe JCL & COBOL
 #             - by Owen Townsend, UV Software, Oct 04/2008
 #
 # Run this script after creating testlibs/subdirs for JCL/COBOL conversion
 # 1. login        <-- login (to your homedir, or as mvstest, or ?)
 # 2. mvstestdirs  <-- setup subdirs required for JCL/COBOL conversion
 # 3. cdl          <-- alias for 'cd $RUNLIBS'
 # 4. mvslibsdirs  <-- make about 25 subdirs in $RUNLIBS
 # 5. cdd          <-- alias for 'cd $RUNDATA'
 # 6. mvsdatadirs  <-- make about 10 subdirs in $RUNDATA
 # 7. copymvsctls  <-- copy control files & functions for conversion & execution
 #    ===========
 #
 # copy control files
 cp $UV/ctl/cnvcob5.tbl     $RUNLIBS/ctl #search/replace table for COBOL cnvrtr
 cp $UV/ctl/cobdirectives   $RUNLIBS/ctl #COBOL DIRECTIVES for compiler
 cp $UV/ctl/extfh.cfg       $RUNLIBS/ctl #COBOL file handler configuration
 cp $UV/ctl/jclunixop51     $RUNLIBS/ctl #options for JCL to Korn shell converter
 #
 cp $UV/ctl/GDGmkdirs       $RUNDATA/ctl #script make subdirs for new GDG files
 # cp $UV/ctl/gdgctl51_sample $RUNDATA/ctl #sample GDG ctlfile, regen/customize
 #Apr16/09 - GDG control files moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/...
 #           to allow multiple $RUNDATA's to have different control files
 #
 #Feb18/11 - following disabled
 # cp $UV/ctl/jclperlop61   $RUNLIBS/ctl #options for JCL to Perl converter
 # cp $UV/sfun/* sfun    # copy ksh functions, disabled Nov12/2010
 #Nov12/2010 - functions now in $APPSADM/sfun/...
 # ------ function descriptions --------
 # jobset51       - job init for insert at begin JCL/scripts
 # jobend51       - job end copy new GDGs from jobtmp to subdirs
 # jobabend51     - job ABend, ERRmsg & warn new GDGs not updated
 # logcron1       - console msg for scripts run by cron (date/time stamped)
 # logmsg1        - console msg (date/time stamp)
 # logmsg2        - console msg (date/time stamp) reverse video
 # exportfile     - exports Logicalname=Physicalname (non GDG)
 # exportgen0     - exports for GDG file - current generation
 #                  or prior generation, -1, -2, etc
 # exportgen1     - exports for next generation, +2, +3, etc
 # stepctl51      - step ctl function for jcpause
 exit 0

'exportfile' & 'exportgen_' fucntions are vital to JCL conversion. See descriptions & listings starting in 'Part_5'. The JCL converter converts 'DD's to exportfile or exportgen, for example:

     exportfile E212653 $MSTR/e2121653.mtaxe.piscines
     exportgen0 0 E212044 $TAPE/tu.f01.e212-no.auxtxj_

When the JCL/scripts are executed, the export... functions will be called via the Korn shell 'FPATH' variable which is defined in the profile as $APPSADM/sfun.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4E1. Converting YOUR MVS JCL to Korn shell scripts

Modifying JCL converter options

Here are the 1st 50 lines from the JCL converter control file listed on '3E1'. You must review & modify these options appropriately for your site.


 jclunixop51:a1b2c0d3e2f3g1i1j0k3l50m4n3o0p0r0s0t1u1v0w0x0y1z0 #<-- options
 #           =================================================
 #  a1                           - append 1 on COBOL reserved word DDNAMES
 #    b1                         - generate blank line between steps
 #    b2                         - insert stepctl51 (mandatory as of Feb08/12)
 #      c1                       - program names UPPER case
 #      c2                       - filenames UPPER case (also uop=l2 jcldata52)
 #      c4                       - control card modulenames UPPER case
 #        d1                     - drop DDNAMES that begin/end with LOAD/LIB
 #        d2                     - drop DSNAMES that begin/end with load/lib
 #          e1                   - echo run command to test script w/o programs
 #          e2                   - option '-v' on cp & mv echo to console log
 #            f1                 - copy FTP commands from lib module to instream
 #            f2                 - use FTP option '-u' to inhibit authorization
 #              g0               - create new GDG's in $RUNDATA/subdir/gdgfile_
 #              g1               - new GDGs $JGDG relative move to subdir/ at EOJ
 #              g2               - new GDGs $JGDG absolute $RUNDATA/jobtmp/...
 #                 i1            - use datactl53I Indexed file for recsz,keys,etc
 #                 i0            - will try to load datactl53I into memory table
 #                   j1          - generate cmd line for JAVA (vs COBOL)
 #                   j2          - include -DDDNAME=$DDNAME for each file in step
 #                   j4          - special convert IKJEFT01, see MVSJCL.doc
 #                     k1        - FTP: insert 'open' prior to 1st line if IP#
 #                     k2        - FTP: insert 'user' prior 1st word if not cmd
 #                       l50     - limit SYSIN/SYSTSIN lines shown in script
 #                          m0   - generate exportfile modules original filename
 #                          m1   - redirect modules to $RUNDATA vs $RUNLIBS dflt
 #                          m2   - redirect SYSIN modules to $RUN____/parms/...
 #                          m4   - redirect ALL modules to $RUN____/parms/...
 #                          m8   - show original filename prior to $RUN____/parms
 #                            n0 - unrecognized JCL passed thru as is
 #                            n1 - unrecognized JCL cmntd out with '#?' cols 1-2
 #                            n2 - if any '=' present, convert any ','s to ';'s
 #                            n3 - if n2 & no '=', cmnt out with '#?' cols 1-2
 #                            n4 - convert unrecognized JCL to instream data
 #                          o1   - remove 1st segment of DDName overrides
 #                        p1     - append parm data on COBOL execution command
 #                      r0       - gen cobrun, executes .int's & allows animation
 #                      r1       - gen runw for .ints NetExpress/Windows
 #                      r2       - assume executable programs either unix/windows
 #                      r4       - assume executables in PATH (progname only)
 #                      r8       - generate 'findexec' Multi-Level program search
 #                      r16      - generate 'unikixvsam $CBLX/COBOLX'
 #                      r32      - generate Natural call (natsec batch ...)
 #                    s1         - convert SORT for SYNCSORT (not uvsort)
 #                  t1           - disabled, see TOPNODE table & TOPDIRINSERT
 #                u1             - use uvcp for IEBGENER/IDCAMS REPRO (vs cp)
 #                u2             - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8
 #              v1               - inhibit DELETE via IDCAMS DELETE
 #              v2               - inhibit DELETE via DISP=(OLD/SHR/MOD,DELETE,
 #            w1                 - generate 'unikixbld -i -d $KIXDATA/filename'
 #            w2                 - insert $RUNDATA on exportfile/gen for unikix
 #          x#                   - make all indexed output files IDXf# (1,3,4,8)
 #        y1                     - generate oprtr prompt to acknowledge Abterms
 #      z1                       - custom for DST, make topnode $SYMBOL no/sep

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4E2. Converting YOUR MVS JCL to Korn shell scripts

control tables for Top-Nodes

Here are lines 106-133 extracted from ctl/jclunixop51 (listed on page '3E1').

 :CTLTBL:
 TOPDIRDEFAULT~~~~~~~~~~~~~~~~~$WRK~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINSERT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # TOPDIRDEFAULT - inserted if only 1 node (no High Level Qualifier) in DSN
 #               - recommend '$WRK' or 'wrk' (1 node files likely temp files)
 # TOPDIRINSERT - if specified, will be inserted above HLQ, retaining all '.'s
 #                (some sites code this as 'mstr')
 # - if NOT specified, the existing top-node is used as a subdir within $RUNDATA
 # - could use TOPNODES to convert any unwanted HLQs as desired
 # - could use FILEREP1 table to convert multiple nodes as desired
 #
 #------------------------ TOPNODES table ------------------------------
 # table of TOPNODES allowed & replacements (optional)
 # 01-30 - topnodes allowed
 # 31-60 - topnode replacements (if col 31 not '~')
 # - if 01-30 of last entry 'ALLOTHER', any others replaced by 31-60
 # - use statmvsjcl1 to create summary table of topnodes used in all JCL
 # - see www.uvsoftware.ca/mvsjcl.htm#6A2
 # - code in lower case since applied at output time(script) vs input(JCL)
 :TOPNODES:
 ar~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 gl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 py~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 rpts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #Note1 - you must also code valid top-nodes in $RUNLIBS/ctl/GDGmkdirs
 #      - called by jobset51 to setup subdirs for new generations of GDG files
 #      - see listing at MVSJCL.htm#4E5

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4E3. Converting YOUR MVS JCL to Korn shell scripts

customizing for YOUR Top-Nodes

Before converting your JCL to Korn shell scripts, you must decide whether to store all your data-files in 1 directory (suggest data1/...), or to use your top-nodes as subdirs within $RUNDATA.

We will illustrate 'customizing for your topnodes' using the demo files distributed in /home/uvadm/mvstest/testlibs/ctl/... If you performed the demos in Part_1, you would have setup user 'mvstest' & the demo files would now be in /home/mvstest/testlibs/ctl/... ($RUNLIBS/ctl/).

For your own conversion, you would setup a new set of libraries as illustrated on page '4C3' & populated subdirs cbl0, cpy0, jcl0, proc0, etc with your own COBOL & JCL modules. Page '4C3' shows these subdirs at /p1/apps/testlibs/..., but you can place them wherever desired.

topnode/subdir assignment

Topnode validation & subdir assignment is controlled by the :CTLTBL: & :TOPNODES: tables within the JCL converter control file (ctl/jclunixop51).

The supplied tables reflect the test/demos in Part_1 (using top-node/subdirs ar, gl, py). You should modify the :TOPNODES: table for your valid top-nodes.

You should code your most common top-nodes in the :TOPNODES: (allowed) table & all other (low volume) will be combined into a 'misc' directory.

You must also code your valid topnodes in the '$RUNLIBS/ctl/GDGmkdirs' script, listed on the page '4E5'.

Note
  • see more discussion & examples of top-node/subdirs in Part_6
    begining on page '6C1'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4E4. customizing for YOUR Top-Nodes

full-PATH or relative-PATH data filenames

We strongly recommend that all data filenames be coded as relative-PATH, since that allows us to use the same script for TESTing & PRODuction &/or to allow different programmers to use different sets of TEST data.

This flexibility is achieved by defining variables RUNDATA=testdata/ or proddata/ and RUNLIBS=testlibs/ or prodlibs/ in the profiles of programmers & operators, It works because the JCL converter inserts function 'jobset51' or 'jobset52' at the begining of all output scripts. These functions perform 'cd $RUNDATA' so all data filenames can be coded relative to $RUNDATA.

However, some customers may need full-PATH data filenames (probably because they are using unikix software). MVS customers can use option 'w2' in ctl/jclunixop51 to insert '$RUNDATA/' at the begining of all data filenames.

Full-PATH names also requires jobset52 vs jobset51. Both define subdirs for temporary files & new generations of GDG files until successful EOJ.

      export JTMP=jobtmp/$JOBID2              <-- relative-PATH in jobset51
      export JGDG=jobtmp/$JOBID2/GDG
      export JTMP=$RUNDATA/jobtmp/$JOBID2     <-- full-PATH in jobset52
      export JGDG=$RUNDATA/jobtmp/$JOBID2/GDG

options g0,g1,g2

Options g0,g1,g2 (in ctl/jclunix41) are related to the above discussion.

option g0
  • creates new generations of GDG files in the original subdirs
option g1
  • creates new generations of GDG files in temp subdir $JGDG/
    (to be moved back to original at successful EOJ)
  • assuming jobset51 used to define relative-PATH name for $JGDG/
option g2
  • creates new generations of GDG files in temp subdir $JGDG/
    (to be moved back to original at successful EOJ)
  • assuming jobset52 used to define absolute-PATH name for $JGDG/

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4E5. customizing for YOUR Top-Nodes

customizing Top-Nodes - Procedures Required

You can determine the topnodes used by your JCL, using the 'statmvsjcl1' job. See the demo summary table output listed below. Here are the concise operating instructions for your JCL.

This assumes that the JCL has been FTP'd into $RUNLIBS/jcl0/..., that the PROCs have been FTP'd into $RUNLIBS/proc0/..., and that $RUNLIBS & 'cdl' are defined in your profiles for your $RUNLIBS vs demo testlibs used for mvstest in Part_1.


 1. Login --> your home directory
    =====

 2. cdl alias --> your testlibs/prodlibs
    ===

 3. jcl2ksh51A all   <-- run partial conversion
    =============     - enough to expand the JCL/PROCs into jcl2/...
                      - see jcl2ksh51A documented on pages '4J1' - 4J3

 3. uvcopy statmvsjcl1,fild1=jcl2
    =============================
    - create summary tables for programs,procs,& topnodes
    - just the 'topnodes' table listed below
      (see programs & procs tables at CNVaids.htm#4B1)

stats/jcl2_topnodes summary table

     statmvsjcl1 2008/08/08_20:03:18 Summary table of DSN Top-Nodes in jcl0
     tbl#003 pg#001     -argument-
     line#  count    %  Top-Node
         1      27  19  &&(ALLTempFiles)
         2      33  23  AR
         3      57  41  GL
         4      10   7  PY
         5       2   1  RPTS
         6       3   2  WRK
         7       1   0  WRK(IKJDEMO1)
               138*100   *TOTAL*
Note
  • original JCL is FTP'd from mainframe into subdir jcl0/...
  • BUT, above job inputs all JCL from the jcl2/... subdir
  • so topnodes report will include files in the expanded PROC's in jcl2/...

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4E6. customizing for YOUR Top-Nodes

  1. Based on your topnode summary table, decide on any changes & consolidations desired. You might combine low volume topnodes into a 'misc/' subdir. You can also change topnode spellings if desired.

  2. Modify the :TOPNODES: table in the JCL conversion control file. See demo topnodes table listed above on page '4e1' (lines 100-125 excerpted from $RUNLIBS/ctl/jclunixop51). Replace the demo topnodes with your topnodes.

 5a. vi ctl/jclunixop51   <-- edit the JCL conversion control field
     ==================     - replace demo topnodes with your topnodes
  1. Modify the topnode/subdirs in $RUNLIBS/ctl/GDGmkdirs. 'GDGmkdirs' is a script to create topnode/subdirs in the 'jobtmp' directory, used to store new generations of GDG files until successful EOJ reached, then moved to the intended $RUNDATA/subdirs. The GDGmkdirs script is called by function 'jobset51', which is called on line 10 of all converted JCL/scripts.
NOTE
  • GDGmkdirs OBSOLETE as of Oct 2014

 6a. vi ctl/GDGmkdirs     <-- edit supplied GDGmkdirs script
     ================       - replace demo topnode/subdirs with yours

See the GDGmkdirs script listed on the next page --->

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4E7. customizing for YOUR Top-Nodes

ctl/GDGmkdirs - make topnode/subdirs

NOTE
  • GDGmkdirs OBSOLETE as of Oct 2014

'GDGmkdirs' is a script to make the topnode/subdirs in the jobtmp/subdirs used to hold new generations of GDG files, until successful EOJ, when they are moved back to the intended $RUNDATA/subdirs. Here is the demo script distributed in $RUNLIBS/ctl/GDGmkdirs.

 # GDGmkdirs - make subdirs for new versions of GDG files
 #             saved in jobtmp/subdirs/... until Normal EOJ
 #           - by Owen Townsend, UV Software, Aug 25/2008
 #
 #Apr16/2009 - this script moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/
 #           - to allow multiple $RUNDATA's to have different GDG controls
 #
 # script in $RUNDATA/ctl/... called by jobset51 (called by all JCL/scripts)
 # exportgen1 creates new GDG files in $RUNDATA/$JGDG/subdirs/...
 # - where: JGDG=$RUNDATA/jobtmp/$JOBID2/GDG/
 # - at normal EOJ, GDG files are moved to intended subdirs (NOT if Abterm)
 #
 # user must code names of his site's data file subdirs here
 # - matching the TOPNODEs table in $RUNLIBS/ctl/jclunixop51
 # - following subdirs are for the demo JCL/scripts
 #   (at www.uvsoftware.ca/mvsjcl.htm#Part_1)
 #
 #Mar14/09 - JCL converter option g1 inserts $JGDG/... on new GDGs exportgen1
 # - new option 'g0' omits $GDG/ so new GDGs in same subdir as old
 # - this GDGmkdirs script must still exist (since called by jobset51)
 #   BUT, subdirs created will not be used, since no files redirected to $JGDG/
 #
 if [[ ! -d $JTMP ]]; then
    echo "JTMP not defined or not in \$RUNDATA"; exit 81; fi
 #
 # make $JGDG/ for gdg subdirs
 # also make $GTMP/ for exportgen0/1 'ls' outputs to determine latest gen#s
 if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi
 if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi
 #
 # You MUST modify following (ar,gl,etc) to the subdirs desired at your site
 #==========================================================================
 if [[ ! -d $JGDG/ar ]]; then mkdir $JGDG/ar; fi
 if [[ ! -d $JGDG/gl ]]; then mkdir $JGDG/gl; fi
 if [[ ! -d $JGDG/py ]]; then mkdir $JGDG/py; fi
 if [[ ! -d $JGDG/mstr ]]; then mkdir $JGDG/mstr; fi
 if [[ ! -d $JGDG/misc ]]; then mkdir $JGDG/misc; fi
 if [[ ! -d $JGDG/tape ]]; then mkdir $JGDG/tape; fi
 exit 0
Note
  • for your conversion, you must modify the demo subdirs (ar,gl,etc above)
    to your list of topnode/subdirs (determined by running statmvsjcl1).
  • see statmvsjcl1 sample/demo on the previous page
  • you do not need to modify GDGmkdirs until you begin testing

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4F1. Converting YOUR MVS JCL to Korn shell scripts

Transferring LIBS & DATA from the mainframe

I assume you will have FTP connections from the mainframe to unix/linux. Please see page '4C4' for the recommended directory design to receive the libraries onto the unix/linux system. By convention the directories receiving the mainframe modules have suffix '0', intermediate conversions have suffix 1,2,3,etc, and fully converted directories have suffix 's'. Only the '0' subdirs are shown here.

If possible create .zip files on the mainframe. You might name them cbl.zip, cpy.zip, jcl.zip, proc.zip, etc. FTP them into the appropriate subdirs. Then change into each subdir, unzip & remove the .zip file.

 /p1/apps
 :-----testlibs        <-- RUNLIBS=$/p1/apps/testlibs
 :     :------
 :     :--MF--cbl0     <-- your COBOL programs transferred from mainframe
 :     :------
 :     :--MF--cpy0     <-- for COBOL copybooks
 :     :------
 :     :--MF--jcl0     <-- your JCLs transferred from mainframe
 :     :------
 :     :--MF--proc0    <-- your PROCs transferred from mainframe
 :     :------
       '--MF--'          - 'MF' indicates subdirs receiving from 'MainFrame'
 /p4/apps
 :-----cnvdata           <-- $CNVDATA=/p4/apps/cnvdata
 :     :------
 :     :--MF--cpys       <-- COBOL copybooks
 :     :--MF--ctl        <-- control files (LISTCAT)
 :     :--MF--d0         <-- data files FTP'd from mainframe (variable length)
 :     :------d0ebc        - filenames lower case, '.clus.vseprd' dropped
 :     :------d1ebc        - converted to fixed length for conversion
 :     :------d2asc        - converted to ASCII (packed/binary preserved)
 :     :------maps         - copybooks converted to record layouts
 :     :------pfx1         - uvcopy jobs generated from copybooks
 :     :------.etc.        - see other subdirs on page '4C7'

'd0' will hold the data files to be converted.

If possible, create LISTCAT reports on the mainframe & transfer to ctl/listcat0. We will extract record-sizes, indexed keys, etc to guide us in datafile & JCL conversions. See LISTCAT processing on page '4H1'.

The 'copybooks' are used to generate the 'uvcopy jobs' that perform the datafile conversions. Copybooks might be stored directly into cnvdata/cpys (to assist datafile conversion), but better if you 1st convert in testlibs (as instructed on page '4G1') & then copy from testlibs/cpys to cnvdata/cpys.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4G1. Converting YOUR MVS JCL to Korn shell scripts

Converting COBOL copybooks/programs & Compiling

COBOL conversion is covered here in the JCL conversion documentation to make this a complete review of all steps required for the several 'Re-Conversions' that may be performed during the mainframe conversion period.

But for your 1st COBOL conversions, you must follow the procedures documented in MVSCOBOL.htm. Initial conversions & compiles usually encounter many errors that can be resolved by modifying the search/replace tables provided for reserved word differences & customer site coding peculiarities.

Here in MVSJCL.doc we are summarizing the COBOL re-conversions, that might be performed 2 or 3 times during the conversion/test/debug period, to capture updates that have been made on the mainframe.

converting All COPYBOOKs

 cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys
       cleanup         convert         copy(cp)

 #0a. Login as appsadm ---> /home/appsadm

 #0b. cdl  --> $RUNLIBS

 #1. cnvMF51Acpy all        <-- convert ALL copybooks from cpy0 to cpy1 & cpy2
     ============

 #2. cp cpy2/* cpys      <-- copy converted copybooks to cpys (used by compiler)
     ==============

 #3. cp cpy2/* $CNVDATA/cpys  <-- also copy to $CNVDATA for datafile conversion
     =======================

converting All PROGRAMs & compiling

 cbl0 -------> cbl1 -------> cbl2 --------> cbl3 ----------> cbls -------> cblx
      cleanup       convert       copy(cp)       sysin cnvt       compile

 #1. cnvMF51A all         <-- convert ALL programs from cbl0 to cbl1 & cbl2
     ===========

 #2. cp cbl3/* cbls      <-- copy converted programs to cbls (used by compiler)
     ==============

 #4. mfcblA all          <-- recompile all cobol programs, cbls --> cblx
     ==========

 #5. uvlpd1p cblx .err   <-- print 1st page of all .err reports
     =================     - to guide programmers making corrections
                           - should be very few on these re-conversions

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4G2. Converting YOUR MVS JCL to Korn shell scripts

Converting 1 COBOL copybook/program & Re-compiling

Here are some handy scripts you can use to re-convert & re-compile 1 copybook or 1 COBOL program at a time (vs prior page ALL copybooks & ALL programs). The scripts are supplied in /home/uvadm/sf/IBM/... & are listed in MVSCOBOL.htm#5C1.

converting 1 COPYBOOK at a time

 cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys
       cleanup         convert         copy(cp)

 #0a. Login as appsadm or yourself

 #0b. cdl  --> $RUNLIBS

 #1. cnvMF51cpy cpy0/copybknm.cpy  - convert 1 copybook cpy0->cpy1->cpy2
     ============================

 #2. cp cpy2/copybknm.cpy cpys   - copy converted copybook to cpys
     =========================   - above script prompts for this

 #3. cp cpy2/copybknm.cpy $CNVDATA/cpys  - also copy to $CNVDATA
     ==================================  - for datafile conversion

converting 1 PROGRAM & Re-Compiling

 cbl0 -------> cbl1 -------> cbl2 ------> cbl3 ------> cbls ------> cblx
      cleanup       convert      acpt cnv --- prompt for copy & compile ---
                                             copy(cp)       compile

 #1. cnvMF51 cbl0/progname.cbl  - convert 1 program cbl0->cbl1->cbl2->cbl3
     =========================    (prompts to copy cbl3->cbls)

 #2. cp cbl3/progname.cbl cbls  - copy cnvrtd program to cbls
     =========================    (if you replied`'n' above)

 #3. mfcbl1 progname.cbl        - recompile 1 cobol program cbls-->cblx
     ===================

only if compile fails


 #4. uvlp12 cblx/progname.err e1  - print 1st page of .err reports
     ===========================  - to guide correction & recompile

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4H1. Converting YOUR MVS JCL to Korn shell scripts

create Data conversion control file from LISTCAT

We assume the LISTCAT report has been transferred from the mainframe & stored at $CNVDATA/ctl/listcat0. 'catdata51' will extract filenames, avg-recsize, max-recsize, indexed key start(lth) onto 1 line per file.

Initial data conversions must be performed as instructed in MVSDATA.htm. Here in MVSJCL.doc, we are covering 'Re-Conversion', because you might reconvert all JCL,COBOL,DATA 2 or 3 times during conversion period

You will not recreate the DATA conversion control file ($CNVDATA/ctl/datacnv54), because it required manual editing to add copybook names.

But you might want to recreate the 'JCL conversion control file' ($RUNLIBS/ctl/datactl53I), because a newer LISTCAT from the mainframe might provide more accurate information on the datafiles for the JCL converter.


 #1a. Login as appsadm ---> /home/appsadm

 #1b. cdc  --> $CNVDATA

 #2. uvcopy catdata51,fili1=ctl/listcat0,filo1=ctl/datacat51
     =======================================================
     - extract data conversion info from mainframe LISTCAT report

 #3. sort -o ctl/datacat52 ctl/datacat51
     ===================================
     - sort by data file name, see sample listing on page '3F2'
     - see full listing at MVSDATA.htm#8B1.

 #4. uvlp12 ctl/datacat52     <-- list the output file
     ====================

 #5. vi ctl/datacat52         <-- edit the datacat52 extract
     ================
     - drop unwanted files (not required for conversion)
     - add any missing files (not on disc when LISTCAT run)

 #6. uvlp12 ctl/datacat52     <-- re-list the datacat52 extract report
     ====================
     - store in 3 ring binder for frequent reference during conversion

 #7. cp ctl/datacat52 $RUNLIBS/ctl
     ==============================
     - copy datacat52 from $CNVDATA to $RUNLIBS for later use in JCL conversion
     - see page '4K1' to create JCL conversion control file ctl/datactl53I
       from up to 6 sources (JCL itself, LISTCAT, spreadsheets, edited info)
Note
  • instructions above are repeated from MVSDATA.htm#4F4
  • those instructions continue to create 'datacnv54' for data conversion

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4I1. Converting YOUR MVS JCL to Korn shell scripts

Converting Your DATA files

DATA conversion is covered here in the JCL conversion documentation to make this a complete review of all steps required for the several 'Re-Conversions' that may be performed during the mainframe conversion period.

The mainframe data files might be re-transferred & reconverted 2 or 3 times during the test/debug period, & of course 1 final time on the 'go live' weekend.

For your 1st DATA file conversions, you must follow the procedures documented in MVSDATA.htm. MVSDATA.doc shows you how to generate the data conversion 'uvcopy jobs' from the COBOL copybooks. This can be completely automatic, unless you have files with multiple record types, in which case some manual coding is required.

For subsequent DATA file conversions, you can use the data conversion uvcopy jobs that were generated (& modified) during the initial conversion. You may need changes to some jobs if the mainframe copybooks change during the conversion period.

Here in MVSJCL.doc, we will briefly review how to re-convert datafiles, assuming the data conversion jobs have already been generated as documented in MVSDATA.htm#Part_4. You can use the data re-convert instructions when you re-transfer data files from the mainframe, which you might do several times during the testing period.

BUT, if you change any copybooks (from which data conversion jobs are generated) or the control file ctl/datacnv54I (which relates copybooks to datafilenames & provides file types & keys), then you must refer to MVSDATA.htm#PART_4 to re-generate the data conversion 'uvcopy jobs' in $CNVDATA/pfx3.

Important Notes

Note
  • for INITIAL datafile conversions, you MUST use MVSDATA.htm
  • to GENERATE uvcopy jobs (automatically from COBOL copybooks)
  • modify uvcopy jobs for files with multiple record-types
Note
  • for SUBSEQUENT datafile conversions, just EXECUTE the uvcopy jobs
  • already generated, modified, tested during initial conversions

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4I2. Converting YOUR MVS JCL to Korn shell scripts

GENERATING data conversion jobs

'EXECUTE' data conversions here in MVSJCL

subdirs to GENERATE 'data conversion uvcopy jobs'

 /p4/apps/cnvdata/  <-- Data conversion superdir ($CNVDATA)
 :-----cpys      - COBOL copybooks
 :-----ctl       - conversion control files
 :-----maps      - 'cobmaps' record layouts generated from copybooks
 :-----pfx1      - conversion jobs generated from COBOL copybooks by 'uvdata51'
 :-----pfx2      - conversion jobs with actual datafile names & indexed keys
 :               - coded by utility 'uvdata52' using control file ctl/datacnv54I
 :-----pfx3      - uvcopy jobs copied from pfx2 & modified for various reasons
 :               - for Multi Record Type files (insert code to test types)
 :               - will execute the jobs from pfx3

generating data conversion jobs

 cpys ---------> maps ---------> pfx1 ---------> pfx2 ----------> pfx3/...
       cobmap1          uvdata51       uvdata52         cp & vi  (data cnvt jobs)
                                   (ctl file req'd)

The data conversion jobs are generated from the COBOL copybooks, but we also need a control file to relate the copybooks to the datafilenames, and also to supply file types, indexed keys, etc.

creating the data conversion control file

The mainframe 'LISTCAT' report is the best place to get this information. We can transfer the mainframe file & extract the information into a control file used in the conversion job generations. See procedures at MVSDATA.htm#4E1 thru page 4F6.

 mainframe         unix/linux
 LISTCAT -----> ctl/listcat0 ---------> ctl/datacat51 ----------> ctl/datacnv54I
          FTP                catdata51            (many steps omitted)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4I3. Converting YOUR MVS JCL to Korn shell scripts

subdirs to GENERATE 'data conversion uvcopy jobs'

/p4/apps/cnvdata/ <-- Data conversion superdir ($CNVDATA)

 :-----cpys      - COBOL copybooks
 :-----ctl       - conversion control files
 :-----maps      - 'cobmaps' record layouts generated from copybooks
 :-----pfx1      - conversion jobs generated from COBOL copybooks by 'uvdata51'
 :-----pfx2      - conversion jobs with actual datafile names & indexed keys
 :-----pfx3      - uvcopy jobs copied from pfx2 & modified for multi R/T files
 :               - will execute the uvcopy jobs from pfx3

subdirs for DATA files to be converted

                         (in same superdir as above)
 :-----d0ebc                    <-- EBCDIC data files FTP'd from mainframe
 :     :---AR.DATA.FILE1          - filenames UPPER case
 :     :---GL.DATA.FILE1(0)       - GDG file suffixes (0), G1234V00, etc
 :     :---GL.DATA.FILE2.G1234V00 - GDG file suffixes (0), G1234V00, etc
 :     :---...etc...
 :-----d1ebc                    <-- EBCDIC data filenames changed to unix stds
 :     :---ar.data.file1          - filenames lower case
 :     :---gl.data.file1_000001   - GDG file suffixes changed to VU conventions
 :     :---gl.data.file2_000001   - GDG file suffixes changed to VU conventions
 :     :---...etc...
 :-----d2asc                    <-- to receive ASCII conversions
 :     :---ar.data.file1          - ASCII data files from most recent conversion
 :     :---gl.data.file1_000001   - copy from here to refresh testdata subdirs
 :     :---gl.data.file2_000001   - copy from here to refresh testdata subdirs
 :     :---...etc...

subdirs for $RUNDATA

 p1/testdata/                   <-- $RUNDATA for testing
 :-----ar                          - topnodes/subdirs (ar,gl for illustrations)
 :     :---data.file1              - subdirs/datafiles copied here for testing
 :     :---...etc...               - refreshed whenever required from cnvdata
 :-----gl
 :     :---data.file1_000001
 :     :---...etc...
 :     :
 :     data1                <-- OR put all data files in 1 subdir ?
 :     :---data.file1
 :     :---data.file1_000001
 :     :---...etc...

Then script 'copy2nodes' copies all files from $CNVDATA/d2asc to the subdirs in $RUNDATA/... making subdirs as required from the topnode of the filenames.

Note that the datafiles in $CNVDATA/d2asc topnodes 'ar' & 'gl' are converted to subdirs when copied to $RUNDATA/...

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4I4. Converting YOUR MVS JCL to Korn shell scripts

Re-Transfer/Re-Convert DATA files

            FTP         rename        convert     copy to TopNode subdirs
 mainframe -----> d0ebc-------->d1ebc-------->d2asc------->$RUNDATA/TNsub/...
            FTP      cpd0d1rename    pfx3/jobs     copy2nodes

You might need to re-transfer/re-convert data files several times during the testing period. You can use the following 'Execution' Instructions for this, provided you have not changed any copybooks or the control file that relates copybooks to datafilenames & file types, keys,etc.

If you have changed any copybooks or the control file, then you MUST follow the data conversion job 'Generation' Instructions detailed in MVSDATA.htm#Part_4

The following Execution Instructions originate from MVSDATA.htm#4G2.


 #00. Transfer (FTP) mainframe DATA files ---> $CNVDATA/d0ebc

 #01. cdc ---> alias 'cd $CNVDATA' ---> /home/mvstest/cnvdata for example
      ============================

 #02. ls d0ebc >tmp/ls_d0ebc
      ======================
      - create mainframe filenames to be converted to unix/linux conventions

 #03. uvcopy mksfd0d1,fili1=tmp/ls_d0ebc,filo1=sf/cpd0d1rename
      ========================================================
      - make script to copy d0ebc to d1ebc, changing filenames
        from mainframe conventions to unix/linux VU standards
        GDG filename(0) --> filename_000001, etc

 #04. sf/cpd0d1rename   <-- execute script to copy/rename
      ===============

 #__. ................  <-- many steps omitted (see MVSDATA.htm#4G2)
      ================

 #23. uvcopyxx 'pfx3/*'
      =================
      - execute all jobs to convert all files from d1ebc to d2asc
Note
  • missing steps #05-#22 may be seen at MVSDATA.htm#4G3 thru 4G5.
  • those steps create the control file & generate the uvcopy jobs
  • you can omit them if you have not changed copybooks or file specs
  • IE, you have only re-transferred the data files from the mainframe

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4I5. Converting YOUR MVS JCL to Korn shell scripts

copying converted data files to $RUNDATA

Most mainframe conversion sites choose to use the topnode as a sub-directory on the unix/linux target systems. UV software provides the 'copy2nodes' script to facilitate this.


 #24. rm -rf $RUNDATA/*   <-- remove all subdirs from testdata dir
      ==================

 #25. mvsdatadirs    <-- recreate the basic subdirs required in testdata
      ===========      - jobtmp, joblog, rpts, sysout, tmp, wrk

 #26. copy2nodes d2asc $RUNDATA
      ==========================
      - copy all converted datafiles, creating subdirs from topnodes
        (subdir created when new topnode 1st encountered)
Note
  • above DATA conversions originate from MVSDATA.htm#4G2 thru 4G6.
  • only the 'Re-Execution' steps are shown here in MVSJCL.doc
  • you MUST refer to MVSDATA.htm#Part_4 to 'Re-Generate' pfx3 jobs
  • if any copybooks or control file changes have been made

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4I6. Converting YOUR MVS JCL to Korn shell scripts

Re-transfer/Re-convert 1 datafile (vs all)

The following Execution Instructions originate from MVSDATA.htm#4G2.


 #00. Transfer (FTP) mainframe DATA files ---> $CNVDATA/d0ebc

 #01. Login as appsadm or yourself

 #02. cdc --> alias 'cd $CNVDATA' --> /app/risk/cnvdata for example
      ===========================
Note
  • You need to copy/rename mainframe files to unix/linux conventions
  • from UPPER to lowercase, GDG filename conventions different
  • here is the copy/rename instruction for a sample datafile:

 #03. cp d0ebc/DBDPDW.PDW200.$ADDR.DLY(0) d1ebc/dbdpdw.pdw200._addr.dly_000001
      ========================================================================
Note
  • if you have more than 1 file to copy/rename, it might be easier to
  • use the procedure for all files documented on page '4I4'.
  • uvcopy job 'mksfd0d1' generates script 'cpd0d1rename'

 #10. uvcopy pfx3/dbdpdw.pdw200._addr.dly_000001
      ==========================================
      - execute 1 job to convert 1 file from d1ebc to d2asc

copying converted data file to $RUNDATA

Most mainframe conversion sites choose to use the topnode as a sub-directory on the unix/linux system.


 #11. cp  d2asc/dbdpdw.pdw200._addr.dly_000001
      ========================================
          $RUNDATA/dbdpdw/pdw200._addr.dly_000001
          ========================================
      - copy 1 converted datafile to $RUNDATA topnode subdir
Note
  • copying files making topnode a subdir very awkward manually
  • much easier to use the 'copy2nodes' script for All datafiles
  • unless you have huge files that would take a long time to copy all

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4J1. Converting YOUR MVS JCL to Korn shell scripts

Initial conversion of All JCL

You should perform the initial conversion of All Your JCL, using the step by step method documented in this section. Then you should test/debug 1 or 2 JCL/scripts to verify the conversions.

From the testing & debugging 1 or 2 JCL/scripts you may find improvements that can be made to the JCL converter options file (ctl/jclunixop51) & to the data information file (ctl/datactl53I). After modifying these control files you can reconvert the 1 or 2 JCLs using the 'jcl2ksh51' script (page '4N1')

After you are satisfied with the conversion & testing of 1 or 2 JCL/scripts, you can the use the 'jcl2ksh51A' script to reconvert all JCL/scripts, to realize the improvements in all JCL/scripts.

This works well because automatic conversions stop at jcl3, & we copy JCL/scripts from jcl3 to jcls, only when we are ready to test/debug each JCL/script.

directories involved in JCL conversion

 /p1/apps
 :-----testlibs        <-- RUNLIBS=/p1/apps/testlibs
 :     :------
 :     :--MF--ctl      <-- control files
 :     :------           - jclunixop51 specifies options for JCL conversion
 :     :------           - datactl53I supplies file types,recsizes,indexed keys
 :     :------           - datajcl51 (filenames) extracted from all JCL
 :     :------             supplies file info for files missing from datactl53I
 :     :------             (work files scratched, not present for LISTCAT)
 :     :------           - you can edit dataedt52 to override datajcl51 entries
 :     :------
 :     :--MF--jcl0     <-- your JCLs transferred from mainframe
 :     :------jcl1       - intermediate conversion 73-80 cleared
 :     :------jcl2       - PROCs expanded from procs
 :     :------jcl3       - JCLs converted to Korn shell scripts
 :     :------jcls       - copy here manually 1 by 1 during test/debug
 :     :------
 :     :--MF--proc0    <-- your PROCs transferred from mainframe
 :     :------
 :     :--MF--slis     <-- SLI library may be included in JCLs
 :     :------

JCL conversion steps

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      manual copy
                                                             1 at a time

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4J2. Converting YOUR MVS JCL to Korn shell scripts

preparation for JCL conversion

The first part of Part_4 documented several preparations required before attempting to convert your JCL. These are listed below with references back to the original documentation.

  1. You have installed the Vancouver Utilities as per '4B2' (briefly) and in complete detail in install.htm.

  2. You have setup user profiles as per '4B3' (briefly) and in complete detail at ADMjobs.htm#Part_1.

  3. I recommend you setup user 'appsadm' for initial conversions by the team leader. After initial mass conversions, the various team members will use their own logins for individual program compiling & JCL/script testing. See 'appsadm' setup at ADMjobs.htm#1D1 thru 1D7.

  4. Setup the conversion 'super-directory' as per pages '4C1' & '4C2'. The conversion superdir is defined as 'RUNLIBS' in the stub_profile. In our example it is:

 export RUNLIBS=/p1/apps/testlibs
 ================================
Note
  • '/p1' is a separate file system (see ADMjobs.htm#Part_2)
  • for preliminary JCL conversion trials you could setup testlibs in a homedir
  • But for the serious conversion project I recommend separate filesystems.
  1. Setup the JCL & COBOL conversion subdirs. You can use the 'mvslibsdirs' script to setup the 30 subdirs listed on page '4C3'.

 #5a. login appsadm --> /home/appsadm

 #5b. cd $RUNLIBS  <-- change to the conversion superdir '/p1/apps/testlibs'

 #5b. cdl          <-- same as above but easier
      ===              alias cdl='cd $RUNLIBS' is defined in the profile

 #5c. mvslibsdirs  <-- setup 30 subdirs for JCL & COBOL conversions
      ===========
  1. Copy conversion 'control files' to subdir ctl/... as per page '4D2'.

 #6a. copymvsctls  <-- script to copy control files from /home/uvadm/ctl
      ===========      to $RUNLIBS/ctl/...
  1. Modify JCL converter options 'ctl/jclunixop51' listed on page '4E1' and discussed thru page 4E4.

 #7a. vi ctl/jclunixop51  <-- modify JCL converter options
      ==================
  1. Transfer your mainframe JCLs, PROCs,& SYSIN/parms into the appropriate subdirs (jcl0, proc0, parm0) as discussed on page '4F1'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4J3. Converting YOUR MVS JCL to Korn shell scripts

convert All JCL - 'script' method

For your initial conversion we recommend you use the 'step by step' method (starting on page '4K1'), because you can more easily notice any errors.

If you do try the 'do everything' script (jcl2ksh51A), be prepared to revert to the step by step method if you have problems. Or you could activate 'console logging' to capture all screen messages, or you could login from a 'putty' terminal with a large windows history.


 #1. Login as appsadm ---> /home/appsadm

 #2a. cd $RUNLIBS  <-- change to the conversion superdir '/p1/apps/testlibs'
      ===========

 #2b. cdl          <-- same as above but easier
      ===              alias cdl='cd $RUNLIBS' is defined in the profile

 #3. jcl2ksh51A all    <-- convert JCL thru all steps, as illustrated below
     =============      - reply null (take default) at all prompts
                        - or reply 'y' for prompts that demand a y/n response
 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh     copy 1 at a time
                                                          (before test/debug)
Note
  • rather than 'jcl2ksh51A' (do everything script) above
  • we recommend the 'step by step' method below (pages '1K1' - '1K5')
  • to better understand & to detect any errors sooner

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4K1. Converting YOUR MVS JCL to Korn shell scripts

convert All JCL - 'step by step' method

  1. cleanup mainframe JCL, PROCs, SLIs,& PARMs (strip CR's, clear cols 73-80, & shorten to last nonblank).

 #1a. uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl     #<-- cleanup JCL
      ================================================
 #1b. uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.prc  #<-- cleanup PROCs
      ===================================================
 #1c. uvcopyx cleanup sli0 slis uop=q0i7g8n1,arg1=.sli     #<-- cleanup SLIs
      ================================================
 #1d. uvcopyx cleanup parm0 parms uop=q0i7g8n1             #<-- cleanup parms
      ========================================

 #2. jclpx51 jcl1 jcl2 procs slis
     ===========================
     - expand procs as we copy JCL from subdir jcl1 to subdir jcl2

JCL conversion subdirs

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh     copy 1 at a time
                                                          (before test/debug)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4K2. Converting YOUR MVS JCL to Korn shell scripts

creating JCL converter DATA-INFO control file

The JCL converter needs an Indexed file 'ctl/datactl53I' to get information about the data-files (record-size, file-type, key-location/length, GDG or not). This info is required for SORTs, IDCAMS, IEBGENER, etc that are converted to uvsort & uvcp.

The mainframe JCL did not necessarily specify record-size etc, since this info could be obtained from the mainframe VTOC or LISTCAT. But there is no VTOC or LISTCAT on unix/linux, so we will supply that info to the JCL converter via an Indexed file (ctl/datactl53I). We can collect datafile info from up to 'six' sources. See detailed descriptions in Part_6 begining on page '6C1'.

The only mandatory source is the JCL itself. Utility job 'jcldata51' will extract all DSN's from all JCL. These are sorted & duplicates dropped resulting in 1 line per unique datafilename found in all JCL.


 #3. uvcopy jcldata51,fild1=jcl2,filo2=ctl/datajcl51
     ===============================================
     - generate data info control file for JCL converter
     - extract DSNs from all JCL, sort, drop dups

 #3a. uvcopy jcldata51   <-- same as above (files default as shown)
      ================

 #4. uvcopy jcldata52,fili1=ctl/datajcl51,filo2=ctl/datajcl52
     ========================================================
     - convert mainframe filenames to conventions used in Korn shell scripts
     - translate UPPER case to lower case
     - convert any embedded '$' '#' to '_'s
     - convert any filename(module) to filename@module
     - modify GDG (0), (+1), G0587V00, etc to '_000001'

 #4a. uvcopy jcldata52   <-- same as above (files default as shown)
      ================

Please see sample outputs listed on the next page --->

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4K3. Converting YOUR MVS JCL to Korn shell scripts

sample ctl/datajcl51

 DB2.PROD.DWPARM(QUDW33)                cntf=0002 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdwkscix prg=DSNUTILB
 DBDPCSM.CSM781.$CHP14.EFDS.MERGE(+1)   cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=csm781m prg=CSM78100
 DBDPCSM.CSMUNLK3.$MDBCID.IN.PDW.%%MDY  cntf=0005 rca=00147 rcm=00147 typ=RSF src=Jr__________ job=csmunlk3 prg=SORT
 DBDPDW.DBDFTP.$ABA.MONTHLY(0)          cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200
 DBDPCSM.CSMSRT.$WELLS.G0587V00         cntf=0001 rca=00753 rcm=00753 typ=RSF src=Jr__________ job=csmwel_1 prg=SYNCSORT
 DBDPDW.PDW202.$ADDR.USG.WKY(+1)        cntf=0001 rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw202p1 prg=PDW20200

sample ctl/datajcl52

 db2.prod.dwparm@qudw33       rca=00000 rcm=00000 typ=RSF src=J___________ job=pdwkscix prg=DSNUTILB
 dbdpcsm.csm781._chp14.efds.merge_     rca=00000 rcm=00000 typ=RSF src=J___________ job=csm781m prg=CSM78100
 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY rca=00147 rcm=00147 typ=RSF src=Jr__________ job=csmunlk3 prg=SORT
 dbdpdw.dbdftp._aba.monthly_  rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200
 dbdpdw.dbdftp._aba.monthly_  rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200
 dbdpdw.pdw202._addr.usg.wky_ rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw202p1 prg=PDW20200

final result - ctl/datactl53

 db2.prod.dwparm@qudw33                   cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdwkscix prg=DSNUTIL
 dbdpcsm.csm781._chp14.efds.merge_        cpy=nasc354.cpy  rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdw100pe prg=PDW2100
 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY    cpy=____________ rca=00147 rcm=00147 typ=RSF src=J___XrYi__D_ job=pdm825mp prg=SORT
 dbdpdw.dbdftp._aba.monthly_              cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW2020
 dbdpdw.dbdftp._aba.monthly_              cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW2020
 dbdpdw.pdw202._addr.usg.wky_             cpy=____________ rca=00039 rcm=00039 typ=RSF src=Jr____Yi__Dp job=pdw301p1 prg=PDW2020

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4K4. Converting YOUR MVS JCL to Korn shell scripts

script to create JCL DATA-INFO file ctl/datactl53I

The easy way to create the JCL converter DATA-INFO control file is to use script 'jcldata51A'.

'jcldata51A' creates ctl/datajcl51 & ctl/datajcl52 (shown above) & merges ctl/datajcl52 with 5 other optional sources to create the final result (ctl/datactl53I used by the JCL converter).

The 5 optional information files must have been created before you run script 'jcldata51A' (or 'jcl2ksh51A' which calls jcldata51A & performs all conversions). See Part 6 pages '6C1' thru 6C5 for descriptions of the 5 optional files. You should get the mainframe LISTCAT & create ctl/datacat52 if at all possible.

You can make null files for any of the 5 optional information sources that you do not have. If you had none of the 5 optional files you could create null files as follows. We sequence from #5b to #5f to indicate that the 1st file #5a (ctl/datajcl52) has already been created above.


 #5b. >ctl/datacat52
 #5c. >ctl/dataxl152
 #5d. >ctl/dataxl252
 #5e. >ctl/datacnv52
 #5f. >ctl/dataedt52

 #6. jcldata51A  <-- create datajcl51 & datajcl52 & sort 6 files together:
     =========      (datajcl52+datacat52+dataxl152+dataxl252+dataedt52+datacnv52)
                  - to create datactl53 & load Indexed file datactl53I

modifying JCL conversion control files

After your 1st conversion, you might notice that some files do not have record sizes (in converted SORTs etc), & you might want to add the record sizes into the control file & reconvert all JCL.

You should not modify ctl/datajcl52 or ctl/datacat52 since any rerun of jcldata51A or LISTCAT reconvert would overwrite your manual changes.

'ctl/dataedt52' is provided for you to code any missing record sizes, file types, etc.


 #5f. vi ctl/dataedt52  <-- create ctl/dataedt52 to override file info
      ================      on matching filenames in ctl/datajcl51

 #6. jcldata51A    <-- rerun to sort 6 files together & create ctl/datactl53I
     =========

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4K5. Converting YOUR MVS JCL to Korn shell scripts

JCL to Korn shell script conversion


 #6. jclxx51 jcl2 jcl3     <-- convert expanded JCL to Korn shell scripts
     =================
     - JCL converter called for each JCL found in jcl2 & ksh written to jcl3
     - uses ctl/datactl53 to get file characteristics (record-sizes,etc)
Note
  • automatic conversion stops at jcl3
  • you must manually copy each JCL/script from jcl3 to jcls (in PATH)
  • only when you are ready to test/debug each JCL/script

Alternative 'script' method to convert All JCL

Here is the alternative to the above 'step by step' conversion documented on the previous 4 pages. You were advised to use the 'step by step' method for your 1st conversion to better understand & detect errors sooner.

But, do use the 'jcl2ksh51A' script for your subsequent re-conversions after you have proven the conversions work OK at your site.


 #1. jcl2ksh51A all    <-- convert JCL thru all steps, as illustrated above
     =============      - reply null (take default) at all prompts
                        - or reply 'y' for prompts that demand a y/n response
 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      manual copy
Note
  • do NOT use the 'script' method for your 1st conversion
  • use the 'step by step' method (previous 4 pages)
  • to better understand & to detect any errors sooner

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4L1. Optional Preparations depending on site preferences

Preparations Required before test/debug can begin

Depending on your site, you may have some initial preparations that must be performed before you can begin testing & debugging your JCL/scripts.

creating the gdgctl file

Before you can execute any JCL/scripts, you must create the GDG control file. 'ctl/gdgctl51I' is an Indexed file that is accessed by GDG functions (exportgen0, exportgen1,& gdgupab1) to supply the number of generations for each datafile & also to record a history of the last 14 accesses or errors).

Please study 'Part_5' for complete details, but if you are anxious to run some jobs (that do not contain GDG files), here is the minimum instructions with few explanations.

Utility job 'jclgdgctl51' will read all JCL, extract all DSN's,& sort with data reduction to 1 line per unique filename. The output file is then reformatted into the gdgctl layout & loaded into the Indexed file by 'gdgload51'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4L2. Optional Preparations before testing begins

Op. Instrns. to create gdgctl file


 #1a. login mvstest,appsadm,or yourself --> /home/mvstest,appsadm,homedir

 #1b. cdl --> $RUNLIBS (/home/mvstest/testlibs, /p1/apps/testlibs, ???)
           - see directories,profiles,$RUNLIBS,etc discussed page '1A1' +

 #2. [ jcl2ksh51A all ]      <-- we assume JCL conversion already completed
     =================        - left all converted scripts in jcl3/...

 #3. uvcopy jclgdgctl51,fild1=jcl3,filo2=ctl/gdgctl51
     ================================================

 #3a. uvcopy jclgdgctl51     <-- same as above (files default as shown above)
      ==================       - sample output shown below
     data1/gl.account.master_                       gdg=31
     data1/gl.account.trans_                        gdg=31 opt=c

These samples are based on the test/demo JCLs shown in Part_1 (but most lines removed for this illustration).


 #4. cp ctl/gdgctl51 $RUNDATA/ctl/gdgctl51
     ========================================
     - copy/rename for GDG control file
Note
  • GDG control files moved to $RUNDATA to allow multiple $RUNDATA's

 #5. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #6. vi ctl/gdgctl51    <-- edit to modify no of generations as desired
     ===============      - replace any $SYMBOLS with values
                            (see '5F1', could ignore for early testing)

 #7. uvcopy gdgload51,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I
     ======================================================
     - load Indexed file to supply file info to JCL converter

 #7a. uvcopy gdgload51   <-- same but easier (files default as shown above)
      ===============

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4L3. Optional Preparations before testing begins

Cross References for COBOL & JCL/scripts

These cross-reference reports will be invaluable during testing & debugging.

Please see complete instructions & illustrated reports at XREFjobs.htm, but here are the reports & concise instructions to create them in subdir 'xref'.

Cross-Ref Reports Available

xcobcall1
  • list of all CALLED-PROGRAMs in each PROGRAM
xcobcall2
  • crossref all PROGRAMS calling any 1 CALLED-PROGRAM
xcobcopy1
  • list all COPYBOOKS in any 1 PROGRAM
xcobcopy2
  • crossref all PROGRAMS copying any 1 COPYBOOK
xcobfile2
  • crossref all PROGRAMS using each external-file
xcobsql1
  • list all SQL Includes in any 1 PROGRAM
xcobsql2
  • crossref all PROGRAMS using any 1 SQL Include
xjkshfile1
  • list all DATAFILES used in any 1 ksh SCRIPT
xjkshfile2
  • crossref show all ksh SCRIPTs using any 1 DATAFILE
xjkshprog1
  • list all PROGRAMs executed in any 1 ksh SCRIPT
xjkshprog2
  • crossref show all ksh SCRIPTS executing any 1 PROGRAM

Operating Instructions for Cross-Refs reports


 #1. xrefall cbls jcl3 ksh   <-- crossref COBOL & ksh scripts
     =====================

 #2.  uvlpd12D xref   <-- print all files in the directory (Duplex)
      =============
Note
  • before you print all, see if line counts are manageable
  • the xjkshfile1 & xjkshfile2 reports are sometimes very large
    & I sometimes print all except these 2

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4L4. Optional Preparations before testing begins

Job-Flow reports

The 'JobFlow' reports are your guide to testing & debugging. They show you the programs & datafiles used in each step of each JCL/script.

I recommend you print these out before you start your testing & debugging. They serve as your guide & checklist to monitor your progress & make notes about any problems.

The JObFlow reports extract the essential info about each datafile in each step. The file info from the COBOL program is inserted onto the matching info from the JCL. The following items are shown for each file in each step:

See complete instructions & sample reports at XREFjobs.htm#Part_2.

You could run jobflow reports for all jobs but the report would be huge so we will give you the instructions to run the jobflow report for any 1 job.

You must have run 'cobfiles5A' to load an Indexed file for lookup by jobflow51 to include COBOL file information on the jobflow report.

You may regenerate the Job-Flow reports any time you make significant changes to the JCL/scripts during testing & debugging.


 #1. jobflow51 jcls/jar200.ksh   <-- generate JobFlow report for 1 job only
     =========================

 #2. uvlp12L tmp3/jar200.ksh     <-- print jobflow report for 1 JCL only
     =======================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4L5. Optional Preparations depending on site preferences

Extract control cards from JCL to separate files

Note
  • Extracting control cards from JCL is a VSE option.
  • will be adapted for MVS JCL conversion when requested

The VSE JCL converter has an option to #comment out all embedded control cards (for dates, rates, etc) & to create filename references to those records in subdir $RUNDATA/jobparms1 & $RUNDATA/jobparms2.

Utility job 'jobparmx1' is provided to extract the embedded control cards from i JCL/scripts into separate files that can be updated before JCL/scripts are executed.

Control files will have a date-stamp appended (current date at generation time). Run control administrators may duplicate the files & append future dates which will be selected when the current data reaches or passes file dates.

Also see 'jobparms1' which will be run at 6PM (before batch shift) to copy $RUNLIBS/jobparmx1/* to $RUNDATA/jobparms1, selecting the appropriate control card from any multiple dates for any 1 jobname_step_program

See more details in Part_6 (optional procedures) begining on page '6D1'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4M1. Converting YOUR MVS JCL to Korn shell scripts

Test/Debug 1 JCL/script to fine tune conversion

The previous section '4J1' - 4K4 documented the initial conversion of All JCL. Now you should test/debug 1 or 2 JCL/scripts to verify the conversions.

From the testing & debugging 1 or 2 JCL/scripts you may find improvements that can be made to the JCL converter options file (ctl/jclunixop51) & to the data information file (ctl/datactl53I). After modifying these control files you can reconvert the 1 or 2 JCLs using the 'jcl2ksh51' script (page '4N1')

After you are satisfied with the conversion & testing of 1 or 2 JCL/scripts, you can the use the 'jcl2ksh51A' script to reconvert all JCL/scripts, to realize the improvements in all JCL/scripts.

This works well because automatic conversions stop at jcl3, & we copy JCL/scripts from jcl3 to jcls, only when we are ready to test/debug each JCL/script.

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      prompt & copy

We will present the operating instructions for jcl2ksh51 & jcl2ksh51A on page '4N1' & '4N2', but 1st we will remind you of a few aids to assist you in testing & debugging. These & many more aids were 1st presented in 'Part_2'.

  1. testdatainit - clear output subdirs before test runs

  2. joblog - capture logs in joblog subdir of current directory
 2a. joblogA    - capture logs And turn on COBOL Animation
                - saves having to 'export ANIM=+A' to animate
  1. llr - script to list all files & subdirs within a subdir (Recursive)

We will illustrate using these aids as we test/debug JCL/script 28401d23.ksh


 28401d23.ksh          <-- execute JCL/script to demo debug aids
 ============

 joblog 28401d23.ksh  <-- execute & capture log in $RUNLIBS/joblog/28401d23.log
 ====================

 joblogA 28401d23.ksh <-- execute & capture log in $RUNDATA/joblog/28401d23.log
 ====================   - the 'A' version also turns on COBOL Animation
                        - saves having to 'export ANIM=+A' to animate

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4M2. Testing & Debugging Aids

testdatainit - clear output subdirs before testing

You can use the 'testdatainit' script before running your JCL/script tests, to clear out any old outputs & enable you to more easily examine the outputs of your current test runs.

You can run testdatainit anytime, if you have changed your profile (as shown above) to redefine RUNDATA as a subdir in your homedir, or if you know that no other programmers are currently testing & do not need to retain any existing outputs.

RUNDATA subdirs cleared by testdatainit

 $RUNDATA
 :     :-----ftp         ---
 :     :-----jobctl       0  <-- '0' marks subdirs cleared by testdatainit
 :     :-----joblog       0    - Job Debug logs stored here (by joblog script)
 :     :-----jobmsgs      0    - vital/error messages here (date/time stamped)
 :     :-----jobparms1   --- SYSIN data cards, originally embedded in JCL
                             jobparmx1 utility extracts to $RUNLIBS/jobparmx1
                             dates appended to allow updates for future runs
                             jobparms1 utility copies current cards each day
                             from $RUNLIBS/jobparmx1 dropping date stamps
 :     :-----jobparms2   --- SYSIN data cards that do not need updates
 :     :-----jobtmp       0
 :     :-----mstr        --- Master datafiles
 :     :-----rpts         0
 :     :-----sysout       0
 :     :-----tape        -?- Tape files (might clear if only outputs)
 :     :-----tmp          0
 :     :-----wrk          0

 #1. cdd                    <-- change to $RUNDATA superdir

 #2. testdatainit           <-- run the testdatainit script
     ============           <-- will prompt y/n to proceed or not
     --> y                  <-- to proceed or 'n' to cancel

 #3. joblog 28401d23.ksh   <-- run JCL/script being test/debugged
     ===================

 #4. llr rpts              <-- display report files
     ========                - 'llr' lists all subdirs & all files in rpts

 #5. llr jobtmp            <-- display temp/work/inter-step files
     ==========

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4M3. Testing & Debugging Aids

joblog - capture logs via 'tee'

Console logging is highly recommended (especially for production) since it captures everything that happens on the screen, including operator commands & replies to prompts. See console logging activation on page '1U1' & '1U2'.

But until you get console logging activates, you could use the joblog script (provided in /home/uvadm/sf/IBM/...).

These scripts capture the JCL/script screen displays into a file using the unix/linux 'tee' command. The log filename is created by dropping the '.ksh' extension from the jobname & then appending '.log'.


 28401d23.ksh          <-- execute JCL/script (with no logging)
 ============

 joblog 28401d23.ksh  <-- execute & capture log in $RUNDATA/joblog/28401d23.log
 ====================

 joblogA 28401d23.ksh <-- execute & capture log in $RUNDATA/joblog/28401d23.log
 ====================   - the 'A' version also turns on COBOL Animation
                        - saves having to 'export ANIM=+A' to animate

llr - display all files in multilevel subdirs

The 'llr' script is convenient to examine the contents of multi-level subdirs, such as $RPTS, $JTMP, or the entire $RUNDATA.


 #4. llr rpts > tmp/llr  <-- run the 'llr' script & capture output
     ==================

 #4a. uvlp12 tmp/llr      <-- print results (or vi, more, etc)
      ==============

sample llr of rpts after running 1 job

 ./rpts:
 drwxrwxr-x    2 laval3   users        4096 Feb 13 08:43 070213
 ./rpts/070213:
 -rw-rw-r--    1 laval3   users       40033 Feb 13 08:43 28401D23_S0060_E212640C_084349.lvl
 -rw-rw-r--    1 laval3   users        2437 Feb 13 08:43 28401D23_S0060_E212640C.hex

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4M4. Testing & Debugging Aids

jobstop - pause at each step

The JCL converter inserts a call to function 'stepctl51' st the begining of each step. This function normally just calculates StepTimes, but can be activated to stop at the begining of each step (or a specified step) & wait for the operator to enter cont(inue), clear, endok,or endab.


 stepctl51  # test oprtr jobstop/jobclear
 #========  # inserted at begining of each step by JCL converter option 'b2'

Pausing at the begining of each step allows you to investigate the files in data1/... & jobtmp/JOBXX/GDG/... that might be deleted at the end of the step. Also note JCL converter option 'v3' will #comment out the 'rm's (converted from original 'DELETE's).

execute job with jobstop activated


 #1. Login --> /home/mvstest OR your homedir
 #2. cdd --> $HOME/testdata

 #3. jobstop jobxx.ksh   <-- activate stop at begin each step
     =================     - stores control record in jobctl/jobxx.ctl

 #4. joblog jobxx.ksh    <-- execute the job
     ================      - will get following display at begin each step
   --> jobxx.ksh paused by job control file: jobctl/jobxx.ctl
       - job control record: jobxx.ksh S0000 111125_124512
       - waiting until reply 'go' or 'clear'

 #5. Login on a 2nd screen --> $HOME
 #6. cdd --> $HOME/testdata

 #7. l data      <-- investigate data files on screen#2
     =======       - while jobxx paused on screen#1

 #8. l jobtmp/JOBXX/GDG/         <-- investigate GDG files in jobtmp
     ===================
     @home@mvstest@testdata@data1@gl.account.acntlist_000006
     @home@mvstest@testdata@data1@gl.account.master_000007
     @home@mvstest@testdata@data1@gl.account.trans_000006

option to specify stop step

The 'jobstop' script may also specify the 1st step# to stop (art end of step)


 #6a. jobstop jobxx.ksh stop=S0030 <-- store jobctl file with stop step#
      ============================

 #6b. joblog jobxx.ksh    <-- execute the job
      ================       - will stop at end of step S0030
                               & subsequent steps if you reply 'cont'inue

See 'jobstop' script listed on page '9A6'

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4N1. Converting YOUR MVS JCL to Korn shell scripts

jcl2ksh51 - reconvert 1 JCL to script

Pages '4J1' - 4K4 documented the initial conversion of All JCL. Then you should test/debug 1 or 2 JCL/scripts to verify the conversions.

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      prompt & copy

As an example, we will convert 'JAR100', a demo JCL supplied with Vancouver Utilities in /home/uvadm/mvstest/jcl0/JAR100. You can see it listed on page '1C1' & the expected output script on page '1C2'.


 #0a. Login as appsadm ---> /home/appsadm

 #0b. cdl  --> $RUNLIBS

 #1. jcl2ksh51 jcl0/JAR100.jcl    <-- convert 1 JCL at a time
     =========================

alternate example from City of Lynn Valley


 #1a. jcl2ksh51 jcl0/28401D23.jcl   <-- convert 1 JCL at a time
      ===========================

prompt/overwrite warning

The final destination is 'jcls' where JCL/scripts must be copied to be found by the search PATH. Before overwriting any existing JCL/script, you will be prompted to answer 'y' or 'n'.

If you had made substantial modifications to the existing script, you might want to answer NO. Then you could save modified parts of existing script (in tmp subdir), copy the new script from jcl3 to jcls, then edit the new script in jcls & read in modified parts of the previous script from the saved version (or vice versa if it were easier to read new parts into the existing).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4N2. Converting YOUR MVS JCL to Korn shell scripts

Re-Convert All JCL using 'jcl2ksh51A' script


'4J1' - 4K4 documented the initial conversion of all JCL.

'4M1' suggested test/debug 1 or 2 JCL/scripts & modifying option/control files for optimum results.

We now suggest you reconvert all JCL/scripts, to realize the improvements in all JCL/scripts. You can do this quickly using the 'jcl2ksh51A' script (vs step by step method required on the initial conversion of All JCL).

      cleanup          jclproc51           jclunix51              cp
 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      prompt & copy

 #0a. Login as appsadm ---> /home/appsadm

 #0b. cdl  --> $RUNLIBS

 #1. jcl2ksh51A all
     =============
     - convert all JCL from jcl0/... thru several steps to scripts in jcl3/...
     - jclunixop51 has options to use ctl/datactl53I to supply file types,
       record sizes, Indexed keys, etc
     - see more explanations on pages '4K1' - 4K3.
  1. The conversion team leader would now assign the various JCLs to the various team members for testing & debugging

 #3. cp jcl3/??? jcls
     ================
     - team members will copy JCL/scripts 1 at a time to jcls/... (in PATH)
       just before they are ready to test/debug each script
     - this allows us to reconvert anytime to jcl3/... to improve conversions
       after updating datactl53 & reloading datactl53I (as shown above)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4N3. Testing & Debugging Aids

alldiff2 - diff report for all files in 2 dirs

The 'alldiff2' script will run the unix 'diff' utility on all pairs of files in 2 subdirs. The unix 'diff' command is a marvelous thing. It shows you the differences between any 2 text files.

I recommend you use 'alldiff2' whenever you make changes to the JCL converter or the control files.

First save the existing scripts as jcl3.old, remake jcl3, rerun the converter, & then run alldiff2 to verify that the changes made are the changes you intended & nothing else has gotten screwed up.

You can use the 'newold' script to change the name & make the new subdir.


 #1a. Login as yourself or appsadm

 #1b. cdl ---> $RUNLIBS
  1. Modify the control files to enhance conversions. See ctl/jclunixop51 listed at MVSJCL.htm#3E1. See ctl/datactl53I listed on page '3F5' or '4K2'

 #3. newold jcl3   <-- script to 'mv jcl3 jcl3.old' & 'mkdir jcl3'
     ===========

 #4. jclxx51 jcl2 jcl3       <-- reconvert all JCL in jcl2 to ksh in jcl3
     =================

 #5. alldiff2 jcl3.old jcl3  <-- run alldiff2 script
     ======================    - saves jcl3.dif in the tmp subdir

 #6. uvlp12 tmp/jcl3.dif     <-- print the jcl3.dif file
     ===================       - or vi, more, etc

sample jcl3.dif

Here is a sample dif file resulting from updating ctl/datactl53I. We added 'topi=$TAPE2' onto the control file line for data file 'tu.f01.e212801.adrpos'. We then ran uvcopy loadcat3I to reload the indexed file & reconverted all JCL as shown above.

 37c37
 < exportgen0 0 E211801 $TAPE/tu.f01.e211801.adrpos_
 ---
 > exportgen0 0 E211801 $TAPE2/tu.f01.e211801.adrpos_
 diff file# 10 - jcl3.old/... vs jcl3/24599j04.ksh
 97c97
 < exportgen1 +1 E212990 $TAPE/tu.f01.e211801.adrpos_
 ---
 > exportgen1 +1 E212990 $TAPE2/tu.f01.e211801.adrpos_
 diff file# 78 - jcl3.old/... vs jcl3/28401j04.ksh

2 different of 280 files compared jcl3.old to jcl3

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4O1. Aids & Techniques to assist Your Testing/Debugging

setup 'testdata' in Your homedir ?

If you have multiple programmers, you might need to setup the testdata superdir in programmer homedirs to prevent update conflicts.

 /p1/apps
 :-----testdata            <-- RUNDATA=/p1/apps/testdata
 :     :-----jobctl            - for jobstop stop at begin each step for debug
 :     :-----joblog            - Job Debug logs stored here (by joblog script)
 :     :-----jobmsgs           - progress msgs (step begin, end Normal/AbTerm)
 :     :-----jobparms1         - current datacards from $RUNLIBS/jobparmx1 at 6PM
 :     :-----jobparms2         - datacards from $RUNLIBS/jobparmx2 at 6PM
 :     :-----jobtmp            - job temporary files
 :     :-----mstr              - master files
 :     :-----rpts              - reports
 :     :-----sysout            - COBOL DISPLAY upon SYSLST reports
 :     :-----tape              - tape files reassigned to disc by JCL converter
 :     :-----tmp               - misc temp files & sort work files
 :     :-----wrk               - work files (inter-step)

Here is how 'userx' might setup his own testdata superdir, copy all data files, & modify his profile to use the private version of testdata.

  1. Login ---> /home/userx

 #2. mkdir testdata            <-- make private testdata superdir
     ==============

 #3. cp -r $RUNDATA testdata  <-- copy all files from shared testdata
     ========================

 #4. vi .bash_profile          <-- edit profile to modify $RUNDATA
     ================
     export RUNLIBS=/p1/apps/testlibs   <-- leave RUNLIBS common to all programmers
     export RUNDATA=$HOME/testdata      <-- change ONLY RUNDATA def to your homedir

 #5a. exit              <-- logoff

 #5b. Login             <-- log back on to activate new RUNDATA definition

 #6a. echo $RUNDATA    <-- verify change effective

 #6b. cdd               <-- alias cdd should not take you to $HOME/testdata

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4O2. Aids & Techniques to assist Your Testing/Debugging

uvhdcob display copybook names with data

uvhd
  • displays data records only (no knowledge of copybook fields)
  • uvhd is shareware & may be downloaded from www.uvsoftware.ca
  • source program is self-contained (no linkable archives req'd)
uvhdcob
  • displays copybook fieldnames, preceding data for each field
  • browse,search,update,print,write,drop,check-seq (same as uvhd)
  • intended for use in conjunction with uvhd
    (may exit to uvhd to display record without fieldnames & return)
  • does not have all the functionality of uvhd
  • displays only the 1st occurrence of occurs fields
  • might not encode proper fieldnames for multi-record-type files
  • 'cobmap1' is a uvcopy job which must be run prior to uvhdcob
    a 1 time operation to convert the COBOL copybook directory
    to a directory of 'cobmaps' (COBOL record layouts)

uvhdcob demo from /home/uvadm


 uvcopy cobmap1,fili1=tf/custmas1,filo1=tmp/custmas1
 ===================================================
 - make the cobmap required from supplied copybook

 uvhdcob dat1/custmas1 tmp/custmas1
 ==================================
 dat1/custmas1 rcsz=256 totrecs=32 current=1 fsiz=8192 fptr=0
 cobmapfile=maps/custmas1 today=199911291108 datalastmod=1999112910
 rec#       1 fieldname occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0   5 n  130140
 002 cm-delete                    6   9
 003 cm-name                     10  34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35  59    1815 BOWEN ROAD
 005 cm-city                     60  75    NANAIMO
 006 filler001                   76  76
 007 cm-prov                     77  78    BC
 008 filler002                   79  79
 009 cm-postal                   80  89    V9S1H1
 010 cm-phone                    90 101    604-754-5531
 011 cm-contact                 102 119
 012 cm-thisyr-sales       012  120 124pns 001234567C
 013 cm-lastyr-sales       012  180 184pns 001234567D
 014 cm-thisyr-xft              240 244pns 4320202020
 015 cm-lastyr-xft              245 249pns 2020202020
 016 filler003                  250 255
 null=next,r#=rec,s=search,u=update,p=print,i=iprint,w=write,t=tally,c=checkseq
 ,e=exit to uvhd, q=quit, ?=help --> q

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4O3. Aids & Techniques to assist Your Testing/Debugging

uvhdcob sample for City of Lynn Valley


 #1a. Login as yourself --> your homedir

 #1b. cdd       <-- change to $RUNDATA

 #2. uvhdcob data1/e2121653/mtaxe.piscines.dat $RUNLIBS/maps/e212159b r83
     ====================================================================

sample uvhdcob for the piscines file

 uvhdcob data1/e2121653.mtaxe.piscines.dat lastmod=20070307:1612
 record#=1 totalrecs=263 recsize=83 filesize=21829 fileptr=0
 cobmap=/tax/cnvdata/maps/e212159b today=20070322:1249
 rec#       1 fieldname occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 fp-role-k                    0  19    015     5  14   4
 002 fp-code-maj                 20  20pns 1C
 003 fp-dt-crea                  21  25pns 019910305C
 004 fp-dt-maj                   26  30pns 019920319C
 005 fp-mat1                     31  36pns 86532599502C
 006 fp-mat2                     37  41pns 000000000C
 007 fp-code-post                42  47    H7K3E2
 008 fp-nbr-pisc                 48  48pns 2C
 009 fp-code-pisc                49  49
 010 fp-no-semaine               50  51pns 000C
 011 fp-no-vendeur               52  53pns 000C
 012 fp-annee-fact               54  56pns 01991C
 013 filler001                   57  81
 rec#=1 of 263,null=next,r#=rec,s=search,u=update,p=print,i=iprint,w=write
 ,t=tally,c=chkseq,e=exit to uvhd,q=quit,?=help -->

script to save having to specify the map

We can use the data conversion control file (ctl/datacnv54I) & the 'uvhdc' script to save having to specify the copybook map & to enable running uvhdcob from any location & avoid having to code recsize for indexed files.


 #2a. uvhdc data1/e2121653/mtaxe.piscines
      ==================================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4P1. Converting YOUR MVS JCL to Korn shell scripts

Determine solutions for any 3rd party software

The JCL converter automatically converts SORT, IDCAMS, IEBGENER, and some DITTOs, but you may need conversion solutions for 3rd party software such as EASYTRIEVE.

You can code equivalent solutions using uvcp, uvsort, & uvcopy, but you may have to write COBOL programs for complex EasyTrieves.

Easytrieve conversion to 'uvcopy'

As of March 2008, the Easytrieve conversion is documented separately in EZTRVetc.htm.

'ez2uvcopy' is a Vancouver Utility (from UV Software) to convert CA Easytrieve to the uvcopy interpretive language. 'uvcopy' is a powerful data manipulation language that was developed to replace various mainframe utilities when converting to Unix or Linux systems.

uvcopy provides functions that are non-existent in the usual Unix utilities:

uvcopy is somewhat similar to the IBM 360 assembler language, so if you have a mainframe background the code will look familiar to you. In addition to the usual basic instructions, uvcopy has many powerful instructions for scan/replace, table processing, etc.

uvcopy has the power of assembler but without the complexity of compiling since it is 'interpretive' (just edit the parameter file & rerun).

There is a lot of documentation for uvcopy, but if you have a mainframe background, I think you could get a quick start by studying the examples given in UVjobs1.htm. Then you could run the 'ezdemo2' conversion given in Part 1 of EZTRVetc.htm & refer to the uvcopy3.htm instruction manual as required.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4Q1. Converting YOUR MVS JCL to Korn shell scripts

Setup Backup scripts now (vs later)

Setup Your backup scripts now to protect your programmers from 'oops'. See several backup scripts suggested in ADMjobs.htm#Part_3 (& Part 4).

We recommend setting up 'crontabs' to backup cnvdata, testdata,& testlibs every night to both tape & disc (documented in ADMjobs.htm#Part_5). Those procedures provide 2 days backups on disc for immediate recoveries

The backup scripts & crontabs are stored in the 'appsadm' home directory.

appsadm - Application Administrator

We recommend you setup a login/userid 'appsadm' to serve as the applications administrator for the unix/linux site. The appsadm home directory would hold various scripts, crontabs, log files, etc used in application administration. Here are some suggested sub-directories:

 /home/appsadm
 :-----bin              - binaries for site developed/modified programs
 :-----ctl              - control files (miscellaneous)
 :-----env              - master copies of profiles etc
 :                        modified appropriately for your site
 :-----log1             - console logging files (currently active)
 :     :-----user1        - sub-directoried by user login
 :     :-----user2
 :     :     :-----070306_175400
 :     :-----.etc.
 :-----log2             - console logging files (for current month)
 :     :-----user1
 :     :-----user2
 :     :     :-----070304_153300
 :     :     :-----070305_134500
 :     :     :-----070306_175400
 :     :-----.etc.
 :-----log3             - console logging files (for last month)
 :     :-----user1
 :     :-----user2
 :     :-----.etc.
 :-----logs             - backup logs (run by cron)
 :
 :-----pf             <-- uvcopy jobs developed/modified by site admin
 :
 :-----sf             <-- shell scripts developed/modified by appsadm
 :                      - also holds the 'crontabs' used to schedule backups
 :                        & any other jobs you wish to run automatically
 :
 :-----src              - source for any programs developed/modified by appsadm
 :-----tmp

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4R1. Converting YOUR MVS JCL to Korn shell scripts

setup console logging

This is a VITAL feature to replace the console logging systems provided by proprietary mainframe systems. Console Logging uses the Unix/Linux 'script' command inserted at the end of the profile to create a date/time stamped console log file which captures all console I/O until the operator logs off.

Console log files must be processed (to remove screen control codes) before being viewed or printed & this is accomplished automatically when the user logs off & back on. He may then use the logview script to view or print the latest (or earlier) log file.

See the sample console log created when the conversion test/demo jobs are executed on page '1U3'. See complete details about console logging in ADMjobs.htm#Part_6.

Console logging is activated by uncommenting 4 lines at the end of the supplied profile. See the stub_profile listed at ADMjobs.htm#1C1. You must also setup a subdir in /home/appsadm/log1,2,3 matching your userid.

Console logging should be mandatory for operators, but can be optional for programmers, who can use the 'joblog' script during test/debug.


 #1. vi .bash_profile   <-- edit your profile
     ================     - uncomment following 4 lines near end
     login1 || exit 2          # exit here if 2nd login
     logfixA                   # process log1 file to log2 (to allow read/print)
     echo 'console logging requires aliases to be stored in .bashrc or .kshrc'
     exec script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)

 #2a. cd /home/appsadm    <-- change to appsadm & make subdirs matching userid
 #2b. mkdir log1/userx    <-- make subdir in log1 for current log collection
 #2c. mkdir log2/userx    <-- make subdir in log2 for current month collection
 #2d. mkdir log3/userx    <-- make subdir in log3 for last month history

 #3a. exit            <-- logoff
 #3b. Login           <-- log back in to activate console logging

 #4a. 28401d23.ksh    <-- run some of your JCL/scripts
      ============
 #4b. llr rpts        <-- list some directories, etc
      ========

 #5. logoff & back on to process console log
     (from /home/appsadm/log1/userx/... to log2/userx/...)

 #6. logview          <-- display your log files
     =======
     --> 1            <-- enter 1 to view the latest
Note
  • see 'Part_7' for an illustrated demo of Console Logging (& Job Logging)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

4S1. Converting YOUR MVS JCL to Korn shell scripts

Parallel, Re-transfer, Setup for production,& go live

  1. Run parallels with mainframe when you have enough JCL/scripts debugged

  2. Re-transfer mainframe JCL,COBOL,& DATA a few times during conversion period

  3. Setup the production machine.

  4. Go live (over a weekend usually), You will need to re-transfer & reconvert all data files as documented on page '4I2' or in MVSDATA.htm. The JCL/scripts & programs will not need re-transfer/reconvert on the 'go live' weekend, since you will already have them well tested.

  5. See 'Part_7' Operating Aids - Console Logging (captures all console messages) - Job Logging (captures only VITAL & ERRor messages)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_5 MVS JCL conversion - Special Sub-Systems

Part 5 GDG files - Contents


5A1. Introduction & Overview

5B1. How mainframe GDG files are converted for unix/linux
5B2.  Allowing for Abterms (don't increment GDGs until Normal EOJ)
5B3.  Sample GDG control file
5B4.  Options to process prior generations, using the control file
- vs having to modify JCL/scripts to specify desired GDG#
5B5.  exportgen0 selects next gen# using gdgctl51I Indexed control file
5B6.  gdgctl file option for expiry dates & range processing of prior generations
5B7.  Retaining a history of prior GDG# processing in the control file

5C1. Creating the gdgctl file (operating instructions)
5C3. Updating the GDG text control file & reloading the Indexed file
utility job 'gdgload51' loads ctl/gdgctl51 to ctl/gdgctl51I
5C4. Display the gdgctl Indexed file with 'uvhd'
5C6. Updating the gdgctl Indexed file directly with 'uvhd'.
5C7. Updating the gdgctl Indexed file directly with 'vi' (dangerous).
5C9. Alternate location for the GDG control file ($APPSADM/ctl)

5D1. Sample JCL/script jgl100.ksh using GDG files
5D2.  GDG logic explained, how we prevent GDG# increments on failed runs
5D3.  Test data files supplied to illustrate GDG processing
5D4.  Op. Instrns. for jgl100.ksh to demo GDG processing - successful run
5D5.  Console log & directory listings after new generation created
- new generations (written to jobtmp) MOVED to $RUNDATA/data1 at jobend
5D6.  Op. Instrns. for jgl100.ksh to demo GDG processing - on run FAILURE
5D7.  Console log & directory listings after run failure
- new generations (written to jobtmp) NOT moved to $RUNDATA/data1/

5E1. Exception processing with GDG files
- example of processing a series of GDG files already stored in subdir
  without having to modify JCL/scripts or copy files
5E2.  Test files & JCL JGL220 to demo prior generation & range processing
5E3.  Converted Korn shell script jgl220.ksh to demo prior gen & range prcsng
5E4.  gdgctl51test2 control file to demo prior gen & range processing
5E5.  Op. Instrns. for jgl220.ksh to demo prior gen/range prcsng - 1st run
5E6.  Console log & directory listings after run #1 to demo range processing
5E7.  Op. Instrns. for jgl220.ksh to demo prior gen/range prcsng - 2nd run
5E8.  Console log & directory listings after run #2 to demo range processing
5E9.  jgl220.ksh run#3 demo GDG range processing - Op. Instrns & console log
5E10.   jgl220.ksh run#4 demo GDG range processing - Op. Instrns & console log
5E11.   GDG control file (ctl/gdgctl51I.dat) after 4 test runs
5E12.   Notes re generations selected for master & transaction files

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part 5 MVS JCL conversion - Special Sub-Systems

Part 5 GDG files - Contents (continued)


5F0. Caveats for Vancouver Utility GDG system
- some sites have situations requiring manual changes
5F1.  $SYMBOLS in data file names in the JCL/scripts
- you must replace with actual values in ctl/gdgctl51
- easy to do using vi mass change commands (see examples given)
5F2.  You must modify jclunixop51 to code your datafile topnodes/subdirs
 (vs supplied coding for the mvstest demo subdirs)
- may generate automatically from topnode list & templates (see '6A1')
 You must code your valid topnodes in the '$RUNLIBS/ctl/GDGmkdirs' script.
 used to hold new GDGs until Normal EOJ (moved back to $RUNDATA/subdir)
5F3.  You must modify any JCL/scripts that have DDNAME assignments
- if the logical filename on the exportgen0/1 function is assigned
  to an alternate logical filename via an exportfile (vs exportgen)
- an unusual situation that occurred at a VSE site
5F4.  Should be no changes required to jobs that write new GDGs & readback.
 But changes were required for a site using the option to convert all
 tape files to GDG files because it depended on an I/O indicator to
 generate exportgen0/exportgen1 (vs original mainframe coding 0/+1)
5F5.  problems converting tape files to GDG files at a VSE site.

5J0. Listings of functions used for GDG files
5J1. exportgen0 - determine current generation of a GDG file
5J2. exportgen1 - determine next generation of a GDG file
5J3. exportgenall - concatenate all generations of a GDG file
5J4. exportgenx - error message if gen# < (-3) or > (+3)
5J5. exportfile - function for non-GDG files (exports & displays filename)

5K1. jobset51 - setup job environment for scripts converted from IBM MVS JCL
- JCL converter inserts a call to this function at begin script
- changes directory to $RUNDATA, sets up subdirs, etc
5K2. jobset52 - full-PATH version of jobset51 (relative-PATH, recommended)
- differences shown via 'diff' command
5K3. jobend51 - display GDG files moved from jobtmp/GDG/
back to $RUNDATA/data1/ (so they show on console log)
5K4. jobabend51 - display GDG files NOT moved from jobtmp/GDG/
because job Terminated Abnormally

5M0. Listings of uvcopy jobs used for GDG files
5M1. makegdgctl51 - create ctl/gdgctl51 file from ctl/datactl53
5M2. gdgload51 - load ctl/gdgctl51 file to indexed file ctl/gdgctl51I
5M3. gdgunload51 - convert indexed file back to text file for editing/reload
5M4. gdgget51 - used by exportgen1 to get max generations from the
indexed control file (ctl/gdgctl51I)
5M5. gdgget52 - used by exportgen0 to determine next generation#
- checks gdgctl51I for over-ride to prior generation

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5A1. Vancouver Utilities GDG system - Introduction & Overview

GDG Enhancements

The Vancouver Utilities provides GDG (Generation Data Group) processing similar to the mainframe facility. In May 2007, the VU GDG system was significantly enhanced and some new features go well beyond the original implementation provided on the mainframe.

Vancouver Utility GDG system - Basic Features

  1. After mainframe GDG files are converted (from EBCDIC to ASCII, preserving packed/binary fields), they are copied to the testdata/proddata directories & renamed with suffix '_000001' (1st generation using 6 digit#).

  2. When mainframe JCL is converted to Korn shell scripts, GDG files are identified with a trailing '_' underscore only.

  3. The JCL calls Korn shell 'functions' to determine the appropriate generation. 'exportgen0' defines the latest/highest generation (for reading). 'exportgen1' defines the next generation (for writing).

  4. Earlier versions of exportgen1 incremented the generation# immediately (vs delaying until the job terminated normally as on the mainframe). If a multi-step job terminated abnormally, you were advised to use the 'restart' facility (provided for every step by the VU JCL converter). But if for some reason you wanted to restart from the begining, you had to manually remove any new generations created before the abterm.

  5. The abterm problem is now solved by an enhanced version of 'exportgen1' & a new function 'jobend51' called at Normal End of Job. 'exportgen1' now assigns new generations to the 'jobtmp' directory & at Normal EOJ, function 'jobend51' will move the jobtmp files back to the $RUNDATA directories. This allows you to rerun abterm jobs from the begining , but if you do restart, you will be prompted if it is OK to move any jobtmp files back to the $RUNDATA directories.
Note
  • writing new GDGs to jobtmp controlled by option g0/g1 in ctl/jclunixop51
  • g1 (default) writes new GDGs to jobtmp/... for move back at Normal EOJ
  • g0 option writes new GDGs in original $RUNDATA/subdir
  • for g0, you could restart failed jobs at step after failure, else
    you must remove any new GDGs created up to failure before rerunning
  1. Earlier versions of exportgen1 used a hard-coded number of generations to be accumulated before erasing older generations, unless you coded the gdg=... keyword on all exportgen1's for the file, which could be problematic.

  2. The new system provides an Indexed control file which exportgen1 accesses to get the desired number of generations for each file.

  3. We provide a utility to automatically create the indexed file by extracting all GDG filenames from all JCL/scripts, sorting,& dropping duplicates. You then edit the control file to modify the default number of generations as desired & run another utility job to load the indexed file.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5A2. Vancouver Utilities GDG system - Introduction & Overview

Vancouver Utility GDG system - Advanced Features

The indexed control file allows us to provide some significant enhancements that go well beyond the original GDG implementation on the mainframe.

  1. You can specify a prior generation of a file to be defined by exportgen0 for the next run only, or until a specified expiry date/time is reached. This avoids having to modify the JCL/scripts. Note that you only have to modify one entry in the control file, whereas you could easily miss some of the possible multiple references in one or more JCL/scripts.

  2. You can specify range processing for a series of prior generations This is a powerful feature that 1 customer is already planning to make good use of. On the mainframe he had 30 tapes that had to be processed one at a time by a batch COBOL program & the operator simply mounted the tapes in turn.

  3. On the new unix system, all tape files are automatically converted to generation disc files, so to process the 30 tapes (now GDG disc files) separately, the customer might have to modify the JCL to hard-code the next desired generation# or he might specify via an operator keyin.

  4. With the enhanced GDG system, he edits the control file specifying the low to high range of generation#s to be processed. He can then run the batch job 30 times to process the 30 files (with no changes to JCL/scripts & no operator generation# keyins).

  5. This is possible because 'exportgen0' uses the current next generation#, which is incremented by the 'jobend51' function at normal EOJ. At the high end of the range, processing returns to normal, but an historical record is maintained in the indexed file database, making it easier to reactivate if the same cycle is repeated periodically.

  6. You can specify 'opt=c' (confirm) on control file entries to cause exportgen0 to prompt the operator to confirm the generation# selection, or to enter an alternative 6 digit generation#.

  7. The new system maintains a history of the last 30 accesses by exportgen0 and exportgen1. You can look at the control file (with uvhd) and for each of the last 30 accesses, you can see: date:time, generation# selected, lowest:highest generations on-file, jobname, step#,& program of last access.

  8. Each of the last 30 entries that define access history is identified with one of three status codes: 'G0'=exportgen0(reading current/selected gen), 'G1'=exportgen1(writing next gen), or 'AB'=ABnormal Termination (indicates file not moved from jobtmp/GDG/ back to RUNDATA/data1/).

    GDG control file history updates optional

As of June 2012, GDG control file history updates is optional depending on environmental variable GDGCTLUPDT, default GDGCTLUPDT=YES (in common_profile). Inhibiting history updates might speed up on very busy system and reduce possibility of file locks & corruption. GDGCTLUPDT=YES is required to use some advanced features & could be useful debugging problems with GDG files.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5B1. MVS JCL conversion - Generation files

Generation Data Groups

Mainframe GDG files are implemented via unix/linux Korn shell functions (exportgen0, exportgen1/2/..., exportgen-1/-2/...,& exportgenall). These functions are listed later beginning on page '5J0'. Here is a sample conversion (before & after) of GDG files:

JCL conversion - GDG files (BEFORE & AFTER)

 //ACCTMAS  DD DSN=GL.ACCOUNT.MASTER(0),DISP=SHR
 //ACTLIST  DD DSN=GL.ACCOUNT.ACNTLIST(+1),DISP=(,CATLG,DELETE),
 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),
 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)
 exportgen0 ACCTMAS data1/gl.account.master_           #<-- current generation
 exportgen1 ACTLIST $JTMP/data1/gl.account.acntlist_   #<-- next generation

Note that the '(0)' suffix on an MVS DSN indicates the current generation & '(+1)' indicates the next generation. The JCL converter identifies GDG files with a trailing '_' underscore & uses function 'exportgen0' to define the current generation & function 'exportgen1' to define the next generation (for the following COBOL or utility programs).

Note that exportgen1 writes the next generation to $JTMP/... for move back to data1/... at successful end of job.

Data filename conversion

After the data files are converted from EBCDIC to ASCII (preserving any packed/binary fields), they must be renamed as they are copied from $CNVDATA/subdirs to $RUNDATA/subdirs.

The 1st generation might be assigned as generation _000001. After a few updates to the account.master file we might have:

 data1/gl.account.master_000001     <-- 1st generation of GDG file after conversion
 data1/gl.account.master_000002
 data1/gl.account.master_000003
 data1/gl.account.master_000004
 data1/gl.account.master_000005     <-- current generation

Generation# does not auto wrap

The unix function exportgen1 does not automatically handle generation wrap (as did the mainframe), but note that if you had a generation file that was updated once a day it would take 2500 years to exceed 900000.

However uvcopy jobs are provided to rename files with suffixes over 900000 The uvcopy job is 'gdgreset6' for 6 digit GDG#s (versions since Dec 2005). and 'gdgreset4' for 4 digit GDG#s (versions older than Dec 2005).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5B2. MVS JCL conversion - GDG files

Allowing for Abterms (don't increment GDGs)

Early versions of the exportgen1 function wrote new GDG files into the same directory as the prior generations, thus creating a problem if multi-step JCL/scripts terminated abnormally & had to be rerun.

You might have been able to use the restart at any step capability, but if not you would have to manually remove any newly created generations before rerunning.

The new version of exportgen1 (exportgen1c) writes new generations of GDG files into the jobtmp/GDG/. When the job reached the normal EOJ point, the 'jobend51' function copies the new generations back to the defined $RUNDATA/data1/.

Option g0/g1 now controls writing new GDGs to $RUNDATA/data1/... or jobtmp/GDG/... See option g0/g1 in ctl/jclunixop51 listed on page '3E1'.

g1
  • (default) writes new GDGs to jobtmp/... for move back at Normal EOJ.
g0
  • option writes new GDGs in original $RUNDATA/subdir

For g0, you could restart failed jobs at step after failure, else you must remove any new GDGs created up to failure before rerunning.

Generation limits per file

Early versions of exportgen1 used a system wide number of generations for all files, or you had to specify gdg=... as an argument on all instances of exportgen1 for a particular file.

The new version of exportgen1 (exportgen1c) accesses an indexed control file to retrieve the desired number of generations for each file.

When changes are desired, you can edit the text version of the control file (ctl/gdgctl51) & reload the indexed file (ctl/gdgctl51I), which is accessed by exportgen1.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5B3. MVS JCL conversion - GDG files

sample GDG control file

 data1/gl.account.acntlist_                     gdg=08
 data1/gl.account.master_                       gdg=10
 data1/gl.account.trans_                        gdg=20 opt=c
 data1/py.payroll.master_                       gdg=30
 data1/py.time.cards_                           gdg=52 next=000021
  1. The GDG control file ($RUNLIBS/ctl/gdgctl51) can be automatically created by extracting the 'exportgen1's from all JCL/scripts. See Operating Instructions later on page '5C1'.

  2. If desired, there is an option to include all files in the control file (both GDG & non-GDG).

  3. You will be prompted for the default number of generations per file.

  4. After initial creation, you can edit the control file to specify the number of generations desired for each file.

  5. You can also specify 'opt=c' for operator confirmation of selected gen# & opportunity to enter an alternative 6 digit generation#.

  6. You can specify 'next=...' to override the usual selection of the highest generation. See more about this begining on the following pages.

    loading the GDG Indexed control file

The actual GDG control file used by exportgen0,exportgen1,etc is an Indexed file for random lookup by filename, but it is much easier to prepare the contents as a text file (for easy editing).

A sample text file is provided in /home/uvadm/ctl/gdgctl51. You could use this as a guide, add your own filenames & desired generations, then load it into the Indexed GDG control file which is $RUNDATA/ctl/gdgctl51I as follows.

This assumes you have setup a user such as 'mvstest' with profiles,directories,& environmental variables (RUNLIBS & RUNDATA) as described in MVSJCL.htm#Part_1.

If setting up your own directories (vs subdirs copied from /home/uvadm/mvstest) you could use scripts mvslibsdirs & mvsdatadirs as at MVSJCL.htm#4C3 & '4C4' and use script copymvsctls to copy sample control files from /home/uvadm/ctl/ as on MVSJCL.htm#4D1.


 #1. login mvstest --> /home/mvstest

 #2. cd $RUNDATA  --> /home/mvstest/testdata

 #3. uvcopy gdgload51[,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I]
     ========================================================

 #3a. uvcopy gdgload51   <-- same as above (files default as shown)
      ===============

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5B4. MVS JCL conversion - GDG files

exportgen0 & gdgctl - Exception Processing

Normally exportgen0 defines the latest generation (file with highest 6 digit suffix). Consider the following data files & the 'exportgen0' example:

data1/gl.account.master_000001 data1/gl.account.master_000002 data1/gl.account.master_000003 data1/gl.account.master_000004 data1/gl.account.master_000005


 exportgen0 0 GLMSTR data1/gl.account.master_  <-- JCL/script coding to define the file
 ============================================        for the following COBOL program

 export GLMSTR=data1/gl.account.master_000005  <-- effective result
 ============================================

option to process prior generations

To process prior generations, you could temporarily modify the JCL/script, explicitly coding the desired 6 digit suffix. For example we could code:


 export GLMSTR=data1/gl.account.master_000002   <-- script modified with specific#
 ============================================
            - - - OR - - -

 exportfile GLMSTR data1/gl.account.master_000002 <-- OR use this to display filename
 ================================================
  1. If you hard-code the 6 digit seq#, you have to change 'exportgen0' to 'export' or 'exportfile' since exportgen0 is valid only for filenames with trailing '_'

  2. 'export' is the underlying command & 'exportfile' is a function which does issue the 'export' command, but in addition displays the filename for the console log.

    disadvantages of changing the JCL/scripts

  3. You have to remember to change them back after your reruns.

  4. Anytime you edit the JCL/scripts, there is the possibility of making mistakes.

  5. There may be multiple 'exportgen0's in multiple JCL/scripts to be modified for the reruns desired.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5B5. MVS JCL conversion - GDG files

exportgen0 & gdgctl rerun facility

In May 2007, a new version of exportgen0 (exportgen0c) was developed to provide a powerful rerun (prior generation access) capability.

This system uses the same control file ($RUNDATA/ctl/gdgctl51) that was 1st added to carry the desired no of generations per file (for exportgen1c).

Consider the following few lines of the gdgctl file & the following generations of the account.master file:

      data1/gl.account.acntlist_     gdg=4
      data1/gl.account.master_       gdg=6   <-- samples extracted from ctl/gdgctl51
      data1/gl.account.trans_        gdg=50 opt=c
      data1/gl.account.master_000001
      data1/gl.account.master_000002
      data1/gl.account.master_000003         <-- last 5 generations of account.master
      data1/gl.account.master_000004
      data1/gl.account.master_000005

If you wanted to rerun a JCL/script using prior generation _000002, you could modify the control file as follows:

      data1/gl.account.acntlist_     gdg=4
      data1/gl.account.master_       gdg=6   next=000002   <-- gen# for rerun
      data1/gl.account.trans_        gdg=50  opt=c
  1. It is safest to edit only the ctl/gdgctl51 text file, not the indexed file (ctl/gdgctl51I.dat) used by exportgen0 (& the jobend51 function).

  2. After modifying the text file, you must load it to the indexed file using 'uvcopy gdgload51'

  3. Or you could update the Indexed file directly using 'uvhd' (as shown later on page '5C3').

  4. Or if very careful, you could edit the Indexed file directly using the 'vi' editor since we do have the text file as backup & we can recreate the text file by rerunning jclgdgctl51.

  5. At the end of the 1st JCL/script with exportgen0 reference to account.master, the 'next=000002' is disabled by changing it to 'next=000000'

  6. You do have to remember to clear the original 'next=000002' from the text file version before you reload the indexed file for some other reason.

  7. It might be safer to 1st run the 'gdgunload51' job to convert the indexed file back to a text file for future edits & reload.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5B6. MVS JCL conversion - GDG files

Expiry Times

The system allows you to specify an expiry time when modifying the gdgctl file. For example:


     data1/gl.account.master_  gdg=6  next=000002_yymmdd:HHMMSS
     ==========================================================

The exception processing (defining prior generations of the file) is disabled if the expiry date has been exceeded when the next JCL/script is run with exportgen0 references to the account.master.

Progressing thru a range of prior generations

The system also allows for successive runs to process thru a range of prior generations. For example:


     data1/gl.account.trans_ gdg=50 opt=c next=000001(000001:000012)
     ===============================================================

This would allow you to load the transaction files for all 12 months, before you do any processing, then process the 12 months on successive runs. (with no changes to JCL/scripts or control file required).

After the 12th run the control file entry would be updated by the jobend51 function executed at Normal EOJ, to:


     data1/gl.account.trans_ gdg=50 opt=c next=000000(000001:000012)
     ===============================================================

IE, the next gen# is set to '000000' to indicate the processing is completed but not lose a record of the manual edits. The next reference by exportgen0 for this file would define the then highest generation# (which might still be '000012').

You could combine expiry times with progression, but it is not necessary, since the progression automatically ends the exception processing when the upper limit is reached. Expiry dates are ignored if a low < high range is specified, but the format would be:


     data1/gl.account.trans_ gdg=50 opt=c next=000001(000001:000012)yymmdd:HHMMSS
     ============================================================================
Note
  • actually all next=... entries must be in the full format shown above
  • if you do not need progression, specify low & high same as next gen#
  • if you do not need expiry date, specify as 000000:000000

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5B7. MVS JCL conversion - GDG files

Retaining History in gdgctl

An earlier simplified example of a 1 time access to a prior generation is shown below, followed by the actual format required, which retains some history of your prior generation overrides in the gdgctl file.


     data1/gl.account.master_ gdg=6 next=000002  <-- gen# for next access (1 time)
     ==========================================

     data1/gl.account.master_ gdg=6 next=000000  <-- reset to this at Normal EOJ
     ==========================================

     data1/gl.account.master_ gdg=6 next=000002(000002:000002)yymmdd:HHMMSS <-- req'd
     ======================================================================

     data1/gl.account.master_ gdg=6 next=000000(000002:000002)yymmdd:HHMMSS <-- reset
     ==============================******==================================

gdgctl illustrating prior gen# over-rides

 data1/gl.account.acntlist_ gdg=08
 data1/gl.account.master_   gdg=10 next=000002(000002:000002)000000:000000 <--note1
 data1/gl.account.trans_    gdg=20 next=000002(000002:000002)070529:235959 <--note2
 data1/py.payroll.master_   gdg=30 op=c                                     <--note3
 data1/py.time.cards_       gdg=52 next=000001(000001:000012)000000:000000 <--note4
 data1/py.time.cards.div2_  gdg=52 next=000001(000001:000012)070529:235959 <--note5
  1. 'next=000002' will be reset to 'next=000000' (disabling over-ride) at the end of the 1st JCL/script that references the file with exportgen0.

  2. Specify an 'expiry date' if you want the over-ride to persist for multiple runs until some specified date/time.

  3. Specify 'opt=c' if you want an operator prompt to confirm gen# selection or enter an alternative generation#

  4. The generation# will be incremented each time you run the JCL/script referencing the file. After the 12th run it will be set to 'next=000000(000001:000012)' disabling the over-ride, but leaving some history, in case you wanted to reactivate in future.

5a. You could also specify a non-zero expiry date/time, but not necessary since the override is automatically disabled at the high end of the range.

5b. Expiry dates are ignored for ranges (when low & high different), but you could code expiry dates with ranges for an historical record.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5C1. MVS JCL conversion - GDG files

creating the gdgctl file

For these discussions, we assume you have already setup userid mvstest & copied the demo files from /home/uvadm/mvstest/* to /home/mvstest/... as instructed on page MVSJCL.htm#1P1 thru 1P3. And then converted the supplied demo JCLs & COBOL programs as per 1Q1-1R3.

If you had very few GDG files you could create ctl/gdgctl51 with the editor (see the sample further below), but in case you have a lot of GDG files, we provide a utility job. 'jclgdgctl51' will read all JCL, extract all DSN's,& sort with data reduction to 1 line per unique filename.

There are several options (as shown below at #3), but the ones you might want to change are 'g15' default generations & 'h40' the column# where you want to insert the gdg=...

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5C2. MVS JCL conversion - GDG files

Op. Instrns. to create gdgctl file


 #1a. login mvstest,appsadm,or yourself --> /home/mvstest,appsadm,homedir

 #1b. cdl --> $RUNLIBS (/home/mvstest/testlibs, /p1/apps/testlibs, ???)
           - see directories,profiles,$RUNLIBS,etc discussed page '1A1' +

 #2. [ jcl2ksh51A all ]      <-- we assume JCL conversion already completed
     =================        - left all converted scripts in jcl3/...

 #3. uvcopy jclgdgctl51,fild1=jcl3,filo2=ctl/gdgctl51,uop=c0f2g99h40j1
     ==================================================================
     options: c0 = no filecounts, f2 = exportgen files only, g99 = default gens
              h40 = col# to insert gdg=..., j1 = remove $JTMP/

 #3a. uvcopy jclgdgctl51     <-- same as above (files default as shown)
      ==================       - sample output shown below
     data1/gl.account.master_                       gdg=31
     data1/gl.account.trans_                        gdg=31 opt=c
     data1/py.payroll.master_                       gdg=31

These samples are based on the test/demo JCLs shown in Part_1 (but several lines removed for this illustration).


 #4. cp ctl/gdgctl51 $RUNDATA/ctl/gdgctl51
     ========================================
     - copy/rename for GDG control file
Note
  • GDG control files moved to $RUNDATA to allow multiple $RUNDATA's

 #5. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #6. vi ctl/gdgctl51    <-- edit to modify no of generations as desired
     ===============      - replace any $SYMBOLS with values

 #7. uvcopy gdgload51,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I
     ======================================================
     - load Indexed file to supply file info to JCL converter

 #7a. uvcopy gdgload51   <-- same but easier (files default as shown above)
      ===============
Note
  • see page '5F1' for special editing if you have $SYMBOLS
  • on your data file names extracted from your JCL/scripts by jclgdgctl51

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5C3. MVS JCL conversion - GDG files

updating text file with vi & reloading Indexed file


 #1. login mvstest --> /home/mvstest

 #2. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #3. vi ctl/gdgctl51    <-- view the supplied file
     ===============
     data1/gl.account.acntlist_  gdg=31
     data1/gl.account.master_    gdg=31
     data1/gl.account.trans_     gdg=31
     data1/py.payroll.master_    gdg=31
     data1/py.time.cards_        gdg=31

 #3a. update the file as shown below:
     data1/gl.account.acntlist_  gdg=08
     data1/gl.account.master_    gdg=10 next=000002(000002:000002)_991231:235959
     data1/gl.account.trans_     gdg=20 opt=c next=000001(000001:000012)000000:000000
     data1/py.payroll.master_    gdg=30
     data1/py.time.cards_        gdg=52

 #3b. quit the editor & reload the Indexed file

 #4. uvcopy gdgload51,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I
     ======================================================
     - load Indexed file to supply file info to JCL converter

 #4a. uvcopy gdgload51    <-- same as above (files default as shown)
      ===============

 #5.  Run the supplied demo JCL/script (jgl100.ksh) & observe that it
      processes data1/gl.account.master_000002 (NOT the latest gen# 000003

 #5a. jgl100.ksh    <-- run demo job, observe console log
      ==========      - should see input generation ..._000002

 #5b. jgl100.ksh    <-- rerun demo job, observe console log
      ==========      - should see input ..._000003 (last gen#)
                      - override was reset by jobend51 at end 1st run

updated control file supplied

An alternate version of the gdgctl file is supplied with the next=... controls as shown above. We will use it for the jgl220.ksh demos begining on page '5E1'. We will load it as follows:


 #3b. uvcopy gdgload51,fili1=ctl/gdgctl51test2
      =======================================
      - must specify alternate input file (else would default to ctl/gdgctl51)
      - no need to specify output file which defaults to ctl/gdgctl51I

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5C4. MVS JCL conversion - GDG files

display gdgctl Indexed file with uvhd (char mode)

Rather than updating the text file version & reloading the Indexed file, you could update the Indexed file directly with 'uvhd'. This is safer than updating the indexed file directly with 'vi'.

Note that when the text file is loaded into an Indexed file, you get 2 partitions (gdgctl51I.dat & gdgctl51I.idx).


 uvhd ctl/gdgctl51I.dat r2048u   <-- execute uvhd to display gdgctl file
 =============================     - options: r2048=record-size, u=update
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
        2048 gl.account.master_                                 gdg=10
          64 next=000000(000000:000000)000000:000000
         128 000000:000000:G0_000000(000000:000000)_______  _____ _________
         192 000000:000000:G0_000000(000000:000000)_______  _____ _________
         256 000000:000000:G0_000000(000000:000000)_______  _____ _________
         320 000000:000000:G0_000000(000000:000000)_______  _____ _________
         384 000000:000000:G0_000000(000000:000000)_______  _____ _________
         448 000000:000000:G0_000000(000000:000000)_______  _____ _________
         512 000000:000000:G0_000000(000000:000000)_______  _____ _________
         576 000000:000000:G0_000000(000000:000000)_______  _____ _________
         640 000000:000000:G0_000000(000000:000000)_______  _____ _________
         704 000000:000000:G0_000000(000000:000000)_______  _____ _________
         768 000000:000000:G0_000000(000000:000000)_______  _____ _________
         832 000000:000000:G0_000000(000000:000000)_______  _____ _________
         896 000000:000000:G0_000000(000000:000000)_______  _____ _________
         960 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1024 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1088 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1152 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1216 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1280 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1344 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1408 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1472 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1536 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1600 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1664 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1728 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1792 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1856 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1920 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1984 000000:000000:G0_000000(000000:000000)_______  _____ _________..

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5C5. MVS JCL conversion - GDG files

gdgctl file displayed by uvhd


 uvhd ctl/gdgctl51I.dat r2048u   <-- execute uvhd to display gdgctl file
 =============================     - options: r2048=record-size, u=update
  1. Please see the uvhd display on the previous page. We are showing records 2 & 3 after loading the indexed file with ctl/gdgctl51test2. Each 2048 byte record is display on 26 lines (of 64 bytes). Here are the 1st 2 lines for records 2 & 3.
        2048 gl.account.master_                                 gdg=12
          64 next=000002(000002:000002)991231:235959
                 - - - 11 lines omitted - - -
        2048 gl.account.trans_                                  gdg=18 opt=c
          64 next=000001(000001:000012)000000:000000
                 - - - 11 lines omitted - - -
  1. Only lines 2 & 3 have items that might be updated with uvhd or vi. You might want to modify the number of generations (gdg=12 or gdg=18 above). You might want to add option 'opt=c' to prompt operator to confirm gen# (as shown for the data1/gl.account.trans file).

  2. Some users may have a reason to code the 'next=...' options shown above 'next=000002...' for data1/gl.account.master overrides the normal selection of the highest generation until the expiry date is reached.

  3. 'next=000001(000001:000012)...' on data1/gl.account/trans, will increment the generation# thru a range of previously stored generations from low to high. 'exportgen0' will use the next=... value & 'jobend51/gdgupok1' will increment the generation# at successful EOJ. We will demonstrate later using jgl220.ksh (see pages '5E1' thru '5E11').

  4. Note that the last 2 bytes of each record show as '..' because uvhd shows any unprintable characters as '.'. The 1st '.' is a real period inserted in the last data byte to allow possible updating with the editor. The last byte of the record & the 2nd '.' is x'0A' which is the indexed file record status byte for a good record, whereas x'00' indicates a deleted record.

  5. You can see the hex characters by adding option 'h2' to force display in 'vertical hexadecimal', which is automatic if the record contains any non-character bytes. The above was in character because the only non-char was the LineFeed x'0A' which is expected at the end of text records.

  6. On page '5C5' we will show how to use uvhd to perform the same updates as shown using vi on the text file on the previous page.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5C6. MVS JCL conversion - GDG files

updating gdgctl Indexed file with uvhd

On this page we will show you only the 'uvhd' commands to update the Indexed file. Please see the records displayed on page '5C3'. The records already have the updates shown below because we loaded the file from ctl/gdgctl51test2 which was already updated with 'vi' before loading the indexed file (the easier way to make extensive updates).


 #1. login mvstest --> /home/mvstest

 #2. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #3. uvhd ctl/gdgctl51I.dat r2048u  <-- start uvhd with options
     =============================      r2048=recsize, u=update
      <--- see uvhd record display on prior page
         - uvhd displays the 1st record & prompts for commands
         - you can reply as shown below:

 #3a. -->    <-- null entry to advance to record #2

 #3b. --> u 64(38),'next=000002(000002:000002)000000:000000'
          ==================================================

easier alternative

Actually the gdgload51 utility inserts zero-filled inactive entries, so you only have to update the 6 digit next gen# as follows:


 #3b. --> u 69(6),'000002'
          ================

 #3c. --> q   <-- quit

Notes

  1. If you use uvhd, you must be sure not to modify the keys (1st 50 bytes)

  2. using uvhd is more awkward than an editor, but much safer. uvhd will never change the record size which would corrupt the remainder of the file, since the index partition depends upon all data record being same size. Adding or deleting bytes inadvertently is very easy to do with vi.

  3. Updating the Indexed file directly with 'vi' is dangerous, but it is fast & convenient, and we will show you how on the next page.

  4. After updating with 'vi' you should always run the 'dcheck' utility to ensure the validity of the Indexed file.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5C7. MVS JCL conversion - GDG files

updating gdgctl Indexed file with vi


 #1. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata

 #2. vi ctl/gdgctl51I.dat   <-- start 'vi' on the Indexed file .dat partition
     ====================
 gl.account.trans_                                  gdg=18 opt=c next=000001(0000
 01:000003)000000:000000                         000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________  000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________  000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________  000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________  000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________  000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________.

 #2a. -->vi updates ...

 #2x. -->:wq  <-- write & quit vi editor

 #3. dcheck ctl/gdgctl51I    <-- validate the Indexed file
     ====================      - to ensure you did not screw up with editor

notes re display above

To the 'vi' editor the gdgctl51I.dat records are considered very long lines, since there is only 1 Linefeed at the end of the 2048 byte records. They appear as 26 lines on the screen, since screen lines wrap at 80 bytes. If we printed the original record you would see only the 1st 90 bytes (page-width).

To simulate the screen appearance I ran a uvcopy job 'splitrec1' which inserts a Line-Feed every 80 bytes. I 1st used vi to write 1 record to tmp/gdgctl1.


 uvcopy splitrec1,fili1=tmp/gdgctl1,filo1=tmp/gdgctl2
 ====================================================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5C8. MVS JCL conversion - GDG files

Notes re updating gdgctl with 'vi'

  1. Shown above is the 3rd record of gdgctl51I after loading from gdgctl51test2. Each 2048 byte record requires 26 lines. The filename appears 1st, in this example 'data1/gl.account.trans. The only items you might need to update are on the 1st 2 lines (+ 6 chars of the 3rd line). The rest is history.
 gl.account.trans_                                  gdg=18 opt=c next=000005(0000
 01:000012)000000:000000 JGL220             err4 070621:210051:G0_000003(000001:0
 00003)JGL220   S0010 cgl200err4 070621:210030:G0_000003(000001:000003)JGL220   S
  1. 'gdg=18' is the number of generations to be maintained. 'opt=c' is the option for operator confirmation of gen# selection. 'next=...' is the option to process a series of existing prior generations.

  2. Note 'next=000005(000001:000012)...'. This 'vi' snapshot was captured 4 runs after setting next=000001(000001:000012)...'

  3. If you are very careful you might be able to update with vi. Use only the 'R'eplace command of vi, not insert or delete. Note that 'gdgload51' inserts a period '.' at col 2047 to indicate the end of the record. See the end-of-record '.' on the last of the 13 x 80 column lines required to show the 2048 byte record. You know the record has not shifted if the '.' is 1 column left of the 'S' on the line above.

  4. When you rewrite the file, check that the file-size is a multiple of the record-size (256). Or use control-G in the editor to check before writing.

  5. Updating the indexed file is only justified if you always run the 'dcheck' utility to validate & if you maintain the text file version.

  6. If you do much updating with vi, you could periodically run 'gdgunload51' to convert the Indexed file back to the text file backup.

  7. If need be you can recreate the text file by running jclgdgctl51 (see '5C1').

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5C9. MVS JCL conversion - GDG files

Alternate location for GDG control file

The location of the GDG control file is determined by the common_profile (stored at /home/appsadm/env/common_profile & called by .profile or .bash_profile). Here are lines 61-64 of $APPSADM/env/common_profile.

 export GDGCTL=$RUNDATA/ctl       #<-- default location
 # export GDGCTL=$APPSADM/ctl     #<-- could change to this ?
 #Mar14/12 - allow gdgctl51I.dat/.idx & GDGmkdirs to be located anywhere
 # - vs $RUNDATA/ctl, see doc at www.uvsoftware.ca/mvsjcl.htm#5C2

If you have multiple RUNDATA directories you might want to activate 'export GDGCTL=$APPSADM/ctl' & #comment out 'export GDGCTL=$RUNDATA/ctl' so you would have only 1 GDG control file vs multiple.

If you created the GDG control file as instructed on page '5C2', you could now copy the GDG control files to $APPSADM as follows (assuming you are in $RUNDATA).


 #1. cp ctl/gdgctl51* $APPSADM/ctl
     =============================
     - GDG control file created/edited on page '5C2'

 #2. cp ctl/GDGmkdirs $APPSADM/ctl
     =============================
     - script to make GDG subdirs in $RUNDATA/jobtmp/GDG
     - previously copied to $RUNDATA/ctl by copymvsctls on page '4D1'

'GDGmkdirs' is also copied to the alternate location, since it is called (in jobset51) using the same path ('$GDGCTL') as for the GDG control file. A sample GDGmkdirs was copied to $RUNDATA/ctl by script 'copymvsctls' on page '4D1'.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D1. MVS JCL conversion - GDG files

GDG logic illustrated

This illustration will show you how we prevent incrementing the generation# on abnormal terminations. We will use the 'jgl200.ksh' JCL/script from pages '1E1' - '1E4'. Here we will show only lines relevant to GDG logic.

jgl200.ksh to illustrate GDG logic

 ##JGL200   JOB  (1234),'TEST/DEMO MVS JCL CONVERSION'
        --- omitting lines not relevant to GDG logic ---
 jobset51    # call function for JCL/script initialization          <--Note1,2,3
        --- omit step 1 SORT creates data1/gl.account.trans_
 exportgen1 +1 GLTRANS data1/gl.account.trans_
 #exportgen1 GDGs written to jobtmp/$jobid2 restored to outdir at Normal EOJ
 exportgen0 0 GLMSOLD data1/gl.account.master_                           <--Note4
 exportgen1 +1 GLMSNEW data1/gl.account.master_                          <--Note5
 logmsg2 "Executing--> cobrun $ANIM $CBLX/cgl200"
 #3----------------------------------------------------------------------
 cobrun $ANIM $CBLX/cgl200
 #4----------------------------------------------------------------------
 LCC=$?; S0020C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0020R=1; alias goto="";
 if ((S0020C != 0))                                                      <--Note6
    then logmsg2 "ERR: step#$JSTEP cgl200 abterm $SCC"
    alias goto="<<S9900=\A"; fi
 goto
 #8======================================================================
 S9000=A                                                                 <--Note7
 jobend51 #move any new GDG files from jobtmp to intended outdirs
 logmsg2 "JobEnd=Normal, JCC=$JCC, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 exit 0 #ver:20151027 a2b0c0d1e2f0g1h1i15j0k15l1m4n3o8p0q0r0s2t1u1v0w0x0y1z1
 #9======================================================================
 S9900=A                                                                 <--Note8
 jobabend51 #report GDGs NOT moved from jobtmp/subdirs to outdirs
 logmsg2 "JobEnd=AbTerm, JCC=$JCC,Steps=$XSTEP/$JSTEP" RV ACK
 exit $JCC

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D2. MVS JCL conversion - GDG files

Notes re jgl200.ksh above

  1. 'jobset51' sets up jobtmp/JGL100/GDG/ to hold any new GDG files until normal EOJ. See jobset51 listed on page '5K1'.

  2. You must modify jobset51 to make $RUNDATA subdirs (ar,gl,mstr,tape). - OBSOLETE as of Oct 2014, all data files now in $RUNDATA/data1/...

  3. jobset51 performs 'cd $RUNDATA', so all files are defined in the script relative to $RUNDATA, which is /home/mvstest/testdata/... for the test/demos documented in MVSJCL.htm#Part_1.

  4. exportgen0 defines the current generation for input. Assuming there are 3 generations in the file 000001,000002,000003, the result would be:

    exportgen0 0 GLMSOLD data1/gl.account.master_000003                     <--Note4
    ===========================================================
  1. exportgen1 defines the next generation for output, effectively:

    exportgen1 +1 GLMSNEW data1/gl.account.master_000004                    <--Note5
    ===========================================================
    #exportgen1 GDGs written to jobtmp/$jobid2/GDG restored to outdir at Normal EOJ
Note
  • #comment following any exportgen1 reminds you that new GDG files are
  • 1st written to jobtmp/$JOBID/GDG/... & moved back to data1/... at EOJ
  • not moved if script abends, so you can rerun abends w/o removing files
  1. Return code from the COBOL program is tested & control goes to S9900 on failure(non-zero) & S9000 on success(zero).

  2. At S9000 (Normal EOJ), function 'jobend51' will move GDG files from jobtmp/GDG/ back to $RUNDATA/data1/.

  3. At S9900 (Abnormal EOJ), jobset51 is not called, so any new GDG files are not moved back to $RUNDATA/data1/. This means you can rerun the job without having to remove any new GDGs (so exportgen0 will get intended input).

  4. Note that for a multi-step JCL/script, you might use the restart facility to restart at the step that failed. On a restart jobset51 will prompt you & copy any new GDG files back to $RUNDATA/data1/.
Note
  • writing new GDGs to jobtmp controlled by option g0/g1 in ctl/jclunixop51
  • g1 (default) writes new GDGs to jobtmp/... for move back at Normal EOJ
  • g0 option writes new GDGs in original $RUNDATA/subdir
  • for g0, you could restart failed jobs at step after failure, else
    you must remove any new GDGs created up to failure before rerunning

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D3. MVS JCL conversion - GDG files

$RUNDATA subdirs BEFORE jgl200.ksh test GDG

 /home/mvstest/testdata:
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:03 data1
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:03 joblog
 drwxrwxr-x    3 mvstest  users        4096 Jun  1 15:03 jobtmp
 /home/mvstest/testdata/data1/gl*
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 gl.account.master_000001
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 gl.account.master_000002
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 gl.account.master_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 gl.account.trans_000001
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 gl.account.trans_000002
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 gl.account.trans_000003

/home/mvstest/testdata/jobtmp: total 0

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D4. MVS JCL conversion - GDG files

run jgl200.ksh & observe GDG results

This assumes you have setup the 'mvstest' user & copied the demo files from /home/uvadm/mvstest/* to /home/mvstest/... as instructed on pages '1P1'-'1P3'.


 #1. login mvstest --> /home/mvstest           (see dtree on page '1A1')

 #2. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata

 #3. rm data1/*[4-9]         <-- remove excess generations
     ===============             (from prior testing)

 #4. cp -r data1 data1save   <-- save data1/... files to retore after tests
     =====================

 #5. testdatainit            <-- remove old test output files
     ============                (jobtmp/*, joblog/*, etc)
                               - also prompts to reload the GDG control file

 #5a. uvcopy gdgload51,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I
     ========================================================
     - testdatainit prompts to reload GDG control file
NOTE
  • Be sure to run #6b to capture joblog (not #6a without logging)

 #6a. jgl200.ksh                  <-- execute JCL/script WITHOUT LOGGING
      ==========                    - BUT use alternative below to capture joblog

 #6a. joblog jgl200.ksh           <-- BETTER ALTERNATIVE to capture console log file
      =================             - see listing on the next page

 #7a. vi joblog/jgl200.log        <-- view console log
      ====================

 #7b. uvlp12 joblog/jgl200.log    <-- OR, print console log
      ========================

 #8a. ls -l data1                 <-- inspect contents of data1 subdir
      ===========                   - see before above & after below
                                      on successful & failed runs

 #8b. ls -l jobtmp/jgl200/GDG/    <-- inspect contents of jobtmp/...
      ========================      - on good runs, files already moved out
                                    - on failure, new GDG files still there

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D5. MVS JCL conversion - GDG files

jgl200 run#1 - Terminated Normally

 151028:075201:jgl200: Begin Job=jgl200
 151028:075201:jgl200: /home/mvstest/testlibs/jcls/jgl200.ksh
 151028:075201:jgl200: Arguments: jgl200.ksh
 151028:075201:jgl200: ProcessID=10354
 151028:075201:jgl200: RUNDATE=20151028
 151028:075201:jgl200: RUNLIBS=/home/mvstest/testlibs
 151028:075201:jgl200: RUNDATA=/home/mvstest/testdata
 151028:075201:jgl200: JTMP=jobtmp/jgl200
 151028:075201:jgl200: SYOT=sysout/JGL200
 151028:075201:jgl200: LOGNAME=mvstest TESTPROD=T000
 151028:075201:jgl200: HOSTNAME=uvsoft5.uvsoftware.ca
 151028:075201:jgl200: ******** Begin Step S0010 sort (#1) ********
 151028:075201:jgl200: file: SORTIN=data1/gl.account.tran1 fsize=4K
 151028:075201:jgl200: gen+1 SORTOUT=/home/mvstest/testdata/data1/gl.account.trans_ gens=7
 151028:075201:jgl200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 fsize=4K
 151028:075201:jgl200: Executing--> uvsort "fili1=data1/gl.account.tran1,typ=RSF,rcs=80,filo1=...
 151028:075201:JGL200: uvsort fili1=data1/gl.account.tran1,filo1=jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans
 151028:075201:JGL200: EOF fili01 20 rds, 1600 size; data1/gl.account.tran1
 151028:075201:JGL200: sort phase complete, used 512 megabytes, sort output begin
 151028:075201:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans_000004
 151028:075201:JGL200: StepTimes: S0010 sort Begun=07:52:01 End=07:52:01 Elapsed=00:00:00
 151028:075201:jgl200: ******** Begin Step S0020 cgl200 (#2) ********
 151028:075201:jgl200: gen+1 GLTRANS=/home/mvstest/testdata/data1/gl.account.trans_ gens=7
 151028:075201:jgl200: gen0 GLMSOLD=data1/gl.account.master_000003 insize=16K
 151028:075201:jgl200: gen+1 GLMSNEW=/home/mvstest/testdata/data1/gl.account.master_ gens=7
 151028:075201:jgl200: Executing--> cobrun -F /home/mvstest/testlibs/cblx/cgl200
 151028:075201:jgl200: moving /home/mvstest/testdata/jobtmp/jgl200/GDG/files back to intended directories
 /home/mvstest/testdata/data1/gl.account.master_000004
 /home/mvstest/testdata/data1/gl.account.trans_000004
 151028:075201:JGL200: StepTimes: S0020 cgl200 Begun=07:52:01 End=07:52:01 Elapsed=00:00:00
 151028:075201:JGL200: Job Times: Begun=07:52:01 NormalEnd=07:52:01 Elapsed=00:00:00
 151028:075201:jgl200: JobEnd=Normal, JCC=0, StepsExecuted=2, LastStep=S0020

$RUNDATA subdirs AFTER jgl200.ksh run OK

 /home/mvstest/testdata/data1
 -rw-rw-r--. 1 mvstest apps 13952 Apr 11  2015 data1/gl.account.master_000001
 -rw-rw-r--. 1 mvstest apps 13952 Apr 11  2015 data1/gl.account.master_000002
 -rw-rw-r--. 1 mvstest apps 13952 Apr 11  2015 data1/gl.account.master_000003
 -rw-rw-r--. 1 mvstest apps 13952 Oct 28 07:52 data1/gl.account.master_000004
 -rw-rw-r--. 1 mvstest apps  1600 Apr 11  2015 data1/gl.account.trans_000001
 -rw-rw-r--. 1 mvstest apps  1600 Apr 11  2015 data1/gl.account.trans_000002
 -rw-rw-r--. 1 mvstest apps  1600 Apr 11  2015 data1/gl.account.trans_000003
 -rw-rw-r--. 1 mvstest apps  1600 Oct 28 07:52 data1/gl.account.trans_000004
 /home/mvstest/testdata/jobtmp:
 drwxrwxr-x    6 mvstest  users        4096 Jun  1 15:03 jgl200
 /home/mvstest/testdata/jobtmp/jgl200:
 total 0
Note
  • new generation ..._000004 was initially created in jobtmp/jgl200/GDG/
  • but has been moved back to $RUNDATA/data1/ by jobend51 at Normal EOJ

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D6. MVS JCL conversion - GDG files

jgl200 run#2 - demo Abnormal Termination

We will now cause a run failure & rerun to illustrate that the new generations of GDG files are not stored in the $RUNDATA/data1/ if AbTerm occurs.


 #1. cdl --> /home/mvstest/testlibs  ('cdl' is an alias for 'cd $RUNLIBS')
     ===

 #2. vi jcls/jgl200.ksh     <-- update script to cause FAILURE
     ==================       - step 2 lines 68-75 shown AFTER UPDATE BELOW
      #3----------------------------------------------------------------------
      cobrun $ANIM $CBLX/cgl200
      #4----------------------------------------------------------------------
      # LCC=$?; S0020C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0020R=1; alias goto="";
      LCC=99; S0020C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0020R=1; alias goto="";
      if ((S0020C != 0))
         then logmsg2 "ERR: step#$JSTEP cgl200 abterm $SCC"
         alias goto="<<S9900=\A"; fi
      goto
NOTE
  • original LCC=$? (capture step status) saved as a #comment
  • then changed to LCC=99 to cause FAILURE

 #3. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #4. rm data1/gl*[4-9]         <-- restore GDG files to only 3 generations
     =================

 #5. joblog jgl200.ksh        <-- execute with joblogging
     =================            see listing on the next page -->

 #6. vi joblog/jgl200.log     <-- view console log
     ====================

 #7a. ls -l data1/gl*             <-- inspect data1/gl* files
      ===============               - see before above & after below
                                      on successful & failed runs

 #7b. ls -l jobtmp/jgl200/GDG/    <-- inspect contents of jobtmp/...
      ========================      - on good runs, files already moved out
                                    - on failure, new GDG files still there
                                      see listing on the next page -->

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D7. MVS JCL conversion - GDG files

jgl200 run#2 - Terminated Abnormally

 151028:075609:jgl200: Begin Job=jgl200
 151028:075609:jgl200: /home/mvstest/testlibs/jcls/jgl200.ksh
 151028:075609:jgl200: Arguments: jgl200.ksh
 151028:075609:jgl200: ProcessID=10594
 151028:075609:jgl200: RUNDATE=20151028
 151028:075609:jgl200: RUNLIBS=/home/mvstest/testlibs
 151028:075609:jgl200: RUNDATA=/home/mvstest/testdata
 151028:075609:jgl200: JTMP=jobtmp/jgl200
 151028:075609:jgl200: SYOT=sysout/JGL200
 151028:075609:jgl200: LOGNAME=mvstest TESTPROD=T000
 151028:075609:jgl200: HOSTNAME=uvsoft5.uvsoftware.ca
 151028:075609:jgl200: ******** Begin Step S0010 sort (#1) ********
 151028:075609:jgl200: file: SORTIN=data1/gl.account.tran1 fsize=4K
 151028:075609:jgl200: gen+1 SORTOUT=/home/mvstest/testdata/data1/gl.account.trans_ gens=7
 151028:075609:jgl200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 fsize=4K
 151028:075609:jgl200: Executing--> uvsort "fili1=data1/gl.account.tran1,typ=RSF,rcs=80,filo1=...
 151028:075609:JGL200: uvsort fili1=data1/gl.account.tran1\
                       ,filo1=jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans_000005
 151028:075609:JGL200: EOF fili01 20 rds, 1600 size; data1/gl.account.tran1
 151028:075609:JGL200: sort phase complete, used 512 megabytes, sort output begin
 151028:075609:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans_000005
 151028:075609:JGL200: StepTimes: S0010 sort Begun=07:56:09 End=07:56:09 Elapsed=00:00:00
 151028:075609:jgl200: ******** Begin Step S0020 cgl200 (#2) ********
 151028:075609:jgl200: gen+1 GLTRANS=/home/mvstest/testdata/data1/gl.account.trans_ gens=7
 151028:075609:jgl200: gen0 GLMSOLD=data1/gl.account.master_000004 insize=16K
 151028:075609:jgl200: gen+1 GLMSNEW=/home/mvstest/testdata/data1/gl.account.master_ gens=7
 151028:075609:jgl200: Executing--> cobrun -F /home/mvstest/testlibs/cblx/cgl200
 151028:075610:jgl200: ERR: step#S0020 cgl200 abterm 99
 151028:075610:jgl200: jobabend51 ERR: GDG files NOT moved from jobtmp/... to intended dirs
 151028:075610:jgl200: - can rerun OK, since GDGs not added to RUNDATA/dirs
 151028:075610:jgl200: - OR restart at abterm step & reply y to move prompt
 151028:075610:jgl200: jobabend51 ERR: /home/mvstest/testdata/jobtmp/jgl200/GDG/files NOT moved back & listed below:
 @home@mvstest@testdata@data1@gl.account.master_000005
 @home@mvstest@testdata@data1@gl.account.trans_000005
 151028:075610:jgl200: - reply y/n acknowledge GDG msg, but no auto action
 151028:075610:JGL200: StepTimes: S0020 cgl200 Begun=07:56:09 End=07:56:10 Elapsed=00:00:01
 151028:075610:JGL200: Job Times: Begun=07:56:09 ***AbEnd=07:56:10 Elapsed=00:00:01
 151028:075610:jgl200: JobEnd=AbTerm, JCC=99,Steps=2/S0020

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D8. MVS JCL conversion - GDG files

$RUNDATA subdirs AFTER jgl200.ksh run FAILURE

 testdata:
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:11 data1
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:11 joblog
 drwxrwxr-x    3 mvstest  users        4096 Jun  1 15:03 jobtmp
 testdata/data1:
 -rw-rw-r--. 1 mvstest apps 13952 Apr 11  2015 data1/gl.account.master_000001
 -rw-rw-r--. 1 mvstest apps 13952 Apr 11  2015 data1/gl.account.master_000002
 -rw-rw-r--. 1 mvstest apps 13952 Apr 11  2015 data1/gl.account.master_000003
 -rw-rw-r--. 1 mvstest apps 13952 Apr 11  2015 data1/gl.account.master_000004
 -rw-rw-r--. 1 mvstest apps  1600 Apr 11  2015 data1/gl.account.trans_000001
 -rw-rw-r--. 1 mvstest apps  1600 Apr 11  2015 data1/gl.account.trans_000002
 -rw-rw-r--. 1 mvstest apps  1600 Apr 11  2015 data1/gl.account.trans_000003
 -rw-rw-r--. 1 mvstest apps  1600 Apr 11  2015 data1/gl.account.trans_000004

jobtmp: total 0 drwxrwxr-x. 5 mvstest apps 37 Oct 28 07:56 jgl200

jobtmp/jgl200: total 8 drwxrwxr-x. 2 mvstest apps 4096 Oct 28 07:56 GDG drwxrwxr-x. 2 mvstest apps 4096 Oct 28 07:56 gtmp drwxrwxr-x. 2 mvstest apps 6 Oct 28 07:56 tmp

jobtmp/jgl200/GDG: total 20 -rw-rw-r--. 1 mvstest apps 13952 Oct 28 07:56 @home@mvstest@testdata@data1@gl.account.master_000005 -rw-rw-r--. 1 mvstest apps 1600 Oct 28 07:56 @home@mvstest@testdata@data1@gl.account.trans_000005

Notes re job FAILURE

  1. data1/gl... files are unchanged (no new generations seen), - because new generations are written to jobtmp/GDG/... (only restored to data1/... if Normal Termination reached (S9000)

  2. After a failure, you can see the new GDG files ..._000005 are in jobtmp/jgl200/GDG/... - full path names, '/'s replaced by '@'s to allow GDG files in subdirs other than data1/...
      @home@mvstest@testdata@data1@gl.account.master_000005
      @home@mvstest@testdata@data1@gl.account.trans_000005
  1. The new GDGs in jobtmp/GDG/... are not moved back to $RUNDATA/data1/... because job ends Abnormally at S9900 (not moved back to data1/... as at S9000)

  2. After we correct the problem, we can simply rerun the job, no need to worry about removing new GDGs for incomplete jobs.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D9. MVS JCL conversion - GDG files

jgl200 run#3 - 1st run AFTER Abnormal Termination


 #1. cdl --> /home/mvstest/testlibs

 #2. vi jcls/jgl200.ksh  <-- update script to remove cause of failure
     ==================    - opposite of causing failure on page '5D6'
                           - step 2 lines 68-75 shown after failure ccorerction
      #3----------------------------------------------------------------------
      cobrun $ANIM $CBLX/cgl200
      #4----------------------------------------------------------------------
      LCC=$?; S0020C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0020R=1; alias goto="";
      # LCC=99; S0020C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0020R=1; alias goto="";
      if ((S0020C != 0))
         then logmsg2 "ERR: step#$JSTEP cgl200 abterm $SCC"
         alias goto="<<S9900=\A"; fi
      goto
NOTE
  • we restored the original LCC=$? (capture step status) saved as a #comment
  • saving the failure caausing line as a comment # LCC=99 ...

 #3. cdd  --> /home/mvstest/testdata
     ===

 #4. joblog jgl200.ksh        <-- execute with joblogging
     =================            see listing on the next page -->

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D10. MVS JCL conversion - GDG files

jgl200 joblog run#3 - after Abnormal Termination

 151028:075800:jgl200: jobset51 WARN: files in jobtmp/GDG subdirs (prior AbTerm ERR?)
 151028:075800:jgl200: ---- files in jobtmp/jgl200/GDG/*/* listed below:
 jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.master_000005
 jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans_000005
 151028:075800:jgl200: If NO restart by step#, GDG files in jobtmp/... will be cleared
 151028:075800:jgl200:    - allows rerun from begin job with no worry about GDGs
 151028:075800:jgl200: If RESTARTing by step#, example--> jobname.ksh start=S0050
 151028:075800:jgl200:    - GDG files in jobtmp/... will NOT be cleared
 151028:075800:jgl200:    - will be available to steps after restart step#
 151028:075800:jgl200:    - will be restored to data1/... subdir at JobEnd=Normal
 151028:075800:jgl200: enter/continue - will clear jobtmp/... if no restart
 151028:075800:jgl200: enter/continue - will not clear jobtmp/... if start=...
 151028:075904:jgl200: Begin Job=jgl200
 151028:075904:jgl200: /home/mvstest/testlibs/jcls/jgl200.ksh
 151028:075904:jgl200: RUNDATE=20151028
 151028:075904:jgl200: RUNLIBS=/home/mvstest/testlibs
 151028:075904:jgl200: RUNDATA=/home/mvstest/testdata
 151028:075904:jgl200: JTMP=jobtmp/jgl200
 151028:075904:jgl200: LOGNAME=mvstest TESTPROD=T000
 151028:075904:jgl200: HOSTNAME=uvsoft5.uvsoftware.ca
 151028:075904:JGL200: StepTimes: S0000  Begun=07:56:10 End=07:59:04 Elapsed=00:02:54
 151028:075904:jgl200: ******** Begin Step S0010 sort (#1) ********
 151028:075904:jgl200: file: SORTIN=data1/gl.account.tran1 fsize=4K
 151028:075904:jgl200: gen+1 SORTOUT=/home/mvstest/testdata/data1/gl.account.trans_ gens=7
 151028:075904:jgl200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 fsize=4K
 151028:075904:jgl200: Executing--> uvsort "fili1=data1/gl.account.tran1,typ=RSF,rcs=80,filo1=...
 151028:075904:JGL200: uvsort fili1=data1/gl.account.tran1\
                       ,filo1=jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans_000005
 151028:075904:JGL200: EOF fili01 20 rds, 1600 size; data1/gl.account.tran1
 151028:075904:JGL200: sort phase complete, used 512 megabytes, sort output begin
 151028:075904:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans_000005
 151028:075904:JGL200: StepTimes: S0010 sort Begun=07:59:04 End=07:59:04 Elapsed=00:00:00
 151028:075904:jgl200: ******** Begin Step S0020 cgl200 (#2) ********
 151028:075904:jgl200: gen+1 GLTRANS=/home/mvstest/testdata/data1/gl.account.trans_ gens=7
 151028:075904:jgl200: gen0 GLMSOLD=data1/gl.account.master_000004 insize=16K
 151028:075904:jgl200: gen+1 GLMSNEW=/home/mvstest/testdata/data1/gl.account.master_ gens=7
 151028:075904:jgl200: Executing--> cobrun -F /home/mvstest/testlibs/cblx/cgl200
 151028:075904:jgl200: moving /home/mvstest/testdata/jobtmp/jgl200/GDG/files back to intended directories
 /home/mvstest/testdata/data1/gl.account.master_000005
 /home/mvstest/testdata/data1/gl.account.trans_000005
 151028:075904:JGL200: StepTimes: S0020 cgl200 Begun=07:59:04 End=07:59:04 Elapsed=00:00:00
 151028:075904:JGL200: Job Times: Begun=07:59:04 NormalEnd=07:59:04 Elapsed=00:00:00
 151028:075904:jgl200: JobEnd=Normal, JCC=0, StepsExecuted=2, LastStep=S0020

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D11. MVS JCL conversion - GDG files

Notes

  1. Note the 'files exist in jobtmp/GDG subdirs (from prior Abterm)' warning & the prompts to move back (for restart) or not (rerun from begining).

  2. If the job only creates new generations & does not update indexed files, it is probably easier to rerun the job from the begining, since we know that any new generations have not been moved back to RUNDATA/data1/.

  3. But if job has updated indexed files (in RUNDATA/data1/), then you should restart from the step# in error (after fixing the problem of course). In this case reply 'y' to move the GDGs (from prior steps) back to RUNDATA/data1/.

  4. You might also prefer to restart at the error step if the job was very long, had very big files, created time stamped outputs, etc.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D12. MVS JCL conversion - GDG files

gdgctl record - ABterm on run#2 & rerun #3 OK

After an abnormal termination, you can look (with uvhd) at the gdgctl records for any files you are concerned about. Here is control record for the gdg file created by jgl200.ksh after the 3 runs illustrated on the previous pages. (run#1 OK, run#2 ABterm, run#3 OK).


 cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
 ===

 uvhd ctl/gdgctl51I.dat r2048   <-- display control file with uvhd
 ============================
 rec#=3 rsize=2048 fptr=4096 fsize=18432 rcount=9
                      10        20        30        40        50        60
 r#        3 0123456789012345678901234567890123456789012345678901234567890123
        4096 gl.account.master_                                 gdg=07
             6626666767266776752222222222222222222222222222222226663332222222
             7CE133F5E4ED13452F000000000000000000000000000000000747D070000000
          64 next=000000(000000:000000)000000:000000 jgl200    151028:153645
             6677333333323333333333333233333333333332666333222233333333333332
             E584D0000008000000A0000009000000A0000000A7C2000000151028A1536450
         128 151028:153645:01+000004(000001:000003)jgl200   S0020 cgl200
             3333333333333333233333323333333333333266633322253333266633322222
             151028A153645A01B0000048000001A0000039A7C20000030020037C20000000
         192 151028:153645:00 000003(000001:000003)jgl200   S0020 cgl200
             3333333333333333233333323333333333333266633322253333266633322222
             151028A153645A0000000038000001A0000039A7C20000030020037C20000000
         256 151028:153609:01+000005(000001:000003)jgl200   S0020 cgl200
             3333333333333333233333323333333333333266633322253333266633322222
             151028A153609A01B0000048000001A0000039A7C20000030020037C20000000
         320 151028:153609:00 000004(000001:000003)jgl200   S0020 cgl200
             3333333333333333233333323333333333333266633322253333266633322222
             151028A153609A0000000038000001A0000039A7C20000030020037C20000000
         384 151028:153401:01+000005(000001:000003)jgl200   S0020 cgl200
             3333333333333333233333323333333333333266633322253333266633322222
             151028A153401A01B0000048000001A0000039A7C20000030020037C20000000
         448 151028:153401:00 000004(000001:000003)jgl200   S0020 cgl200
             3333333333333333233333323333333333333266633322253333266633322222
             151028A153401A0000000038000001A0000039A7C20000030020037C20000000
         512                ---- segments omitted ----
        1984                                                               >.
             2222222222222222222222222222222222222222222222222222222222222230
             00000000000000000000000000000000000000000000000000000000000000EA

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5D13. MVS JCL conversion - GDG files

notes re gdgctl51I after failure demo

  1. Note latest history entries at the top, starting at displacement 128, You can confirm this by dates:times (latest at the top)

128 - run#1 output file '+000004' '+' flag for new generation 192 - run#1 input file ' 000003' ' ' blank flag existing generation

256 - run#2 output file '+000005' '+' flag for new generation 320 - run#2 input file ' 000004' ' ' blank flag existing generation

    384 - run#3 output file '+000005' '+' flag for new generation
    448 - run#3 input  file ' 000004' ' ' blank flag existing generation
        - rerun after  failure, gen#s in jobtmp/GDG 000006 & 000005 ignored
  1. You can see that run#3 (OK) created gen# 000005, which had been created by run#2 (ABterm), but was not moved back to RUNDATA/data1/...

  2. You will not have to worry about this, if you can simply rerun the job from the begining. No new GDGs were created since we did not reach the S9000 jobend51 function that moves files back.

  3. Alternatively, you use the 'restart' option to restart at the failing step, since you are given the option to move the files back to RUNDATA/data1/ at the begining of a restarted job. You will be prompted by the 'jobset51' function called at the begining of all JCL/scripts converted by the Vancouver Utilities JCL converter.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E1. MVS JCL conversion - GDG files

prior GDG & Range processing

Here we will show you how you might use one of the extra features of the Vancouver Utility GDG system to process a series of GDG files already stored in the directory before processing begins.

We can update the gdgctl file to specify the from:to series of generations to be processed 1 a t a time when processing begins. This feature saves having to modify any JCL or copy any files between the multiple runs.

For example, suppose we have already stored 12 months of gl transactions & we now wish to process all 12 successively without having to modify any JCL or copy files.

The job that stores the 12 files would use exportgen1 & assuming that there were no existing files in the data1/ subdir, the result would be as follows:

sample data1/gl.account.trans files

 /home/mvstest/testdata
 :-----data1
 :     :-----gl.account.trans_000001
 :     :-----gl.account.trans_000002
 :     :-----gl.account.trans_000003
 :     :-----gl.account.trans_000004
 :     :-----gl.account.trans_000005
 :     :       - - - etc - - -
 :     :-----gl.account.trans_000012

updating gdgctl to process a series of GDG files

Here is the ctl/gdgctl51 file entry before & after updating to process a series of GDG files:


 data1/gl.account.trans opt=c gdg=18           <-- before updating
 ===================================

 data1/gl.account.trans opt=c gdg=18 next=000001(000001:000012)  <-- after edit/update
 ==============================================================    - before any runs

 data1/gl.account.trans opt=c gdg=18 next=000002(000001:000012)  <-- after 1st run
 ==============================================================

 data1/gl.account.trans opt=c gdg=18 next=000012(000001:000012)  <-- after 11th run
 ==============================================================

 data1/gl.account.trans opt=c gdg=18 next=000000(000001:000012)  <-- after 12th run
 ==============================================================
  1. After the 12th run, the next gen# is set to '000000' which disables the feature, but retains a history/comment, which can easily be activated for the next requirement.

  2. Any runs after next is reset to 000000 will pick up the highest gen# in the directory as normal, which may still be the 12th month.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E2. MVS JCL conversion - GDG files

Demo prior GDG & Range processing

The next few pages will illustrate how you can setup the control file to process prior generations. You can load the alternate control file, already setup to process a prior generation of the account.master file & multiple generations of the account.trans file with automatic incrementing thru a range generations.

data1/gl* files for GDG range demo

 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000001
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000002
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000001
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000002
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000004
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000005
               - - - only 5 trans generations supplied - - -
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000012
Note
  • we supply 5 generations of the trans_ file & will run jgl220 4 times.
  • 1st 3 will use generations 000001,2,3 due to next=... override
  • 4th run reverts to latest existing (000005) since limit reached (000003)

JGL220 JCL to demo prior GDG processing

 //JGL220   JOB  (1234),'TEST/DEMO MVS JCL CONVERSION'
 //* UPDATE GL ACCOUNT MASTER WITH GLTRANS
 //* demo exportgen0 input prior master generation (ignore newer gens)
 //* demo exportgen0 input a progression of prior trans files
 //STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
 //GLMSOLD  DD DSN=GL.ACCOUNT.MASTER(0),DISP=OLD
 //GLTRANS  DD DSN=GL.ACCOUNT.TRANS(0),DISP=OLD
 //GLMSNEW  DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE),
 //            UNIT=DISK,SPACE=(TRK,(50,50),RLSE),
 //            DCB=(MODEL.DSCB,LRECL=80,BLKSIZE=6118,RECFM=FBA)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E3. MVS JCL conversion - GDG files

JGL220.jcl converted to jgl220.ksh

 k#001 #!/bin/ksh
 k#002 ##JGL220   JOB  (1234),'TEST/DEMO MVS JCL CONVERSION'
 k#003 export jobid2=jgl220 JOBID2=JGL220; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$jobid1" ]]; then export jobid1=$jobid2; fi
 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#006 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
 k#008 autoload exportfile exportgen0 exportgen1 exportgen2 exportgenall exportgenx
 k#009 . $APPSADM/env/stub.ini  #<-- for control-M (see notes in env/stub.ini)
 k#010 jobset51    # call function for JCL/script initialization
 k#011 goto
 k#012 S0000=A
 k#013 # * UPDATE GL ACCOUNT MASTER WITH GLTRANS
 k#014 # * demo exportgen0 input prior master generation (ignore newer gens)
 k#015 # * demo exportgen0 input a progression of prior gltrans files
 k#016 #1======================= begin step#S0010 CGL200 ========================
 k#017 S0010=A
 k#018 stepctl51;
 k#019 goto
 k#020 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#021 logmsg2 "******** Begin Step $JSTEP cgl200 (#$XSTEP) ********"
 k#022 ##STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
 k#023 export PROGID=cgl200
 k#024 export PARM="$YEAREND"
 k#025 exportgen0 0 GLMSOLD data1/gl.account.master_
 k#026 exportgen0 0 GLTRANS data1/gl.account.trans_
 k#027 exportgen1 +1 GLMSNEW data1/gl.account.master_
 k#028 #exportgen1 GDGs written to jobtmp/$jobid2 restored to outdir at Normal EOJ
 k#029 logmsg2 "Executing--> cobrun $ANIM $CBLX/cgl200"
 k#030 #3----------------------------------------------------------------------
 k#031 cobrun $ANIM $CBLX/cgl200
 k#032 #4----------------------------------------------------------------------
 k#033 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0010R=1; alias goto="";
 k#034 if ((S0010C != 0))
 k#035    then logmsg2 "ERR: step#$JSTEP cgl200 abterm $SCC"
 k#036    alias goto="<<S9900=\A"; fi
 k#037 goto
 k#038 #8======================================================================
 k#039 S9000=A
 k#040 jobend51 #move any new GDG files from jobtmp to intended outdirs
 k#041 logmsg2 "JobEnd=Normal, JCC=$JCC, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 k#042 exit 0 #ver:20151027 a2b0c0d1e2f0g1h1i15j0k15l1m4n3o8p0q0r0s2t1u1v0w0x0y1z1
 k#043 #9======================================================================
 k#044 S9900=A
 k#045 jobabend51 #report GDGs NOT moved from jobtmp/subdirs to outdirs
 k#046 logmsg2 "JobEnd=AbTerm, JCC=$JCC,Steps=$XSTEP/$JSTEP" RV ACK
 k#047 exit $JCC

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E4. MVS JCL conversion - GDG files

setup to demo prior GDG & Range processing

We need to load the alternate control file, provided to process a prior generation of the account.master file & multiple generations of the account.trans file with automatic incrementing thru a range generations.


 #1. login mvstest --> /home/mvstest  (see subdirs on page '1A1')

 #2. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #3. vi ctl/gdgctl51test2   <-- inspect gdgctl to demo prior GDG & Range
     ====================
      # gdgctl51test2 - GDG control file
      #               - by Owen Townsend, UV Software, 2007
      # - distributed in /home/uvadm/mvstest/testlibs/ctl/gdgctl51test2
      # - see www.uvsoftware.ca/mvsjcl.htm#Part_5
      # - loaded by 'gdgload51' to test GDG files
      # - using jgl220.ksh, see MVSJCL.doc pages 5E1-5E11
      data1/gl.account.acntlist_   gdg=06
      data1/gl.account.master_     gdg=12 next=000002(000002:000002)991231:235959
      data1/gl.account.trans_      gdg=18 opt=c next=000001(000001:000003)000000:000000
      data1/py.payroll.master_     gdg=20
      data1/py.time.cards_         gdg=30
Note
  • we supply 5 generations of the trans_ file & will run jgl220 4 times.
  • 1st 3 will use generations 000001,2,3 due to next=... override
  • 4th run reverts to latest existing (000005) since limit reached (000003)

 #4. uvcopy gdgload51,fili1=ctl/gdgctl51test2
     ========================================
     - load alternate gdgctl51test2 to demo prior select/increment GDG

 #5. testdatainit              <-- remove any old test output files
     ============                  (jobtmp/*, joblog/*, etc)

 #6a. rm -f data1/*            <-- remove test files & any excess generations
      =============                (from prior runs)

 #6b. cp data1save/* data1        <-- refresh testdatafiles
      ====================          - only 3 generations per file

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E5. MVS JCL conversion - GDG files

prior GDG select/increment - Run#1


 #1. jgl220.ksh                <-- execute JCL/script to demo GDG files
     ==========                  - BETTER to use joblog as below

 #1a. joblog jgl220.ksh        <-- alternative to capture console log file
      =================

 #2.  vi joblog/jgl220.log     <-- view console log
      ====================

 #2b. uvlp12 joblog/jgl220.log <-- OR, print console log
      ========================     see listing on the next page -->

 #3.  ls -l data1/gl*          <-- display  data1/gl* files after 1st run
      ===============

 #3a. lslp data1               <-- OR, print data1/gl* files after 1st run
      ==========                      see listing on the next page -->

 #4. Please inspect the console logs & directory listings on the next page
     & observe the following:

observations after 1st run

  1. The master file selected was data1/gl.account.master_000002, because the gdgctl file had next=000002... overriding the usual selection of the last generation in the directory which was _000005

  2. The trans file selected was data1/gl.account.trans_000001, because the gdgctl file had next=000001(000001:000003)... & this was the 1st run.

  3. After the 1st run, the trans entry in ctl/gdgctl51I.dat would be: next=000002(000001:000003)...

  4. Note that 'opt=c' coded on the control file entry for data1/gl.account.trans_ causes the following operator prompt to confirm 'y' or enter an alternative 6 digit generation#.
     gen0: GLTRANS=data1/gl.account.trans_000001     <-- confirm y or alt# ?
     gen0: GLTRANS: generations=000001:000003  <-- enter y(000001) or alt# ?
     070616:155225:JGL220: gen0: GLTRANS=data1/gl.account.trans_000001 insize=1600

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E6. MVS JCL conversion - GDG files

jgl220.log after 1st run

 080827:093441:JGL220: Begin Job=JGL220
 080827:093441:JGL220: /home/mvstest/testlibs/jcls/jgl220.ksh
 080827:093441:JGL220: Arguments:
 080827:093441:JGL220: RUNLIBS=/home/mvstest/testlibs
 080827:093441:JGL220: RUNDATA=/home/mvstest/testdata
 080827:093441:JGL220: JTMP=jobtmp/JGL220 SYOT=sysout/JGL220
 080827:093441:JGL220: RUNDATE=20080827
 080827:093441:JGL220: Begin Step S0010 cgl200 (#1)
 080827:093441:JGL220: gen0: GLMSOLD=data1/gl.account.master_000002 insize=8720
 gen0: GLTRANS=data1/gl.account.trans_000001  <-- confirm y or alt# ?
 gen0: GLTRANS: generations=000001:000005  <-- enter y(000001) or alt# ?
 080827:093557:JGL220: gen0: GLTRANS=data1/gl.account.trans_000001 insize=1600
 080827:093558:JGL220: gen+1: GLMSNEW=jobtmp/JGL220/GDG/data1/gl.account.master_000004 gens=12
 080827:093558:JGL220: Job Times: Begun=09:34:41 End=09:35:58 Elapsed=00:01:17
 080827:093558:JGL220: moving jobtmp/JGL220/GDG/files back to $RUNDATA/subdirs/
 `jobtmp/JGL220/GDG/data1/gl.account.master_000004' -> `data1/gl.account.master_000004'
 080827:093558:JGL220: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

data1/gl* files after 1st run

 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000001
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000002
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000003
 -rw-rw-r--    1 mvstest  users        8720 Jun  2 07:31 account.master_000004
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000001
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000002
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000004
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000005

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E7. MVS JCL conversion - GDG files

prior GDG select/increment - Run#2


 #1. jgl220.ksh                <-- execute JCL/script to demo GDG files
     ==========                  - BETTER to use joblog as below

 #1a. joblog jgl220.ksh        <-- alternative to capture console log file
      =================

 #2a. vi joblog/jgl220.log     <-- view console log
      ====================

 #2b. uvlp12 joblog/jgl220.log <-- OR, print console log
      ========================     see listing on the next page -->

 #3.  ls -l data1/gl*          <-- display data1/gl* files after 2nd run
      ===============

 #3a. lslp data1               <-- OR, print data1/gl* files after 2nd run
      ==========                      see listing on the next page -->

 #4. Please inspect the console logs & directory listings on the next page
     & observe the following:

observations after 2nd run

  1. The master file selected was data1/gl.account.master_000002, because the gdgctl file had next=000002... overriding the last generation of _000005. The next=000002 was not reset because the expiration date was 991231.

  2. The trans file selected was data1/gl.account.trans_000002, because the gdgctl file had next=000002(000001:000003)... (next= incremented at end 1st run).

  3. After the 2nd run, the trans entry in ctl/gdgctl51I.dat should be: next=000003(000001:000003)...

  4. We supply 5 generations of the trans_ file & demo 1st 4 runs. Runs 1,2,3 will use generations 000001,2,3 (overriding last existing 000005) Run#4 will revert to 000005, since upper limit of (000001:000003) exceeded.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E8. MVS JCL conversion - GDG files

jgl220.log after 2nd run

 080827:094734:JGL220: Begin Job=JGL220
 080827:094734:JGL220: /home/mvstest/testlibs/jcls/jgl220.ksh
 080827:094734:JGL220: Arguments:
 080827:094734:JGL220: RUNLIBS=/home/mvstest/testlibs
 080827:094734:JGL220: RUNDATA=/home/mvstest/testdata
 080827:094734:JGL220: JTMP=jobtmp/JGL220 SYOT=sysout/JGL220
 080827:094734:JGL220: RUNDATE=20080827
 080827:094734:JGL220: Begin Step S0010 cgl200 (#1)
 080827:094734:JGL220: gen0: GLMSOLD=data1/gl.account.master_000002 insize=8720
 gen0: GLTRANS=data1/gl.account.trans_000002  <-- confirm y or alt# ?
 gen0: GLTRANS: generations=000001:000005  <-- enter y(000002) or alt# ?
 080827:094741:JGL220: gen0: GLTRANS=data1/gl.account.trans_000002 insize=1600
 080827:094741:JGL220: gen+1: GLMSNEW=jobtmp/JGL220/GDG/data1/gl.account.master_000005 gens=12
 080827:094741:JGL220: Job Times: Begun=09:47:34 End=09:47:41 Elapsed=00:00:07
 080827:094741:JGL220: moving jobtmp/JGL220/GDG/files back to $RUNDATA/subdirs/
 `jobtmp/JGL220/GDG/data1/gl.account.master_000005' -> `data1/gl.account.master_000005'
 080827:094741:JGL220: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

data1/gl* files after 2nd run

 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000001
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000002
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000003
 -rw-rw-r--    1 mvstest  users        8720 Jun  2 07:31 account.master_000004
 -rw-rw-r--    1 mvstest  users        8720 Jun  2 07:32 account.master_000005
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000001
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000002
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000004
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000005

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E9. MVS JCL conversion - GDG files

prior GDG select/increment - Run#3


 #1. jgl220.ksh            <-- execute JCL/script to demo GDG files
     ==========

 #1a. joblog jgl220.ksh    <-- alternative to capture console log file
      =================

jgl220.log after 3rd run

 080827:094816:JGL220: Begin Job=JGL220
 080827:094816:JGL220: /home/mvstest/testlibs/jcls/jgl220.ksh
 080827:094816:JGL220: Arguments:
 080827:094816:JGL220: RUNLIBS=/home/mvstest/testlibs
 080827:094816:JGL220: RUNDATA=/home/mvstest/testdata
 080827:094816:JGL220: JTMP=jobtmp/JGL220 SYOT=sysout/JGL220
 080827:094816:JGL220: RUNDATE=20080827
 080827:094816:JGL220: Begin Step S0010 cgl200 (#1)
 080827:094816:JGL220: gen0: GLMSOLD=data1/gl.account.master_000002 insize=8720
 gen0: GLTRANS=data1/gl.account.trans_000003  <-- confirm y or alt# ?
 gen0: GLTRANS: generations=000001:000005  <-- enter y(000003) or alt# ?
 080827:094819:JGL220: gen0: GLTRANS=data1/gl.account.trans_000003 insize=1600
 080827:094819:JGL220: gen+1: GLMSNEW=jobtmp/JGL220/GDG/data1/gl.account.master_000006 gens=12
 080827:094819:JGL220: Job Times: Begun=09:48:16 End=09:48:19 Elapsed=00:00:03
 080827:094819:JGL220: moving jobtmp/JGL220/GDG/files back to $RUNDATA/subdirs/
 `jobtmp/JGL220/GDG/data1/gl.account.master_000006' -> `data1/gl.account.master_000006'
 080827:094819:JGL220: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E10. MVS JCL conversion - GDG files

prior GDG select/increment - Run#4


 #1. jgl220.ksh            <-- execute JCL/script to demo GDG files
     ==========

 #1a. joblog jgl220.ksh    <-- alternative to capture console log file
      =================

jgl220.log after 4th run

 080827:094823:JGL220: Begin Job=JGL220
 080827:094823:JGL220: /home/mvstest/testlibs/jcls/jgl220.ksh
 080827:094823:JGL220: Arguments:
 080827:094823:JGL220: RUNLIBS=/home/mvstest/testlibs
 080827:094823:JGL220: RUNDATA=/home/mvstest/testdata
 080827:094823:JGL220: JTMP=jobtmp/JGL220 SYOT=sysout/JGL220
 080827:094823:JGL220: RUNDATE=20080827
 080827:094823:JGL220: Begin Step S0010 cgl200 (#1)
 080827:094823:JGL220: gen0: GLMSOLD=data1/gl.account.master_000002 insize=8720
 gen0: GLTRANS=data1/gl.account.trans_000005  <-- confirm y or alt# ?
 gen0: GLTRANS: generations=000001:000005  <-- enter y(000005) or alt# ?
 080827:094825:JGL220: gen0: GLTRANS=data1/gl.account.trans_000005 insize=1600
 080827:094825:JGL220: gen+1: GLMSNEW=jobtmp/JGL220/GDG/data1/gl.account.master_000007 gens=12
 080827:094825:JGL220: Job Times: Begun=09:48:23 End=09:48:25 Elapsed=00:00:02
 080827:094825:JGL220: moving jobtmp/JGL220/GDG/files back to $RUNDATA/subdirs/
 `jobtmp/JGL220/GDG/data1/gl.account.master_000007' -> `data1/gl.account.master_000007'
 080827:094825:JGL220: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E11. MVS JCL conversion - GDG files

gdgctl file after 4 runs of jgl220.ksh


 uvhd ctl/gdgctl51I.dat r2048   <-- display control file with uvhd
 ============================
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
        2048 gl.account.master_                                 gdg=12
          64 next=000002(000002:000002)991231:235959 JGL220
         128 080827:094825:G1_000007(000001:000006)JGL220   S0010 cgl200
         192 080827:094823:G0_000002(000001:000006)JGL220   S0010 cgl200
         256 080827:094819:G1_000006(000001:000005)JGL220   S0010 cgl200
         320 080827:094816:G0_000002(000001:000005)JGL220   S0010 cgl200
         384 080827:094741:G1_000005(000001:000004)JGL220   S0010 cgl200
         448 080827:094734:G0_000002(000001:000004)JGL220   S0010 cgl200
         512 080827:093558:G1_000004(000001:000003)JGL220   S0010 cgl200
         576 080827:093441:G0_000002(000001:000003)JGL220   S0010 cgl200
         640 000000:000000:G0_000000(000000:000000)_______  _____ _________
         704 000000:000000:G0_000000(000000:000000)_______  _____ _________
               - - - 18 lines omitted to save space - - -
        1920 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1984 000000:000000:G0_000000(000000:000000)_______  _____ _________ .
                      10        20        30        40        50        60
 r#        3 0123456789012345678901234567890123456789012345678901234567890123
        4096 gl.account.trans_                                  gdg=18 opt=c
          64 next=000000(000001:000003)000000:000000 JGL220
         128 080827:094823:G0_000005(000001:000005)JGL220   S0010 cgl200
         192 080827:094816:G0_000003(000001:000005)JGL220   S0010 cgl200
         256 080827:094734:G0_000002(000001:000005)JGL220   S0010 cgl200
         320 080827:093441:G0_000001(000001:000005)JGL220   S0010 cgl200
         384 000000:000000:G0_000000(000000:000000)_______  _____ _________
         448 000000:000000:G0_000000(000000:000000)_______  _____ _________
         512 000000:000000:G0_000000(000000:000000)_______  _____ _________
         576 000000:000000:G0_000000(000000:000000)_______  _____ _________
         640 000000:000000:G0_000000(000000:000000)_______  _____ _________
         704 000000:000000:G0_000000(000000:000000)_______  _____ _________
               - - - 18 lines omitted to save space - - -
        1920 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1984 000000:000000:G0_000000(000000:000000)_______  _____ _________ .

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5E12. MVS JCL conversion - GDG files

Notes re data1/gl.account.master_

  1. Note the history of the 4 runs of jgl220.ksh. The latest is inserted at the top, pushing the previous history entries down.

  2. data1/gl.account.master_ has been processed by exportgen0 & exportgen1 on each of 4 runs.

  3. exportgen0 always selected gen# 000002 because of the 'next=000002...' override.

  4. exportgen1 created new generations from 000004 (at the bottom) to 000007 (at the top).

    Notes re data1/gl.account.trans_

  5. data1/gl.account.trans_ has been processed only by exportgen0 on each of 4 runs.

  6. The 1st 3 runs selected generations 000001, 000002, 000003 due to the 'next=......(000001:000003)...' override.

  7. Run#4 reverted to 000005, since upper limit of (000001:000003) exceeded.

  8. Note that the next control card was reset to 'next=000000(000001:000003)' 'next=000000' means future runs will select highest generation found. '(000001:000003)' is retained but inactive incase you want to reactivate by resetting 'next=000000' to 'next=000001' or higher.

    GDG control file history updates optional

As of June 2012, GDG control file history updates is optional depending on environmental variable GDGCTLUPDT, default GDGCTLUPDT=YES (in common_profile). Inhibiting history updates might speed up on very busy system and reduce possibility of file locks & corruption.

Of course GDGCTLUPDT=YES is required to use the advanced features documented on the pages above, and could be useful in debugging problems with GDG files.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5F0. MVS JCL conversion - Generation files

GDG system - Caveats

Here are some situations that may occur at some sites, and that require manual editing to enable the Vancouver Utility GDG system to function as intended.


5F1. $SYMBOLS in data file names in the JCL/scripts
- you must replace with actual values in ctl/gdgctl51
- easy to do using vi mass change commands (see examples given)

5F2. You must modify jclunixop51 to code your datafile topnodes/subdirs
 (vs supplied coding for the mvstest demo subdirs)
- may generate automatically from topnode list & templates (see '6A1')
      You must also code your valid topnodes in the '$RUNLIBS/ctl/GDGmkdirs'
      script used to hold new GDGs until Normal EOJ (moved to $RUNDATA/subdir).

5F3. You must modify any JCL/scripts that have DDNAME assignments
- if the logical filename on the exportgen0/1 function is assigned
  to an alternate logical filename via an exportfile (vs exportgen)
- an unusual situation that occurred at a VSE site

5F4. Should be no changes required to jobs that write new GDGs & readback.
But changes were required for a site using the option to convert all
tape files to GDG files because it depended on an I/O indicator to
generate exportgen0/exportgen1 (vs original mainframe coding 0/+1)

5F5. problems converting tape files to GDG files at a VSE site.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5F1. special procedures for VU GDG system required at some sites

replace $SYMBOLS in gdgctl file

Any $SYMBOLS in the GDG control file ($RUNLIBS/ctl/gdgctl51) need to be replaced by the actual values.

$SYMBOLS in the filenames given to exportgen0/exportgen1 are replaced by the Korn shell, but any $SYMBOLS in filenames extracted by jclgdgctl51 & loaded into the gdgctl file would remain as is.

We need to replace them with actual values so exportgen0/exportgen1 can match to the control file.

sample filenames extracted from JCL/scripts

 $MSTR/e2121653.mtaxe.piscines_           gdg=15
 $MSTR/e2121656.itaxe.facturat_           gdg=15
 $TAPE/ev.f01.28401a19.annexe_            gdg=15
 $TAPE/ev.f01.e211211.diftax_             gdg=15
 $TAPE2/tu.f01.e211801.adrpos_            gdg=15
 $TAPE2/tu.f01.e212-no.eauctr_            gdg=15

after replacing $SYMBOLS with values

 data1/e2121653.mtaxe.piscines_           gdg=15
 data1/e2121656.itaxe.facturat_           gdg=15
 tape/ev.f01.28401a19.annexe_            gdg=15
 tape/ev.f01.e211211.diftax_             gdg=15
 tape2/tu.f01.e211801.adrpos_            gdg=15
 tape2/tu.f01.e212-no.eauctr_            gdg=15

Note that the replacements are very easy to do using vi mass change commands. This editing would be in addition to the procedures shown earlier on page '5C1', so we will extend those operating instruction numbers.


 #5. vi ctl/gdgctl51    <-- edit the GDG control file
     ===============
 #5a. --> :%s/$MSTR/data1/
 #5b. --> :%s/$TAPE2/tape2/    <-- vital to replace $TAPE2 before $TAPE
 #5b. --> :%s/$TAPE/tape/

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5F2. special procedures for VU GDG system required at some sites

customizing for your TOP-NODEs

  1. Before you convert your JCL to Korn shell scripts, you must code your most valid top-nodes in the :TOPNODES: (allowed) table & all other (low volume) will be combined into a 'misc' directory.

  2. You must also code your valid topnodes in the '$RUNLIBS/ctl/GDGmkdirs' script.

See the operating procedures for these on pages '4E1' thru '4E5'. These points mentioned here since this is the 'caveats' (watch out for) section of Part 5.

GDGmkdirs - make subdirs for GDG files

NOTE
  • GDGmkdirs OBSOLETE as of OCT 2014
 # GDGmkdirs - make subdirs for new versions of GDG files
 #             saved in jobtmp/subdirs/... until Normal EOJ
 #           - by Owen Townsend, UV Software, Aug 25/2008
 #
 #Apr16/2009 - this script moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/
 #           - to allow multiple $RUNDATA's to have different GDG controls
 #
 # script in $RUNDATA/ctl/... called by jobset51 (called by all JCL/scripts)
 # exportgen1 creates new GDG files in $RUNDATA/$JGDG/subdirs/...
 # - where: JGDG=$RUNDATA/jobtmp/$JOBID2/GDG/
 # - at normal EOJ, GDG files are moved to intended subdirs (NOT if Abterm)
 #
 # user must code names of his site's data file subdirs here
 # - matching the TOPNODEs table in $RUNLIBS/ctl/jclunixop51
 # - following subdirs are for the demo JCL/scripts
 #   (at www.uvsoftware.ca/mvsjcl.htm#Part_1)
 #
 #Mar14/09 - JCL converter option g1 inserts $JGDG/... on new GDGs exportgen1
 # - new option 'g0' omits $GDG/ so new GDGs in same subdir as old
 # - this GDGmkdirs script must still exist (since called by jobset51)
 #   BUT, subdirs created will not be used, since no files redirected to $JGDG/
 #
 if [[ ! -d $JTMP ]]; then
    echo "JTMP not defined or not in \$RUNDATA"; exit 81; fi
 #
 # make $JGDG/ for gdg subdirs
 # also make $GTMP/ for exportgen0/1 'ls' outputs to determine latest gen#s
 if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi
 if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi
 #
 # You MUST modify following (ar,gl,etc) to the subdirs desired at your site
 #==========================================================================
 if [[ ! -d $JGDG/ar ]]; then mkdir $JGDG/ar; fi
 if [[ ! -d $JGDG/gl ]]; then mkdir $JGDG/gl; fi
 if [[ ! -d $JGDG/py ]]; then mkdir $JGDG/py; fi
 if [[ ! -d $JGDG/tape ]]; then mkdir $JGDG/tape; fi
 if [[ ! -d $JGDG/misc ]]; then mkdir $JGDG/misc; fi
 exit 0

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5F3. special procedures for VU GDG system required at some sites

correction for files reassigned

Here is a situation I noticed in a VSE conversion that currently requires manual correction.

VSE sites often defined most files up front & sometimes used SORT OPTION FILNM &/or TDYNASN to reassign the logical name to an alternate used for the SORT or a COBOL program.

This is a problem because the JCL converter assumes that the file is a non-GDG & uses 'exportfile' for the reassignment. This would cause 'file not found' because exportfile would assign the file as is (with trailing underscore). We need 'exportgen0/1' to select the latest or next GDG file with 6 digit sequence#.

To illustrate the problem I have extracted a few lines from a typical VSE JCL.

 #!/bin/ksh
 ##JOB 33001D10
          ---------- lines omitted -----------
   .... VSE sites often defined most files up front ....
 exportfile E212001 data1/e2123001.itaxe.banqtaxe
 exportfile E212002 data1/e2123002.itaxe.taxation
 exportgen0 0 E212990 tape/tu.f01.e212-no.soldes_
 exportgen1 +1 E212991 $JTMP/tape/tu.f01.e212-no.soldav_
       ---------- lines omitted -----------
            ....... SORT step .......
 #  cat > $SYS011 <</*EOD
 #  SORT FIELDS=(18,6,A),FORMAT=BI,WORK=4
 #  OPTION FILNM=(E212084,E212990),SORTOUT=020,SORTIN=(014)
 # /*EOD
 exportfile SORTOUT $E212084
 exportfile SORTIN1 $E212990
 ## EXEC SORT
 #3----------------------------------------------------------------------
 uxsort "fili1=$SORTIN1,typ=RSF,rcs=354,filo1=$SORTOUT,keys=(17,6,b,a)"
 #4----------------------------------------------------------------------
Note
  • JCL converter assumes that SORTIN1 is a non-GDG file (uses exportfile)
  • you must change '$SORTIN1' to '$E212990' as shown on the uxsort below:
  • since $E212990 is the 'exportgen0' definition
  • whereas the $SORTIN1 'exportfile' definition would be undefined

 #3----------------------------------------------------------------------
 uxsort "fili1=$E212990,typ=RSF,rcs=354,filo1=$SORTOUT,keys=(17,6,b,a)"
 #4----------------------------------------------------------------------

TDYNASN is a similar situation

 ## EXEC TDYNASN
      ... TDYNASN step reassigned logical filename
 # ASSGN E212990,SYS014,INPUT
 exportfile SYS014 $E212990

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5F4. special procedures for VU GDG system required at some sites

Write new generation & Readback in same job

There should be no manual changes required to jobs that write new generations of GDG files & read back on a later step within the same job, because the new GDG is written into $JTMP (jobtmp/subdir). 'exportgen1' determines the next generation by examining the files in the original $RUNDATA/subdir & does not get confused by the new generation in the $JTMP/GDG/...

The mainframe JCL would use the (+1) suffix on the new generation creation DSN, and also on the DSN that reads the file back, because the programmer knew that the GDG generation# was not updated until successful EOJ.

This situation is illustrated by demo JCL jcl0/JGL210.jcl, and here are the relevant lines extracted from the mainframe JCL & from the converted script (jcl3/jgl210.ksh):

JCL to demo Write GDG & Readback in 1 job

 //* Demo GDG processing, write gltrans(+1) & read back as (+1)
 //STEP010  EXEC PGM=SORT
 //SORTIN   DD DSN=GL.ACCOUNT.TRAN1,DISP=OLD
 //SORTOUT  DD DSN=GL.ACCOUNT.TRANS(+1),DISP=(,CATLG,DELETE),...
 //SYSIN    DD *
 SORT FIELDS=(1,8,CH,A,69,12,CH,A)
 /*
 //STEP020  EXEC PGM=CGL200,PARM=&YEAREND
 //GLTRANS  DD DSN=GL.ACCOUNT.TRANS(+1),DISP=OLD
 //GLMSOLD  DD DSN=GL.ACCOUNT.MASTER(0),DISP=OLD
 //GLMSNEW  DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE),...

corresponding lines from converted script

 exportfile SORTIN data1/gl.account.tran1
 exportgen1 +1 SORTOUT $JTMP/data1/gl.account.trans_                    #<--Note1
 #exportgen1 assigns $JTMP/GDG/file, move to data1/file at Normal EOJ
 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\
 ,keys=(0,8,c,a,68,12,c,a)"
 #4----------------------------------------------------------------------
 exportgen1 +1 GLTRANS $JTMP/data1/gl.account.trans_                     #<--Note2
 #exportgen1 assign $JTMP/GDG/file, move to data1/file at Normal EOJ
 # 2+ exportgen1's for this file in this JCL/script
 exportgen0 0 GLMSOLD data1/gl.account.master_
 exportgen1 +1 GLMSNEW $JTMP/data1/gl.account.master_
 #exportgen1 assign $JTMP/GDG/file, move to data1/file at Normal EOJ
 #3----------------------------------------------------------------------
 cobrun $ANIM $CBLX/cgl200
 #4----------------------------------------------------------------------

The 'Note1' line above writes a new generation for the sorted file. The 'Note2' line above reads the new GDG back into the COBOL program. They were both codes with the '(+1)' suffix on the DSN's, and are now both coded on the 'exportgen1' function in the Korn shell script.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5F5. special procedures for VU GDG system required at some sites

problem converting tape files to GDG's

We noticed a problem when converting VSE JCL's with tape files to GDG's.

The VSE JCL carried a comment indication INPUT or OUTPUT, and we added an option to the JCL converter to use the I/O indicator to generate 'exportgen1' for OUTPUT & 'exportgen0' for INPUT. We also coded the tape files in a 'tape/...' subdir.

Using the example on the previous page the write & read back file definitions might be:

exportgen1 +1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)

 exportgen0 0 GLTRANS tape/account.trans_     #Note2 (readback on following step)

correction method #1 (OK)

exportgen1 +1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)

exportgen1 0 GLTRANS $JTMP/tape/account.trans_ #2 (readback on following step)

Correction method #1 is similar to the example on the previous page, resulting for the fact that the mainframe programmer would have coded both files with suffix '(+1)'.

correction method #2 (NOK)

exportgen1 +1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)

exportgen0 0 GLTRANS $JTMP/tape/account.trans_ #2 (readback on following step)

Correction method #2 is to leave the function as 'exportgen0' & simply add the '$JTMP/' prefix onto the file.

Note that the '$JTMP/' directory is honoured by exportgen0, but is ignored by exportgen1 when determining the latest generation within a directory. Function 'exportgen1' will 1st remove any '$JTMP/' prefix before it determines the latest generation, but 'exportgen0' will not.

Note
  • Do NOT use correction method#2. It will work, but will generate ERRORS
  • when the system tries to update the GDG history in the control file

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5J0. MVS JCL conversion - Generation files

Listings of GDG functions


5J1. exportgen0 - determine current generation of a GDG file

5J2. exportgen1 - determine next generation of a GDG file

5J3. exportgenall - concatenate all generations of a GDG file

5J4. exportgenx - error message if gen# < (-3) or > (+3)

5J5. exportfile - function for non-GDG files (exports & displays filename)

5K1. jobset51 - job setup function called at line 10 of all JCL/scripts
- enhanced in May 2007 to support new features in GDG system
- you must add code for YOUR datafile subdirs
- vs subdirs used in supplied test/demos

5K2. jobset52 - full-PATH version of jobset51 (relative-PATH, recommended)
- differences shown via 'diff' command

5K3. jobend51 - job ending function called at normal EOJ of all JCL/scripts
- added in May 2007 to support new features in GDG system
- you must add code for YOUR datafile subdirs
(vs subdirs used in supplied test/demos)

5K4. jobabend51 - jobend function called at Abnormal Termination
- you must add code for YOUR datafile subdirs
(vs subdirs used in supplied test/demos)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5J1. MVS JCL conversion - GDG functions

exportgen0 determine current generation

 # exportgen0  - function to export the latest existing generation of a filename
 #             - replaces mainframe MVS JCL GDG functions
 #             - used by Vancouver Utilities JCL to Korn shell converter
 #             - these functions distributed in /home/uvadm/sfun/...
 #
 #                      ** Change History **
 #
 #Aug19/14 - change $JOBID2 to $jobid2 on #cmts, code alrdy chgd Jun10
 #Jun10/14 - ensure filenames lower-case
 #Jun01/14 - allow AIX COBOL file type prefix, see sample below
 #Dec05/12 - verify directory of subdir/file_ or $RUNDATA/subdir/file_
 #Dec05/12 - old history cleared
 #
 #                  ** summary of GDG functions supplied **
 #
 # exportgen0 0:-50  - determine current generation (highest generation#)
 #                     or any prior generation (-1),(-2),(-3),...(-50)
 # exportgen1 +1:+50 - determine future generations (+1),(+2),(+3),...(+50)
 # exportgen2 +1:+50 - alternate exportgen1, writes direct to $RUNDATYA/subdir
 # exportgenall        - concatenates all existing generations
 # exportfile          - non-GDG, same as 'export', but displays filename
 #
 #                    ** uvcopy jobs used for GDG functions **
 #
 # jclgdgctl51 - creates gdgctl51 by extracting all exportgens from all scripts
 # gdgload51  - loads edited text file ctl/gdgctl51 to indexed file gdgctl51I
 # gdgget51  - gets records from indexed file by key, called by exportgen1c
 # gdgget52  - gets records from indexed file by key, called by exportgen0c
 # gdgupok1  - updates gdgctl file next=... reset =000000 or increment range
 # gdgupab1  - updates gdgctl file history, files NOT moved to RUNDATA/subdirs
 #
 #                   ** sample usage illustrated **
 #
 #   gl.account.master_000001
 #   gl.account.master_000002  <-- assume $RUNDATA contains these files:
 #   gl.account.master_000003
 #
 #command: exportgen0 0 CUSTMAS data1/gl.account.master_
 #         =============================================
 #result:  export CUSTMAS=data1/gl.account.master_000003  <-- gen0=highest onfile
 #         =============================================
 #
 #                      ** sample control file **
 #
 # gl.account.master_   gdg=10
 # gl.account.trans_    gdg=20  next=000003(000003:000003)_070531:235959
 # py.payroll.master_   gdg=30  opt=c
 # py.time.cards_       gdg=52  next=000001(000001:000012)_000000:000000
 #
 #
 #                      ** AIX COBOL file type **
 #
 # AIX COBOL file type may be coded as keyword cft=...
 # - not coded for non-cobol steps (different version not needed)
 #
 # exportgen0 0 CUSTMAS data1/ar.customer.master_ cft=QSAM
 # =======================================================
 # export CUSTMAS=QSAM-data1/ar.customer.master_000003      <-- result
 # ===================================================
 #
 #                       ** Vital Requirements **
 #
 # export FPATH=$APPSADM/sfun   #<-- must define FPATH in common_profile
 # ==========================      - directory holding these ksh functions
 #
 #                 ** coding for function exportgen0 **
 #
 function exportgen0  # function name here must match physical filename
 {
 if (($# < 3)); then
    logmsg2 "ERR: gen0: $# requires 3 args: gen#=$1, LFD=$2, LBL=$3"
    exit 9; fi
 integer gn=$1;
 if (($gn > 0)); then
    logmsg2 "ERR: gen0: arg1 gen# $gn must be 0,-1,-2,etc"
    exit 9; fi
 #
 # capture DDname & DSNname into named variables
 lfd=$2; lbla=$3;
 #
 # ensure filename lowercase
 ## lbla=$(echo $3 | tr [A-Z] [a-z])
 #Oct18/14 - get err --> tr: extra operand 'm' <-- ?? (#cmt out for now)
 # - on Red Hat running with ksh login shell
 # - OK on bash shell & following OK
 ## lbla=$(echo $3 | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz')
 # - but dont think we need for IMMD
 #
 #Jun01/14 - allow AIX COBOL file type as following keyword cft=...
 if [[ "$4" == cft=* ]]; then
    cft=${4#*=}; cft=${cft}-;
 else cft=""; fi
 #
 #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles
 #         - extract subdir/filename from $RUNDATA/subdir/filename
 lbl1=${lbla##*/}      # drop large left to get filename
 lbl2=${lbla%/*}       # drop small right to get $RUNDATA/subdir
 lbl3=${lbl2##*/}      # drop large left to get subdir
 lbl4=$lbl3/$lbl1      # create subdir/filename (to match coding in gdgctl51I)
 lbld=$(echo $lbl4 | tr "/" "_")  # convert any '/' to '_' in DSNname
 #                                # for filename to hold ls of gdg filenames
 #
 #Dec05/12 - verify directory of subdir/file_ or $RUNDATA/subdir/file_
 if [[ ! -d "$lbl2" ]]; then
    logmsg2 "ERR: gen0: $lbl2 directory not found, continue/kill/fix ?"
    read reply; fi
 #
 # verify that filename ends with '_'
 if [[ ! "$lbla" == *_ ]]; then
    logmsg2 "ERR: gen0: filenames should end with '_', continue/kill/fix ?"
    read reply; fi
 #
 # verify $GTMP subdir present, created by jobset51
 if [[ ! -d $GTMP ]]; then
    logmsg2 "ERR: gen0: \$GTMP subdir not found GTMP=$GTMP"; exit 9; fi
 #
 # $GTMP subdir to hold output of 'ls' with all files matching filename_*
 # export GTMP=jobtmp/$jobid2/gtmp <-- defined in jobset51
 # used for ls output file create/readback to determine latest generation:
 #   lslbls=$GTMP/${JSTEP}I_$lbld
 #   lslbls=$RUNDATA/jobtmp/$jobid2/gtmp/${JSTEP}I_$lbld
 # could use GTMP=jobtmp/${jobid2}_$(date +%y%m%d%H%M%S)/gtmp
 #   in alternative code version for time stamped jobtmp subdirs
 #
 # capture current step# (part of ls output filename)
 typeset -RZ4 step="$JSTEP"                # capture step# from calling job
 if [[ -z "$step" ]]; then step=0000; fi   # set 0000 if undefined
 #
 # capture all matching GDG filenames into a file for readback to get highest#
 # - 1st create filename for 'ls' write lslbls=jobtmp/$jobid2/${JSTEP}I_$lbld
 # - with all filenames matching up to the trailing '_'
 lslbls=$GTMP/${step}I_$lbld       # assign filename for ls write
 ls $lbla[0-9][0-9][0-9][0-9][0-9][0-9] >$lslbls 2>/dev/null
 #
 # if no existing files, define ..._000001 filename, warning msg,& early return
 if [[ ! -s $lslbls ]]; then       # if NO existing files ?
    lblgena=${lbla}000001          # create filename for 1st generation
    export $lfd=$lblgena           # export LFD=lbl of next generation
    logmsg2 "ERR: gen0: No existing file, gen_000001 exported, $lfd=$lblgena "
    logmsg2 "ERR: gen0: No existing file, continue/kill/fix ?"
    read reply;                    # June05/03 OT warning added
    return 0; fi                   # return 0 if no files existing
 #
 # call uvcopy job gdgget52 to select control file entry for matching filename
 # - from indexed file ctl/gdgctl51I using filename as key
 # - uvcopy job will write selected entry to a file for reading by this script
 lblxG=$GTMP/${step}G0_$lbld        # create filename to be written by uvcopy
 #
 #Jun11/12 - test $GDGCTLUPDT for alt uvcopy job with noupdate/nolock
 if [[ "$GDGCTLUPDT" == "NO" ]]
 then uvcopy gdgget52n,fili1=$lslbls,filo2=$lblxG,arg1=$lfd,arg2=$lbl1,arg3=$gn,rop=i63
 else uvcopy gdgget52,fili1=$lslbls,filo2=$lblxG,arg1=$lfd,arg2=$lbl1,arg3=$gn,rop=i63
      #===============================================================================
 #Nov16/14 - fix arg2=$lbl4 to arg2=$lbl1 (ctlfile now no subdir)
 fi
 # arg1  = DDN (ex: GLMSTR)
 # arg2  = DSN filename key for lookup gdgctl file (ex: gl.account.master_)
 # arg3  = gen# desired (0,-1,-2,etc)
 # fili1 = $lslbls ls of all matching filenames_* to underscore (+ 6 digits)
 # filo2 = $lblxG output file for gdgctl entry (possible override, prior gen#)
 #         output file has 1 line with 4 fields as follows:
 # ===============================
 # gen#   gdg=... next=... opt=...
 # 000004 gdg=15
 # 000006 gdg=24  next=000006(000001:000012)070529:235959 opt=c
 # ============================================================
 # field1 = gen# determined by gdgget52 (Oct18/08 chnaged from filename_gen#)
 # field2 = gdg=... no of generations maintained for this file
 # field3 = next=... in gdgctl file (not/used except for debug/audit)
 # field4 = opt=c from gdgctl file, causes prompt for confirm/change
 #Oct18/08 - gdgget52 changed to return just gen# vs filename_gen#
 #         - exportgen0 changed to concat filename_ + gen#
 #
 # read the file written by uvcopy, 1 line with 4 fields (as above)
 exec 3< $lblxG                # open the file
 read -u3 genx gens next opts  # read 1st 4 fields (4th field options)
 exec 3<&-                     # close file
 lblgenx=$lbla$genx            # concat filename_ + gen#
 #
 export $lfd=$cft$lblgenx      # export LFD=LBL for selected filename
 #=======================
 #
 # get filesize & display results for console log
 fsize="";
 if [[ $lblgenx == /* ]]; then lblx=$lblgenx; else lblx=$RUNDATA/$lblgenx; fi
 ## if [[ -f $lblx ]]; then fsize=$(stat -c%s $lblx); fi
 #Nov09/10 - SUN unix does not have stat to get filesize
 #Nov19/10 - use 'du' as portable way to get filesize
 #Oct15/11 - du option 'h' reports in 4K increments (but OK)
 #Jan06/14 - change 'du' to '\du' disable any alias du
 #         - use option -k (-h did not work on AIX)
 \du -k $lblgenx | read fsize dummy
 #
 logmsg1 "gen$gn $lfd=$cft$lblgenx insize=${fsize}K"
 #==================================================
 # return no of generations existing
 gdgsbf=$(wc -l $lslbls); gdgsb=${gdgsbf% *}; gdgs=${gdgsb##* };
 return $gdgs        # return no of generations existing
 }

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5J2. MVS JCL conversion - GDG functions

exportgen1 determine next generation

 # exportgen1  - function to export NEXT generation of a file (not yet existing)
 #             - replaces mainframe MVS JCL GDG functions
 #             - used by Vancouver Utilities JCL to Korn shell converter
 #             - these functions distributed in /home/uvadm/sfun/...
 #             - must be copied to $APPSADM/sfun, since common_profile FPATH is:
 #               export FPATH=$APPSADM/sfun  <--Function PATH for ksh
 #
 #                          ** Change History **
 #
 #Oct18/14 - modify for IMMD new dir structure $DATA/gg/filename
 #           $DATA=$ISS2APPHOME/data/gg (fullpath)
 #         - write newgdg to $JGDG/fullpath('@'s replace '/'s)/filename
 #         - jobend51 will replace '@'s with '/'s to write newgdg
 #         - this allows for the new data1/gg/ & for GDG's in other systems
 #         - elimnates need for GDGmkdirs
 #Aug19/14 - change $JOBID2 to $jobid2 on #cmts & line 158 export JTMP=...
 #Jun10/14 - ensure filenames lower-case
 #Jun01/14 - allow AIX COBOL file type prefix, see samples further below
 #May24/12 - modify to allow superdir/subdir/filename (vs subdir/filename)
 #           data1/filexx will now default to $RUNDATA/data/filexx
 #Mar14/12 - gdgctl51I located via env-var $GDGCTL vs $RUNDATA
 #         - common_profile default "export GDGCTL=$RUNDATA/ctl"
 #         - could change to "export GDGCTL=$APPSADM/ctl"
 #Dec05/12 - clear prior history
 #
 #                ** summary of GDG functions supplied **
 #
 # exportgen0 0:-50  - determine current generation (highest generation#)
 #                     or any prior generation (-1),(-2),(-3),...(-50)
 # exportgen1 +1:+50 - determine future generations (+1),(+2),(+3),...(+50)
 # exportgen2 +1:+50 - alternate exportgen1, writes direct to $RUNDATYA/subdir
 # exportgenall      - concatenates all existing generations
 # exportfile        - non-GDG, same as 'export', but displays filename
 #
 #                    ** uvcopy jobs used for GDG functions **
 #
 # jclgdgctl51 - creates gdgctl51 by extracting all exportgens from all scripts
 # gdgload51  - loads edited text file ctl/gdgctl51 to indexed file gdgctl51I
 # gdgget51  - gets records from indexed file by key, called by exportgen1c
 # gdgget52  - gets records from indexed file by key, called by exportgen0c
 # gdgupok1  - updates gdgctl file next=... reset =000000 or increment range
 # gdgupab1  - updates gdgctl file history, files NOT moved to RUNDATA/subdirs
 #
 #                      ** July 2008+ version **
 #
 # - this version avoids GDG incrementing if job abends
 # - does not write new GDG files directly to $RUNDATA/subdirs
 # - JCL converter changed to write exportgen1 files to $JTMP
 #   for move back to $RUNDATA/subdirs by jobend51 at Normal EOJ
 # - must modify jobset51 & jobend51 to create required subdirs
 # - July 2008 version gets gdg=... values from indexed file
 # - gdg priority: 1st = arg3 on exportgen1, 2nd = Indexed file
 #   3rd = default hard coded in this function (15 as of May 25/07)
 # - text file ctl/gdgctl51 created by uvcopy job 'jclgdgctl51', edited to specify
 #   gen#s by file & loaded to ctl/gdgctl51I indexed file by 'gdgload51'
 # - this function reads the indexed file using uvcopy job 'gdgget51', which
 #   returns the no of generations for the sepecified filename
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 #                       ** Vital Requirements **
 #
 # Directory holding these functions must be defined by FPATH (for Korn shell)
 # export FPATH=$APPSADM/sfun       #<-- in common_profile
 # ==========================
 #
 #                    ** command format & sample usage **
 #
 # exportgen1 gen DDname DSname [generations] [touch option] <-- format
 # =========================================================
 # - arg1 gen desired +1,+2,etc (as of Jan 2011)
 # - arg2 Logical filename
 # - arg3 physical filename
 # - arg4 generations to maintain (see default below if absent)
 # - arg5 option to touch (create new empty file)
 #
 # exportgen1 +1 CUSTMAS $JGDG/gl.account.master_   <-- example
 # ==============================================
 #
 # gl.account.master_000001
 # gl.account.master_000002 <-- existing files
 # gl.account.master_000003
 #
 # export CUSTMAS=$JGDG/gl.account.master_000004     <-- result
 # =============================================
 # [ touch $JGDG/gl.account.master_000004 ]
 #
 #                  ** AIX COBOL file type **
 #
 # AIX COBOL file type may be coded as keyword cft=...
 # - not coded for non-cobol steps (different version not needed)
 #
 # exportgen1 +1 CUSTMAS data1/ar.customer.master_ cft=QSAM
 # ========================================================
 # export CUSTMAS=QSAM-data1/ar.customer.master_000004       <-- result
 # ===================================================
 #
 #           ** filename manipulations **
 #
 # lbla  =  arg3 = data1/filename        (VU)
 #          arg3 = $DATA/gg/filename    (IMMD)
 #
 # lblp  =  fullpath/filename (prepends $RUNDATA if no leading /)
 #
 # lblf  = filename only
 #
 # dirp  = directories (fullpath to filename)  <-- this or next ?
 #
 # dirpa = directories(fullpath) with '/'s replaced by '@'s
 #
 # lblja  = ${dirpa}@${lblf}             <-- will write to $JGDG (adding gen#)
 #
 # lbljag = $JGDG/${dirpa}@${lblf}$genx  <-- write newgdg in jobtmp/...
 #                                        - for restore by jobend51

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 #                  ** coding for: function exportgen1 **
 #
 function exportgen1  # function name here must match physical filename
 {
 # define/create GDG subdirs if not present
 export JTMP=jobtmp/$jobid2
 export JGDG=$JTMP/GDG
 export GTMP=$JTMP/gtmp
 test -d $JTMP || mkdir $JTMP
 test -d $JGDG || mkdir $JGDG
 test -d $GTMP || mkdir $GTMP
 #
 typeset -RZ6 gen0;             # define cur gen# 6 digits Right just, zero fill
 typeset -RZ6 genx;             # define next gen# 6 digits Right just, zero fill
 typeset integer gensdflt=15;   # generations default 15
 typeset integer gens=$gensdflt # init gens to gensdflt
 integer filecnt=0; integer excess=0; integer lblcnt=0;  # clear counters
 #
 if (($# < 3)); then
    logmsg2 "ERR: gen1: $1 requires 3 args: gen=$1, LFD=$2, lbl=$3"
    exit 91; fi
 #
 # capture gen, DDname, DSNname cft=... gdg=...
 gn=$1; lfd=$2; lbla=$3;
 #
 # ensure filename lowercase
 ## lbla=$(echo $lbla | tr [A-Z] [a-z])
 #Oct18/14 - #cmntd out got err --> tr: extra operand 'm' ??
 # - on Red Hat running with ksh login shell
 # - OK on bash shell & following OK
 ## lbla=$(echo $lbla | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz')
 # - but dont think we need for IMMD
 #
 #Jun01/14 - allow AIX COBOL file type as following keyword cft=...
 if [[ "$4" == cft=* ]]; then
    cft=${4#*=}; cft=${cft}-;
 else cft=""; fi
 #
 # retrieve gdg=.., if arg4 or arg5
 if [[ "$4" == gdg=* ]]; then gens=${4#gdg=};
 elif [[ "$5" == gdg=* ]]; then gens=${5#gdg=}; fi
 #
 # verify that filename (arg3 on call) ends with '_'
 if [[ ! "$lbla" == *_ ]]; then
    logmsg2 "ERR: gen1: filenames must end with '_', continue/kill/fix ?"
    read reply; fi
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 # ensure fullpathname, if no leading '/' - prepend $RUNDATA
 lblp=$lbla
 if [[ $lblp != /* ]]; then lblp=$RUNDATA/$lbla; fi
 #
 # avoid problem when no matching files present
 # - by creating gen# filename_000000 as nullfile & removing later below
 if [[ ! -e ${lblp}000000 ]]; then touch ${lblp}000000; fi
 # echo "DEBUG1: \$lbla=$lbla \$lblp=$lblp"
 #
 # split fullpathname to directories/filename
 lblf=${lblp##*/}      # drop large left to get filename only
 dirp=${lblp%/*}       # drop small right to get directories only
 #
 #Dec03/12 - verify directory of subdir/file_ or $RUNDATA/subdir/file_
 if [[ ! -d "$dirp" ]]; then
    logmsg2 "ERR: gen1: $ddirp directory not found, continue/kill/fix ?"
    read reply; fi
 #
 ##lbla=$(echo $3 | tr [A-Z] [a-z]) #Jun10/14 ensure filename lower-case
 # convert '/'s to '@'s to write newgdg to $JGDG temp restore by jobend51
 lblja=$(echo $lblp | tr '/' '@')
 # will later create lbljag - with next gen# appended
 #
 # create filename to write all matching lbls (in $Gtmp/...)
 typeset -RZ4 step="$JSTEP"                # capture step# from calling job
 if [[ -z "$step" ]]; then step=0000; fi   # set 0000 if undefined
 lslbls=$GTMP/${step}O_$lblf       # assign filename for ls write
 # use 'ls' to create tmp file of matching filenames
 ls $lblp[0-9][0-9][0-9][0-9][0-9][0-9] >$lslbls 2>/dev/null
 #
 # read back file of filenames created by 'ls' above & use last name
 exec 3< $lslbls                 # open file of 'ls' names
 while read -u3 lblgenr          # read lines of ls filenames
       do  lblgenh=$lblgenr      # save highest generation filename
           ((filecnt+=1))        # count files for excess delete
       done                      #
 exec 3<&-                       # close file
 #
 gen0=${lblgenh##*_}             # drop filename, capture gen# of last filename
 genx=$gen0
 ((genx+=$gn))                   # calc next generation
 #
 #Sep28/09 - display for debugging
 ## echo "DEBUG3: lbla=$lbla gen0=$gen0 genx=$genx"
 ## read reply
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 # create filename for newgdg write to $JGDG
 lbljag=$JGDG/${lblja}$genx
 #
 # export for COBOL program, prepending with Cobol File Type if any
 export $lfd=$cft$lbljag     # export LFD=LBL for selected filename
 #======================     # for COBOL or utility program
 #
 # retrieve gdg=... from indexed file using filename key & uvcopy job gdgget51
 lblG=$GTMP/${step}G1_$lblf     # create filename for outfile
 # lblG=$GTMP/${step}G$gn_$lblf     # create filename for outfile
 #Oct18/14 - lblG outfile for uvcopy with new gen# not used, replaced by return code
 #         - removed the $gn_ which disappeared & looked funny
 #
 #Jun11/12 - test $GDGCTLUPDT for alt uvcopy job with noupdate/nolock
 if [[ "$GDGCTLUPDT" == "NO" ]]
 then uvcopy gdgget51n,fili1=$lslbls,filo2=$lblG,arg1=$lblf,arg2=$genx,arg3=$gn,rop=i63
 else uvcopy gdgget51,fili1=$lslbls,filo2=$lblG,arg1=$lblf,arg2=$genx,arg3=$gn,rop=i63
      #===============================================================================
 fi
 gens=$?           # capture gdg=... value from return code
 # verify generations min/max, if invalid set to default
 if (($gens<2)) || (($gens>250)); then gens=$gensdflt; fi
 #
 # delete files to maintain generations spcfd by arg#3 or default (see above)
 ((excess=$filecnt-$gens+1))    # calc number of files to delete
 #note: +1 because filecnt does not include the new generation being created
 # echo "DEBUG4: gens=$gens, filecnt=$filecnt, excess=$excess"
 #
 # if excess, re-read file of filenames, deleting 1st few excess
 if ((excess > 0)); then
    exec 3< $lslbls              # re-open file of 'ls' names
    while read -u3 lblgenr       # read lines of ls filenames
          do ((lblcnt+=1))      # count files for excess delete
             if ((lblcnt <= excess)); then rm -f $lblgenr; fi
          done                   #
    exec 3<&-                    # close file
 fi
 # can now remove the _000000 nullfile if created above
 if [[ ! -s ${lblp}000000 ]]; then rm -f ${lblp}000000; fi
 #
 # touch (create new empty file) if arg4,5,or 6 = 'touch'
 if [[ "$4" == "touch" ]]; then touch $lblgenx;
 elif [[ "$5" == "touch" ]]; then touch $lblgenx;
 elif [[ "$6" == "touch" ]]; then touch $lblgenx; fi
 #
 # display result for console log
 logmsg1 "gen$gn $lfd=$cft$lblp gens=$gens"
 #============================================
 # return no of generations existing
 gdgsbf=$(wc -l $lslbls); gdgsb=${gdgsbf% *}; gdgs=${gdgsb##* };
 return $gdgs        # return no of generations existing
 }

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5J3. MVS JCL conversion - GDG functions

exportgenall concatenate all generations

 # exportgenall - function to export all of the existing generation of a filename
 #              - by Mark Wedge, Armas Solutions, Aug 2002
 #
 #Aug19/14 - change $JOBID2 to $jobid2 on #cmts, code alrdy chgd Jun10
 #Jun01/14 - allow AIX COBOL file type prefix, see sample below
 #
 # All matching files with the 6 digit gen# are concatentated into 1 output file.
 # The output file will have the trailing '_' (ID for generation file)
 # but will have no 6 digit# (preventing any future inclusion as a member)
 #
 # ap/account.trans_000001
 # ap/account.trans_000002   <-- sample input 3 files
 # ap/account.trans_000003
 #
 # ap/account.trans_       <-- output 3 files combined into 1
 #
 #command: exportgenall CUSTMAS ap/account.trans_
 #         ======================================
 #result:  export CUSTMAS=ap/account.trans_
 #         ================================
 #
 # All files 'ap/account.trans_[0-9][0-9][0-9][0-9][0-9][0-9]'
 # will be concatenated in to the base name 'ap/account.trans_'
 # To remove all generations, the 'rm' comamnd will be generated as follows:
 # rm -f ${CUSTMAS}[0-9][0-9][0-9][0-9][0-9][0-9]
 # The concatenated file '_' will remain & might be a backup in case of error
 #
 #                      ** AIX COBOL file type **
 #
 # AIX COBOL file type may be coded as keyword cft=...
 # - not coded for non-cobol steps (different version not needed)
 #
 # exportgenall CUSTMAS data1/ar.customer.master_ cft=QSAM
 # =======================================================
 # export CUSTMAS=QSAM-data1/ar.customer.master_            <-- result
 # =============================================
 #
 function exportgenall
 {
 if [[ -n "$1" && -n "$2" ]]; then :
 else logmsg2 "ERR: exportgenall requires: LFD=$1 lbl=$2"; exit 9; fi
 lfd=$1; lbl1=$2
 #
 #Jun01/14 - allow AIX COBOL file type as following keyword cft=...
 if [[ "$3" == cft=* ]]; then
    cft=${3#*=}; cft=${cft}-;
 else cft=""; fi
 #
 typeset -RZ4 step="$JSTEP"                # capture step# from calling job
 if [[ -z "$step" ]]; then step=0000; fi   # set 0000 if undefined
 #
 #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles
 #         - extract subdir/filename from $RUNDATA/subdir/filename
 lbl2=${lbl1##*/}      # drop large left to get filename
 lbl3=${lbl1%/*}       # drop small right to get $RUNDATA/subdir
 lbl4=${lbl3##*/}      # drop large left to get subdir
 lbla=$lbl4/$lbl2      # create subdir/filename (to match coding in gdgctl51I)
 lblc=$(echo $lbla | tr "/" "_") #convert any '/' to '_' in DSNname
 #                     # for use as filename of filenames in $JGDG/gtmp
 #
 #Jun05/03 - verify that filename (arg2 on call) ends with '_'
 if [[ ! "$lbla" == *_ ]]; then
    logmsg2 "ERR: gen filenames should end with '_', continue?, need fix?"
    read reply; fi
 #
 cat /dev/null > $lbla
 cat ${lbla}[0-9][0-9][0-9][0-9][0-9][0-9] > $lbla 2>$GTMP/${step}GAERR_$lblc
 #===========================================================================
 #Nov29/11 - redirect stderr to file in gtmp/...
 #
 export $lfd=$cft$lbla  # result export DDNAME=DSNname_
 #====================
 #
 # get filesize & display results for console log
 fsize="";
 if [[ $lbla == /* ]]; then lblb=$lbla; else lblb=$RUNDATA/$lbla; fi
 ##if [[ -f $lblb ]]; then fsize=$(stat -c%s $lblb); fi
 ##Nov09/10 - SUN unix does not have stat to get filesize
 logmsg1 "genall: $lfd=$cft$lbla bytes=$fsize"
 #============================================
 #
 #Aug29/08 - call gdgget52 to add exportgenall 'GA' entry to ctlfile history
 # capture all matching GDG filenames into a file for readback to get low#/high#
 # - 1st create filename for 'ls' write lslbls=jobtmp/$jobid2/${JSTEP}I_$lbla
 # - with all filenames matching up to the trailing '_'
 lslbls=$GTMP/${step}I_$lblc       # assign filename for ls write
 ls $lbla[0-9][0-9][0-9][0-9][0-9][0-9] >$lslbls 2>/dev/null
 #
 # call uvcopy job gdgget52 to select control file entry for matching filename
 # - from indexed file ctl/gdgctl51I using filename as key
 lblxG=$GTMP/${step}GA_$lblc       # create filename to be written by uvcopy
 #Oct18/08 - remove $RUNDATA/ if present due to option e1 in jclunixop51
 lblr=${lbla#$RUNDATA/}            # remove $RUNDATA/ for optn e1 jclunixop51
 #Note - output file not required for exportgenall (simply adding history)
 #
 #Jun11/12 - test $GDGCTLUPDT for alt uvcopy job with noupdate/nolock
 if [[ "$GDGCTLUPDT" == "NO" ]]
 then uvcopy gdgget52n,fili1=$lslbls,filo2=$lblxG,arg1=$lfd,arg2=$lblr,arg3=GA,rop=i63
 else uvcopy gdgget52,fili1=$lslbls,filo2=$lblxG,arg1=$lfd,arg2=$lblr,arg3=GA,rop=i63
      #===============================================================================
 fi
 # arg1  = DDN (ex: GLMSTR)
 # arg2  = DSN filename key for lookup gdgctl file (ex: data1/gl.account.master_)
 # arg3  = 'GA' indicates All Generations, coded in gdgctl (GDG History file)
 #         vs codes 00,01-,02-,etc for exportgen0 & 01+,02+,etc for exportgen1
 # fili1 = $lslbls ls of all matching filenames_* to underscore (+ 6 digits)
 # filo2 = $lblxG output file for gdgctl entry (NOT required for exportgenall)
 #
 return 0
 }

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5J4. MVS JCL conversion - non-GDG function

exportgenx - report err if gen# out of bounds

 # exportgenx - function to report error in JCL to script conversion
 #            - when GDG JCL not as expected
 #            - see GDG doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5
 #
 #Aug19/14 - change $JOBID2 to $jobid2 on echo (no active code uses here)
 # exportgen0 - current generation (0) & prior (-1),(-2),(-3)
 # exportgen1 - future generations not yet existing (+1),(+2),etc
 # exportgenx - (this function) errmsg if GDG JCL was not as expected
 # exportgenall - concatenates all existing generations
 #
 # This 'exportgenx' reports an error if script run before manual correction
 #
 function exportgenx
 {
 lfd=$1; lbl=$2          # capture args into named variables
 logmsg2 "ERR: exportgenx - ERR in JCL to UNIX script conversion"
 logmsg2 "- LFD=$lfd, LBL=$lbl."
 logmsg2 "- see GDG doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5"
 logmsg2 "- correct script $jobid2 & rerun"
 logmsg2 "- enter=continue, or kill job by interrupt (del or ^C)"
 read reply               # wait for operator to enter or kill
 return 9
 }

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5J5. MVS JCL conversion - non-GDG function

exportfile - exports & display non-GDG filename

 # exportfile - function to export DDname=DSName for Micro Focus external names
 #              DDname (logical name in program) = DSName (physical filename)
 #
 #Jun10/14 - ensure filenames lower-case
 #Jun01/14 - allow AIX COBOL file type prefix, see sample below
 #
 # exportfile CUSTMAS data1/ar.customer.master  <-- example of use
 # ===========================================
 # export CUSTMAS=data1/ar.customer.master      <-- result
 # =======================================
 #
 # exportfile - display non-GDG filenames on console (& console-log)
 #            - also see GDG functions:
 # exportgen0 - to determine current generation (0) highest gen#
 # exportgen1 - to determine next generation (+1)
 #
 #Jun01/14 - allow AIX COBOL file type prefix
 #         - Cobol File Type code follows exportfile as follows:
 #         - not coded for non-cobol steps (different version not needed)
 #
 # exportfile CUSTMAS data1/ar.customer.master cft=QSAM
 # ====================================================
 # export CUSTMAS=QSAM-data1/ar.customer.master          <-- result
 # ============================================
 #
 # export FPATH=$APPSADM/sfun
 # ==========================
 # - functions must be in directory defined by FPATH in profiles as above
 #
 function exportfile
 {
 #
 if [[ -n "$1" && -n "$2" ]]; then :
 else logmsg2 "ERR: exportfile requires: DDname=$1 DSName=$2."
      exit 9; fi
 #
 # echo "DEBUG1: \$1=$1, \$2=$2"
 # capture args into named variables
 lfd=$1; lbl=$2
 #Jun10/14 ensure filename lower-case
 #
 # ensure filename lowercase
 ## lbl=$(echo "$lbl" | tr [A-Z] [a-z])
 #Oct18/14 - get err --> tr: extra operand 'm' <-- ?? (#cmt out for now)
 # - on Red Hat running with ksh login shell
 # - OK on bash shell & following OK
 ## lbla=$(echo $2 | tr 'ABCDEFGHIJKLMNOPQRSTUVWXYZ' 'abcdefghijklmnopqrstuvwxyz')
 # - but dont think we need for IMMD
 # echo "DEBUG2: \$lbl=$lbl"
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 #Jun01/14 - allow AIX COBOL file type as following keyword cft=...
 if [[ "$3" == cft=* ]]; then
    cft=${3#*=}; cft=${cft}-;
 else cft=""; fi
 #echo "DEBUG3: \$3=$3, \$cft=$cft"
 #
 export $lfd=$cft$lbl        # export LFD=lbl of highest gen existing
 #===================
 #
 #Oct05/08 - init file if name ends with 'nullfile'
 if [[ $lbl == *nullfile ]]; then >$lbl; fi
 #
 # get filesize & display results for console log
 # - allow for Indexed file by also testing for '.dat' suffix
 #Feb08/15 - allow for PL/1 coding on end filename,recsize(80),type(fixed)
 lbla=${lbl%%,*}
 fsize="";
 if [[ $lbla == /* ]]; then lblc=$lbla; lbld=$lbla.dat;
    else lblc=$RUNDATA/$lbla; lbld=$RUNDATA/$lbla.dat; fi
 ## if [[ -f $lblc ]]; then fsize=$(stat -c%s $lblc);
 ##   elif [[ -f $lbld ]]; then fsize=$(stat -c%s $lbld); fi
 ## SUN has no 'stat', use 'du' without option 'h'
 #
 if [[ -f $lblc ]]; then \du -k $lblc | read fsize dummy
 elif [[ -f $lblc.dat ]]; then \du -k $lblc.dat | read fsize dummy; fi
 if [[ -z "$fsize" ]]; then fsize=0; fi
 logmsg1 "file: $lfd=$cft$lbl fsize=${fsize}K"
 #============================================
 return 0      # return 0 if file was found
 }

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5K1. MVS JCL conversion - GDG functions

jobset51 - alt version of jobset51 Sep2009

 # jobset51 - setup environment for UNIX scripts converted from MVS JCL
 #          - this KORN shell function stored in $APPSADM/sfun
 #          - called at the begining of each JCL/script
 #          - inserted by JCL converter from ctl/jclunixop51
 #          - uses $RUNLIBS & $RUNDATA (exported in prgmr/oprtr profiles)
 #            to define Libraries & Data dirs for 'test' or 'prod'uction
 #          - see more doc at: www.uvsoftware.ca/mvsjcl.htm
 #
 # jobset51 - use for most Vancouver Utility installations
 # jobset53 - aalternative for IMMD directory structure
 #
 #        - - - sample RUNLIBS/RUNDATA for programer testing - - -
 # export RUNLIBS=/home/mvstest/testlibs #<-- test/demo Libraries
 # export RUNDATA=/home/mvstest/testdata #<-- test/demo Data superdir
 #
 #        - - - sample RUNLIBS/RUNDATA for production operators - - -
 # export RUNLIBS=/p2/apps/prodlibs           #<-- production libraries
 # export RUNDATA=/p2/apps/proddata           #<-- production Data superdir
 #
 # - JCL/scripts are found via $RUNLIBS/jcls in the profile PATH
 # - COBOL program subdir defined here in jobset51 as '$RUNLIBS/cblx'
 #   (this allows programs to have same names as JCL/scripts)
 #
 #                      ** change history **
 #
 #Nov10/14 - created from jobset53 IMMD directory structure
 #         - restoring Vancouver Utility directory structure
 #         - retaining support for new exportgen0/exportgen1 functions
 #
 #                  ** begin code for function jobset51 **
 #
 # See explanations at www.uvsoftware.ca/mvscobol.htm#2E1 - 2E9
 # - COBOL converter inserts unixwork1.cpy, unixproc1.cpy,& perform unixproc1
 # - unixproc1 reformats $RUNDATE into various date formats for COBOL use
 #
 function jobset51
 { #Feb07/12 - export lower case of $JOBID2 for start/stop, stepctl51, etc
 # typeset -l jobid2; jobid2=$JOBID2; export jobid2
 # Aug19/20 - dont need above, begin JOB exports jobid2 lowercase
 #
 # Default RUNDATE to system date yyyymmdd, but allow cmd line override
 # --> jobname.ksh RUNDATE=20091120  <-- override system date for this job
 if [[ -z "$RUNDATE" ]]; then RUNDATE=$(date +%Y%m%d); fi; export RUNDATE
 export RUNDTTM=$(date +%y%m%d_%H%M%S)
 export YMD=$(date +%y%m%d)
 export HMS=$(date +%H%M%S)
 #
 #Jan25/12 - export HMS in jobset51 for logmsg2
 cd $RUNDATA              #change to working dir for production (or test)
 cdstatus=$?              # capture status of cd $RUNDATA
 #Oct20/14 - ensure reqquired subdirs present in $RUNDATA
 test -d jobctl   || mkdir jobctl
 test -d joblog   || mkdir joblog
 test -d jobmsgs  || mkdir jobmsgs
 test -d jobtimes || mkdir jobtimes
 if ((cdstatus))          # ERR if cdstatus not zero (OK)
    then logmsg2 "jobset51 ERR: cd \$RUNDATA ($RUNDATA) failed"
         logmsg2 "- investigate, RUNDATA definition in profiles"
         logmsg1 "- enter to exit"; read reply; exit 91; fi
 #
 # cd $RUNDATA means all files are referenced relative to $RUNDATA
 # - allows switching between production & test files by changing $RUNDATA
 # - JCL converter has converted HLQs of DSNs to subdirs within $RUNDATA
 # - High Level Qualifiers might be applications (ar,gl,mstr,tape,etc)
 #
 # - COBOL programs are found via $CBLX/progname in JCL/scripts
 # - RPG   programs are found via $RPX/progname in JCL/scripts
 # - JAVA  programs are found via $CBLX/progname in JCL/scripts
 #Sep24/15 - change CBLX to CBLX
 export CBLX=$RUNLIBS/cblx    # path for loading COBOL programs
 export RPX=$RUNLIBS/rpgx     # path for loading RPG programs
 #
 if [ -z "$ANIM" ]; then ANIM=-F; fi
 # 'ANIM=-F' inhibits non-numeric field checks (could change to +F ?)
 # - cobol programs are called via ---> cobrun $ANIM $CBLX/progname <---
 #
 # make subdirs for work files, instream data files,& GDG subdirs
 # define jobtmp/subdirs for new GDG files
 umask 002  # ensure perms to create dirs/files 775/664 (group share)
 export JTMP=jobtmp/$jobid2
 export JGDG=$JTMP/GDG
 export GTMP=$JTMP/gtmp
 test -d $JTMP || mkdir $JTMP
 test -d $JGDG || mkdir $JGDG
 test -d $GTMP || mkdir $GTMP
 test -d $JTMP/tmp || mkdir $JTMP/tmp
 #
 # $JTMP/...     - for work files & instream data files
 # $GTMP/...     - for exportgen0,1,etc 'ls' output files
 #                 GDG matching filenames readback to determine latest gen#
 # $JGDG/...     - store new GDGs for move back at Normal EOJ
 # $JTMP/tmp/... - for ADRDSSU DUMP INCLUDE/EXCLUDE, each ssuch step will:
 #               - clear $JTMP/tmp/*, copy to, remove from,
 #                 then move remaining files to output directory tape1/...
 #
 #Note - if multiple copies of same job could be run at same time:
 #       to avoid problems naming temp dirs using jobnames
 # solution#1
 #  - use the 'joblog2' script to run these jobs
 #  - joblog2 ensures any currently running same name job completes
 #    before scheduling the next same name job
 #  - this solution does not require any change here in jobset51
 #
 # solution#2
 # - $JTMP subdir could be date/time stamped (or append process ID)
 #   export JTMP=jobtmp/${jobid2}$(date +%y%m%d%H%M%S) #<-- date/time stamp
 #   export JTMP=jobtmp/${jobid2}$$                    #<-- process ID
 # - If you do this, then 'rm -rf $RUNDATA/jobtmp/*' nightly by cron
 # - see crontab_appsadm1 & script cleantmps at ADMjobs.htm#5B1
 #
 #----------- SYOT/sysout definition ---------------
 export SYOT=sysout/$JOBID2
 # jclunix51 changed to generate SYSOUT files as follows:
 # exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_SYSOUT_$(date +%y%m%d_%H%M%S) J20
 # - should setup cron to remove sysout/... files older than 30 days ??
 # make subdir for SYSOUT files (or any file w/o DSN=...)
 if [[ ! -d $SYOT ]]; then mkdir $SYOT; fi
 #
 # $JTMP & $SYOT are vital - ensure created successfully else exit
 if [[ -d $JTMP && -d $SYOT ]]; then :
    else logmsg2 "jobset51 ERR: $JTMP &/or $SYOT failed creation"
         logmsg2 "- investigate: permissions,JTMP,SYOT dirnames changed?"
         logmsg1 "- enter to exit"; read reply; exit 92; fi
 #Note - in code above we create $JTMP & $SYOT if not already existing
 #     - will clean out any prior run $JTMP files (but not $SYOT files)
 # - BUT not on a 'RESTART', see following line of code below (near end)
 # ---> else rm -rf $JTMP/*; fi  <--- see below
 #
 # define subdir for intersttep temp/work files & in IDCAMS conversions
 # ensure nullfile present & empty, for use on DD DUMMY
 # - use /dev/null, but some unix variants had problems with that
 #May24/12 - nullfile changed from $RUNDATA/ctl/... to $RUNDATA/tmp/...
 #         - so ctl/ could be omitted from $RUNDATA (need tmp/ for sorts)
 >tmp/nullfile    # ensure present & empty
 export NULLFILE=tmp/nullfile
 #
 #Nov15/13 - setup JTMP1 file for miscellaneous uses
 #         - ICETOOL uses tmp1 as output file for COUNT function
 export JTMP1=$JTMP/tmp1
 #
 #Jan09/14 - add RPTS for VSE JCL conversions
 export RPTS=rpts
 #
 # Ensure $JGDG/subdirs exist for exportgen1 new files til Normal EOJ
 # - at Normal EOJ, will move $JGDG/subdir/files back to $RUNDATA/subdirs
 # Execute GDGmkdirs to make subdirs for new GDGs created by function exportfile1
 # - script executed by jobset51 & exportgen1
 #Oct18/14 - remove GDGmkdirs, enhanced exportgen1 does not need
 # GDGmkdirs $JTMP  #<-- May2012 execute from $PATH $UV/IBM/sf/...
 # ==============  #  - could copy to $RUNLIBS/sf/... precedence over $UV/IBM/sf
 #
 # Test for any files in $JGDG/subdirs at begin job
 # (prior run abend not moving GDG/subdir/files back to $RUNDATA/subdirs)
 # - will prompt operator to move back or not (rerun from begining)
 #Nov27/11 - recovergdg code removed, saved as sfun/jobset51_recovergdg
 lsgdgs=$(ls $JGDG/* 2>/dev/null);  # capture filenames in GDG/subdirs
 if [[ -n "$lsgdgs" ]]; then
    logmsg2 "jobset51 WARN: files in jobtmp/GDG subdirs (prior AbTerm ERR?)"
    logmsg2 "---- files in $JGDG/*/* listed below:"
    echo    "$lsgdgs"
    logmsg2 "If NO restart by step#, GDG files in jobtmp/... will be cleared"
    logmsg2 "   - allows rerun from begin job with no worry about GDGs"
    logmsg2 "If RESTARTing by step#, example--> jobname.ksh start=S0050"
    logmsg2 "   - GDG files in jobtmp/... will NOT be cleared"
    logmsg2 "   - will be available to steps after restart step#"
    logmsg2 "   - will be restored to data1/... subdir at JobEnd=Normal"
    logmsg2 "enter/continue - will clear jobtmp/... if no restart"
    logmsg2 "enter/continue - will not clear jobtmp/... if start=..."
    read reply
 fi
 # initialize step counters
 export JSTEP=S0000 XSTEP=0
 integer JCC=0 SCC=0 LCC=0;
 #
 # Allow for RESTART at any step by start=... argument on command line:
 # --> jobname.ksh start=S0020   <-- restart at step 2
 #Oct20/14 - allow both start=... & restart=...
 test -n "$restart" && start="$restart"
 test -z "$start"   && export start=S0000
 if [[ $start != S[0-9][0-9][0-9][0-9] ]]; then
    logmsg2 "jobset51 ERR: start=$start invalid"; exit 94; fi
 alias goto="<<${start}=\A"
 #
 if [[ $start != S0000 ]]; then
    logmsg2 "WARN: **START** at start=$start";
 else
    # ensure $JGDG/subdirs exist to hold exportgen1 files until Normal EOJ
    # Normal EOJ will move $JGDG/subdir/files back to $RUNDATA/GDG/subdirs
    #Note - create user set of subdirs in 2 places, above for file test
    #     - and here after 'rm -fr $JTMP/*' for non-restart
    rm -fr $JTMP/*;
    test -d $JGDG || mkdir $JGDG
    test -d $GTMP || mkdir $GTMP
    test -d $JTMP/tmp || mkdir $JTMP/tmp
    #
    #Oct18/14 - remove GDGmkdirs enhanced exportgen1 does not need
    # GDGmkdirs $JTMP  #<-- May2012 execute from $PATH $UV/IBM/sf/...
    #==============  #  - could copy to $RUNLIBS/sf/... precedence
 fi
 #------------------------------------------------------------------------
 #Feb06/12 - add 'stop step' feature
 if [[ -n "$stop" ]]; then
    if [[ $stop != S[0-9][0-9][0-9][0-9] ]]; then
       logmsg2 "jobset51 ERR: stop=$stop invalid"; exit 95; fi
    exec 4>jobctl/$jobid2.ctl
    print -u4 "$jobid2.ksh start=$start stop=$stop $(date +%y%m%d_%H%M%S)"
    exec 4>&-;
    logmsg2 "WARN: **STOP** at: stop=$stop";
 fi
 #------------------------------------------------------------------------
 #Nov24/10 - setup OBSLOGDIR for Old Mutual, #cmt out at UVSI
 ## export OBSDATE=$(date +%y%m%d)
 ## export OBSLOGDIR=$RUNDATA/obslog/$OBSDATE
 ## test -d $OBSLOGDIR || mkdir $OBSLOGDIR
 #------------------------------------------------------------------------
 # Display various information at begining of JCL/script execution
 # - for the console log, info may be useful to debug problems
 logmsg2 "Begin Job=$jobid2"
 logmsg1 "$scriptpath"
 logmsg1 "Arguments: $args"
 logmsg1 "ProcessID=$$"
 logmsg1 "RUNDATE=$RUNDATE"
 logmsg1 "RUNLIBS=$RUNLIBS"
 logmsg1 "RUNDATA=$RUNDATA"
 logmsg1 "JTMP=$JTMP"
 logmsg1 "SYOT=$SYOT"
 logmsg1 "LOGNAME=$LOGNAME TESTPROD=$TESTPROD"
 logmsg1 "HOSTNAME=$HOSTNAME"
 ## logmsg1 "OBSLOGDIR=$OBSLOGDIR"
 uvtime W1D0 jobbgn    # get start time for later elapsed time calc
 #Jan26/12 - arg2 filename disabled, no dummy
 return 0
 }
 #----------------------------- end jobset51 -----------------------------

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5K2. MVS JCL conversion - GDG functions

jobset51/jobset52 differences

The difference is that jobset51 defines JTMP,JGDG,& SYOT with RELATIVE names, but jobset52 defines them with ABSOLUTE-PATH names. We recommend relative-PATH and the control file is provided with jobset51 coded on line 71.

The control file is ctl/jclunixop51 (for MVS) or ctl/jclunixop41 (for VSE). The JCL converters copy lines 63-73 of the control file to the begining of each converted output script.

Customers requiring full-PATH names must change 'jobset51' to 'jobset52' in the control file before executing the JCL converter.

We listed only 'jobset51' and you could use 'diff' to see the differences.


 diff -b sfun/jobset51 sfun/jobset52
 ===================================
 5,6c5,6
 < function jobset51
 < { #     'jobset51' is called at the begining of each JCL/script
 ---
 > function jobset52
 > { #     'jobset52' is called at the begining of each JCL/script
 74,80c75,81
 < export JTMP=jobtmp/$JOBID2
 < export RPTS=rpts
 < export SYOT=sysout/$JOBID2
 < #NOTE - this is ***jobset51***, so above un-commented & following #commented
 < # export JTMP=$RUNDATA/jobtmp/$JOBID2
 < # export RPTS=$RUNDATA/rpts
 < # export SYOT=$RUNDATA/sysout/$JOBID2
 ---
 > # export JTMP=jobtmp/$JOBID2
 > # export RPTS=rpts
 > # export SYOT=sysout/$JOBID2
 > #NOTE - this is ***jobset52***, so above commented & following un-commented
 > export JTMP=$RUNDATA/jobtmp/$JOBID2
 > export RPTS=$RUNDATA/rpts
 > export SYOT=$RUNDATA/sysout/$JOBID2
Note
  • this is a good example using the 'diff' utility
  • one of the most impressive unix/linux utilities

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5K3. MVS JCL conversion - GDG functions

jobend51 - support new GDG features (May 2007+)

 # jobend51 - common function called at Normal EOJ of JCL/scripts
 #          - by Owen Townsend, UV Software, May 23/2007
 #          - this KORN shell function stored in $APPSADM/sfun
 #          - see more doc at: www.uvsoftware.ca/mvsjcl.htm#
 #
 #Apr20/15 - add code to test for GDG#s > threshold & resequence
 #Nov10/14 - created from jobend53 IMMD directory structure
 #         - restoring Vancouver Utility directory structure
 #         - retaining support for new exportgen0/exportgen1 functions
 # exportgen1 enhanced to allow for IMMD new dir structure
 # - writes newgdgs to $JGDG (jobtmp/$jobid2/GDG) as following sample:
 #   $JGDG/@home@mvstest@testdata@data1@gl.account.master_000004
 # - full path name with '/'s replaced by '@'s
 # - can now retore '@'s to '/'s & move back to intended dir
 #
 function jobend51
 {
 JTMP=$RUNDATA/jobtmp/$jobid2
 JGDG=$JTMP/GDG
 # move any GDG files in jobtmp/GDG/... back to intended dirs
 # lsgdgs=$(ls $JGDG/* 2>/dev/null);  # capture filenames in GDG/...
 # if [[ -n "$lsgdgs" ]]; then
 ls $JGDG >$JTMP/gdgfiles
 if [[ -s $JTMP/gdgfiles ]]; then
    logmsg2 "moving $JGDG/files back to intended directories"
    for jgdgfpa in $JGDG/*
      { fpa=$(basename $jgdgfpa)
        fpd=$(echo $fpa | tr '@' '/')
        echo $fpd              # show filename on log
        mv -i $JGDG/$fpa $fpd  # move current file
        #====================
      }
 fi
 # call job to update the GDG control file for any prior gen# processing
 # - as indicated by exportgen0 functions within this job
 # - resets next gen# 000000 if indicated & expiry date:time past
 # - increments next gen# if processing range low to high & resets at end
 #Jun11/12 - make optional depending on env-var $GDGCTLUPDT
 if [[ "$GDGCTLUPDT" == "NO" ]]; then :
 else uvcopy gdgupok1
      #==============
 fi

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 #Apr20/15 - add code to test for GDG#s > threshold & resequence
 #  $JGDG/@home@mvstest@testdata@data1@gl.account.master_000004
 typeset -RZ6 fpfg         # 6 digits Right justified Zero filled
 exec 3<$JTMP/gdgfiles     # open file of GDG filenames
 while read -u3 fpaf extra
   do fpdf=$(echo $fpaf | tr '@' '/')
      fpd=${fpdf%/*}          # drop filename to get directories
      fpf=$(basename $fpdf)   # drop directories to get filename
      fpfb=${fpf%_*}_         # drop _gdg# & restore trailing '_'
      fpfg=${fpf##*_}         # drop filename_ to get gdg#
      if [[ $fpfg -gt 900000 ]]; then
         gdgreset1 $fpd $fpfb 900000 100001
         #=================================
      fi
   done
 #
 # disable any jobctl file for job ending (change name to allow inspection)
 test -f jobctl/$jobid2.ctl && mv jobctl/$jobid2.ctl jobctl/$jobid2.ctl_old
 #
 #Jan15/12 - call uvtime option D2 to report elapsed time of last step
 uvtime W1D2 steptimes
 uvtime W1D4 jobtimes NormalEnd
 return 0
 }
 #------------------------------ end jobend51 ----------------------------

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5K4. MVS JCL conversion - GDG functions

jobabend51 - support new GDG features (May 2007+)

 # jobabend51 - function called at Abnormal Termination of JCL/scripts
 #            - by Owen Townsend, UV Software, June 18/2007
 #            - ksh function stored in $APPSADM/sfun
 #            - see doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5
 # This function called at Abnormal Termination, to report new GDGs
 # NOT moved back from jobtmp/... to $RUNDATA/dir/...
 # also updates the gdgctl file, inserting an AB warning in history entries
 #
 #Nov10/14 - created from jobabend53 IMMD directory structure
 #         - restoring Vancouver Utility directory structure
 #         - retaining support for new exportgen0/exportgen1 functions
 # exportgen1 enhanced to allow for IMMD new dir structure
 # - writes newgdgs to $JGDG (jobtmp/$jobid2/GDG) as following sample:
 #   $JGDG/@immd@tidw@data@gg@pidw.prd.gg.cmperib_000003
 # - full path name with '/'s replaced by '@'s
 # - jobend51 restores '@'s to '/'s & move back to intended dir
 # - jobabend51 reports any GDG files NOT moved back to intended dir
 #
 function jobabend51
 {
 JTMP=$RUNDATA/jobtmp/$jobid2
 JGDG=$JTMP/GDG
 # note if any GDG files in jobtmp/...
 lsgdgs=$(ls $JGDG/* 2>/dev/null);  # capture filenames in GDG/...
 if [[ -n "$lsgdgs" ]]; then
    logmsg2 "jobabend51 ERR: GDG files NOT moved from jobtmp/... to intended dirs" RV
    logmsg2 "- can rerun OK, since GDGs not added to RUNDATA/dirs"
    logmsg2 "- OR restart at abterm step & reply y to move prompt"
 fi
 # report any GDG files in jobtmp/... NOT moved back to intended dirs
 # - also call uvcopy job to update gdgctl file with err entry
 lsjgdg=$(ls $JGDG)
 if [[ -n "$lsjgdg" ]]; then
    logmsg2 "jobabend51 ERR: $JGDG/files NOT moved back & listed below:"
    echo "$lsjgdg"          # list files not moved back
    # update control file - optional depending on env-var $GDGCTLUPDT
    # if [[ "$GDGCTLUPDT" == "NO" ]]; then
    #   uvcopy gdgupab1,fild1=$psd,arg1=$sd  # also lists files
    # fi
    #Oct18/14 - gdgupab1 needs work, can do later, since inhibited for IMMD
 fi
 # ensure operator acknowledges GDG files not moved back
 if [[ -n "$lsgdgs" ]]; then
    logmsg2 "- reply y/n acknowledge GDG msg, but no auto action" RV ACK
 fi
 # disable any jobctl file for job ending (change name to allow insection)
 test -f jobctl/$jobid2.ctl && mv jobctl/$jobid2.ctl jobctl/$jobid2.ctl_old
 uvtime W1D2 steptimes
 uvtime W1D4 jobtimes ***AbEnd
 return 0
 }
 #---------------------------- end jobabend51 --------------------------

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5M0. MVS JCL conversion - Generation files

Listings of uvcopy jobs used by GDG functions

Note
  • we will list only 2 jobs here (the 2 with active links)
  • you can inspect any others in /home/uvadm/pf/IBM/...
 5M1< jclgdgctl51   - create ctl/gdgctl51 file from all JCL/scripts
                      in directory jcls (converted to Korn shell scripts)

5M2. gdgload51 - load ctl/gdgctl51 file to indexed file ctl/gdgctl51I

5M3< gdgunload51 - convert indexed file back to text file for editing/reload


5M4. gdgget51 - used by exportgen1 to get max generations from the
indexed control file (ctl/gdgctl51I)
 5M5< gdgget52      - used by exportgen0 to determine next generation#
                    - checks gdgctl51I for over-ride to prior generation
 5M6< gdgupok1   - update gdgctl file at Normal EOJ
                    - called by jobend51 function
 5M7< gdgupab1   - update gdgctl file at Normal EOJ
                    - called by jobabend51 function

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5M2. MVS JCL conversion - uvcopy jobs called by GDG functions

gdgload51 - load indexed file ctl/gdgctl51I

 # gdgload51 - uvcopy job from UVSI stored in: /home/uvadm/pf/IBM/
 # gdgload51 - load ctl/gdgctl51 to indexed file ctl/gdgctl51I
 #          - by Owen Townsend, UV Software, May 31/2007
 #          - see doc at www.uvsoftware.ca/mvsjcl.htm#Part5
 #
 #Oct20/14 - clear any job=... stored by prior jclgegctl51
 #Oct17/14 - see uvcopy jclgdgctl51 create input for IMMD new dirs
 #Mar14/12 - define gdg file using $GDGCTL (default in profile $RUNDATA/ctl)
 #
 #           ** Op. Instrns. for VU JCL/scripts **
 #
 # Assuming - JCL/conversion completed for user 'mvstest'
 #          - JCLs converted to /home/mvstest/testlibs/jcl3/...
 #          - using jcl3 (all JCL/scripts)
 #          - since will copy jcl3/... to jcls/... 1 at a time for debug/test
 #
 # 1. Login mvstest --> /home/mvstest
 #
 # 2. cdl --> /home/mvstest/testlibs
 #
 # 3. uvcopy jclgdgctl51,fild1=jcl3,filo1=ctl/gdgctl51
 #    ================================================
 #    - prior job to create initital gdgctl51 (text file)
 #
 # 4. cp ctl/gdgctl51 $GDGCTL/ctl/    <-- copy to GDG control directory
 #    ============================
 #  NOTE - GDGCTL defined in profile, either $RUNDATA or $APPSADM:
 #
 # 4a. cp ctl/gdgctl51 $RUNDATA/ctl/  <-- $RUNDATA for programmer testing
 #     =============================    - separate sets of testdata files
 #
 # 4b. cp ctl/gdgctl51 $APPSADM/ctl/  <-- $APPSADM better for production
 #     =============================    - 1 control file for all GDG files
 #                                      - common set of production data files
 #
 # 5. cd $GDGCTL        <-- change to GDG ctlfile directory
 #    ==========
 #
 # 6. vi ctl/gdgctl51   <-- edit before loading Indexed file
 #    ===============     - modify no of generations (see sample below)
 #
 #*7. uvcopy gdgload51,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I
 #    =======================================================
 #    - load Indexed file for use by exportgen1, exportgen0,& jobend51
 #
 #Note - $GDGCTL in profile defines the 'ctl' control file directory
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 # The gdgctl file specifies the no of generations to be maintained by the
 # exportgen1 function which writes new generations & deletes oldest generations
 # The gdgctl file also provides prior generation exception processing
 # in conjunction with the exportgen0 function (see next=... examples below)
 #
 #                 ** sample input text file ctl/gdgctl51 **
 #
 # data1/gl.account.acntlist_ gdg=08
 # data1/gl.account.master_   gdg=10 next=000002(000002:000002)000000:000000
 # data1/gl.account.trans_    gdg=20 opt=c next=000001(000001:000012)070531:235959
 # data1/py.payroll.master_   gdg=30
 #
 # jclgdgctl51 creates only filenames & gdg=... with a default no of generations
 # You would then edit the text file modifying generations as desired
 #
 # You would probably not setup any next=... at this time, but it is possible
 #     next=gen###(lowgen:higen#)yymmdd:HHMMSS
 #     next=000000(000000:000000)000000:000000
 # - will be set all zeros by gdgload51 if not coded on input
 # - see field explanations & examples at www.uvsoftware.ca/mvsjcl.htm#Part_5
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 #               ** control file record format ctl/gdgctl51I **
 #
 # 000:049 - filename example--> data1/gl.account.master_ <--trailing underscore
 # 051:056 - gdg=..   - generations for this file (default set in jclgdgctl51)
 # 058:062 - opt=c    - option for oprtr confirm y or enter alternate gen#
 # 064:102 - next=... any input verified & adjusted to bytes 064-103
 #           next=gen###(lowgen:higen#)yymmdd:HHMMSS
 #           next=000000(000000:000000)000000:000000
 #           zeros template/place-holder generated if not coded
 # 104:113 - jobname of last JCL/script to access this file
 #         - signal to jobend function to reset next=... as appropriate
 #           (reset next=000000 &/or increment next=... from low to high)
 # 114:126 - date/time yymmdd:HHMMSS file created by exportgen1
 #         - used by gdgupok1 to '+' flag history entry last exportgen1
 #
 # 128:191 - 1st entry of multiple action history entries
 #         - yymmdd:HHMMSS:g0_123456(123456:123456)JOBNAME  S1234 PROGRAM +
 #         - stored by exportgen0, exportgen1, jobend51?, jobend52?
 #         - action entries shifted down & latest action stored here
 # 190:190 - gdgupok1 '+' flag if moved back from jobtmp/subdir (exportgen1)
 #
 # 192:255 - update history#2 (shifted from 128-191 by jobend51)
 # 256:319 - update history#3 (shifted from 192-255)
 # 320:1983-  --- entries #4-#29 ---
 #1984:2045- update history#30
 #2046:2046- '.' period marking end of record data
 #2047:2047- x'0A' Indexed record status byte
 #         - see explanations & examples at www.uvsoftware.ca/mvsjcl.htm#Part_5
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 opr='load gdgctl text file to Indexed file, shifting keywords over for maxkey'
 was=c5000
 fili1=?${GDGCTL}/gdgctl51,rcs=256,typ=LST
 filo1=?${GDGCTL}/gdgctl51I,rcs=2047,typ=ISF,isk1=0(50)
 #
 # load zeros entries for next gen# & exportgen0 update/history entries
 #         1         2         3         4         5         6         7
 #1234567890123456789012345678901234567890123456789012345678901234567890
 lodv3=k0(100)
 next=gen###(lowgen:higen#)yymmdd:HHMMSS               <-- next gen# override
 next=000000(000000:000000)000000:000000
 next=######(######:######)######:######               <-- verify user coding
 yymmdd:HHMMSS:G1_123456(123456:123456)jobname  S1234 programid  <-- history
 000000:000000:___000000(000000:000000)_______  _____ _________
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #1234567890123456789012345678901234567890123456789012345678901234567890
 #         1         2         3         4         5         6         7
 @run
        opn    all                    open I/O files
        sxo    128,'0(50)'            open the sort
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 # begin loop to get records, reformat,& put to the sort
 # - if codes on right (gdg=..., etc) prior to col 51
 #   shift over to allow 50 bytes for the filename key
 man20  get    fili1,a0(200)          get ctlfile record
        skp>   man40
        cmc    a0(1),'#'              comment line ?
        skp=   man20                  yes - bypass, get next
        clr    b0(200),' '            clear reformat area
        mvu    b0(80),a0,' '          move filename until ending blank
        scnp   a0(80),' &'            scan to 1st nonblank folwng filename
        mvc    b50(80),ax0            ensure 50 bytes allowed for filenames
 #
 # clear cnt=... & job=... Oct20/2014
        scn    b0(150),' cnt='        cnt=... to be cleared
        skp!   1
        clr    bx0(10),' '            clear cnt=...
        scn    b0(150),' job='        job=... to be cleared
        skp!   1
        clr    bx0(20),' '            clear job=...
 #
 # test for next=... coded on input, ifso verify & shift to byte 64
 # - else insert zeros entry at byte 64
 man30  scn    b0(80),' next='
        skp!   man36
        mvc    n0(40),bx1             isolate user's next=... entry
        clr    bx0(40),' '            clear next=... from original position
        cmcp   n0(40),k200(40)        verify users coding with table pattern
        skp!   err1
 man34  mvc    b64(40),n0             restore user entry to byte 64+
        skp    man38
 #
 # - user next=... entry not coded, insert zeros entry at byte 64
 man36  mvc    b64(40),k100           store zeros entry at byte 64+
 #
 # common point to put record to the sort
 man38  sxp    b0(128)                put to the sort
        skp    man20                  repeat loop get/put to sort
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 # end of input - now execute the sort
 man40  sxs                           execute the sort
 #
 # begin loop to get sorted records & load to Indexed file
 man50  sxg    c0(128)                get record from the sort
        skp>   man90
 #
 # create zeros entries for exportgen0,1,jobend update/history slots
 # - create zero entry only for 1st or for all by move overlapping ??
 man52  mvc    c128(64),k400          create zeros action history entrie#1
        mvc    c192(1920),c128        move overlap to create all 30 entries
        mvc    c2046(1),'>'           mark last data byte of record
        put    filo1,c0(2047)         write record to output file
        skp    man50                  repeat loop get/put sorted recs
 #
 # end of sorted records - close files & eoj
 man90  cls    all
        eoj
 #--------------------------------------------------------------------
 # Err rtns
 err1   msg    n0(40)                show users next=... entry
        msg    k0(40)                show next=... valid format
        msgw   'ERR: next=... format invalid, should fix & reload'
        mvc    b123(4),'err1'        flag record in error
        skp    man34
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

5M4. MVS JCL conversion - uvcopy jobs called by GDG functions

gdgget51 for exportgen1 to get max gens from gdgctl51I

 # gdgget51 - get gdg=... for any file in $GDGCTL/gdgctl51I
 #          - called by exportgen1 function
 #          - by Owen Townsend, UV Software, May 2007
 #          - see GDG doc at www.uvsoftware.ca/mvsjcl.htm#Part_5
 #
 #Aug19/20 - $JOBID2 changed to $jobid2 lower case to match
 #           jobset51/53,jobend51,jobabend51, exportfile, exportgen0/1
 #         - only code change in table k800  ${JOBID2} --> ${jobid2}
 #Mar14/12 - define gdg file using $GDGCTL (default in profile $RUNDATA/ctl)
 #Jan08/11 - exportgen1,2,3 combined into exportgen1
 #         - exportgen1 arg1 now +1,+2,+3,etc max 50
 #Apr16/09 - GDG control files moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/...
 #           to allow multiple $RUNDATA's to have different control files
 #Oct25/08 - chg to manulock filr1 typ=ISFl4, redm5l4, updl4
 #Sep03/08 - add autolock option l2 on filr1=ctl/gdgctl51I,typ=ISFl2
 #Aug26/08 - increase recsize to 2047+1=2048 (allows 30 history entries)
 #Aug28/08 - name changes getgdg51->gdgget51,getgdg52->gdgget52,
 #           gdgctlload1->gdgload51,gdgctlunload1->gdgunload51
 #           gdgctlupok1->gdgupok1,gdgctlupab1->gdgupab1
 #
 # gdgget51 called by exportgen1 as follows:
 #
 # uvcopy gdgget51,fili1=$lslbls,filo2=$lblcG,arg1=$lblb,arg2=$gen2,arg3=$gn
 # =========================================================================
 # - arg3 +1,+2,+3,etc max 50
 # - use arg1=... filename as key to read Indexed file & return gdg=... value
 #
 # gdg=$?     <-- calling script can capture gdg=... from return code
 # ======
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 #                        ** gdgget5_ versions **
 #
 #*gdgget51 - this version called by exportgen1
 #          - to lookup ctl/gdgctl51I to get no of generations for the file
 # gdgget52 - version called by exportgen0
 #          - allows for prior version selection via ctl/gdgctl51
 #
 #               ** control file record format ctl/gdgctl51I **
 #
 # 000:049 - filename example--> data1/gl.account.master_ <--trailing underscore
 # 051:056 - gdg=..   - generations for this file (default set in jclgdgctl51)
 # 058:062 - opt=c    - option for oprtr confirm y or enter alternate gen#
 # 064:102 - next=... any input verified & adjusted to bytes 064-103
 #           next=gen###(lowgen:higen#)yymmdd:HHMMSS
 #           next=000000(000000:000000)000000:000000
 #           zeros template/place-holder generated if not coded
 # 104:113 - jobname of last JCL/script to access this file
 #         - signal to jobend function to reset next=... as appropriate
 #           (reset next=000000 &/or increment next=... from low to high)
 # 114:126 - date/time yymmdd:HHMMSS file created by exportgen1
 #         - used by gdgupok1 to '+' flag history entry last exportgen1
 #
 # 128:191 - 1st entry of multiple action history entries
 #         - yymmdd:HHMMSS:g0_123456(123456:123456)JOBNAME  S1234 PROGRAM +
 #         - stored by exportgen0, exportgen1, jobend51?, jobend52?
 #         - action entries shifted down & latest action stored here
 # 190:190 - gdgupok1 '+' flag if moved back from jobtmp/subdir (exportgen1)
 #
 # 192:255 - update history#2 (shifted from 128-191 by jobend1)
 # 256:319 - update history#3 (shifted from 192-255)
 # 320:1983-  --- entries #4-#29 ---
 #1984:2045- update history#30
 #2046:2046- '.' period marking end of record data
 #2047:2047- x'0A' Indexed record status byte
 #         - see explanations & examples at www.uvsoftware.ca/mvsjcl.htm#Part_5
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 uop=i31
 was=a2000c9000k2000
 filr1=${GDGCTL}/gdgctl51I,typ=ISFl4s2,rcs=2047,isk1=0(50)
 fili1=?lslbls,rcs=128,typ=LST
 filo2=?gdgctl1,rcs=128,typ=LSTt
 # load zeros entries for next gen# & exportgen0 update/history entries
 #         1         2         3         4         5         6         7
 #1234567890123456789012345678901234567890123456789012345678901234567890
 lodv3=k0(100)
 next=gen###(lowgen:higen#)yymmdd:HHMMSS               <-- next gen# override
 next=000000(000000:000000)000000:000000
 next=######(######:######)######:######               <-- verify user coding
 yymmdd:HHMMSS:00 123456(123456:123456)jobname  S1234 programid  <-- history
 000000:000000:01+000000(000000:000000)_______  _____ _________
 ######:######:                                        <-- verify history ents
 $date1:$time1                                         <-- values inserted above
 ${JSTEP}
 ${jobid2}
 ${PROGID}
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #1234567890123456789012345678901234567890123456789012345678901234567890
 #         1         2         3         4         5         6         7
 # k000=next=gen#..., k100=next=000..., k200=next=###...
 # k300=yym..., k400=000..., k500=###...
 # k600=$date1:$time1, k700=${JSTEP}, k800=${jobid2}, k900=${PROGID}
 #
 # uvcopy gdgget51,fili1=$lslbls,filo2=$lblcG,arg1=$lblb,arg2=$gen2,arg3=+1
 # ========================================================================
 # - use arg1=... filename as key to read Indexed file & return gdg=... value
 # - arg3 +1,+2,+3,etc max 50
 @run
        opn    all                     open files
        mvn    g0(6),$arg2(6)          store gen# selected by exportgen1
        mvn    $ca1,$arg3(4)           store gen desired +1,+2,+3,etc
        mvn    g30(3+),$ca1            store gen for history update
        mvc    g50(30),$jobstamp       retrieve yymmdd:HHMMSS:JOBID
 #
 # begin loop to read ls filenames to get low & high gen#s for history entry
 # - disregard gen _000000, created to avoid problems when no existing files
 man20  get    fili1,a0(200)           get next ls filename
        skp>   man26
        mvc    a200(200),a0            save high entry before EOF
        cmn    g10(6),0                low gen# already stored ?
        skp>   man20
        scnr   a0(90),'_'              scan back to '_' ID gdg#
        mvc    g10(6),ax1              save low gen# for history
        skp    man20
 #
 # EOF - extract high gen# from saved last record before EOF
 man26  scnr   a200(90),'_'            scan back to '_' ID gdg#
        mvc    g20(6),ax201            save high gen# for history
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 # store filename key from arg1 & perform random read
 man30  mvf    c0(2047),$arg1(50)      store key from arg1 in I/O area
        redm5l4 filr1,c0(2047)         perform random read by key =
        skp>   err1
        skp<   nolock
 #
 # store $jobid2,date/time so gdgupok1 can flag '+' entries from exportgen1
        mvc    c104(10),k800           jobid2
        mvc    c114(13),g50            date:time stamp
        put    filo2,c0(128)           write output to $JTMP/...
 # output file not used (as of June2007), return code used to return gdg=...
        scn    c0(80),' gdg='          scan record for gdg=...
        skp!   err1
 #
 # store gdg=... value for return code
 man40  mvn    $ca2,cx5(3)             store gdg for return code
 #
 # build history action entry for exportgen0 in w/s for later move to ctlrec
 man50  mvc    k400(13),k602           date:time
        mvc    k414(3),g30             arg3 01+,02+,etc
        mvc    k417(6),g0              gen# selected
        mvc    k424(6),g10             low gen#
        mvc    k431(6),g20             high gen#
        mvc    k438(9),k800            jobid2
        mvc    k447(5),k700            STEP#
        mvc    k453(9),k900            PROGID
 #
 # shift history down & insert new entry & update GDG control record
        mvc    c5000(1920),c128        save current history
        mvf    c128(64),k400(64)       store new entry
        mvc    c192(1856),c5000        restore history shifted down
        mvc    c2046(1),'>'            restore EOR ID char
        updl4  filr1,c0(2047)          update gdgctl rec for jobend51
        skp!   err2
 #
 # error check gen request +1,+2,+3 etc max 50
        cmn    $ca1,1                  err chk gen request
        skp<   err3
        cmn    $ca1,50
        skp>   err3
 #
 # common point to close file, cancel job,& return gdg value or 0
 man90  cls    all                     close files
        can    ' ',$ca2                cancel with return code gdg or 91
 #
 #Jun11/12 - err1 was setting $ca2=0, now changed to 91
 #
 # redm5l4 returned < already locked - prompt oprtr to retry
 nolock msg    c0(50)                  show filename locked
        msgw   'ctl/gdgctl51I record locked for filename above - enter to retry'
        skp    man30
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 #---------------------------------------------------------------------
 # filename not found or no gdg=... value coded in gdgctl file
 err1   msg    c0(80)                  show filename not found
        msg    'ERR: arg1 filename_ matches no filename_ in ctl/gdgctl51I'
        msgw   '- may continue, will use gdg default coded in exportgen1'
        mvn    $ca2,91                 set return code 91
 ##     skp    man50                   go store history entry in gdgctl
 ##Nov25/10 - chg man50 to man90, cant update if have not read
        skp    man90                   go end job & return 0
 #
 err2   msg    c0(80)                  show filename update err
        msgw   'ERR: updating gdgctl51I record for jobend action'
        can    ' ',92
 #
 err3   msg    c0(80)                  show filename update err
        msgwv1   'ERR: gen request=$ca1, must be +1,+2,+3,etc max 50'
        can    ' ',93
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_6 Converting 'YOUR' MVS JCL to Korn shell scripts

OPTIONAL jobs depending on site preferences

Part 6 documents optional jobs that might be required or desired at some sites. Part 4 (which documents the step by step conversion procedures) will refer you to Part 6 for these optional procedures.

Optional jobs are documented very briefly in Part 4 with references to details & examples elsewhere (such as here in Part 6).


6A1. Assigning mainframe files to sub-directories on unix/linux systems.
You might want to use the top-node of DSNs as a sub-directory, rather
than storing all data files in 1 directory. You can do this using the
TOPNODES table in the JCL conversion control file (jclunixop51).

6B1. Alternate illustrations of topnode/subdir assignment, based on longer
more complex DSNs than those used in the 'mvstest' demos of Part_1.

6C1. creating JCL conversion control files.
 The JCL converter uses an Indexed file 'ctl/datactl53I' to get information
 about data-files (record-size, file-type, key-location/length, GDG or not).
 'ctl/datactl53I' may be created from up to 6 component control files
- the 1st component ctl/datajcl52 is extracted from the JCL itself
  and its creation is documented in Part 4 on pages '4K1' - 4K3.
- the other 5 optional components are documented here in Part 6.

6D1. jobparmx1/jobparms1 (optional) can be used to extract control cards
 from all JCLs so you can update them separately form the JCL/scripts.
 The control card files are date-stamped to allow updates for future dates.
- see details & examples begining on page '6D1'.

6E1. jclstrip1 - cleanup converted JCL/scripts
- remove non-essential code & extraneous comments
- remove mainframe steps that do not apply to unix/linux
- remove commented original JCL stmnts that may have been
  useful during conversion & testing

6F1. Manual changes for DDNAMEs required in scripts converted from JCL,
if the DDNAME is a forward reference. This sometimes occurs in a multi-part
file when 1 part is a DDNAME reference to INSTREAM data which is declared
after the multi-part file.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6A1. Optional Preparations depending on site preferences

assigning mainframe files to subdirs

You might want to use the top-node of DSNs as a sub-directory, rather than storing all data files in 1 directory. You can do this using the TOPNODES table in the JCL conversion control file (jclunixop51). To illustrate this, we will first show you some sample DSNs & the converted equivalents, based on the demo JCL conversions documented in 'Part_1'.

sample Mainframe JCL DSNs

 //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER,DISP=SHR
 //SORTIN   DD DSN=AR.SALES.ITEMS,DISP=SHR
 //SORTOUT  DD DSN=&&TEMPSLS,DISP=(NEW,PASS),
 //GLMSOLD  DD DSN=GL.ACCOUNT.MASTER(0),DISP=OLD
 //GLMSNEW  DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE),

files in data1/all.nodes.retained - CURRENT

exportfile CUSTMAS data1/ar.customer.master exportfile SORTIN data1/ar.sales.items exportfile SORTOUT $JTMP/__tempsls exportgen0 0 GLMSOLD data1/gl.account.master_ exportgen1 +1 GLMSNEW $JTMP/data1/gl.account.master_ #exportgen1 assign $JTMP/GDG/file, move to subdir/file at Normal EOJ exportfile PAYMSTR data1/pytest.payroll.master

 /home/mvstest         <-- $RUNDATA - all datafiles in data1/...
 :-----testdata          - test/demo data files supplied
 :     :-----data1/...   - all datafiles in data1/...existing.nodes.retained...
 :     :-----jobtmp      - temporary files new GDGs, SYSINs, etc
 :     :-----tmp         - tmp subdir for uvsort & misc use
 :     :-----wrk         - interstep temporary work files

using topnodes as subdirs - OUT-DATED

exportfile CUSTMAS ar/customer.master exportfile SORTIN ar/sales.items exportfile SORTOUT $JTMP/__tempsls exportgen0 0 GLMSOLD data1/gl.account.master_ exportgen1 +1 GLMSNEW $JTMP/data1/gl.account.master_ #exportgen1 assign $JTMP/GDG/file, move to subdir/file at Normal EOJ exportfile PAYMSTR misc/pytest.payroll.master

 /home/mvstest         <-- $RUNDATA subdirs - from topnodes/...
 :-----testdata          - test/demo data files supplied
 :     :-----ar/...      - A/R datafiles in ar/... subdir (topnode AR.)
 :     :-----gl/...      - G/L datafiles in gl/... subdir (topnode GL.)
 :     :-----py/...      - Payroll datafiles in py/... subdir (topnode PY.)
 :     :-----misc/...    - other topnodes in misc/... subdir (see control table)
 :     :-----jobtmp      - temporary files for SYSIN instream data
 :     :-----tmp         - tmp subdir for uvsort & misc use

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6A2. Optional Preparations depending on site preferences

topnode/subdirs OR all files in data1/... ?

To help you decide whether to use topnodes as subdirs, OR put all datafiles in data1/..., you can run 'statmvsjcl1' to table summarize existing topnodes used in your mainframe JCL.

Here are the operating instructions illustrated for the mvstest demos (Part_1).

statmvsjcl1 - create JCL summary table stats


 #1. login mvstest ---> /home/mvstest

 #2. cdl ---> $RUNLIBS ---> /home/mvstest/testlibs

 #3. uvcopy statmvsjcl1,fild1=jcl2    (fild1=... defines input directory)
     =============================
     - creates 3 table summaries in stats/... (programs,procs,& topnodes)
     - see topnodes on next page, see other reports on page '2K2'

 #4. uvlp12 stats/jcl0_topnodes   <-- print result (stored in stats subdir)
     ==========================

stats/jcl2_topnodes summary table

 statmvsjcl1  2008/08/08_20:03:18  Summary table of DSN Top-Nodes in jcl0
 tbl#003 pg#001     -argument-
 line#  count    %  Top-Node
     1      27  19  &&(ALLTempFiles)
     2      33  23  AR
     3      57  41  GL
     4      10   7  PY
     5       5   3  PYTEST
     6       2   1  RPTS
     7       3   2  WRK
     8       1   0  WRK(IKJDEMO1)
           138*100   *TOTAL*

From the table summary above, you can see that sub-dirs such as AR & GL have high file counts, and others such as PYTEST have low files counts.

You might want to use a separate subdirs for files with high-count topnodes, but combine low-count files into 1 'misc' subdir. On the following pages, we will show you how to do that, using the TOPNODES table in the JCL conversion control file (jclunixop51).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6A3. Optional Preparations depending on site preferences

Modifying JCL conversion control table

The JCL conversion control table is designed for the 'mvstest' demo JCL & the TOPNODES table (about line 75+) converts topnodes to subdirs. The control file is supplied in /home/uvadm/mvstest/testlibs/ctl/jclunixop51. It is copied to /home/mvstest/testlibs/ctl/jclunixop51 if you perform the 'mvstest' demos in 'Part_1'.

mvstest demo control file - uses topnodes as subdirs

Here are lines 67-97 extracted from /home/mvstest/testlibs/ctl/jclunixop51:

 # TOPDIRDEFAULT - used if only 1 node (no High Level Qualifier) in DSN
 #               - should specify in case no HLQ present on DSN
 #               - recommend '$WRK' or 'wrk' (1 node files likely temp files)
 # TOPDIRINSERT - if specified, will be inserted above HLQ, retaining all '.'s
 #              - vs replacing HLQ/topnode
 #              - omit (leave tildes) to convert HLQ's to subdirs
 #              - if specified, I recommend 'mstr'
 :CTLTBL:
 TOPDIRDEFAULT~~~~~~~~~~~~~~~~~$WRK~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINSERT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  <-- omitted
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # table of TOPNODES allowed & replacements (optional)
 # 01-30 - topnodes allowed
 # 31-60 - topnode replacements (if col 31 not '~')
 # - if 01-30 of last entry is 'ALLOTHER'
 #   then any others replaced by 31-60 of last entry
 :TOPNODES:
 ar~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 gl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~  <-- TOPNODES spcfd
 py~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 rpts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Compare above control file (for datafiles in topnode/subdirs) with the control file on the next page (for all datafiles in 1 directory).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6A4. Optional Preparations depending on site preferences

changing control file for all datafiles in data1/...

If you wish to assign all datafiles into 1 directory (such as data1/...), with filenames unchanged (retain all nodes), you would change lines 67-97 of the control file as follows (demo for mvstest).


 #1. login mvstest ---> /home/mvstest

 #2. cdl ---> $RUNLIBS ---> /home/mvstest/testlibs

 #3. vi ctl/jclunixop51        <-- edit JCL conversion control file
     ==================

 #3a. code 'TOPDIRINSERT' as 'mstr' (supplied as null/tildes)

 #3b. remove existing TOPNODES table entries (supplied as ar,gl,py)

control file - AFTER change for all datafiles in data1/...

 # TOPDIRDEFAULT - used if only 1 node (no High Level Qualifier) in DSN
 #               - should specify in case no HLQ/topnode present on DSN
 #               - recommend '$WRK' or 'wrk' (1 node files likely && temp files)
 # TOPDIRINSERT - if specified, will be inserted above topnode, retain all '.'s
 #              - vs replacing HLQ/topnode
 #              - omit (leave tildes) to convert HLQ's to subdirs
 #              - if specified, I recommend 'mstr'
 :CTLTBL:
 TOPDIRDEFAULT~~~~~~~~~~~~~~~~~$WRK~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINSERT~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~  <-- insert 'mstr'
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # table of TOPNODES allowed & replacements (optional)
 # 01-30 - topnodes allowed
 # 31-60 - topnode replacements (if col 31 not '~')
 # - if 01-30 of last entry is 'ALLOTHER'
 #   then any others replaced by 31-60 of last entry
 :TOPNODES:
 # --- omitted, since 'mstr' spcfd for TOPDIRINSERT above ---  <-- omit TOPNODES
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~      (ar,gl,py)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6B1. Optional Preparations depending on site preferences

alternate demo - assigning mainframe files to subdirs

The pages above illustrated mainframe file assignment to topnode/subdirs, based on the 'mvstest' demos of Part_1.

The following pages present alternate illustrations of topnode/subdir assignment, based on longer more complex DSNs that are used on many mainframes.

sample Mainframe JCL data file names

      //C9INFILE DD DSN=H200PALI.T300.F075.DDF(0)
      //C9UNEARN DD DSN=H200PALK.NIXX.C9R13.UNEARN(0)
      //CCRDJRNL DD DSN=H200PFHB.NIXX.C9R01.CCRDJRNL(+1)
      //C9VSEQOP DD DSN=H200PFHD.VIXX.C9RVH.IIVSEQOP
      //SORTOUT  DD DSN=H200PKAH.NIXX.C9R09.TEMPRECS,
      //C9RPSFLE DD DSN=H200PMSF.NIXX.C9R01.C9RPSFLE(+1)

sample data file names after conversion to ksh

      exportgen0 0 C9INFILE h200pali/t300.f075.ddf_
      exportgen0 0 C9UNEARN h200palk/nixx.c9r13.unearn_
      exportgen1 +1 CCRDJRNL $JTMP/h200pfhb/nixx.c9r01.ccrdjrnl_
      exportfile C9VSEQOP h200pfhd/vixx.c9rvh.iivseqop
      exportfile SORTOUT h200pkah/nixx.c9r09.temprecs
      exportgen1 +1 C9RPSFLE $JTMP/h200pmsf/nixx.c9r01.c9rpsfle_

The conversion default has converted the top-node to a subdir. You can see that the top-nodes used on the mainframe would be unnecessarily long when used as subdirs on Unix/Linux. The system was all 'H200' & the 'P' was for Production (vs Test), which we don't need since we handle prod/test with environmental variables on Unix/Linux.

In this case, it might make sense to convert the top-nodes to 3 character subdirs as shown below. This is a good example of something we can do during conversion to make it simpler & easier to work with for many years to come.

preferred data file subdirs after conversion to ksh

exportgen0 0 C9INFILE ali/t300.f075.ddf_ exportgen0 0 C9UNEARN alk/nixx.c9r13.unearn_ exportgen1 +1 CCRDJRNL $JTMP/fhb/nixx.c9r01.ccrdjrnl_ exportfile C9VSEQOP fhd/vixx.c9rvh.iivseqop exportfile SORTOUT kah/nixx.c9r09.temprecs exportgen1 +1 C9RPSFLE $JTMP/msf/nixx.c9r01.c9rpsfle_

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6B2. Modifying the control file to improve conversion

corresponding Directory Design

 /p1/apps
 :-----testdata          <-- RUNDATA=/p1/apps/testdata
 :     :-----ali
 :     :-----alk
 :     :-----fhb         <-- subdirs for above sample data files
 :     :-----fhd
 :     :-----kah
 :     :-----msf
 :     :-----misc        <-- subdir for low volume files to be combined
 :     :-----jobtmp
 :     :-----......      <-- see other required subdirs on page '6B4'

Researching top-nodes present in your JCL

You can use the 'statmvsjcl1' utility to read all your JCL & create a summary table of all top nodes used. You will probably want to use a separate subdir for top-nodes with high file counts, but combine files into 1 'misc' subdir for top-nodes with low file counts.

We will show you later how to use the control file 'TOPNODES' replacement table, but first we will run 'statmvsjcl1' to create the summary table to help us decide which top-nodes are to be combined into 'misc'.

statmvsjcl1 - create JCL summary table stats


 #1. login appsadm ---> /home/appsadm

 #2. cdl ---> $RUNLIBS (/p1/apps/testlibs, using file design from page '6B3')

 #3. uvcopy statmvsjcl1,fild1=jcl2    (fild1=... defines input directory)
     =============================
     - creates 3 table summaries in stats/... (programs,procs,& topnodes)
     - see topnodes on next page, see other reports on page '2K2'

 #4. uvlp12 stats/jcl2_topnodes   <-- print result (stored in stats subdir)
     ==========================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6B3. Modifying the control file to improve conversion

sample top-node summary table

 Job: table3d Dir: jcl2 Keyword(s): DSN
 Qual1: .  Qual2: &  Blanked: .='" Userops: q1c0f0l0k0m0p1w1
 table3d  2007/09/13_08:56:35  Counts by Targetword following specified Keyword
 tbl#001 pg#001     -argument-
 line#  count    %  target-word
     1     358   6   H200P
     2     623  11   H200PALI
     3     609  11   H200PALK
     4     619  11   H200PFHB
     5     600  11   H200PFHD
     6     610  11   H200PKAH
     7   1,268  24   H200PMSF
     8      22   0   J300PALI
     9      21   0   J300PALK
    10       3   0   IATM
    11       1   0   IATMPN
    12       4   0   PSTTMR6
    13       8   0   SYS1
         5,272*100   *TOTAL*

select desired top-nodes

Use the table3d analysis above to decide which top-nodes you wish to retain and all others can be consolidated into a 'misc' subdir, by coding the 'TOPNODES' table in the control file (ctl/jclunixop51).

TOPNODES table (part of ctl/jclunixop51)

 # table of TOPNODES allowed & replacements (optional)
 # 01-30 - topnodes allowed
 # 31-60 - topnode replacements (if col 31 not '~')
 # - if 01-30 of last entry is 'ALLOTHER'
 #   then any others replaced by 31-60 of last entry
 :TOPNODES:
 h200pali~~~~~~~~~~~~~~~~~~~~~~ali~~~~~~~~~~~~~~~~~~~~~~~~~~~
 h200palk~~~~~~~~~~~~~~~~~~~~~~alk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 h200pfhb~~~~~~~~~~~~~~~~~~~~~~fhb~~~~~~~~~~~~~~~~~~~~~~~~~~~
 h200pfhd~~~~~~~~~~~~~~~~~~~~~~fhd~~~~~~~~~~~~~~~~~~~~~~~~~~~
 h200pkah~~~~~~~~~~~~~~~~~~~~~~kah~~~~~~~~~~~~~~~~~~~~~~~~~~~
 h200pmsf~~~~~~~~~~~~~~~~~~~~~~msf~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  1. Top nodes with significant counts in table3d (at top of page) are allowed for (& possibly modified) in the TOPNODES table above

  2. 'H200P' had significant count, but these were all library files & libraries are handled differently in the converted JCL/scripts (using $RUNLIBS defined in profiles for Production & Test libraries)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6B4. Modifying the control file to improve conversion

TOPNODES table - alternative

But if you wanted to retain your original 'topnodes' as 'subdirs', you would simply leave the right side of the replacement table all tildes as shown below.

Then only the left-side topnodes become subdirs & 'ALLOTHERS' are changed to to 'misc'.

 # table of TOPNODES allowed & replacements (optional)
 # 01-30 - topnodes allowed
 # 31-60 - topnode replacements (if col 31 not '~')
 # - if 01-30 of last entry is 'ALLOTHER'
 #   then any others replaced by 31-60 of last entry
 :TOPNODES:
 h200pali~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 h200palk~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 h200pfhb~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 h200pfhd~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 h200pkah~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 h200pmsf~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

sample JCL DSNs - BEFORE conversion

 //C9VSEQOP DD DSN=H200PFHD.VIXX.C9RVH.IIVSEQOP
 //SORTOUT  DD DSN=J300TEMP.NIXX.C9R09.TEMPRECS,

sample filenames - AFTER conversion

exportfile C9VSEQOP h200pfhd/vixx.c9rvh.iivseqop

exportfile SORTOUT misc/h200pkah.nixx.c9r09.temprecs

Note
  • filenames in the 'misc' directory will retain all nodes
  • filenames with topnode/subdirs will have 1 less node

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6B5. Modifying the control file to improve conversion

confirming top-node/subdirs in converted scripts


 #1. login appsadm ---> /home/appsadm
 #2. cdl ---> $RUNLIBS

 #3. uvcopy statksh1,fild1=jcl3   <-- create table stats from Korn shell scripts
     ==========================

 #4a. vi stat/jcl3_topnodes      <-- view topnode/subdir table summary
      =====================

 #4b. uvlp12 tmp/jcl3_topnodes   <-- print result
      ========================

sample top-node summary - after conversion

 Job: table3d Dir: jcl3 Keyword(s): exportfile:exportgen0:exportgen1
 Qual1: .  Qual2:   Blanked: /. Userops: q1c0f0l0k0m0p1w1w2
 table3d  2007/09/13_08:53:41  Counts by Targetword following specified Keyword
 tbl#001 pg#001     -argument-
 line#  count    %  target-word
     1     458  12   ali
     2     451  12   alk
     3     461  13   fhb
     4     451  12   fhd
     5     447  12   kah
     6     891  25   msf
     7     269   7   misc
         3,541*100   *TOTAL*

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6C1. Optional Preparations depending on site preferences

creating JCL conversion control file

The JCL converter needs an Indexed file 'ctl/datactl53I' to get information about the data-files (record-size, file-type, key-location/length, GDG or not). This info is required for SORTs, IDCAMS, IEBGENER, etc that are converted to uvsort & uvcp.

The mainframe JCL did not necessarily specify record-size etc, since this info could be obtained from the mainframe VTOC or LISTCAT. But there is no VTOC or LISTCAT on unix/linux, so we will supply that info to the JCL converter via an Indexed file (ctl/datactl53I). We can collect datafile info from 6 sources as described below.

The only mandatory source is the JCL itself. Utility job 'jcldata51' will extract all DSN's from all JCL. These are sorted & duplicates dropped resulting in 1 line per unique datafilename found in all JCL. The output is written to ctl/datajcl51. A 2nd utility 'jcldata52' then converts the mainframe filenames to the conventions used in the Korn shell scripts:

The next page will summarize the creation of the 6 possible information files. Utility ctldat53 is then used to combine all 6 files. Script 'jcldata51A' is an easier way to run ctldata53 & also create the Indexed file used by the JCL converter to get file info (record sizes,etc).

The 5 optional information files must have been created before you run jcldata51A (or 'jcl2ksh51A' which performs all steps of JCL conversion). Just make null files for any of the 5 optional information sources that you do not have.

Create JCL conversion control file ctl/datactl53I

Note
  • script 'jcldata51A' will create the JCL converter control file
  • the command is shown below, BUT you can NOT run it now
  • See it's logical sequence on page '4K3'
  • 1st we will show you the 6 possible components of ctl/datactl53I

 #5. jcldata51A  <-- create datajcl51 & datajcl52 & sort 6 files together:
     =========      (datajcl52+datacat52+dataxl152+dataxl252+dataedt52+datacnv52)
                  - to create datactl53 & load Indexed file datactl53I

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6C2. Creating the JCL conversion control file

6 sources for JCL conversion control file

 We show the uvcopy utility jobnames below the -------> lines. For example
 uvcopy job 'jcldata51' is used to create 'ctl/datajcl51', which is then
 processed/resorted by 'jcldata52' to create 'ctl/datajcl52'.

 #1. JCL -----------> ctl/datajcl51 -----------> ctl/datajcl52
          jcldata51                  jcldata52

 #2. LISTCAT -----------> ctl/datacat51 -----------> ctl/datacat52
              catdata51                  catdata52

 #3. Excel spreadsheet#1 -----------> ctl/dataxl151 ----------> ctl/dataxl152
                          xl1data51                  xldata52

 #4. Excel spreadsheet#2 -----------> ctl/dataxl251 -----------> ctl/dataxl252
                          xl2data51                  xl2data52

 #5. ----------> ctl/dataedt52
      editor

 #6. EBCDIC datafiles -----------> ctl/datacnv51 -----------> ctl/datacnv52
                       cnvdata51                  cnvdata52

 #7. Six ...52 files above -----------> ctl/datactl53 -----------> ctl/datactl53I
                            ctldata53                  uvcp (load Indexed file)
Note
  • dataedt52 may be the only file you can edit to add any missing info
  • because most other files would be overwritten by reruns
  • You could edit the Excel spreadsheets & rerun those extraction jobs
  • But Excel spreadsheets extract jobs require customization for your site

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6C3. Creating the JCL conversion control file

samples of 6 datafile info sources

Here are just a few lines of all 6 info files that might be used to supply record-sizes, file types, keyloc/keylen, copybooknames, etc for both JCL & DATA file conversion.

sample input#1 - datajcl51


 #01 DB2.PROD.DWPARM(QUDW33)                cntf=0002 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdwkscix prg=DSNUTILB
 #02 DBDPCSM.CSM288.$KM001.BATCH.%%MDY      cntf=0014 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800
 #03 DBDPCSM.CSM288.$KM001.SYNTAX.%%MDY     cntf=0007 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800
 #04 DBDPCSM.CSM781.$CHP14.EFDS.MERGE(+1)   cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=csm781m prg=CSM78100
 #05 DBDPCSM.CSMUNLK3.$MDBCID.IN.PDW.%%MDY  cntf=0005 rca=00147 rcm=00147 typ=RSF src=Jr__________ job=csmunlk3 prg=SORT
 #06 DBDPCSM.CSMUNLK3.$MDBCID.OUT.%%MDY     cntf=0003 rca=00000 rcm=00000 typ=RSF src=J___________ job=csmunlk3 prg=IEFBR14
 #07 DBDPDW.DBDFTP.$ABA.MONTHLY(0)          cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200
 #08 DBDPCSM.CSMSRT.$WELLS.G0587V00         cntf=0001 rca=00753 rcm=00753 typ=RSF src=Jr__________ job=csmwel_1 prg=SYNCSORT
 #09 DBDPDW.PDW202.$ADDR.USG.WKY(+1)        cntf=0001 rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw202p1 prg=PDW20200
 #10 DBDPDW.PDW828.$SCA01.CNSM.ACT.XRF.HIST.SRT   cntf=0003 rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw828h1 prg=SORT

Mainframe Filenames --> unix script standards

Utility jcldata52 copies datajcl51 to datajcl52, changing filename conventions from mainframe to the standards adopted for the Vancouver Utility ksh scripts.

sample input#1 - datajcl52


 #01 db2.prod.dwparm@qudw33       rca=00000 rcm=00000 typ=RSF src=J___________ job=pdwkscix prg=DSNUTILB
 #02 dbdpcsm.csm288._km001.batch.%%MDY     rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800
 #03 dbdpcsm.csm288._km001.syntax.%%MDY    rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800
 #04 dbdpcsm.csm781._chp14.efds.merge_     rca=00000 rcm=00000 typ=RSF src=J___________ job=csm781m prg=CSM78100
 #05 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY rca=00147 rcm=00147 typ=RSF src=Jr__________ job=csmunlk3 prg=SORT
 #06 dbdpcsm.csmunlk3._mdbcid.out.%%MDY    rca=00000 rcm=00000 typ=RSF src=J___________ job=csmunlk3 prg=IEFBR14
 #07 dbdpdw.dbdftp._aba.monthly_  rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200
 #08 dbdpdw.dbdftp._aba.monthly_  rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200
 #09 dbdpdw.pdw202._addr.usg.wky_ rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw202p1 prg=PDW20200
 #10 dbdpdw.pdw828._sca01.cnsm.act.xrf.hist.srt rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw828h1 prg=SORT

sample input#1 - right side (filenames omitted)


 #01 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdwkscix prg=DSNUTILB
 #02 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800
 #03 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800
 #04 rca=00000 rcm=00000 typ=RSF src=J___________ job=csm781m prg=CSM78100
 #05 rca=00147 rcm=00147 typ=RSF src=Jr__________ job=csmunlk3 prg=SORT
 #06 rca=00000 rcm=00000 typ=RSF src=J___________ job=csmunlk3 prg=IEFBR14
 #07 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200
 #08 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200
 #09 rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw202p1 prg=PDW20200
 #10 rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw828h1 prg=SORT

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6C4. Creating the JCL conversion control file

                     ** sample input#2 - datacat52
 py.payroll.master      rca=00128 rcm=00239 typ=IDXf8v  src=_L_ key=(0000,0016)
 py.time.cards          rca=00080 rcm=00080 typ=RSF     src=_L_
 pytest.payroll.master  rca=00256 rcm=00384 typ=IDXf8v  src=_L_ key=(0010,0022)
 pytest.payroll.master2 rca=00128 rcm=00256 typ=IDXf8v  src=_L_ key=(0000,0011)
Note
  • the Sample Site had no LISTCAT, so we are showing datacat52 from mvstest
  • you will notice that the filenames do not match the other files

sample input#3 - dataxl152

 aoe.tfi132._473bkp_                       cpy=t0473w.cpy   rca=_____ rcm=_____
 dbdpcsm.csm501._aif01.batch2              cpy=nasc354.cpy  rca=_____ rcm=_____
 dbdpcsm.csmftp._aif01.srcin.aif1          cpy=shrf025.cpy  rca=_____ rcm=_____
 dbdpdw.dbd714._jpalog.weekly.&weekdate    cpy=____________ rca=00200 rcm=00200
 dbdpdw.dbd714._n905s.%%mdy                cpy=t0905o.cpy   rca=00184 rcm=00184
 dbdpdw.dbd715._j1214.weekly.&weekdate     cpy=t1214i.cpy   rca=_____ rcm=_____
 dbdpdw.dbd715._nformfi.%%mdy.@03del       cpy=____________ rca=00132 rcm=00132
 dbdpdw.dbd900._copy.chkclln.evnt          cpy=____________ rca=00080 rcm=00080
 dbdpnas.nas258._aif01.batch.aif1          cpy=csmf501.cpy  rca=_____ rcm=_____
  1. This Excel spreadsheet info was available at a site where LISTCAT was not, so UV Software wrote the xl1data51,52 & xl2data51,52 jobs to extract the information & combine with the other JCL & LISTCAT info to create the ctl/datactl53I info file used by the JCL converter.

  2. Therefore, this is not directly transferrable to other sites, but if you have similar Excel spreadsheets, UV Software might modify the jobs to process your particular Excel spreadsheet formats.

  3. Note that the copybook info 'cpy=____________' was captured here for use by the DATA conversion tools - see MVSDATA.htm#Part_4.

    sample input#4 - dataxl252

 db2.prod.dwparm@qudw30              cpy=  rca=_____ rcm=_____ src=______Yi__
 db2.prod.dwparm@qudw33              cpy=  rca=_____ rcm=_____ src=______Yi__
 dbdpcrm.dbd40700._crm028.scan_      cpy=  rca=_____ rcm=_____ src=______Yi__
 dbdpcsm.convert._sca02.efdbcid_     cpy=  rca=_____ rcm=_____ src=______Yi__
 dbdpcsm.csm288._km001.batch.%%MDY   cpy=  rca=_____ rcm=_____ src=______Yi__
 dbdpcsm.csm288._km001.batch.%%MDY   cpy=  rca=_____ rcm=_____ src=______Yi__
 dbdpcsm.csm781._chp14.efds.merge_   cpy=  rca=_____ rcm=_____ src=______Yi__
 dbdpcsm.csm781._chp14.efds.merge_   cpy=  rca=_____ rcm=_____ src=______Yi__
 dbdpcsm.csm783._chx01.efdbcid_      cpy=  rca=_____ rcm=_____ src=______Yi__
  1. This 2nd Excel was another existing spreadsheet with several other fields that we ignored. Primarily we wanted to extract the fact that this was an 'i'nput file that we needed to convert (vs many other inter-step work files that we did not need to convert).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6C5. Creating the JCL conversion control file

sample input#5 - dataedt52

 # dataedt52 - manually edited additions to datafile info
 #           - this file used for JCL conversions,
 # Create with editor & store in $RUNLIBS/ctl/dataedt52
 # Will be merged with 5 other info source files
 # (datajcl52,datacat52,dataxl152,dataxl252,datacnv52+dataedt52)
 # to create datactl53 & datactl53I Indexed file used by JCL converter
 # (these '#'comment lines will be dropped on merge)
 #
 # Edit these filenames to match filenames in converter output
 # - lower case, any '$' in mainframe filenames entered as '_'s
 # - GDG files ID by trailing '_' underscores
 # - keywords may follow filenames after at lest 1 space
 # - rca=...,rcm=... should be 5 digits
 #
 dbdpnas.nas258._aif01.batch.aif1    rca=00080 rcm=00080 typ=RSF
 dbdpnas.nas258._aif01.batch.bkp1_   rca=00080 rcm=00080 typ=RSF

sample input #6 - datacnv52

 db2.prod.dwparm@qudw33                       src=__________D_
 dbdpcsm.csm288._km001.batch.%%MDY            src=__________D_
 dbdpcsm.csm783._chx01.efdbcid_               src=__________Db
 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY        src=__________D_
 dbdpdw.dbdftp._aba.monthly_                  src=__________D_
 dbdpods.dbd353._odsf013.extract              src=__________Db
 dbdpods.dbdchp01._weekly.valid               src=__________D_
 dbdpods.dbdsrt._rod197b.deduped.dly_         src=__________Dp
 dbdpods.dbdsrt._rod197b.deduped.dly_         src=__________Dp
 dbdpods.dbdsrt._rod197b.deduped.dly_         src=__________Dp

'datacnv52' is created by scanning the 1st 5000 bytes of each datafile for packed/binary fields & identifying those files with the Dp/Db you see above.

This was for DATA conversions, so we can know the files where it is mandatory to have copybooks to properly generate data conversion jobs to preserve packed/binary fields (vs translating entire record).

'datacnv52' is not required for JCL conversions, but we include all 6 sources for datactl53 used by JCL conversions. We then create 'datacnv53' from 'datactl53' for the DATA conversions.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6C6. Creating the JCL conversion control file

ctl/datactl53 - created from 6 info files above

Here is a sample of 'ctl/datactl53' which is loaded into an Indexed file (ctl/datactl53I) to supply file info (record-sizes, etc) to the JCL converter.

sample ctl/datactl53


 #01 db2.prod.dwparm@qudw33                   cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdwkscix prg=DSN
 #02 dbdpcsm.csm288._km001.batch.%%MDY        cpy=nasc354.cpy  rca=_____ rcm=_____ typ=RSF src=J___X_Yi__D_ job=pdmkeyen prg=NAS
 #03 dbdpcsm.csm288._km001.batch.%%MDY        cpy=nasc354.cpy  rca=_____ rcm=_____ typ=RSF src=J___X_Yi__D_ job=pdmkeyen prg=NAS
 #04 dbdpcsm.csm781._chp14.efds.merge_        cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdw100pe prg=PDW
 #05 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY    cpy=____________ rca=00147 rcm=00147 typ=RSF src=J___XrYi__D_ job=pdm825mp prg=SOR
 #06 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY    cpy=____________ rca=00147 rcm=00147 typ=RSF src=J___XrYi__D_ job=pdm825mp prg=SOR
 #07 dbdpdw.dbdftp._aba.monthly_              cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW
 #08 dbdpdw.dbdftp._aba.monthly_              cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW
 #09 dbdpdw.pdw202._addr.usg.wky_             cpy=____________ rca=00039 rcm=00039 typ=RSF src=Jr____Yi__Dp job=pdw301p1 prg=PDW
 #10 dbdpdw.pdw828._sca01.cnsm.act.xrf.hist   cpy=____________ rca=00039 rcm=00039 typ=RSF src=Jr____Yi__Dp job=pdw828h1 prg=PDW

sample ctl/datactl53 - right side (filenames omitted)


 #01 cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdwkscix prg=DSNUTILB
 #02 cpy=nasc354.cpy  rca=_____ rcm=_____ typ=RSF src=J___X_Yi__D_ job=pdmkeyen prg=NAS25300
 #03 cpy=nasc354.cpy  rca=_____ rcm=_____ typ=RSF src=J___X_Yi__D_ job=pdmkeyen prg=NAS25300
 #04 cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdw100pe prg=PDW21000
 #05 cpy=____________ rca=00147 rcm=00147 typ=RSF src=J___XrYi__D_ job=pdm825mp prg=SORT
 #06 cpy=____________ rca=00147 rcm=00147 typ=RSF src=J___XrYi__D_ job=pdm825mp prg=SORT
 #07 cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW20200
 #08 cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW20200
 #09 cpy=____________ rca=00039 rcm=00039 typ=RSF src=Jr____Yi__Dp job=pdw301p1 prg=PDW20200
 #10 cpy=____________ rca=00039 rcm=00039 typ=RSF src=Jr____Yi__Dp job=pdw828h1 prg=PDW82800

We have shown a ten line sample twice since the lines are too long for hard-copy documentation. We have omitted filenames on the 2nd display, but you can relate using the inserted sequence#s.

We are illustrating these sample control files here before documenting the conversion Operating Instructions to help you understand the process. When you later study the operating instructions, it may clarify things if you refer back to these control file samples.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6D1. Optional Preparations depending on site preferences

Extract control cards from JCL to separate files

Note
  • Extracting control cards from JCL is a VSE option.
  • will be adapted for MVS JCL conversion when requested

The VSE JCL converter has an option to #comment out all embedded control cards (for dates, rates, etc) & to create filename references to those records in subdir $RUNDATA/jobparms1 & $RUNDATA/jobparms2.

Utility job 'jobparmx1' is provided to extract the embedded control cards from i JCL/scripts into separate files that can be updated before JCL/scripts are executed.

Control files will have a date-stamp appended (current date at generation time). Run control administrators may duplicate the files & append future dates which will be selected when the current data reaches or passes file dates.

Also see 'jobparms1' which will be run at 6PM (before batch shift) to copy $RUNLIBS/jobparmx1/* to $RUNDATA/jobparms1, selecting the appropriate control card from any multiple dates for any 1 jobname_step_program

jobparm directories

During conversion, Embedded data cards in the JCL/scripts are extracted into subdirs jobparmx1 & jobparmx2. Filenames are created from 'jobname + step# + programname'

Before each night's batch runs, files from $RUNLIBS/jobparmx1 & jobparmx2 are selected/copied over to $RUNDATA for use by the JCL/scripts.

 $RUNLIBS/jobparmx1 - control cards with 'DONNE' or 'FONCTION' in col 1+
                    - filename: jobname+step#+programname+datestamp(yymmdd)
                    - administrators may created future date-stamped files
                    - latest current file will be copied to $RUNDATA/jobparms1
                    - before each night's batch runs
 $RUNLIBS/jobparmx2 - all other control card sets
                    - without DONNE or FONCTION on any line of set
                    - will simply be copied to $RUNDATA/jobparms2
 $RUNDATA/jobparms1 - control cards with 'DONNE' or 'FONCTION' in col 1+
                    - selected from $RUNLIBS/jobparmx1 before each batch shift
                    - uvcopy job 'jobparms1' selects the latest current file
                    - & drops the date-stamp from the output file
                    - these files will be read by the JCL/scripts
 $RUNDATA/jobparms2 - all other control card sets
                    - without DONNE or FONCTION on any line of set
                    - simply copied from $RUNLIBS/jobparmx2

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6D2. Optional Preparations depending on site preferences

initial extract control cards


 #1. cd $RUNLIBS                  <-- change to libraries (where jcls are)

 #2a. mkdir jobparmx1 jobparmx2     <-- make jobparmx1 subdir for output
 #2b. rm -f jobparmx1/* jobparmx2/*   - or remove all files if subdirs exist

 #3. uvcopy jobparmx1,fild1=jcls,fild2=jobparmx1,fild3=jobparmx2
     ++=========================================================
     - extract control cards from all jcls to jobparmx1 or jobparmx2

rerun ALL - output to 'tmp1/tmp2' subdirs

If you need to rerun, but don't want to overwrite existing files in jobparmx1, you could output to 'tmp1/tmp2' subdirs & manually copy desired files to jobparmx1 & jobparmx2.


 #1. cd $RUNLIBS            <-- change to libraries (where jcls are)

 #2a. mkdir tmp1 tmp2       <-- make tmp1/tmp2 subdirs for output
 #2b. rm -f tmp1/* tmp2/*     - or remove all files if subdirs exist

 #3. uvcopy jobparmx1,fild1=jcls,fild2=tmp1,fild3=tmp2
     =================================================
     - extract ALL control cards to tmp1/tmp2 subdirs

 #4a. cp tmp1/????? jobparmx1    <-- copy desired files to jobparmx1
      =======================

 #4b. cp tmp2/????? jobparmx2    <-- copy desired files to jobparmx2
      =======================

extract control cards from 1 JCL/script

If you need to convert a new JCL, specify the JCL/script name via ',arg1=...' The instructions below will output directly to jobparmx1/jobparmx2.

You could use tmp1/tmp2 to ensure no overwriting files in jobparmx1/jobparmx2. 'arg1=...' may specify a prefix to extract control cards from all JCL/scripts matching the prefix specified.


 #1. cd $RUNLIBS         <-- change to libraries (where jcls area)

 #2. uvcopy jobparmx1,fild1=jcls,fild2=jobparmx1,fild3=jobparmx2,arg1=jclprefix
     ==========================================================================
     - extract control cards from 1 JCL/script direct to jobparmx1/jobparmx2
     - 'jcl2ksh41' (convert 1 JCL) uses arg1=jclname

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6D3. Optional Preparations depending on site preferences

sample embedded data in JCL & script

  1. // JOB 30905D04
  2. // EXEC E212108C,SIZE=512K
  3. DONNE 99999
  4. /*
  5. exportfile SYS011 jobparms/${JOBID2}_${JSTEP}_${PROGID}
  6. #< exportfile SYS011 $JTMP/${JSTEP}_${PROGID}
  7. #< cat > $SYS011 <</*EOD
  8. #< DONNE 99999
  9. #< /*EOD
  10. cobrun $ANIM $CBLX/e212108c

The JCL converter generate lines 2-5 as '#<' comments. The SYS011 logical name used by COBOL program is defined by the exportfile on line 1 above, reproduced below on line 1a & followed by lines 1b & 1c showing sample values for the $SYMBOLS.


 #1a. exportfile SYS011 jobparms1/${JOBID2}_${JSTEP}_${PROGID}
      ========================================================

 #1b. exportfile SYS011 jobparms1/30905d04_S0020_e212108c
      ===================================================
      cd $RUNDATA   <-- jobset41 (function called at begin all jcls)
                      - changes directory to $RUNDATA
                      - so effective pathname might be as follows:

 #1c. exportfile SYS011 /tax/testdata/jobparms1/30905d04_S0020_e212108c
      =================================================================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6D4. Optional Preparations depending on site preferences

control card selections by current date

jobparmx1 is a 1 time job to extract control cards into separate files in subdirs $RUNLIBS/jobparmx1 (if DONNE/FONCTION) or jobparmx2 (all others). (for reruns you might output to tmp1/tmp2 & copy to jobparmx1/jobparmx2)

 jobparmx1 will append the current date on files in jobparmx1, for example:
 - here is an example for 2 control files extracted on Dec 01/2006

control files extracted on Dec 01/06

   jobparmx1/28401a28_S0010_e212319c_061201
   jobparmx1/30905d04_S0020_e212108c_061221
 Run control administrators may duplicate control files, update,& append
 'effective dates' when the new parameters are to take effect.
 - for example, here are the 2 control cards with some future versions

control files with future dates appended

   jobparmx1/28401a28_S0010_e212319c_061201    <-- original extracted
   jobparmx1/28401a28_S0010_e212319c_061211      - future effective dates
   jobparmx1/28401a28_S0010_e212319c_061218
   jobparmx1/30905d04_S0020_e212108c_061201    <-- original extracted
   jobparmx1/30905d04_S0020_e212108c_061215      - future effective dates
   jobparmx1/30905d04_S0020_e212108c_061231
 The appropriate files will be selected
 - from $RUNLIBS/jobparmx1 to $RUNDATA/jobparms1
 - by uvcopy job 'jobparms1' which will run every day before batch shift.

 uvcopy jobparms1,fild1=$RUNLIBS/jobparmx1,fild2=$RUNDATAjobparms1
 =================================================================
 - select/copy current control cards from $RUNLIBS/jobparmx1 to $RUNDATA/jobparms1
 - and drop the date suffix so JCL/script files defs will match

 uvcopy jobparms1   <-- same but easier (subdirs default as shown above)
 ================

Here is an illustration of the selection on Dec 15/2006 for the 2 control files, each with 3 date versions

filenames selected to jobparms1 on Dec15/06

   jobparmx1/28401a28_S0010_e212319c_061211   --> jobparms1 subdir
   jobparmx1/30905d04_S0020_e212108c_061215   --> jobparms1 subdir

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6E1. Optional Preparations depending on site preferences

jclstrip1 - cleanup converted JCL/scripts

jclstrip1 will remove mainframe steps that do not apply to unix/linux. See the table of stepnames embedded in jclstrip1 (LISTLOG,PRTLOG,etc). jclstrip1 was written for VSE & jclstrip2 will be added for MVS.

jclstrip1 also removes commented original JCL stmnts that may have been useful during conversion & testing, but can be removed for ongoing production.

Op. Instrns. for jclstrip1


 #1. Login appsadm --> /home/appsadm. Or login yourself if in group apps
     and profile setup for desired libraries (testlibs or prodlibs)

 #2. cdl --> $RUNLIBS  (definition in .bash_profile)

 #3. mv jcls jcls.old   <-- rename current jcls directory
     ================

 #4. mkdir jcls         <-- make new dir to receive stripped JCL/scripts
     ==========

 #5. uvcopy jclstrip1 jcls.old jcls  <-- strip all JCL/scripts
     ==============================      while copying jcls.old to jcls

sample BEFORE & AFTER


6E2. lists 2 steps DYNUTIL & IDCAMS before jclstrip1 (54 lines)

6E3. lists the 2 steps after jclstrip1 (28 lines)
  1. step 1 drops from 22 to 7 lines, since DYNUTIL is in the table of steps that do not apply to unix/linux (see listing page '6E4'). 'S0010=A' is retained since it could be the target of a goto or restart. The JSTEP & XSTEP+=1 ar retained to maintain the original step numbering.

  2. step 2 drops from 30 to 19 lines since IDCAMS is a required step. We removed 11 lines of #< comments, which showed the original IDCAMS coding for DELETE & DEFINE CLUSTER. These might be useful during conversion, but can be removed after testing is completed.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6E2. jclstrip1 - cleanup converted JCL/scripts

sample JCL/script BEFORE jclstrip1


 #1======================== begin step#S0010_DYNUTIL =========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)"
 stepctl51;  #calc StepTimes & check jobstop/goto end
 goto
 export PROGID=DYNUTIL
 export PARM="";
 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 exportfile E212528 e2125528/ttaxe.b8401d03
 exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID}
 #< cat > $SYS011 <</*EOD
 #<  DELETE 'SORTWK1 ==',POOL=POLMU5
 #< /*EOD
 ## EXEC DYNUTIL,SIZE=96K
 #3----------------------------------------------------------------------
 # DYNUTIL - convert DELETES only (but not for SORTWK_)
 #4----------------------------------------------------------------------
 :  # dummy step set cc 0 for status tests
 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 if ((SCC != 0))
    then logmsg1 "step $JSTEP DYNUTIL abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
 #1======================== begin step#S0020_IDCAMS =========================
 S0020=A
 JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0;
 logmsg1 "Begin Step $JSTEP IDCAMS (#$XSTEP)"
 stepctl51;  #calc StepTimes & check jobstop/goto end
 goto
 export PROGID=IDCAMS
 export PARM="";
 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID}
 #< cat > $SYS011 <</*EOD
 #<    DEL E2125528.TTAXE.B8401D03 PURGE     -
 #<        CATALOG(VSAM.USERCAT.CATALOG.MU5585 UCAT1)
 #<    DEF CL (NAME(E2125528.TTAXE.B8401D03) -
 #<            VOL(PRD318       )                        -
 #<            RECSZ(546 546)                            -
 #<            FILE(E212528)                             -
 #<            CISZ(6144)                                -
 #<            CYL(70 70)                                -
 #<        CATALOG(VSAM.USERCAT.CATALOG.MU5585 UCAT1)
 #< /*EOD
 ## EXEC IDCAMS,SIZE=200K
 #3----------------------------------------------------------------------
 rm -f e2125528/ttaxe.b8401d03
 uxcp "fili1=wrk/nullfile,typ=RSF,rcs=546,filo1=e2125528/ttaxe.b8401d03,typ=RSF,rcs=546"
 LCC=$?; ((SCC+=LCC));
 #4----------------------------------------------------------------------

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6E3. jclstrip1 - cleanup converted JCL/scripts

sample JCL/script AFTER jclstrip1


 #1======================== begin step#S0010_DYNUTIL =========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)"
 stepctl51;  #calc StepTimes & check jobstop/goto end
 goto
 export PROGID=DYNUTIL
 export PARM="";
 exportfile E212528 e2125528/ttaxe.b8401d03
 #1======================== begin step#S0020_IDCAMS =========================
 S0020=A
 JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0;
 logmsg1 "Begin Step $JSTEP IDCAMS (#$XSTEP)"
 stepctl51;  #calc StepTimes & check jobstop/goto end
 goto
 export PROGID=IDCAMS
 export PARM="";
 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID}
 ## EXEC IDCAMS,SIZE=200K
 #3----------------------------------------------------------------------
 rm -f e2125528/ttaxe.b8401d03
 uxcp "fili1=wrk/nullfile,typ=RSF,rcs=546,filo1=e2125528/ttaxe.b8401d03,typ=RSF,rcs=546"
 LCC=$?; ((SCC+=LCC));
 #4----------------------------------------------------------------------
 S0020C=$SCC; ((JCC+=SCC)); alias goto="";
 if ((SCC != 0))
    then logmsg1 "step $JSTEP IDCAMS abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6E4. jclstrip1 - cleanup converted JCL/scripts

jclstrip1 - uvcopy job listing

 # jclstrip1 - strip non-essential code from JCL/scripts
 #           - for City of Laval, June 2008, by Owen Townsend, UV Software
 #
 # 1a. mv jcls jcls.old   <-- rename current jcls directory
 # 1b. mkdir jcls         <-- make new dir to receive stripped JCL/scripts
 #
 # 2. uvcopy jclstrip1 jcls.old jcls  <-- strip all JCL/scripts
 #    ==============================      while copying jcls.old to jcls
 #
 opr='$jobname - strip non-essential steps in JCL/scripts'
 fild1=?indir,typ=DIR,rcs=80           #input directory
 fili1=xxxxxxxx,typ=LST,rcs=256        #current input file from directory
 fild2=?outdir,typ=DIR,rcs=80          #output directory
 filo2=xxxxxxxx,typ=LSTtp775,rcs=256   #current output file
 #
 # Table of STEP names to be stripped
 lod=k0(20)
 LISTLOG
 PRTLOG
 TDYNASN
 DYNUTIL
 DYNOPEN
 BSTTWAIT
 E173001C
 VSECMD
 IPCPBTCH
 SPOB766
 ~~~~~~~~~~~~~~~~~~~~
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 @run
        opn    fild1                    open input directory
        opn    fild2                    open output directory (must exist)
        msgwya1 '- did you: mv jcls jcls.old & mkdir jcls (new/empty) ?'
        cmc    $arg1(1),'y'
        skp=   man10
        can    'cancelled - reply not "y"'
 #
 # begin outer loop to read directory for next filename
 man10  get    fild1,a0(80)             get next record (filename) in directory
        skp>   man90                    (cc set > at EOD)
        skp<   man10                    (cc set < on subdir vs file)
 #
 # create input filename by concat: indir/infile & open
        clr    f0(300),' '
        mvu    f100(80),$fild1,x'00'    move dirname until ending null
        cat    f100(80),'/'             concat the '/'
        cata8  f100(80),a0(80)          concat current filename (a8 null terms)
        mvc    $fili1,f100              store input filename before open
        opn    fili1                    open current input file
 #
 # create same filename in output subdir & open
        mvu    f200(80),$fild2,x'00'    move output dirname until null reached
        cat    f200(80),'/'             concat the '/'
        cata8  f200(80),a0(80)          concat current filename (a8 null terms)
        mvc    $filo2,f200              store output filename before open
        opn    filo2                    open current output file
 #
 # copy JCL/script to 1st step divider line
 man20  bal    getr                     get next line into area 'b'
        skp>   man80
        cmc    b0(5),'#1==='            step divider line ?
        skp=   man30
        put    filo2,b0                 copy to output file
        skp    man20
 #
 # begin each step (step divider line found)
 # #1======================== begin step#S0020_DYNUTIL ========================
 # extract step-name & match to table of steps to be stripped
 man30  mvn    $ca0,0                   clear step strip switch
        clr    d0(200),' '              clear work area
        scn    b0(80),'_'               scan to '_' preceding stepname
        mvu    d0(8),bx1,' '            isolate stepname
        lok    k0(20),k0(8),d0(8)       lookup table of steps to strip
        skp!   1
 man32  mvn    $ca0,1                   set step strip switch
        skp    man60                    go copy step divider & get next
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 # begin loop to copy until next step divider line
 # On all steps - drop the '#<' comment lines
 #              - original SYSIN lines on IDCAMS, etc
 # On steps matching table above (strip switch set)
 # - drop all lines except for:
 # S0020=A
 # JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0;
 # logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)"
 # stepctl41  # test oprtr jobstop/jobclear
 # export PROGID=DYNUTIL
 # export PARM="";
 # exportfile E212003 $MSTR/e2123003.itaxe.transdam    <- drop SYSOUT/SYS011
 # exportgen1 +1 E212999 $JTMP/$TAPE/tu.f01.e212-foncie_
 #
 man40  cmc    b0(5),'#1==='            step divider line ?
        skp=   man60                    yes - go output & get next
        cmc    b0(2),'#<'               orig SYSIN IDCAMS, etc
        skp=   man62                    yes - bypass output & get next
        cmn    $ca0,1                   stripping this step ?
        skp<   man60                    no - go output & get next
 #
 # strip switch set - drop lines (except as described above)
 man42  cmcp   b0(7),'S####=A'
        skp=   man60
        cmc    b0(6),'JSTEP='
        skp=   man60
        cmc    b0(6),'logmsg'
        skp=   man60
        cmc    b0(7),'stepctl'
        skp=   man60
        cmc    b0(7),'export '
        skp=   man60
        cmc    b0(9),'exportgen'
        skp=   man60
        cmc    b0(10),'exportfile'
        skp=   man44
        skp    man62                   drop, bypass output, get next
 #
 # exportfile (strip switch set) - drop if SYSOUT or SYS011
 man44  cmc    b10(3),' SYS'
        skp=   man62                   yes: drop, bypass output, get next
        skp    man60                   retain exportfiles except SYS...
 #
 # common point to copy current line & return to get next
 # - until end of current step
 man60  put    filo2,b0(256)            output record
 man62  bal    getr                     get next line
        skp>   man80
        cmc    b0(5),'#1==='            step divider line ?
        skp=   man30
        skp    man40
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 # EOF current file - output counts, close files,& return for next file pair
 man80  cls    fili1                    close current input file
        cls    filo2                    close current output file
        skp    man10
 #
 # end input directory - display stats, close all dirs & files, & eoj
 man90  cls    all
        eoj
 #
 #----------------------------------------------------------------------
 # getr - subrtn to get next line of JCL/script from current input file
 #      - bypasses cmts, clrs 72-80, squeezes to 1 blank between words
 getr   get    fili1,b0               get next line of current JCL/script
        skp>   getr9                  (cc > at EOF)
 #
 # copy to area c & squeeze to 1 blank between words
 # - ##commented out, not required yet ?
 ##     mvc    c0(256),b0
 ##     sqzl1c1 c0(100),' '           squeeze to 1 blank between words (c1)
 #                                    & leave 1 blank before 1st word (l1)
 # return with cc= (not EOF) or cc> (at EOF)
 getr8  ret=
 getr9  ret>

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6F1. correction required depending on JCL coding

Manual changes required for DDNAMEs

Manual changes for DDNAMEs (in scripts converted from JCL) are required, if the DDNAME is a forward reference. We see this situation in a multi-part file when 1 part is a DDNAME reference to INSTREAM data which is declared after the multi-part file.

sample JCL with DDNAME forward reference

 //IEBCOPY2 JOB test DDNAME=XXX when XXX is a forward reference
 //* - requires manual fix to converted script
 //* - must move XXX def & instream data prior to DDNAME def
 //STEP1    EXEC PGM=IEBCOPY
 //INDD1    DD   DDNAME=HEADERS            <-- concat 1
 //         DD   DSN=AR.SALES.PRODUCTS     <-- concat 2
 //HEADERS  DD   *                             <-- instream 1
 PRODUCT#  DESCRIPTION                         <-- instream 2
 =====================================         <-- instream 3
 /*                                            <-- instream 4
 //OUTDD1   DD   DSN=AR.PRODUCT.LIST
 //SYSIN    DD   *
   COPY INDD=INDD1 OUTDD=OUTDD1
 /*
Note
  • I have inserted blank lines & '<--' comments to help you identify the
    multi-part file & the instream data

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6F2. Manual changes required for DDNAMEs

converted script with DDNAME forward ref - BEFORE fix

Note
  • I am omitting the 1st 12 & last 15 lines
  • they are the same for all converted scripts

 #1======================= begin step#S0010 IEBCOPY ========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg2 "******** Begin Step $JSTEP iebcopy (#$XSTEP) ********"
 ##STEP1     EXEC PGM=IEBCOPY
 export PROGID=iebcopy
 export PARM=""
 exportfile INDD101 $HEADERS #DDNAME=HEADERS  <-- concat 1 (see ERR note below)
 exportfile INDD102 data1/ar.sales.products   <-- concat 2
 exportfile INDD1 $JTMP/_headers02            <-- concat 3
 cat $INDD101 $INDD102 \                      <-- concat 4
     >$INDD1                                  <-- concat 5

#----DDNAME in multi-part file above, ensure def precedes

 HEADERS=$JTMP/${JSTEP}_${PROGID}_HEADERS         <-- instream 1
 exportfile HEADERS $HEADERS                      <-- instream 2
 cat > $HEADERS <</*                              <-- instream 3
 PRODUCT#  DESCRIPTION                            <-- instream 4
 ========================================         <-- instream 5
 /*                                               <-- instream 6
 exportfile OUTDD1 data1/ar.product.list
 SYSIN=$JTMP/${JSTEP}_${PROGID}_SYSIN
 exportfile SYSIN $SYSIN
 cat > $SYSIN <</*
   COPY INDD=INDD1 OUTDD=OUTDD1
 /*
 logmsg2 "Executing--> uvcp \"fili1=$INDD1,rcs=80,typ=LST,filo1=$OUTDD1,r..."
 #3----------------------------------------------------------------------
 uvcp "fili1=$INDD1,rcs=80,typ=LST,filo1=$OUTDD1,rcs=80,typ=LSTt"
 #4----------------------------------------------------------------------
Note
  • if you attempted to run the job before the fix (on the next page)
  • you would get "ERR: exportfile requires 2 args: DDNAME=INDD101, DSName=."
  • since $HEADERS is undefined, because the definition follows the reference

 exportfile INDD101 $HEADERS #DDNAME=HEADERS  <-- concat 1 (see ERR note below)
 ===========================

 HEADERS=$JTMP/${JSTEP}_${PROGID}_HEADERS         <-- instream 1
 ========================================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6F3. Manual changes required for DDNAMEs

converted script with DDNAME forward ref - AFTER fix

Here is the listing, AFTER we have moved the INSTREAM file definition up prior to the multi-part file definition.


 #1======================= begin step#S0010 IEBCOPY ========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg2 "******** Begin Step $JSTEP iebcopy (#$XSTEP) ********"
 ##STEP1    EXEC PGM=IEBCOPY
 export PROGID=iebcopy
 export PARM=""
 HEADERS=$JTMP/${JSTEP}_${PROGID}_HEADERS         <-- instream 1
 exportfile HEADERS $HEADERS                      <-- instream 2
 cat > $HEADERS <</*                              <-- instream 3
 PRODUCT#  DESCRIPTION                            <-- instream 4
 ========================================         <-- instream 5
 /*                                               <-- instream 6
 exportfile INDD101 $HEADERS #DDNAME=HEADERS  <-- concat 1
 exportfile INDD102 data1/ar.sales.products   <-- concat 2
 exportfile INDD1 $JTMP/_headers02            <-- concat 3
 cat $INDD101 $INDD102 \                      <-- concat 4
     >$INDD1                                  <-- concat 5
 exportfile OUTDD1 data1/ar.product.list
 SYSIN=$JTMP/${JSTEP}_${PROGID}_SYSIN
 exportfile SYSIN $SYSIN
 cat > $SYSIN <</*
   COPY INDD=INDD1 OUTDD=OUTDD1
 /*
 logmsg2 "Executing--> uvcp \"fili1=$INDD1,rcs=80,typ=LST,filo1=$OUTDD1,r..."
 #3----------------------------------------------------------------------
 uvcp "fili1=$INDD1,rcs=80,typ=LST,filo1=$OUTDD1,rcs=80,typ=LSTt"
 #4----------------------------------------------------------------------

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6F4. Manual changes required for DDNAMEs

demo convert/fix/run JCL with DDNAME forward ref

IEBCOPY2.jcl (JCL illustrating DDNAME forward reference, listed on page '6F1') is provided in /home/uvadm/mvstest/testlibs/jcl0. You can convert, fix,& run the demo JCL/script, if you have setup user 'mvstest' as in Part_1 (or copied to subdir testlibs/jcl0 in your homedir, as instructed on page '1P4').


 #1. Login as mvstest (or as yourself if testlibs/testdata in your homedir)

 #2. cdl --> $HOME/testlibs (alias cdl='cd $RUNLIBS)

 #3. jcl2ksh51 jcl0/IEBCOPY2.jcl
     ===========================
     - convert JCL to script in jcls/iebcopy2.ksh

 #4. iebcopy2.ksh          <-- attempt to run before fix
     ============            - will get ERROR

 #5. vi jcls/iebcopy2.ksh  <-- manual changes to fix DDNAME forward reference
     ====================    - see BEFORE & AFTER on pages '6F2' & '6F3'

 #6. iebcopy2.ksh          <-- run after fix
     ============

 #7. check results, display output file, confirm concatenation OK

 #7a. cdl --> $HOME/testdata (alias cdd='cd $RUNDATA)

 #7b. cat data1/ar.product.list  <-- display output, confirm files concatenated
      =========================

      PRODUCT#  DESCRIPTION
      ========================================
      BBQ010   BAR-B-Q
      CHR015   LAWN CHAIR
      HAM010   CLAW HAMMER
      HAM020   BALL PEEN HAMMER
      HAM035   JACK HAMMER
      SAW011   HAND SAW
      SAW012   RIP SAW
      SAW051   POWER SAW
      TAB012   LAWN TABLE

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6F5. Manual changes required for DDNAMEs

optional - rerun to capture console log


 #8. joblog iebcopy2.ksh    <-- rerun with script 'joblog'
     ===================      - captures log in joblog/iebcopy2.log

 #9. cat joblog/iebcopy2.log   <-- display console log file
     =======================
 091029:141026:IEBCOPY2: Begin Job=IEBCOPY2
 091029:141026:IEBCOPY2: /home/mvstest/testlibs/jcls/iebcopy2a.ksh
 091029:141026:IEBCOPY2: Arguments:
 091029:141026:IEBCOPY2: RUNLIBS=/home/mvstest/testlibs
 091029:141026:IEBCOPY2: RUNDATA=/home/mvstest/testdata
 091029:141026:IEBCOPY2: JTMP=jobtmp/IEBCOPY2 SYOT=sysout/IEBCOPY2
 091029:141026:IEBCOPY2: RUNDATE=20091029
 091029:141026:IEBCOPY2: ******** Begin Step S0010 iebcopy (#1) ********
 091029:141026:IEBCOPY2: file: HEADERS=jobtmp/IEBCOPY2/S0010_iebcopy_HEADERS bytes=
 091029:141026:IEBCOPY2: file: INDD101=jobtmp/IEBCOPY2/S0010_iebcopy_HEADERS bytes=63
 091029:141026:IEBCOPY2: file: INDD102=data1/ar.sales.products bytes=179
 091029:141026:IEBCOPY2: file: INDD1=jobtmp/IEBCOPY2/_headers02 bytes=
 091029:141026:IEBCOPY2: file: OUTDD1=data1/ar.product.list bytes=242
 091029:141026:IEBCOPY2: file: SYSIN=jobtmp/IEBCOPY2/S0010_iebcopy_SYSIN bytes=
 091029:141026:IEBCOPY2: Executing--> uvcp "fili1=jobtmp/IEBCOPY2/_headers02,rcs=80,typ=LST,filo1=data1/ar.product.list,r...
 091029:141026:IEBCOPY2: uvcp fili1=jobtmp/IEBCOPY2/_headers02,filo1=data1/ar.product.list
 091029:141026:IEBCOPY2: EOF fili01 11 rds, 242 size; jobtmp/IEBCOPY2/_headers02
 091029:141026:IEBCOPY2: EOF filo01 11 wrts, 242 size; data1/ar.product.list
 091029:141026:IEBCOPY2: Job Times: Begun=14:10:26 End=14:10:26 Elapsed=00:00:00
 091029:141026:IEBCOPY2: EOF filr01 rds=5 size=10240: /home/mvstest/testdata/ctl/gdgctl51I
 091029:141026:IEBCOPY2: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6F6. Manual changes required for DDNAMEs

uvcopy job to fix DDNAMEs automatically

The manual correction procedure (described on the following page) is OK, if the problem incidence rate is low, but in case your site has dozens or hundreds of jobs with the DDNAME problem, we have provided uvcopy job 'ddnamefix1' to fix the problem automatically.

This automatic fix assumes that all instances of #DDNAME= are part of a multi- part file & DDNAME=... is a forward reference to INSTREAM data. This was true for the first batch of JCL/scripts we saw with this problem.


 #1. Login as yourself or appsadm

 #2. cdl --> $RUNLIBS

 #3. mkdir jcl4           <-- make new subdir for output
     ==========

 #4. uvcopyx ddnamefix1 jcl3 jcl4 uop=q0i7  <-- run uvcopy job 'ddnamefix1'
     =====================================
     - copies all JCL/scripts from jcl3 to jcl4
     - fixes jobs with the problem, copies others unchanged

 #5a. alldiff2 jcl3 jcl4   <-- create difference report
      ==================

 #5b. vi tmp/jcl4.dif      <-- examine diff report to verify chanages
      ===============

 #6. vi jcl4/...           <-- possible manual corrections
     ===========             - none required in our 1st batch of JCL/scripts
Note
  • see prior page for recommended subsequent test/debug procedures
  • re copying each script from jcl4/... to jcls/... when ready to test

notes re uvcopy job 'ddnamefix1'

  1. 'ddnamefix1' is listed on the following pages. It is a great illustration of the power of uvcopy. How many lines would it take you in COBOL ? Only 51 instructions are required (71 lines of #comments). First page is all #comments to give the operating instructions, illustrate the problem, and explain the logic used.

  2. uvcopy is an interpreter for the uvcopy instructions, the power of assembler with the simlicity of a script, no compile, just edit & rerun.

  3. uvcopy is an essential utility for mainframe conversions since it understands mainframe constructs, such as packed decimal fields & indexed files. None of the standard unix/linux utilities have those capabilities.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

6F7. Manual changes required for DDNAMEs

listing of ddnamefix1 uvcopy job to fix DDNAMEs

 # ddnamefix1 - fix JCL/scripts with DDNAME forward refs to INSTREAM data
 #            - in multi-part files (1 part DDNAME ref to instream following)
 #            - see www.uvsoftware.ca/mvsjcl.htm#6F1
 #            - by Owen Townsend, UV Software, Oct30/2009
 #
 # uvcopy ddnamefix1,fili1=jcl3/jobx.ksh,filo1=jcl4/jobx.ksh
 # =========================================================
 #  - fix 1 job at a time (for testing)
 #
 # uvcopyx ddnamefix1 jcl3 jcl4 uop=q0i7
 # =====================================
 #  - fix all jobs in directory (while copying from jcl3/... to jcl4/...)
 #
 #             ** problem illustrated - original JCL **
 #
 # //INDD1    DD   DDNAME=HEADERS #DDNAME=HEADERS <-- assume IDs multi-part file
 # //         DD   DSN=AR.SALES.PRODUCTS          <-- end multi-part file
 # //HEADERS  DD   *         <-- col 1 match to DDNAME (begin instream group)
 # PRODUCT#  DESCRIPTION     <-- instream data (max 8 lines for this fix)
 # /*                        <-- /* marks end of instream data
 #
 #       ** problem illustrated - converted script to be fixed **
 #
 # exportfile INDD101 data1/ar.sales.products   <-- 1st of multi-part file
 # exportfile INDD102 $HEADERS #DDNAME=HEADERS  <-- #DDNAME= IDs problem
 # exportfile INDD1 $JTMP/_headers02
 # cat $INDD101 $INDD102
 #     >$INDD1
 # #----DDNAME in multi-part file above, ensure def precedes
 # HEADERS=$JTMP/${JSTEP}_${PROGID}_HEADERS     <-- col 1 match to DDNAME
 # exportfile HEADERS $HEADERS                    - IDs begin instream data
 # cat > $HEADERS <</*
 # PRODUCT#  DESCRIPTION
 # /*                                           <-- end of instream data
 #
 #                         ** logic **
 #
 # Read entire JCL/script into memory table
 # Begin loop to search table for next #DDNAME=
 #   (unique pattern inserted by converter & assumed to be in multi-part file)
 # - if #DDNAME not 1st in multi-part, search back to the '01' part
 # - search following 20 lines max for DDNAME value match starting in col 1
 # - then search following 30 lines max for instream data end '/*' in cols 1&2
 # - swap 2 groups of lines
 # Repeat above loop until end of table reached (all DDNAMEs fixed)
 # - write table to output dir/file
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 was=a200000g5000
 fili1=jcl3/iebcopy2.ksh,rcs=128,typ=LST
 filo1=jcl4/iebcopy2.ksh,rcs=128,typ=LSTt
 @run
        opn    all
        rtb    fili1,a0(100),a0(100)  read entire job into memory table
        mvn    $ra,0                  init rgstr for table search
        clr    n0(100),' '            clear work area (DDNAME store, etc)
 #
 # begin loop to search for next '#DDNAME=' (assumed part of multi-part file)
 man20  sts    aa0(100),a0(100),'#DDNAME='
        skp!   man90
        mvn    $re,$ra                save ptr to begin next search (+100)
        mvu    n0(20),ax8,' '         store DDNAME=... value
        mvn    $rn,$rx                save length of name
 #
 # allow DDNAME not 1st part by search back to 01 (of INDD101 in folwng exmple)
 # exportfile INDD101 data1/ar.sales.products
 # exportfile INDD102 $HEADERS #DDNAME=HEADERS
 man22  scnn2  aa0(50),' '            search to 2nd blank
        mvn    $rf,$rx                save dsplcmnt to 2nd blank in perm rgstr
        sub    $rf,2                  back up 2 to adrs last 2 digits DDN
        add    $rf,$ra                 + dsplcmnt to #DDNAME= line
        cmc    af0(2),'01'            reached 01 part ?
        skp<=  man30
        sub    $ra,100                backup to prior line
        skp    man22                  repeat til nonblank begin mp found
 #
 # save dsplcmnt to 1st part & search for DDNAME def in col 1 (20 lines max)
 man30  mvn    $rb,$ra                save dsplcmt to begin multi-part file
        lok    aa0(100),aa0($rn20),n0($rn20)  search for DDNAME def col 1 folwng
        skp!   man80
        mvn    $rc,$ra               save dsplcmt to DDNAME def (begin instream)
        mvn    $re,$ra               save ptr to begin next search (+100)
 # ensure matching DDNAME within 20 lines of begin multi-part file
        mvn    $rj,$rc               dsp to DDNAME def line
        sub    $rj,$rb               - dsp to begin multi-part file
        cmn    $rj,2000              within 20 lines ?
        skp>   man80
 #

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

 # search for end of INSTREAM data '/*' in cols 1-2 (within 30 lines)
 man40  lok    aa0(100),aa0(2),'/*'
        skp!   man80
        mvn    $rd,$ra               save dsp to '/*' end instream
        mvn    $re,$ra               save ptr to begin next search (+100)
 # ensure /*  within 30 lines of begin instream
        mvn    $rk,$rd               dsp to '/*' end instream
        sub    $rk,$rc               - dsp to begin instream
        cmn    $rk,3000              within 30 lines ?
        skp>   man80
 #
 # now swap the 2 groups of lines (move instream ahead of multi-part file)
 # - by moving out to alternate area 'g' & moving back
 # group1 - from $rb for length of $rc-$rb (already calc'd in $rj)
 # group2 - from $rc for length of $rd-$rc+100 (or $rk+100)
 man50  add    $rk,100               calc length of group2
        mvn    $rg,$rk               calc total length
        add    $rg,$rj               = grp1 lth + grp2 lth
        clr    g0(5000),' '          clear work area (max 50 lines)
        mvc    g0($rk3000),ac0       move group2 to 1st part alt area
        mvc    gk0($rj2000),ab0      move group1 to 2nd part alt area
        mvc    ab0($rg5000),g0       move swapped groups back to table
 #
 # end of each #DDNAME ID'd multi-part file & instream test/swap
 # - or end point if swap criteria not all met
 man80  mvn    $ra,$re               load saved dsp to begin next search
        add    $ra,100               + 1 line, so we dont find same again
        skp    man20                 repeat loop until end of table
 #
 # end of table reached - write out & close files
 man90  wtbe   filo1,a0(100),a0(100)
        cls    all
        eoj

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_7 MVSJCL.doc: Operating Aids

Console Logs, Job Debug Logs,& Job Message logs


7A1. Overview of Console Logging, Job Debug Logging,& Job Message Logging

7A2. Console Logging, captures all console I/O for entire batch shift
- activate by uncommenting 6 lines at end of profile
- console logs created in /home/appsadm/log1/userid/...
- see more details at ADMjobs.htm#Part_6

7A3. Job Debug Logging, for programmers to capture 1 joblog at a time
7A4. Demo 'joblog' to capture log from JCL/script jgl100.ksh

7A5. Job Message Logging, captures only the most critical console messages
7A6.  Demo 'jobmsgs1' script to concatenate separate jobmsglogs
- also see demo begining on page '7D1'

7B1. Demo/Execute JCL/script jgl200.ksh 4 times, forcing ERRors on some runs

7B3. Listing of the 'jgl200.ksh' JCL/script

7C1. Listing of the 'Console Log' (6 pages)

7D1. Running the 'jobmsgs1' script to combine jobmsglogs to ALL & ERR files

7D2. Listing the 'ALL' jobmsglog

7D3. Listing the 'ERR' jobmsglog

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7A1. MVSJCL.doc: Operating Aids

capturing console logs on Unix/Linux systems

Console logs are essential to running batch JCL/COBOL applications on mainframe systems. There is no built-in console logging on Unix/Linux systems, but the Vancouver Utilities provide 3 methods of console logging to fit the needs of operators, programmers,& applications administrators.

  1. Console Logging
  1. Job Debug Logging
  1. Job Message Logging

samples of Console, Debug,& Error Logs

Please see MVSJCL.htm#Part_7 for samples & demos of the Vancouver Utility logging systems. Part_7 also illustrates GDG file ERROR recovery. New generations of GDG files are written to the 'jobtmp' directory until the 'Normal EOJ' is reached, when they are moved to their intended directories.

Note that the GDG error Abnormal Termination cannot be missed, since the operator is forced to acknowledge the error. If run by cron overnight, any errors any Abnormal Terminations are emailed to the Applications Administrator.

When the job is rerun, the JCL/script system gives operators the choice of re- running the error job from the begining, or restarting from any specified step.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7A2. MVSJCL.doc: Operating Aids

Console Logging

Console Logging is documented at ADMjobs.htm#Part_6. Here is a brief review:

Console Logging is activated by uncommenting 6 lines at the end of the supplied stub_profile (renamed .profile or .bash_profile). Listing at ADMjobs.htm#1C1.

                 ........ last few lines of profile ........
 #--------------------------------------------------------------------------
 # Capture console log files (see details at www.uvsoftware.ca/admjobs.htm)
 # ---> uncomment next 6 lines in profiles of users who require logging
  # login1 || exit 2          # exit here if 2nd login
  # logfixA                   # process log1 file to log2 (to allow read/print)
  # echo "console logging requires aliases to be stored in .bashrc or .kshrc"
  # echo "--> . aliases <-- 'dot' execute aliases NOW, if not in .bashrc/.kshrc"
  # echo "--> logview   <-- execute logview script to see prior console logs"
  # exec script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)
 # - 'exec script' must be the last non-comment line in the profile
 # - 'script' disables 'aliases', put them in '.bashrc' to make them effective
 #--------------------------- end of stub_profile ---------------------------

console logs created in $APPSADM

 /home/appsadm
 :-----log1                     <-- log files created here (for active users)
 :     :-----user1                - sub-directoried by user login
 :     :     :-----yymmdd_HHMMSS  - date/time stamped log files
 :     :-----user2
 :     :     :-----yymmdd_HHMMSS  - only 1 file per user in log1/user/...
 :     :-----.etc.
 :-----log2                     <-- processed to log2 to remove screen ctl chars
 :     :-----user1                  to enable viewing & printing
 :     :     :-----yymmdd_HHMMSS  - files collected for 1 month
 :     :     :-----080806_110500  - multiple date/time stamped files per user
 :     :-----user2
 :     :     :-----yymmdd_HHMMSS
 :     :-----.etc.

Console logs are date/time stamped & collected in $APPSADM/log1/userid/... and processed to $APPSADM/log2/userid/... to remove screen control characters to enable viewing & printing. This processing & printing might be performed by a cron script every night after batch shifts are completed.

If desired you can force the console log processing at any time simply by logging off & back on (due to the code at the end of your .bash_profile). You would then use the 'logview' script to see your latest logfile (or any previous logfile).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7A3. MVSJCL.doc: Operating Aids

Job Debug Logging

Console Logging (described above) is primarily intended to capture all console messages for all JCL/scripts run by an operator during an entire batch shift.

This is not convenient for programmers, who may want to capture the log for just 1 job at a time, since console logging requires logoff/logon/logview to see the log.

Script joblog is provided for programmers to capture the console messages for 1 job at a time.

RUNDATA Directories

 /home/mvstest
 :-----testdata           <-- RUNDATA=/home/mvstest/testdata
 :     :-----ar
 :     :-----gl             - datafile directories, option to use top-nodes
 :     :-----py               (or could put all datafiles in data1/...)
 :     :-----ftp
 :     :-----jobctl         - for jobstop stop at begin each step for debug
 :     :-----joblog         - Job Debug logs stored here (by joblog script)
 :     :-----jobmsgs        - job progress msgs (step begin, end Normal/AbTerm)
 :     :-----jobtmp         - job temporary files (new GDGs restored at EOJ_
 :     :-----mstr           - could put all datafiles in 1 subdir
 :     :-----pf             - user written uvcopy jobs
 :     :-----rpts           - reports
 :     :-----sf             - user written Korn shell scripts
 :     :-----sysout         - COBOL DISPLAY upon SYSLST reports
 :     :-----tape           - tape files reassigned to disc by JCL converter
 :     :-----tmp            - misc temp files & sort work files
 :     :-----wrk            - work files (inter-step)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7A4. MVSJCL.doc: Operating Aids

demo joblog


 #1. Login as mvstest --> /home/mvstest
     ================

 #2. cdd --> alias 'cd $RUNDATA' --> /home/mvstest/testdata
      ===

 #3. jgl100.ksh               <-- execute JCL/script
     ==========

 #4. more joblog/jgl100.ksh   <-- display the joblog
     ======================
 080827:092705:JGL100: Begin Job=JGL100
 080827:092705:JGL100: /home/mvstest/testlibs/jcls/jgl100.ksh
 080827:092705:JGL100: Arguments:
 080827:092705:JGL100: RUNLIBS=/home/mvstest/testlibs
 080827:092705:JGL100: RUNDATA=/home/mvstest/testdata
 080827:092705:JGL100: JTMP=jobtmp/JGL100 SYOT=sysout/JGL100
 080827:092705:JGL100: RUNDATE=20080827
 080827:092705:JGL100: Begin Step S0010 cgl100 (#1)
 080827:092705:JGL100: gen0: ACCTMAS=data1/gl.account.master_000003 insize=8720
 080827:092705:JGL100: gen+1: ACTLIST=jobtmp/JGL100/GDG/data1/gl.account.acntlist_000004 gens=8
 080827:092705:JGL100: file: SYSOUT=sysout/JGL100/S0010_SYSOUT bytes=0
 080827:092706:JGL100: Job Times: Begun=09:27:05 End=09:27:06 Elapsed=00:00:01
 080827:092706:JGL100: moving jobtmp/JGL100/GDG/subdir/files back to $RUNDATA/subdirs/
 `jobtmp/JGL100/GDG/data1/gl.account.acntlist_000004' -> `data1/gl.account.acntlist_000004'
 080827:092706:JGL100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7A5. MVSJCL.doc: Operating Aids

Job Message Logging

This is an overview of 'Job Message Logging'. Also see the jobmsglog demo later begining on page '7D1'.

'Job Message Logging' captures just the most vital console messages (vs all messages captured by 'Console Logging').

These vital/ERRor messages are captured by the 'logmsg2' script called from the JCL/scripts (vs 'logmsg1' used for less important messages).

A date/time stamped jobmsglog file is written (for each JCL/script executed), to $RUNDATA/jobmsgs/... For example after running jgl100.ksh & jgl200.ksh, you might see:


 l jobmsgs     - list message logs in $RUNDATA/jobmsgs
 =========
 -rw-rw-r-- 1 mvstest apps  159 Aug  3 20:47 080803:204707_JGL100
 -rw-rw-r-- 1 mvstest apps  208 Aug  3 20:47 080803:204726_JGL200

 more jobmsgs/*     <-- show ALL files in jobmsgs/...
 ==============
 080803:204707:JGL100: Begin Job=JGL100                            <--file#1
 080803:204707:JGL100: Begin Step S0010 cgl100 (#1)
 080803:204707:JGL100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
 080803:204726:JGL200: Begin Job=JGL200                            <-- file#2
 080803:204726:JGL200: Begin Step S0010 sort (#1)
 080803:204726:JGL200: Begin Step S0020 cgl200 (#2)
 080803:204726:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
  1. 'logmsg2' is used for more important events (begin job/step, Normal/Abnormal EOJ) & error msgs from JCL/scripts (vs 'logmsg1 for less important).

  2. Each job writes a separate file to the $RUNDATA/jobmsgs subdir

  3. displayed above with 'more' which runs files together

  4. The 'jobmsgs1' script is provided to concatenate jobslogs/* into 1 file with blank line separators, for easier review (see sample on next page).

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7A6. MVSJCL.doc: Operating Aids

jobmsgs1 script to concatenate jobmsglogs

After running a batch shift of many JCL/scripts, you would see many separate files in $RUNDATA/jobmsgs/... Script 'jobmsgs1' makes it easier to review all jobmsgs by concatenating them all together (inserting blank line separators), into $RUNDATA/jobmsgs1/yymmddALL.

The script also writes to $RUNDATA/jobmsgs1/yymmddERR if any 'ERR' message is found anywhere in a jobmsglog file.


 jobmsgs1 jobmsgs    <-- concatenate to jobmsgs1/yymmddALL & jobmsgs1/yymmddERR
 ================

 l jobmsgs1          <-- display output filenames
 ==========
 -rw-rw-r-- 1 mvstest apps 1934 Aug  4 09:12 ALL
 -rw-rw-r-- 1 mvstest apps 1516 Aug  4 09:12 ERR

 more jobmsgs1/yymmddALL   <-- display ALL file contents (concatenated together)
 =======================     - blank line separators inserted by jobmsgs1 script
 080803:204707:JGL100: Begin Job=JGL100
 080803:204707:JGL100: Begin Step S0010 cgl100 (#1)
 080803:204707:JGL100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
 080803:204726:JGL200: Begin Job=JGL200
 080803:204726:JGL200: Begin Step S0010 sort (#1)
 080803:204726:JGL200: Begin Step S0020 cgl200 (#2)
 080803:204726:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
Note
  • See samples of ERR jobmsgs later on page '7C7'

We suggest you run a nightly cron script, which would execute the 'jobmsgs1' script to create the jobmsgs1/yymmddALL & jobmsgs1/yymmddERR reports, and then clear all files from the jobmsgs/... directory for re-accumulation the next day.

For multi-day jobmsglog history, JCL/script/logmsg2 also writes files to $APPSADM/jobmsgs/yymmdd/yymmdd:HHMMSS_JOBID. You could use a cron script to remove files older than 10 or 15 days ?

See sample 'crontabs' & scripts in ADMjobs.htm#Part_5.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7B1. MVSJCL.doc: Operating Aids

Demo Console Logging & Job Message Logging

If you have setup 'mvstest' & converted the demo JCL & COBOL (as documented begining at MVSJCL.htm#1P1, you can run the following demo. You must also activate 'console logging' as described in ADMjobs.htm#Part_6.


 #0a. Login as mvstest --> /home/mvstest
      ================

 #0b. cdd --> alias 'cd $RUNDATA' --> /home/mvstest/testdata
      ===

 #0c. testdatainit   <-- clear any prior jobmsgs, etc
      ============

 #0d. l data1/gl*    <-- list data1/gl* files (BEFORE new GDG's created)
      ===========

 #1. jgl200.ksh      <-- run#1, Terminates Normally
     ==========

 #2a. cdl --> alias 'cd $RUNLIBS' --> /home/mvstest/testlibs'
      ===

 #2b. vi jcls/jgl200.ksh  <-- modify JCL/script to force ERR on step 2
      ==================    - change line #65 from 'LCC=$?' to LCC=99'

 #2c. jgl200.ksh      <-- run#2, Terminates Abnormally
      ==========

 #3a. vi jcls/jgl200.ksh  <-- correct line #65 back to 'LCC=$?'
      ==================

 #3b. jgl200.ksh      <-- run#3, Terminates Normally, BUT you get WARNing
      ==========          'GDG files NOT moved from jobtmp to data1/... subdir'
      --> reply 'n'   <-- to rerun from begining (vs restart step2)
                          (usually best to rerun from begining & reply 'n')
         ----- OR -----

 #3c. jgl200.ksh start=S0020  <-- run#3 RESTART from step#2
      ======================
      --> reply 'y'   <-- to move GDG files from jobtmp to data1/...

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7B2. MVSJCL.doc: Operating Aids


 #4. jgl200.ksh      <-- run#4, Terminates Normally
     ==========

 #5.  l data1/gl*    <-- list data1/gl* files (AFTER new GDG's created)
      ===========

 #6a. exit & log back in to process the console log
      ==================

 #6b. logview        <-- run script to view latest console log
      =======

 #7a. cdd --> alias 'cd $RUNDATA' --> /home/mvstest/testdata
      ===

 #7b. l jobmsgs         <-- list files created by 4 executions of jgl200.ksh
      =========

 #7c. jobmsgs1 jobmsgs  <-- concatenate jobmsgs1/yymmddALL & jobmsgs1/yymmddERR
      ================

 #7d. more jobmsgs1/yymmddALL  <-- inspect ALL jobmsgs
      =======================

 #7e. more jobmsgs1/yymmddERR  <-- inspect ERR jobmsgs
      =======================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7B3. MVSJCL.doc: Operating Aids

jgl200.ksh JCL/script

Here is the JCL/script we use to demo console & job message logging. Note line k#067, which we change from 'LCC=$?' to LCC=99' to force an ERRor and demo the GDG file system ERRor recovery.

 k#001 #!/bin/ksh
 k#002 ##JGL200   JOB  (1234),'TEST/DEMO MVS JCL CONVERSION'
 k#003 export jobid2=jgl200 JOBID2=JGL200; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$jobid1" ]]; then export jobid1=$jobid2; fi
 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#006 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
 k#008 autoload exportfile exportgen0 exportgen1 exportgen2 exportgenall exportgenx
 k#009 . $APPSADM/env/stub.ini  #<-- for control-M (see notes in env/stub.ini)
 k#010 jobset51    # call function for JCL/script initialization
 k#011 goto
 k#012 S0000=A
 k#013 # * SORT TRANSACTIONS & UPDATE GL ACCOUNT MASTER
 k#014 # * - demo GDG processing, write gltrans(+1) & read back as (+1)
 k#015 #0========================== begin proc PGL200 ============================
 k#016 ##STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003                     #<-PROC1call
 k#017 ##PGL200   PROC HLQ=GL,YEAREND=2002                            #<-PROC1
 k#018 HLQ="GL";YEAREND="2002";
 k#019 ##STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003                      #<-PROC1exp
 k#020 HLQ="GL";YEAREND="2003";
 k#021 #1======================= begin step#S0010 SORT ========================
 k#022 S0010=A
 k#023 stepctl51;
 k#024 goto
 k#025 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#026 logmsg2 "******** Begin Step $JSTEP sort (#$XSTEP) ********"
 k#027 ##STEP010  EXEC PGM=SORT,REGION=2048K,PN=STEPA
 k#028 export PROGID=sort
 k#029 export PARM=""
 k#030 exportfile  SORTIN data1/gl.account.tran1
 k#031 exportgen1 +1 SORTOUT data1/gl.account.trans_
 k#032 #exportgen1 GDGs written to jobtmp/$jobid2 restored to outdir at Normal EOJ
 k#033 exportfile  SYSIN $RUNLIBS/parms/pgl200s1
 k#034 #2-------------------------- parms/pgl200s1 ---------------------------
 k#035 # SORT FIELDS=(1,8,CH,A,69,12,CH,A)
 k#036 logmsg2 "Executing--> uvsort \"fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTO..."
 k#037 #3----------------------------------------------------------------------
 k#038 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\
 k#039 ,keys=(0,8,e,a,68,12,e,a)"
 k#040 #4----------------------------------------------------------------------
 k#041 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((SCC<8)) && ((SCC+=90));
 k#042 ((JCC|=LCC)); S0010R=1; alias goto="";
 k#043 if ((S0010C != 0)) #need to modify for COND step S0020
 k#044    then logmsg2 "ERR: step#$JSTEP sort abterm $SCC"
 k#045    alias goto="<<S9900=\A"; fi
 k#046 goto
 k#047 #1======================= begin step#S0020 CGL200 ========================
 k#048 if ((S0010C >  4)); then   # COND=(4,LT,STEP010)
 k#049     alias goto="<<S9000=\A"; fi
 k#050 goto
 k#051 S0020=A
 k#052 stepctl51;
 k#053 goto
 k#054 export JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#055 logmsg2 "******** Begin Step $JSTEP cgl200 (#$XSTEP) ********"
 k#056 ##STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
 k#057 export PROGID=cgl200
 k#058 export PARM="2003"
 k#059 exportgen1 +1 GLTRANS data1/gl.account.trans_
 k#060 #exportgen1 GDGs written to jobtmp/$jobid2 restored to outdir at Normal EOJ
 k#061 exportgen0 0 GLMSOLD data1/gl.account.master_
 k#062 ##PEND1 PGL200
 k#063 exportgen1 +1 GLMSNEW data1/gl.account.master_
 k#064 logmsg2 "Executing--> cobrun $ANIM $CBLX/cgl200"
 k#065 #3----------------------------------------------------------------------
 k#066 cobrun $ANIM $CBLX/cgl200
 k#067 #4----------------------------------------------------------------------
 k#068 LCC=$?; S0020C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0020R=1; alias goto="";
 k#069 if ((S0020C != 0))
 k#070    then logmsg2 "ERR: step#$JSTEP cgl200 abterm $SCC"
 k#071    alias goto="<<S9900=\A"; fi
 k#072 goto
 k#073 #8======================================================================
 k#074 S9000=A
 k#075 jobend51 #move any new GDG files from jobtmp to intended outdirs
 k#076 logmsg2 "JobEnd=Normal, JCC=$JCC, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 k#077 exit 0 #ver:20151027 a2b0c0d1e2f0g1h1i15j0k15l1m4n3o8p0q0r0s2t1u1v0w0x0y1z1
 k#078 #9======================================================================
 k#079 S9900=A
 k#080 jobabend51 #report GDGs NOT moved from jobtmp/subdirs to outdirs
 k#081 logmsg2 "JobEnd=AbTerm, JCC=$JCC,Steps=$XSTEP/$JSTEP" RV ACK
 k#082 exit $JCC
Note
  • change line k#067 as follows to force ERR on step 2 (demo GDG recovery)

 k#067 LCC=99; S0020C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0020R=1; alias goto="";
 =============

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7C1. MVSJCL.doc: Operating Aids

Console Log

Script started on Mon 04 Aug 2008 09:07:16 AM PDT


 <@:mvstest:/home/mvstest> cdd
                           ===
 <@:mvstest:/home/mvstest/testdata> l
 drwxrwxr-x 2 mvstest apps 4096 May 27 21:26 ar
 drwxrwxr-x 2 mvstest apps 4096 Aug  4 09:06 gl
 drwxrwxr-x 2 mvstest apps 4096 Jul 26  2007 data1save
 drwxrwxr-x 2 mvstest apps 4096 Dec  2  2005 jobctl
 drwxrwxr-x 2 mvstest apps 4096 Aug  4 09:04 joblog
 drwxrwxr-x 2 mvstest apps 4096 Aug  4 09:04 jobmsgs
 drwxrwxr-x 2 mvstest apps 4096 Aug  4 09:04 jobmsgs1
 drwxrwxr-x 2 mvstest apps 4096 Aug  4 09:04 jobtmp
 drwxrwxr-x 2 mvstest apps 4096 Mar 19 16:17 pf
 drwxrwxr-x 2 mvstest apps 4096 Apr 20 14:42 rpts
 drwxrwxr-x 2 mvstest apps 4096 May 23  2007 sf
 drwxrwxr-x 2 mvstest apps 4096 Aug  4 09:04 sysout
 drwxrwxr-x 2 mvstest apps 4096 May 28 10:50 tape
 drwxrwxr-x 2 mvstest apps 4096 Aug  4 09:04 tmp
 drwxrwxr-x 2 mvstest apps 4096 Aug  4 09:04 wrk
 <@:mvstest:/home/mvstest/testdata> l gl
                                    ====
 -rw-rw-r-- 1 mvstest apps 3394 Aug  4 09:06 account.acntlist_000001
 -rw-rw-r-- 1 mvstest apps 3394 Aug  4 09:06 account.acntlist_000002
 -rw-rw-r-- 1 mvstest apps 3394 Aug  4 09:06 account.acntlist_000003
 -rw-rw-r-- 1 mvstest apps 8720 Aug  4 09:06 account.master_000001
 -rw-rw-r-- 1 mvstest apps 8720 Aug  4 09:06 account.master_000002
 -rw-rw-r-- 1 mvstest apps 8720 Aug  4 09:06 account.master_000003
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.tran1
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.trans_000001
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.trans_000002
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.trans_000003
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.trans_000004
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.trans_000005

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7C2. MVSJCL.doc: Operating Aids

jgl200.log - run #1

 <@:mvstest:/home/mvstest/testdata> jgl200.ksh <-- run#1, Terminates Normally
                                    ==========
 151027:145736:jgl200: Begin Job=jgl200
 151027:145736:jgl200: /home/mvstest/testlibs/jcls/jgl200.ksh
 151027:145736:jgl200: Arguments: jgl200.ksh
 151027:145736:jgl200: ProcessID=20534
 151027:145736:jgl200: RUNDATE=20151027
 151027:145736:jgl200: RUNLIBS=/home/mvstest/testlibs
 151027:145736:jgl200: RUNDATA=/home/mvstest/testdata
 151027:145736:jgl200: JTMP=jobtmp/jgl200
 151027:145736:jgl200: SYOT=sysout/JGL200
 151027:145736:jgl200: LOGNAME=mvstest TESTPROD=T000
 151027:145736:jgl200: HOSTNAME=uvsoft5.uvsoftware.ca
 151027:145736:jgl200: ******** Begin Step S0010 sort (#1) ********
 151027:145736:jgl200: file: SORTIN=data1/gl.account.tran1 fsize=4K
 151027:145736:jgl200: gen+1 SORTOUT=/home/mvstest/testdata/data1/gl.account.trans_ gens=7
 151027:145736:jgl200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 fsize=4K
 151027:145736:jgl200: Executing--> uvsort "fili1=data1/gl.account.tran1,typ=RSF,rcs=80,filo1=...
 151027:145736:JGL200: uvsort fili1=data1/gl.account.tran1,filo1=jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans
 151027:145736:JGL200: EOF fili01 20 rds, 1600 size; data1/gl.account.tran1
 151027:145736:JGL200: sort phase complete, used 512 megabytes, sort output begin
 151027:145736:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/jgl200/GDG/@home@mvstest@testdata@data1@gl.account.trans_000005
 151027:145736:JGL200: StepTimes: S0010 sort Begun=14:57:36 End=14:57:36 Elapsed=00:00:00
 151027:145736:jgl200: ******** Begin Step S0020 cgl200 (#2) ********
 151027:145736:jgl200: gen+1 GLTRANS=/home/mvstest/testdata/data1/gl.account.trans_ gens=7
 151027:145736:jgl200: gen0 GLMSOLD=data1/gl.account.master_000004 insize=16K
 151027:145736:jgl200: gen+1 GLMSNEW=/home/mvstest/testdata/data1/gl.account.master_ gens=7
 151027:145736:jgl200: Executing--> cobrun -F /home/mvstest/testlibs/cblx/cgl200
 151027:145736:jgl200: moving /home/mvstest/testdata/jobtmp/jgl200/GDG/files back to intended directories
 /home/mvstest/testdata/data1/gl.account.master_000005
 /home/mvstest/testdata/data1/gl.account.trans_000005
 151027:145736:JGL200: StepTimes: S0020 cgl200 Begun=14:57:36 End=14:57:36 Elapsed=00:00:00
 151027:145736:JGL200: Job Times: Begun=14:57:36 NormalEnd=14:57:36 Elapsed=00:00:00
 151027:145736:jgl200: JobEnd=Normal, JCC=0, StepsExecuted=2, LastStep=S0020

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7C3. MVSJCL.doc: Operating Aids

jgl200.log - run #2

 <@:mvstest:/home/mvstest/testdata> cdl
                                    ===
 <@:mvstest:/home/mvstest/testlibs> vi jcls/jgl200.ksh
                                    ==================
    --- use vi to change line 99 of jgl200.ksh from 'LCC=$?' to 'LCC=99'
    --- to force failure on next run (to demo jobmsglog ERRors)
 <@:mvstest:/home/mvstest/testlibs> cdd
                                    ===
 <@:mvstest:/home/mvstest/testdata> jgl200.ksh <-- run#2, Terminates Abnormally
                                    ==========
 080829:151556:JGL200: Begin Job=JGL200
 080829:151556:JGL200: /home/mvstest/testlibs/jcls/jgl200.ksh
 080829:151556:JGL200: Arguments:
 080829:151556:JGL200: RUNLIBS=/home/mvstest/testlibs
 080829:151556:JGL200: RUNDATA=/home/mvstest/testdata
 080829:151556:JGL200: JTMP=jobtmp/JGL200 SYOT=sysout/JGL200
 080829:151556:JGL200: RUNDATE=20080829
 080829:151556:JGL200: Begin Step S0010 sort (#1)
 080829:151556:JGL200: file: SORTIN=gl/account.tran1 bytes=1600
 080829:151556:JGL200: gen+1: SORTOUT=jobtmp/JGL200/GDG/gl/account.trans_000007 gens=18
 080829:151556:JGL200: file: SYSIN=gl/parms/pgl200s1 bytes=
 080829:151556:JGL200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 bytes=34
 080829:151556:JGL200: uvsort fili1=gl/account.tran1,filo1=jobtmp/JGL200/GDG/gl/account.trans_000007
 080829:151556:JGL200: EOF fili01 20 rds, 1600 size; gl/account.tran1
 080829:151556:JGL200: sort phase complete, used 64 megabytes, sort output begin
 080829:151556:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/JGL200/GDG/gl/account.trans_000007
 080829:151556:JGL200: Begin Step S0020 cgl200 (#2)
 080829:151556:JGL200: gen+1: GLTRANS=jobtmp/JGL200/GDG/gl/account.trans_000007 gens=18
 080829:151556:JGL200: gen0: GLMSOLD=gl/account.master_000004 insize=8720
 080829:151556:JGL200: gen+1: GLMSNEW=jobtmp/JGL200/GDG/gl/account.master_000005 gens=10
 080829:151556:JGL200: ERR: step#S0020 cgl200 abterm 99
 080829:151556:JGL200: ERR: Terminated Abnormally,JCC=99,StepsExec=2,Last=S0020 y/n?
 080829:151558:JGL200: Job Times: Begun=15:15:56 End=15:15:58 Elapsed=00:00:02
 080829:151558:JGL200: ERR: GDG files NOT moved from jobtmp/subdirs to /home/mvstest/testdata/subdirs
 080829:151558:JGL200: - can rerun OK, since GDGs not added to RUNDATA/subdirs
 080829:151558:JGL200: - OR restart at abterm step & reply y to move prompt
 080829:151558:JGL200: ERR: jobtmp/JGL200/GDG/gl/files NOT moved to $RUNDATA/gl/ listed below:
 gl/account.trans_000007
 gl/account.master_000005
 080829:151558:JGL200: - reply y/n acknowledge GDG msg, but no auto action y/n?

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7C4. MVSJCL.doc: Operating Aids

jgl200.log - run #3

 <@:mvstest:/home/mvstest/testdata> cdl
                                    ===
 <@:mvstest:/home/mvstest/testlibs> vi jcls/jgl200.ksh
                                    ==================
    --- use vi to change line 99 of jgl200.ksh from 'LCC=99' back to 'LCC=$?'
    --- to demo recovery from GDG files NOT moved from jobtmp/... to data1/ subdir
 <@:mvstest:/home/mvstest/testlibs> cdd
                                    ===
 <@:mvstest:/home/mvstest/testdata> jgl200.ksh <-- run#3, Terminates Normally,
                                    ==========            BUT you get WARNing
 080829:151615:JGL200: Begin Job=JGL200
 080829:151615:JGL200: /home/mvstest/testlibs/jcls/jgl200.ksh
 080829:151615:JGL200: Arguments:
 080829:151615:JGL200: RUNLIBS=/home/mvstest/testlibs
 080829:151615:JGL200: RUNDATA=/home/mvstest/testdata
 080829:151615:JGL200: JTMP=jobtmp/JGL200 SYOT=sysout/JGL200
 080829:151615:JGL200: RUNDATE=20080829
 111127:131222:JGL200: WARN: files in jobtmp/GDG subdirs (from prior AbTerm ERR?)
 111127:131222:JGL200: ---- files in jobtmp/JGL200/GDG/*/* listed below:
 jobtmp/JGL200/GDG/gl/account.master_000005
 jobtmp/JGL200/GDG/gl/account.trans_000007
 111127:131222:JGL200: If NO restart by step#, GDG files jobtmp/ will be cleared
 111127:131222:JGL200:    - allows rerun from begin job with no worry about GDGs
 111127:131222:JGL200: If RESTARTing by step#, example--> jobname.ksh start=S0050
 111127:131222:JGL200:    - GDG files in jobtmp/... will NOT be cleared
 111127:131222:JGL200:    - will be available to steps after restart step#
 111127:131222:JGL200:    - will be restored to data1/... subdir at JobEnd=Normal
 111127:131222:JGL200: enter to continue
 080829:151617:JGL200: Begin Step S0010 sort (#1)
 080829:151617:JGL200: file: SORTIN=gl/account.tran1 bytes=1600
 080829:151617:JGL200: gen+1: SORTOUT=jobtmp/JGL200/GDG/gl/account.trans_000007 gens=18
 080829:151617:JGL200: file: SYSIN=gl/parms/pgl200s1 bytes=
 080829:151617:JGL200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 bytes=34
 080829:151617:JGL200: uvsort fili1=gl/account.tran1,filo1=jobtmp/JGL200/GDG/gl/account.trans_000007
 080829:151617:JGL200: EOF fili01 20 rds, 1600 size; gl/account.tran1
 080829:151617:JGL200: sort phase complete, used 64 megabytes, sort output begin
 080829:151617:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/JGL200/GDG/gl/account.trans_000007
 080829:151617:JGL200: Begin Step S0020 cgl200 (#2)
 080829:151617:JGL200: gen+1: GLTRANS=jobtmp/JGL200/GDG/gl/account.trans_000007 gens=18
 080829:151617:JGL200: gen0: GLMSOLD=gl/account.master_000004 insize=8720
 080829:151617:JGL200: gen+1: GLMSNEW=jobtmp/JGL200/GDG/gl/account.master_000005 gens=10
 080829:151617:JGL200: Job Times: Begun=15:16:17 End=15:16:17 Elapsed=00:00:00
 080829:151617:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/
 `jobtmp/JGL200/GDG/gl/account.master_000005' -> `gl/account.master_000005'
 `jobtmp/JGL200/GDG/gl/account.trans_000007' -> `gl/account.trans_000007'
 080829:151617:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7C5. MVSJCL.doc: Operating Aids

jgl200.log - run #4

 <@:mvstest:/home/mvstest/testdata> jgl200.ksh <-- run#4, Terminates Normally
                                    ==========
 080829:152825:JGL200: Begin Job=JGL200
 080829:152825:JGL200: /home/mvstest/testlibs/jcls/jgl200.ksh
 080829:152825:JGL200: Arguments:
 080829:152825:JGL200: RUNLIBS=/home/mvstest/testlibs
 080829:152825:JGL200: RUNDATA=/home/mvstest/testdata
 080829:152825:JGL200: JTMP=jobtmp/JGL200 SYOT=sysout/JGL200
 080829:152825:JGL200: RUNDATE=20080829
 080829:152825:JGL200: Begin Step S0010 sort (#1)
 080829:152825:JGL200: file: SORTIN=gl/account.tran1 bytes=1600
 080829:152825:JGL200: gen+1: SORTOUT=jobtmp/JGL200/GDG/gl/account.trans_000008 gens=18
 080829:152825:JGL200: file: SYSIN=gl/parms/pgl200s1 bytes=
 080829:152825:JGL200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 bytes=34
 080829:152825:JGL200: uvsort fili1=gl/account.tran1,filo1=jobtmp/JGL200/GDG/gl/account.trans_000008
 080829:152825:JGL200: EOF fili01 20 rds, 1600 size; gl/account.tran1
 080829:152825:JGL200: sort phase complete, used 64 megabytes, sort output begin
 080829:152825:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/JGL200/GDG/gl/account.trans_000008
 080829:152825:JGL200: Begin Step S0020 cgl200 (#2)
 080829:152825:JGL200: gen+1: GLTRANS=jobtmp/JGL200/GDG/gl/account.trans_000008 gens=18
 080829:152825:JGL200: gen0: GLMSOLD=gl/account.master_000005 insize=8720
 080829:152825:JGL200: gen+1: GLMSNEW=jobtmp/JGL200/GDG/gl/account.master_000006 gens=10
 080829:152825:JGL200: Job Times: Begun=15:28:25 End=15:28:25 Elapsed=00:00:00
 080829:152825:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/
 `jobtmp/JGL200/GDG/gl/account.master_000006' -> `gl/account.master_000006'
 `jobtmp/JGL200/GDG/gl/account.trans_000008' -> `gl/account.trans_000008'
 080829:152825:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
 <@:mvstest:/home/mvstest/testdata> l gl
                                    ====
 -rw-rw-r-- 1 mvstest apps 3394 Aug  4 09:06 account.acntlist_000001
 -rw-rw-r-- 1 mvstest apps 3394 Aug  4 09:06 account.acntlist_000002
 -rw-rw-r-- 1 mvstest apps 3394 Aug  4 09:06 account.acntlist_000003
 -rw-rw-r-- 1 mvstest apps 8720 Aug  4 09:06 account.master_000001
 -rw-rw-r-- 1 mvstest apps 8720 Aug  4 09:06 account.master_000002
 -rw-rw-r-- 1 mvstest apps 8720 Aug  4 09:06 account.master_000003
 -rw-rw-r-- 1 mvstest apps 8720 Aug  4 09:08 account.master_000004
 -rw-rw-r-- 1 mvstest apps 8720 Aug  4 09:12 account.master_000005
 -rw-rw-r-- 1 mvstest apps 8720 Aug  4 09:12 account.master_000006
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.tran1
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.trans_000001
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.trans_000002
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.trans_000003
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.trans_000004
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:06 account.trans_000005
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:08 account.trans_000006
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:12 account.trans_000007
 -rw-rw-r-- 1 mvstest apps 1600 Aug  4 09:12 account.trans_000008

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7C6. MVSJCL.doc: Operating Aids

 <@:mvstest:/home/mvstest/testdata> l jobmsgs
                                    =========
 -rw-rw-r-- 1 mvstest apps 208 Aug  4 09:08 080804:090804_JGL200
 -rw-rw-r-- 1 mvstest apps 701 Aug  4 09:10 080804:091055_JGL200
 -rw-rw-r-- 1 mvstest apps 831 Aug  4 09:12 080804:091137_JGL200
 -rw-rw-r-- 1 mvstest apps 208 Aug  4 09:12 080804:091216_JGL200
 <@:mvstest:/home/mvstest/testdata> jobmsgs1 jobmsgs
                                    ================
 joblogr1 - copy all files from 1 directory to a 2nd directory
 080804:091252:joblogr1: uvcopy ver=20080526 pf=/home/uvadm/pf/IBM/joblogr1
 uvcopy DISAM ext=dat LNX L64  license=20080526V site=UV_Software
 080804:091252:joblogr1: EOF fili01 rds=10 size=701: jobmsgs/080804:091055_JGL200
 080804:091252:joblogr1: EOF fili01 rds=4 size=208: jobmsgs/080804:091216_JGL200
 080804:091252:joblogr1: EOF fili01 rds=4 size=208: jobmsgs/080804:090804_JGL200
 080804:091252:joblogr1: EOF fili01 rds=12 size=831: jobmsgs/080804:091137_JGL200
 080804:091252:joblogr1: EOF fild01 rds=6 size=4096: jobmsgs
 080804:091252:joblogr1: EOF filo02 wrts=34 size=1934: jobmsgs1/080804ALL
 080804:091252:joblogr1: EOF filo03 wrts=24 size=1516: jobmsgs1/080804ERR

ALL files from jobmsgs combined into jobmsgs1/080804ALL for easier review ---> enter to display jobmsgs1/080804ALL (with more) files with any ERR msgs combined into jobmsgs1/080804ERR to check for ERRs ---> enter to display jobmsgs1/080804ERR (with more)

   -------- jobmsgs1/ALL & jobmsgs1/ERR removed from this 'Console Log' --------
Note
  • please see the 'jobmsgs' on page '7D1'
  • illustrated separately from 'console logs'
 <@:mvstest:/home/mvstest/testdata> l jobmsgs1
                                    =========
 -rw-rw-r-- 1 mvstest apps 1934 Aug  4 09:12 ALL
 -rw-rw-r-- 1 mvstest apps 1516 Aug  4 09:12 ERR
 <@:mvstest:/home/mvstest/testdata> exit
                                    ====
 Script done on Mon 04 Aug 2008 09:13:25 AM PDT

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7D1. MVSJCL.doc: Operating Aids

Job Message Logging Demo

On page '7B1', we ran JCL/script 'jgl200.ksh' 4 times forcing some GDG file ERRors on run#2. On pages '7C1' thru '7C6', we illustrated the 'console log' which contains all console messages & is quite lengthy.

We will now illustrate the 'job message logs' which are much shorter, since they contain only the more vital & ERRor messages.

The 'logmsg2' function in the JCL/scripts writes the vital/ERR messages to $RUNDATA/jobmsgs/... creating a separate jobmsglog for each JCL/script execution. These files are date/time stamped (ex: 080805:112600_JGL200).

To make it easier to review all jobmsglogs, we will use script 'jobmsgs1' to concatenate the separate jobmsglogs to 2 files in $RUNDATA/jobmsgs1/yymmddALL & $RUNDATA/jobmsgs1/yymmddERR.

We already ran the 'jobmsgs1' script on page '7B1', but it will not hurt to run it again here, since it will simply recreate the ALL & ERR files from the multiple jobmsglogs created by 4 executions of jgl200.ksh.


 #1. cdd --> alias 'cd $RUNDATA' --> /home/mvstest/testdata
     ===

 #2. jobmsgs1 jobmsgs  <-- concatenate to jobmsgs1/yymmddALL & jobmsgs1/yymmddERR
     ================

 #3. l jobmsgs1           <-- display output filenames
     ==========
      -rw-rw-r-- 1 mvstest apps 1934 Aug  4 09:12 ALL
      -rw-rw-r-- 1 mvstest apps 1516 Aug  4 09:12 ERR

 #4. more jobmsgs1/yymmddALL  <-- inspect ALL jobmsglogs
     =======================    - please see the output on the next page -->

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7D2. MVSJCL.doc: Operating Aids

jobmsgs1/yymmddALL


 #4. more jobmsgs1/yymmddALL <-- inspect ALL jobmsglogs
     =======================   - concatenated together with blank line separators
 080829:151518:JGL200: Begin Job=JGL200
 080829:151518:JGL200: Begin Step S0010 sort (#1)
 080829:151518:JGL200: Begin Step S0020 cgl200 (#2)
 080829:151518:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/
 080829:151518:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
 080829:151615:JGL200: Begin Job=JGL200
 111127:131222:JGL200: WARN: files in jobtmp/GDG subdirs (from prior AbTerm ERR?)
 111127:131222:JGL200: ---- files in jobtmp/JGL200/GDG/*/* listed below:
 jobtmp/JGL200/GDG/data1/gl.account.master_000005
 jobtmp/JGL200/GDG/data1/gl.account.trans_000007
 111127:131222:JGL200: If NO restart by step#, GDG files jobtmp/ will be cleared
 111127:131222:JGL200:    - allows rerun from begin job with no worry about GDGs
 111127:131222:JGL200: If RESTARTing by step#, example--> jobname.ksh start=S0050
 111127:131222:JGL200:    - GDG files in jobtmp/... will NOT be cleared
 111127:131222:JGL200:    - will be available to steps after restart step#
 111127:131222:JGL200:    - will be restored to data1/... subdir at JobEnd=Normal
 111127:131222:JGL200: enter to continue
 080829:151617:JGL200: Begin Step S0010 sort (#1)
 080829:151617:JGL200: Begin Step S0020 cgl200 (#2)
 080829:151617:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/
 080829:151617:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
 080829:151556:JGL200: Begin Job=JGL200
 080829:151556:JGL200: Begin Step S0010 sort (#1)
 080829:151556:JGL200: Begin Step S0020 cgl200 (#2)
 080829:151556:JGL200: ERR: step#S0020 cgl200 abterm 99
 *080829:151556:JGL200: ERR: Terminated Abnormally,JCC=99,StepsExec=2,Last=S0020*
 *080829:151558:JGL200: ERR: GDG files NOT moved from jobtmp/subdirs to /home/mvstest/testdata/subdirs*
 080829:151558:JGL200: - can rerun OK, since GDGs not added to RUNDATA/subdirs
 080829:151558:JGL200: - OR restart at abterm step & reply y to move prompt
 080829:151558:JGL200: ERR: jobtmp/JGL200/GDG/gl/files NOT moved to $RUNDATA/gl/ listed below:
 *080829:151558:JGL200: - reply y/n acknowledge GDG msg, but no auto action*
 080829:152825:JGL200: Begin Job=JGL200
 080829:152825:JGL200: Begin Step S0010 sort (#1)
 080829:152825:JGL200: Begin Step S0020 cgl200 (#2)
 080829:152825:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/
 080829:152825:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

7D3. MVSJCL.doc: Operating Aids

jobmsgs1/yymmddERR


 #5. more jobmsgs1/yymmddERR  <-- inspect ERR jobmsglogs
     =======================
 080829:151556:JGL200: Begin Job=JGL200
 080829:151556:JGL200: Begin Step S0010 sort (#1)
 080829:151556:JGL200: Begin Step S0020 cgl200 (#2)
 080829:151556:JGL200: ERR: step#S0020 cgl200 abterm 99
 *080829:151556:JGL200: ERR: Terminated Abnormally,JCC=99,StepsExec=2,Last=S0020*
 *080829:151558:JGL200: ERR: GDG files NOT moved from jobtmp/subdirs to /home/mvstest/testdata/subdirs*
 080829:151558:JGL200: - can rerun OK, since GDGs not added to RUNDATA/subdirs
 080829:151558:JGL200: - OR restart at abterm step & reply y to move prompt
 080829:151558:JGL200: ERR: jobtmp/JGL200/GDG/gl/files NOT moved to $RUNDATA/gl/ listed below:
 *080829:151558:JGL200: - reply y/n acknowledge GDG msg, but no auto action*
 080829:151615:JGL200: Begin Job=JGL200
 111127:131222:JGL200: WARN: files in jobtmp/GDG subdirs (from prior AbTerm ERR?)
 111127:131222:JGL200: ---- files in jobtmp/JGL200/GDG/*/* listed below:
 jobtmp/JGL200/GDG/gl/account.master_000005
 jobtmp/JGL200/GDG/gl/account.trans_000007
 111127:131222:JGL200: If NO restart by step#, GDG files jobtmp/ will be cleared
 111127:131222:JGL200:    - allows rerun from begin job with no worry about GDGs
 111127:131222:JGL200: If RESTARTing by step#, example--> jobname.ksh start=S0050
 111127:131222:JGL200:    - GDG files in jobtmp/... will NOT be cleared
 111127:131222:JGL200:    - will be available to steps after restart step#
 111127:131222:JGL200:    - will be restored to data1/... subdir at JobEnd=Normal
 111127:131222:JGL200: enter to continue
 080829:151617:JGL200: Begin Step S0010 sort (#1)
 080829:151617:JGL200: Begin Step S0020 cgl200 (#2)
 080829:151617:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/
 080829:151617:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
Note
  • the 'ERR' jobmsglog includes messages only from runs #2 & #3.
  • since only they contain 'ERR' msgs & runs #1 & #4 do not.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_8 Converting MVS JCL to Korn shell scripts

JCL/script Review, Modifying, Writing new scripts


8A1. Quiz: profiles, env-vars, JCL/scripts, etc
8A2. stub_profile & common_profile
8A3. $RUNLIBS & $RUNDATA used by JCL/scripts
8A4. filenames defined 'RELATIVELY' from $RUNDATA
8A5. profile changes for Training, Conversion,& Production
8A6. profiles in appsadm/env/ vs uvadm/env/

8B1. Condition Codes (program status Return-Codes)
8B2. Sample JCL/script 'cgl100.ksh to demo return code testing & GDGs

8C1. write new GDG's in Temp subdirs until Normal EOJ
- forcing 'Abterm' to test GDG recovery

8D1. JCL converter inserts code to Restart JCL/scripts from any step

8E1. capturing jobmsgs for programmer testing/review
- captures console log for 1 job at a time for immediate review

8F1. capture all console I/O messages for entire login session
- primarily for production run error checking
- cleanup console logs (remove screen control characters)

8F2. Viewing your 'cleaned up' console log files
- processing console logs via nightly 'cron' jobs

8G1. capturing console logs from cron jobs by mail

Modifying converted JCL/scripts


8J1. Modifying converted JCL/scripts - Overview

8K1. Example #1 - change jar100.ksh to solicit the date from the operator
- vs coded on PARM=... for update prior to running the job

8L1. Example #2 - change jgl100.ksh to solicit account.master_ generation#
- vs default of the latest (highest generation#)

8L2. Ex#2 alternate solution using 'opt=c' option in GDG control file

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

JCL/script Review, Modifying, Writing new scripts (Contents cont)

writing new JCL/scripts


8N1. sortsales1 - simplest possible new script

8N2. sortsales2 - new script modified to Vancouver Utility standards
- to allow running from anywhere
- to allow running same script on different sets of DATA
(production, or test, or multiple test sets)

8N3. sortsales3 - testing condition return code from COBOL programs
and utilities (uvsort, uvcp, etc)

8N4. sorttrans4 - allowing for GDG files when jobs Abend or terminate normally
- new generations not stored on Abnormal termination
- using functions jobabend51 & jobend51

8N5. sorttrans4 - adding 2nd step to illustrate multi-step jobs
with common points at EOJ for Normal & Abnormal terminations
- also adding labels to allow restart at any step
- console log captured to illustrate restart at step 2

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8A1. MVS JCL Conversion to Korn shell scripts

Quiz: profiles, env-vars, JCL/scripts, etc

Part 10 is intended to test your understanding of profiles, environmental- variables, JCL/scripts, etc - things you need to know to work effectively with the converted JCL/scripts.

UV Software provides profiles with the Vancouver Utilties package. After install, they may be found in /home/uvadm/env/... The simplest is 'utilities- profile' for users who are NOT performing mainframe conversions. For mainframe conversions the profile is split into 2 parts - stub_profile & common_profile.

To install, you copy either the 'utilities_profile' or the 'stub_profile' to your homedir, renaming as '.profile' or as 'bash_profile'.

  1. What determines naming to '.profile' or 'bash_profile' ?

  2. What else must you do before the new profile is activated ?

Assuming mainframe conversions, the stub_profile (renamed .profile or .bash_profile) calls 'common_profile' via the 'source' command or '.', for example:


      . /home/uvadm/env/common_profile
      ================================
  1. Why must the stub_profile call common_profile via '.' (or 'source') ?

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8A2. Quiz: profiles, env-vars, JCL/scripts, etc

stub_profile & common_profile

'common_profile' defines many environmental-variables. What is an environmental-variable ? Some important env-vars for mainframe conversions are RUNLIBS, RUNDATA. The common_defines provided defines these as follows: (may be modified for your site depending on file systems setup by your sysadmin).

      export TESTLIBS=/p1/apps/testlibs  <-- defs in common_defines
      export TESTDATA=/p1/apps/testdata
      export PRODLIBS=/p2/apps/prodlibs
      export PRODDATA=/p2/apps/proddata

The 'stub_profile' defines 'RUNLIBS' & 'RUNDATA' in terms of these, for example:

      export RUNLIBS=/p1/apps/testlibs  <-- for programmers
      export RUNDATA=/p1/apps/testlibs
          - - - OR - - -
      export RUNLIBS=/p2/apps/testlibs  <-- for operators
      export RUNDATA=/p2/apps/testlibs

The 'common_profile' uses $RUNLIBS & $RUNDATA to define other items, example:

      export PATH=$PATH:$RUNLIBS/jcls

 #04. What are some other items defined using $RUNLIBS & $RUNDATA ?
      (You could use 'vi' to /search common_profile for /RUNLIBS & /RUNDATA)
  1. What are the advantages of this 3 part profile system ?

  2. What advantages to sysadmin who maintains the common_profile ?

  3. What advantages to the programmer who maintains his stub_profile ?

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8A3. Quiz: profiles, env-vars, JCL/scripts, etc

$RUNLIBS/$RUNDATA used by JCL/scripts

By now you probably understand that the converted JCL/scripts use $RUNDATA to address either test or production data directories & $RUNLIBS to address either test or production libraries.


 #10. But why do we not see $RUNDATA/$RUNLIBS in converted JCL/scripts ?
      (For example see jar100.ksh listed at '1C2')

The COBOL program (car100.cbl) is called by JCL/script jar100.ksh as follows:


      cobrun $ANIM $CBLX/car100
      ========================
  1. What are cobrun, ANIM,& CBLX ?

  2. Where are ANIM & CBLX defined ?

I will give you the answer - they are defined in function 'jobset51', which is called on line#10 of all converted JCL/scripts (sample jar100.ksh at '1C2').


 jobset51  # call function for JCL/script initialization <-- line 10 JCL/scripts
 =======================================================

And line 56 of jobset51 (full listing on '5K1' or extract on '1C5') is:


 export CBLX=$RUNLIBS/cblx   # path for loading COBOL programs (line 56 jobset51)
 ========================
  1. How does this definition of CBLX allow for programmers to execute programs from testlibs & operators to execute programs from prodlibs ?

On our system JCL/scripts are found via $PATH, but COBOL programs are executed explicitly from $CBLX/... (or RUNLIBS/cblx/...).

  1. What is the advantage of this ?

Data files are defined prior to the COBOL execution, for example:


      exportfile CUSTMAS data1/ar.customer.master
      ===========================================

'CUSTMAS' is the LOGICAL filename coded in the COBOL program to access the PHYSICAL filename 'data1/ar.customer.master'.


 #15. What COBOL statement relates the logical filename to the physical filename?
      (see sample COBOL program listed at MVSCOBOL.htm#2D2)

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8A4. Quiz: profiles, env-vars, JCL/scripts, etc

filenames defined 'RELATIVE' to $RUNDATA

Note that 'data1/ar.customer.master' is a 'relative' filename (no leading /). This means the working directory must be above subdir data1/ Somewhere there must be a 'cd $RUNDATA', but we do not see it in the JCL/scripts (see sample jar100.ksh listed on page '1C2').

  1. Where is the 'cd $RUNDATA' ?

'exportfile' is a 'function'.

  1. What is a function ?

  2. Where is the function code stored ?

  3. How does the script know where to find it ?

We could have defined the file with the unix 'export' command as follows:


      export CUSTMAS=data1/ar.customer.master
      =======================================
  1. Why does the 'export' command use '=' between logical & physical names, but our 'exportfile' fucntion uses a ' ' space ?

  2. Why do we use the 'exportfile' function (vs the 'export' command) ?

For GDG generation files, we would use 'exportgen0' to get the current generation & 'exportgen1' to determine the name of the next generation.

For example, see jgl100.ksh listed on page '8B2' (lines 28 & 29):


      exportgen0 0 ACCTMAS data1/gl.account.master_
      =======================================
      exportgen1 +1 ACTLIST $JGDG/data1/gl.account.acntlist_
      ================================================

As you can see our filenaming convention for GDG files is the trailing '_'. The generation# follows the '_' on the actual filenames in data directories. (see examples at '5B1')

  1. What would the actual filename be for generation #1 ?

  2. What other 'exportgen_' functions are available & what do they do ?

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8A5. Quiz: profiles, env-vars, JCL/scripts, etc

profile changes for Training, Conversion,& Production

Earlier, we explained that the RUNLIBS & RUNDATA might be defined in stub_profile as follows:

      export RUNLIBS=/p1/apps/testlibs   <-- for programmers
      export RUNDATA=/p1/apps/testdata
      export RUNLIBS=/p2/apps/prodlibs   <-- for operators
      export RUNDATA=/p2/apps/proddata

But the supplied stub_profile defines RUNLIBS/RUNDATA as follows:

      export RUNLIBS=$HOME/testlibs  <-- overrides defs in common_defines
      export RUNDATA=$HOME/testdata    - remove these for actual conversions
Note
  • the '$HOME/...' definitions in the stub_profiles are intended ONLY for
    the initial conversion training period.
  • they would be removed before the conversion team begins the actual
    conversion testing & debugging.
  1. What are the advantages of the '$HOME' definitions for initial training ?

  2. Why must they be removed before the conversion team begins testing & debugging ?

  3. Do you see any reason why programmers might want to use '$HOME/testdata' after the actual conversion has begun or after production has begun ?

  4. Why might system administrators remove write permissions on the stub_profiles of operators ? of programmers ?

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8A6. Quiz: profiles, env-vars, JCL/scripts, etc

profiles in appsadm/env/ vs uvadm/env/

The profiles are supplied in /home/uvadm/env/... and the stub_profile sources ('.' executes) the common_profile as follows:


      . /home/uvadm/env/common_profile
      ================================

ADMjobs.htm#1D1 - 1D7 recommends setting up user 'appsadm', & copying /home/uvadm/env/* to /home/appsadm/env/..., and change the source execution to:


      . /home/appsadm/env/common_profile
      ==================================
  1. What is the advantage of the above procedure ?

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8B1. Quiz: profiles, env-vars, JCL/scripts, etc

Condition Codes (program status Return-Codes)

On the mainframe, serious errors in program executions were detected automatically, and the job would be 'Terminated Abnormally'.

On Unix/Linux, the scripts must test the return code from the programs and take appropriate action. Our JCL converter inserts code to test the return code, and 'goto' a common 'Terminated Abnormally' errmsg at the end of the script.

sample JCL/script for COBOL with cc test

For illustratation, see JCL/script 'cgl100.ksh' listed on the next page. We have sequence numbered the lines, so we can refer to items by line# in the following questions. We have omitted some non-relevant lines.

  1. Why do we capture the return code '$?' (see line #37) in variable LCC ?

  2. Why do we also capture it in S0010C, SCC,& JCC ?

You can see from 'if ((S0010C != 0))' that if the return code is anything other than zero, we will 'goto' the 'Terminated Abnormally' end point.

  1. Did the mainframe terminate jobs for all non-zero condition codes ?

  2. How would you change the above code if 'cgl100' should be allowed to return codes < 12 ?

  3. Do you understand how the 'goto' (line #41) works ?

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8B2. Quiz: profiles, env-vars, JCL/scripts, etc

sample JCL/script, demo return-codes, GDGs, etc

 k#001 #!/bin/ksh
 k#002 ##JGL100   JOB  (1234),'LIST GL MASTER CHART OF ACCOUNTS'
 k#003 export jobid2=jgl100 JOBID2=JGL100; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$jobid1" ]]; then export jobid1=$jobid2; fi
 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#006 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
 k#008 autoload exportfile exportgen0 exportgen1 exportgen2 exportgenall exportgenx
 k#009 . $APPSADM/env/stub.ini  #<-- for control-M (see notes in env/stub.ini)
 k#010 jobset51    # call function for JCL/script initialization
 k#011 goto
 k#012 S0000=A
 k#013 # * MVS JCL CONVERSION DEMO - PROCs & GDG files
 k#014 #0========================== begin proc PGL100 ============================
 k#015 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003                     #<-PROC1call
 k#016 ##PGL100   PROC HLQ=GL,YEAREND=2002                            #<-PROC1
 k#017 HLQ="GL";YEAREND="2002";
 k#018 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003                      #<-PROC1exp
 k#019 HLQ="GL";YEAREND="2003";
 k#020 #1======================= begin step#S0010 CGL100 ========================
 k#021 S0010=A
 k#022 stepctl51;
 k#023 goto
 k#024 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#025 logmsg2 "******** Begin Step $JSTEP cgl100 (#$XSTEP) ********"
 k#026 ##STEP010  EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND,PN=STEPA
 k#027 export PROGID=cgl100
 k#028 export PARM="2003"
 k#029 exportgen0 0 ACCTMAS data1/gl.account.master_
 k#030 exportgen1 +1 ACTLIST data1/gl.account.acntlist_
 k#031 #exportgen1 GDGs written to jobtmp/$jobid2 restored to outdir at Normal EOJ
 k#032 exportfile SYSOUT $SYOT/${jobid2}_${JSTEP}_SYSOUT_$(date +%y%m%d_%H%M%S)
 k#033 ##PEND1 PGL100
 k#034 logmsg2 "Executing--> cobrun $ANIM $CBLX/cgl100"
 k#035 #3----------------------------------------------------------------------
 k#036 cobrun $ANIM $CBLX/cgl100
 k#037 #4----------------------------------------------------------------------
 k#038 LCC=$?; S0010C=$LCC; ((SCC|=LCC)); ((JCC|=LCC)); S0010R=1; alias goto="";
 k#039 if ((S0010C != 0))
 k#040    then logmsg2 "ERR: step#$JSTEP cgl100 abterm $SCC"
 k#041    alias goto="<<S9900=\A"; fi
 k#042 goto
 k#043 #8======================================================================
 k#044 S9000=A
 k#045 jobend51 #move any new GDG files from jobtmp to intended outdirs
 k#046 logmsg2 "JobEnd=Normal, JCC=$JCC, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 k#047 exit 0 #ver:20151027 a2b0c0d1e2f0g1h1i15j0k15l1m4n3o8p0q0r0s2t1u1v0w0x0y1z1
 k#048 #9======================================================================
 k#049 S9900=A
 k#050 jobabend51 #report GDGs NOT moved from jobtmp/subdirs to outdirs
 k#051 logmsg2 "JobEnd=AbTerm, JCC=$JCC,Steps=$XSTEP/$JSTEP" RV ACK
 k#052 exit $JCC

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8C1. Quiz: profiles, env-vars, JCL/scripts, etc

new GDG's in Temp subdirs until Normal EOJ

On the mainframe, new generations were not updated until the job Terminated Normally, which meant you could just fix the problem & rerun the job, without having to remove the new generations.

Our converted JCL/scripts provide this functionality by writing new GDG's to a temporary subdir. At normal EOJ, function 'jobend51' will move the temp files to the appropriate output subdir. The code lines (in sample job jgl100.ksh) involved in GDG file handling listed below. See more explanations at '5D1' & '5D2'.

      k#010 jobset51   # call function for JCL/script initialization
      k#030 exportgen1 +1 ACTLIST data1/gl.account.acntlist_
      k#045 jobend51   #move GDG files from jobtmp/GDG/... to RUNDATA/data1
      k#051 jobabend51 #report GDGs NOT moved from jobtmp/GDG/... to data1/
  1. Can you explain the role each of these lines play in GDG file handling ?

    Forcing 'Abterm' to test GDG recovery

When I was debugging the GDG file handling, I forced step failures to test recoveries/reruns.

  1. Looking at the jgl100.ksh job (listed on the previous page), can you suggest 2 ways to force the job to fail (give line#s & describe changes).

  2. How could you force the job to fail without changing any code in jgl100.ksh?

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8D1. Quiz: profiles, env-vars, JCL/scripts, etc

Restart JCL/script from any step

The JCL converter inserts code to allow the JCL/scripts to be restarted from any step. A step#/code is inserted at the begining of each step, for example here are relevant lines extracted from jar200.ksh (listed on page '1D2'.

 k#002 ##JGL100   JOB  (1234),'LIST GL MASTER CHART OF ACCOUNTS'
 k#003 export JOBID2=JGL100 jobid2=jgl100; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$JOBID1" ]]; then export JOBID1=$JOBID2; fi
 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#010 jobset51  # call function for JCL/script initialization
 k#011 goto      <-- where does this goto ?
 k#012 S0000=A
 k#015 S0010=A
               - - - step 1 details - - -
 k#42 S0020=A
               - - - step 2 details - - -
 k#64 S9000=A
               - - - Normal Termination - - -
 k#69 S9900=A
               - - - Abnormal Termination - - -

Restart command


 jar200.ksh start=S0020        <-- restart jar200.ksh at step#2
 ======================

It is not readily apparent what makes restart from any step possible. The secret is found in 'jobset51'. See listing on pages '1C5' & '1C6'. The 2 most important lines are 214 & 217:


 js#214 if [[ -z "$STEP" ]]; then export STEP=S0000; fi
        ===============================================
 js#217 alias goto="<<${STEP}=A"
        ========================

Line 217 sets up alias 'goto' with the step code entered on the command line & the 'goto' is executed on line k#11 of the JCL/script (see jar200.ksh above).

  1. Why can we enter 'start=...' in lower case, when the code tests $STEP in UPPER case ?

  2. Unix/linux scripts do not have a real 'goto' command. How does our goto='<<${STEP}=A' work ?

  3. What is the significance of the '<<' ?

  4. What is the reason for the '=A' ? Why not just goto='<<$STEP' ?

  5. Why are lines 3 & 5 required for Restart to work ? (see k#003 & k#005 in JCL/script jar200.ksh above, or jgl100.ksh on '8B2')

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8E1. Quiz: profiles, env-vars, JCL/scripts, etc

jobmsgs for programmer testing

The 'joblog' scripts allow programmers to run JCL/scripts and capture console messages in a file for reviewing. The file is written into subdir joblog/... in your current working directory.

For example, you could run demo JCL/script jar100.ksh & capture the log into $RUNLIBS/joblog/jar100.log as follows:


 #1. login as yourself --> your homedir
 #2. cdl --> alias cdl='cd $RUNLIBS' (might be /home/userxx/testlibs/.)o

 #3. jar100.ksh   <-- run directly, shows log on screen only
     ==========

 #3a. joblog jar100.ksh    <-- run via joblog script
      =================      - to capture log in a file
                               $RUNLIBS/joblog/jar100.log

 #4. more joblog/jar100.log  <-- display the log file
     ======================
 080827:155517:JAR100: Begin Job=JAR100
 080827:155517:JAR100: /home/mvstest/testlibs/jcls/jar100.ksh
 080827:155517:JAR100: RUNLIBS=/home/mvstest/testlibs
 080827:155517:JAR100: RUNDATA=/home/mvstest/testdata
 080827:155517:JAR100: Begin Step S0010 car100 (#1)
 080827:155517:JAR100: file: CUSTMAS=data1/ar.customer.master bytes=8192
 080827:155517:JAR100: file: NALIST=data1/ar.customer.nameadrs.list100 bytes=2858
 080827:155517:JAR100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
  1. How does the joblog script capture logs into a file, while also showing them on the screen ?

 #44a. vi $UV/sf/IBM/joblog  <-- examine script to answer question above
       ====================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8F1. Quiz: profiles, env-vars, JCL/scripts, etc

Console Logging

The console logging system (documented at ADMjobs.htm#Part_6) captures all console outputs & inputs into a date/time stamped file that can be saved for a month or more.

Console logging is activated by uncommenting 7 '##' lines at the end of the stub_profile provided (see ADMjobs.htm#1C1). The 2 most important lines are:

      ## logfixA $LOGNAME
      ## exec script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)

'script' is the unix/linux utility to capture subsequent console I/O (until you logoff) into a file. For example, if your userid is 'john', the filename on Dec 4/2009 at 1:33 would be '/home/appsadm/log1/john/091204_133300'

As well as uncommenting the 7 ## lines at the end of your profile, you must also setup subdirs matching your userid in /home/appsadm/log1,log2,log3.

      mkdir /home/appsadm/log1/john  <-- current logfile being created
      mkdir /home/appsadm/log2/john  <-- cleaned up logfiles for current month
      mkdir /home/appsadm/log3/john  <-- last month's logfiles
  1. What other action is required to begin logging ? - after setting up subdirs matching your userid & uncommenting 7 ## lines

  2. How might you examine your logfiles ?

    cleaning up the log files

Console logs collected in /home/appsadm/log1/... are difficult to examine with 'vi' because they contain many 'screen control characters'. We provide script 'logfixA' to remove the screen control characters (cleanup) while copying the log files from $APPSADM/log1/$LOGNAME/... to $APPSADM/log2/$LOGNAME/... You could run the logfixA cleanup script as follows:


 #1. exit     <-- log off to write out your last script buffer
 #2. Login    <-- log back in
 #3. logfixA  <-- run script to cleanup/copy log1/... to log2/...
 #4. vi /home/appsadm/log2/john/*  <-- examine your cleaned up logs

Actually, you do NOT have to run 'logfixA' explicitly, because your profile runs it for you when you log back in (1 of the 7 ## lines at end profile). And of course logging back in then executes the 'script' command to start collecting your next log file into log1/...

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8F2. Quiz: profiles, env-vars, JCL/scripts, etc

Viewing your console log files

You might list & view your cleaned up log files as follows (if you are John):


 #1. l /home/appsadm/log2/john/   <-- list logfiles for current month
       091201_093000    <-- log file started on Dec 1/2009 at 9:30 AM
       091202_101500    <-- log file started on Dec 2/2009 at 10:15 AM
       091203_144500    <-- log file started on Dec 3/2009 at 2:45 PM

 #2. vi /home/appsadm/log2/john/091203_144500  <-- view latest logfile

BUT, we provide a more convenient 'logview' script, which lists the logfiles & prompts you to enter a file# to view (vs having to enter the filename).


 #3. logview      <-- shows log2/... files for current user
     =======        - then prompts for # of logfile to view
       03. 091201_093000
       02. 091202_101500
       01. 091203_144500   <-- most recent file last as #01

 #3a. 1           <-- reply '1' to see the latest log file
      ===
 #3b. 1 -d        <-- print latest log file on default printer
      ====
 #3c. 1 -dlp0     <-- print latest log file on printer 'lp0'
      =======

processing logfiles by nightly cron jobs

All users should log off at the end of their shift to ensure the last buffer of their 'script command' is written out.

But, in case users forget to logout, we provide scripts & sample crontab files:

killuser2
crontab_root
  • sample crontab to schedule killuser2 (see ADMjobs.htm#5F2)
  • must be owned by root to kill other users
crontab_appsadm
  • sample crontab to schedule 'nightly1' & 'logfixN'
nightly1
  • sample script to call various nightly processing jobs/scripts
  • listed at ADMjobs.htm#5C1, runs 'logfixN'
logfixN
  • copy/cleanup all logfiles from $APPSADM/log1/*/* to log2/.../...
  • listed at ADMjobs.htm#6S4
Note
  • Each morning 'appsadm' should check the results of nightly cron jobs
  1. How would 'appsadm' check results of nightly cron jobs ?
  2. How might he print the prior day's log file for operator 'john'
  3. How might he search for any errors in yestrday's log files ?

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8G1. Quiz: profiles, env-vars, JCL/scripts, etc

capturing logs from cron jobs by mail

The pages above reviewed procedures to capture console logs from JCL/scripts run by logged-in operators (from their command line shell prompts). See complete documentation at ADMjobs.htm#5A1 - 5H1.

BUT, the above method of cpaturing console logs does NOT work for JCL/scripts scheduled by cron (nightly batch jobs). It does not work because their is NO logged-in user to execute the 'script' command (at end of profile) to collect the console messages into a file.

However, cron jobs DO mail console msgs to the owner of the crontab file that scheduled the JCL/scripts. We setup 'appsadm' to own & issue the crontab comamnds. Each morning 'appsadm' could read his mail to see if there were any errors in last night's cron jobs.

BUT, it might be nicer if we could caapture the mail from nightly cron jobs into date/time stamped files (similar to the log files captured from logged- in operators). ADMjobs.htm#5I1 - 5K7 documents how we can do this. Here are some of the subdirs & files used in /home/appsadm/...

 /home/appsadm
 :-----cronlog1     <-- 1 line status msgs (optional)
 :     :-----090423_174201_cronscript1
 :     :-----
 :-----cronlog2     <-- console logs captured by mail from cron
 :     :-----090423_174301_cronscript1
 :     :-----
 :-----env          <-- profiles called by cronscript1
 :     :-----stub_profile_cronlogdemo
 :     :-----common_profile
 :-----sf           <-- crontabs & scripts for demo & production models
 :     :-----cronscript1
 :     :-----cronmailsave1
 :     :-----crontab2
  1. Why can we NOT capture console logs from cron jobs using the same method (script command at end profile) as we do for logged-in operators ?

  2. How do we capture mail from cron jobs into date/time stamped files ?

See 'cronscript1' listed at ADMjobs.htm#5K3 & note it executes the profile on line 99 as follows:


 . $APPSADM/env/stub_profile_cronlogdemo
 ===============================================
 - special version of stub_profile listed at ADMjobs.htm#5K6
  1. Why must cronscript1 '.' execute the stub_profile ? Why must the stub_profile be executed prior to executing any JCL/script (such as jgl100.ksh).

  2. Why did we need a special version of the stub_profile ? How is stub_profile_cronlogdemo different from the normal stub_profile ?

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8J1. Converting MVS JCL to Korn shell scripts

modifying JCL/scripts - Overview

After the initial conversion, you will probably need to & want to modify the JCL/scripts for many reasons, such as:

  1. Improve/clarify messages to operators

  2. Change embedded data (dates,rates,etc) to prompts for operator entries, or the reverse if scripts are run by cron.

  3. Change embedded data or operator prompts to separate parameter file, that can be updated with a unix editor or windows/wordpad networked using Samba.

  4. Integrate new software packages available on open systems unix/linux. This is the huge advantage that converting the JCL to Korn shell scripts has over JCL emulation offered by some vendors.

    Writing new JCL/scripts

Pages '8N1' - '8N6' are a tutorial on writing new scripts to conform to the Vancouver Utility standards established by the mainframe JCL to Korn shell script converter.

We present 5 scripts from the simplest sortsales1 (non-conforming) thru the fully conforming sorttrans5. Each script adds 1 or 2 conforming features to help you understand their importance.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8K1. modifying JCL/scripts - Examples

Ex#1 - prompting operator for PARM info

The 1st example will be based on JCL/script 'jar120.ksh' very similar to jar100.ksh listed on page '1C2' (used in part 1 to demo the JCL conversion to Korn shell scripts).

Problem
  • jar120.ksh passes the report date to the COBOL program car120.cbl
    via PARM="July 31, 2006". On the mainframe this was on the EXEC.
    On unix/linux this is converted to an environmental variable 'PARM'
    & the COBOL program is converted to 'ACCEPT' it's value.

 export PARM="July 31, 2009"   <-- see line #22 in jar120.ksh
 ===========================     - similar to line #22 jar100.ksh page '1C2'
Required
  • add code to jar120.ksh to solicit the report date from the operator.
  • use 'until do ... done' loop to force operator to enter something.
      rptdate=" "
      until [[ "$rptdate" > " " ]]
         do echo "enter report date (ex: January 31, 2009)"
            read rptdate
         done
      export PARM=$rptdate

edit & test

Assuming you have setup testlibs & testdata in your homedir as instructed on page '1P3' and performed the demo conversions on the following pages, then you can edit & test this modification as follows:


 #1. Login as yourself --> /home/yourhomedir
     =================

 #2. cdl (alias cdl='cd $RUNLIBS') --> /home/yourhomedir/testlibs
     ===

 #3. cp jcls/jar120.ksh sf/jar121.ksh  <-- copy/rename (do not change original)
     ================================    - to 'sf' subdir also in PATH

 #4. vi sf/jar121.ksh                  <-- edit demo JCL/script
     ================                    - change/insert code shown above

 #5. cdd (alias cdl='cd $RUNDATA') --> /home/yourhomedir/testdata
     ===

 #6. jar121.ksh   <-- execute modified script, enter report date when prompted
     ==========     - try blank to test 'until' logic

 #7. head data1/ar.customer.nameadrs.list120 <-- display report
     =======================================   - verify entered date in report headings
                                               - similar report listed on page '1T3'

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8L1. modifying JCL/scripts - Examples

Ex#2 - solicitating desired GDG generation#

The 2nd example is based on JCL/script 'jgl100.ksh' on '8B2' which demonstrates GDG files (see jgl100.ksh listed on page '1E3'). jgl100.ksh reads the latest generation of data1/gl.account.master_ & writes the report to the next generation of data1/gl.account.master.list_ Here are the relevant subdirs/files for this exercise:

 /home/yourhomedir
 :-----testlibs            <-- super directory for test libs subdirs
 :     :-----cblx          <-- executable (compiled) COBOL programs
 :     :-----jcls          <-- JCLs converted to Korn shell scripts
 :-----testdata            <-- super directory for test/data subdirs & files
 :     :-----data1         <-- subdir for data files
 :     :     :--O--gl.account.acntlist_000001 <-- report created by jgl100.ksh
 :     :     :--I--gl.account.master_000001
 :     :     :--I--gl.account.master_000002
 :     :     :--I--gl.account.master_000003   <-- latest generation of account.master
Required
  • modify jgl100.ksh to prompt the operator for the generation desired
    (to allow listing prior month's account.master).

Here is line 29 of jgl100.ksh ('1E3') using function 'exportgen0' to determine the latest generation of the account.master_ GDG file.


 exportgen0 0 ACCTMAS data1/gl.account.master_
 =======================================

One solution would replace this with the following:

 gen=000000
 until [[ "$gen" > 000000 ]]
    do echo "enter desired generation (6 digits) for data1/gl.account.master_"
       read gen
    done
 exportfile ACCTMAS data1/gl.account.master_$gen

notes

  1. Use function 'exportfile' when the generation# is coded (via '$gen' here), since 'exportgen0' demands GDG filenames end with '_' & it would automatically determine the latest generation.

  2. You can make the change shown above using operating instructions similar to those given for exercise #1 on the previous page. Test & Debug.

  3. The solution above has a flaw - the gen# specified by the oeperator might not exist & the job would fail.
Required
  • change the 'until' line to test for the existence of the generation#
    specified by the operator. Test & debug.
  • Hint: you can use the '-f' Korn shell test option

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8L2. modifying JCL/scripts - Examples

Ex#2 alternate - get GDG# via 'opt=c' option

Here is an alternate solution to the previous page exercise. The GDG control file (ctl/gdgctl51) allows options to prompt for the generation# desired (null entry defaults to the highest generation).

sample ctl/gdgctl51

 # gdgctl51 - GDG control file
 #          - distributed in /home/uvadm/mvstest/testdata/ctl/gdgctl51
 # - loaded by 'gdgload51' to test GDG files (jgl100.ksh, jgl220.ksh)
 # - see MVSJCL.doc pages 5D1-5D9 & 5E1-5E11
 # - distributed with test/demo files (data1/gl.account.master_, etc)
 # - user must code his data filenames with desired generations gdg=...
 data1/gl.account.acntlist_   gdg=08
 data1/gl.account.master_     gdg=10
 data1/gl.account.trans_      gdg=18
 data1/py.payroll.master_     gdg=20 next=000002(000002:000002)070630:235959
 data1/py.time.cards_         gdg=30 opt=c next=000001(000001:000012)000000:000000

Above is the test/demo GDG control file supplied with Vancouver Utilities. 'opt=c' (on data1/py.time.cards_) is the option to prompt for generation#. You could add it to data1/gl.account.master_ & rerun as follows:


 #1. Login as yourself --> /home/yourhomedir
     =================

 #2. cdd (alias cdl='cd $RUNDATA') --> /home/yourhomedir/testdata
     ===

 #3. vi ctl/gdgctl51   <-- edit GDG control file
     ===============     - add 'opt=c' to data1/gl.account.master_ as shown below:

      data1/gl.account.master_     gdg=10 opt=c
      ===================================

 #4. uvcopy gdgload51  <-- reload Indexed control file ctl/gdgctl51I.dat & .idx
     ================

 #5. jgl100.ksh   <-- execute original script
     ==========     - enter 1 of the valid generation#s
                    - try null entry to test default highest gen

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8N1. Converting MVS JCL to Korn shell scripts

Writing new JCL/scripts

As a starting point consider the following script to sort data1/ar.sales.items by product#. We made this script by extracting the 'uvsort' lines from demo JCL/script jar200.ksh (listed on page '1D2'). See the data1/ar.sales.items file listed on page '1T4'.

stage#1 - simplest possible new script

 #!/bin/ksh
 # sortsales1 - sort sales.items file by prod#, cust#, drop slsmn 65,85
 #         - writing new scripts tutorial stage#1 (see MVSJCL.doc#8N1)
 #         - simplest possible, must be located above I/O subdirs ar & tmp
 uvsort "fili1=data1/ar.sales.items,typ=RSF,rcs=64,filo1=tmp/sales.items_sorted\
 ,typ=RST,rcs=64,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
 exit 0

These scripts are supplied in /home/uvadm/mvstest/testlibs/sf/... If you have followed the instructions on page '1P3' they will now be in /home/yourhomedir/testlibs/sf/... You can run the 1st one as follows:


 #1. Login as yourself --> /home/yourhomedir
     =================

 #2. cdl (alias cdl='cd $RUNLIBS') --> /home/yourhomedir/testlibs
     ===

 #3. vi sf/sortsales1   <-- inspect script (should be same as listed above)
     ================

 #4. cdd (alias cdl='cd $RUNDATA') --> /home/yourhomedir/testdata
     ===

 #5. sortsales1   <-- execute script
     ==========

 #6. uvhd data1/ar.sales.items r64   <-- inspect Input file
     =============================     - need uvhd since no LineFeeds
                                      - see listings on page '1T4'

 #7. cat tmp/sales.items_sorted  <-- inspect output file
     ==========================    - can use cat since output typ=RST
                                   - note in sequence by product# bytes 30-35

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8N2. Writing new JCL/scripts

sortsales2 - stage2 enhancements

 #!/bin/ksh
 # sortsales2 - sort sales.items file by prod#, cust#, drop slsmn 65,85
 #         - writing new scripts tutorial stage#2 (see MVSJCL.doc#8N2)
 #         - add jobset51 to allow run from anywhere using $RUNLIBS/$RUNDATA
 #           to allow use in PRODuction or TEST or multi testdata for prgrmrs
 #         - define files using 'exportfile' to echo filenames to console log
 export JOBID2=sortsales2     # $JOBID2 used by jobset51 for jobtmp subdir
 autoload jobset51 exportfile # declare functions used in this script
 jobset51                     # call function to setup job environment
 exportfile SORTIN data1/ar.sales.items
 exportfile SORTOUT $JTMP/sales.items_sorted
 uvsort "fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT\
 ,typ=RST,rcs=64,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
 exit 0

notes re stage2 enhancements

  1. We added function 'jobset51' at the begining of the script. 'jobset51' (listed at '5K1') performs many job setup functions, most important are:
  1. We use function 'exportfile' to define the filenames as $SYMBOLs on the uvsort command. The exportfile function will echo the filenames into the console log.

  2. Scripts using GDG files would define filenames using exportgen0/exportgen1 which are essential to determine the current & next generation of the files (see later script 'sorttrans4').

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8N3. Writing new JCL/scripts

sortsales3 - stage3 enhancements

 #!/bin/ksh
 # sortsales3 - sort sales.items file by prod#, cust#, drop slsmn 65,85
 #         - writing new scripts tutorial stage#3 (see MVSJCL.doc#8N3)
 #         - enhancements over sortsales2
 #         - added condition code testing & terminated Normally/Abnormally msgs
 export JOBID2=sortsales3     # $JOBID2 used by jobset51 for jobtmp subdir
 autoload jobset51 exportfile logmsg1 logmsg2 # declare functions in this script
 jobset51                     # call function to setup job environment
 exportfile SORTIN data1/ar.sales.items
 exportfile SORTOUT $JTMP/sales.items_sorted
 uvsort "fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT\
 ,typ=RST,rcs=64,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
 LCC=$?               # capture uvsort return code status
 if ((LCC != 0))
    then logmsg2 "ERR - Terminated Abnormally code=$LCC"
         exit $LCC; fi
 logmsg1 "Terminated Normally"
 exit 0

notes re stage3 enhancements

  1. We have added code to test the return code from uvsort to see if successful and if not we generate an error message. Multi step jobs would terminate as illustrated by later job sorttrans5.

  2. Note that the script 'exit's with 0 for success or non-zero for failure. So if this job were called by another job, the calling job could determine if this job was successful or not.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8N4. Writing new JCL/scripts

sorttrans4 - stage4 enhancements

 #!/bin/ksh
 # sorttrans4 - sort account.trans_ file by account#
 #         - writing new scripts tutorial stage#4 (see MVSJCL.doc#8N4)
 #         - changes from stage#3 (sortsales3)
 #         - change input from data1/ar.sales.items to data1/gl.account.trans_ (GDG file)
 #         - change exportfile to exportgen0/exportgen1 for GDG files
 #         - add functions jobend51/jobabend51 to inhibit new GDGs on Abterms
 export JOBID2=sorttrans4     # $JOBID2 used by jobset51 for jobtmp subdir
 autoload jobset51 exportfile logmsg1 logmsg2 jobend51 jobabend51
 jobset51                     # call function to setup job environment
 exportgen0 0 SORTIN data1/gl.account.trans_
 exportgen1 +1 SORTOUT data1/gl.account.trans_
 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RST,keys=(0,8,c,a)"
 LCC=$?               # capture uvsort return code status
 if ((LCC != 0))
    then logmsg2 "ERR - Terminated Abnormally code=$LCC"
         jobabend51   # show new GDG files NOT moved to output subdir
         exit $LCC; fi
 jobend51             # show new GDG files MOVED to output subdir (Normal EOJ)
 logmsg1 "Terminated Normally"
 exit 0

notes re stage4 enhancements

  1. This script illustrates GDG files. GDG files are defined using 'exportgen0' for the current generation & 'exportgen1' for the next generation.

  2. We declared functions 'jobend51' & 'jobabend51' on the autoload line.

  3. Note that 'exportgen1' creates new generations in $JTMP. At the end of the job, the new genertions are moved back to the intended output subdir by 'jobend51' which is executed ONLY if all steps are successful.

  4. If any steps fail, 'jobabend51' will warn the operator & list the new generations NOT moved back to the intended output subdir.

  5. This allows the operator to simply rerun the job from the begining (after correcting the problem).

  6. Alternatively he could restart the job at the point of failure and use the option (by jobset51 at begining of the rerun) to move the new generations back to the intended subdir.

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8N5. Writing new JCL/scripts

sorttrans5 - stage5 enhancements

 #!/bin/ksh
 # sorttrans5 - sort account.trans_ file by account#
 #         - writing new scripts tutorial stage#5 (see MVSJCL.doc#8N5)
 #         - changes from stage#4 (sorttrans4)
 #         - add 2nd step to calculate transaction total $amount
 #         - add common points for Terminated Normally & Abnormally
 #         - insert step# codes S0000,S0010,S0020 to allow restart at any step
 export JOBID2=sorttrans5; args="$*"   # $JOBID2 & args used by jobset51
 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 autoload jobset51 exportfile logmsg1 logmsg2 jobend51 jobabend51
 jobset51                     # call function to setup job environment
 goto
 S0000=A
 S0010=A
 exportgen0 0 SORTIN data1/gl.account.trans_
 exportgen1 +1 SORTOUT data1/gl.account.trans_
 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RST,keys=(0,8,c,a)"
 #4----------------------------------------------------------------------
 LCC=$?; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 if ((SCC != 0))
    then logmsg2 "ERR - Step Abterm code=$SCC"
    alias goto="<<S9900=A"; fi
 goto
 #
 S0020=A
 exportgen0 0 GLTRAN data1/gl.account.trans_
 exportfile GLSUM tmp/account.trans_sum
 #3----------------------------------------------------------------------
 uvcopy addup1,fili1=$GLTRAN,filo1=$GLSUM,uop=q0b40c10
 #4----------------------------------------------------------------------
 LCC=$?; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 if ((SCC != 0))
    then logmsg2 "ERR - Step Abterm code=$SCC"
    alias goto="<<S9900=A"; fi
 goto
 #8======================================================================
 S9000=A
 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs
 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 exit 0
 #9======================================================================
 S9900=A
 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
 exit $JCC

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

8N6. Writing new JCL/scripts

notes re stage5 enhancements

  1. We have added a 2nd step to illustrate a multi-step job. 'uvcopy addup1' is a Vancouver utility preprogrammed job to accumulate any field in any file. Option 'uop=b40c10' defines the field Begining byte# & Column length.

  2. For muti-step jobs we code common 'goto' points at he end of the job, for Normal & Abnormal terminations. Note the goto labels 'S9000=A' for Normal & 'S9900=A' for Abnormal.

  3. We also provide for 'RESTART' at any step by adding goto labels at each step (see S0010=A & S0020=A). To restart at step 2 the operator enters:

 sorttran5 start=S0020
 =====================

'jobset51' stores any start=... in the goto alias which defaults to S0000=A if no start=... was specified on the command line. Note 'args="$*"' and 'for arg in $args ...' were added to export command line arguments for jobset51.

console log illustrating restart

 090928:110921:sorttrans5: Begin Job=sorttrans5
 090928:110921:sorttrans5: Arguments: start=S0020
 090928:110921:sorttrans5: RUNLIBS=/home/mvstest/testlibs
 090928:110921:sorttrans5: RUNDATA=/home/mvstest/testdata
 090928:110921:sorttrans5: JTMP=/home/mvstest/testdata/jobtmp/sorttrans5
 090928:110921:sorttrans5: RUNDATE=20090928
 090928:110921:sorttrans5: WARN: **restarting** at STEP=S0020
 090928:110921:sorttrans5: gen0: GLTRAN=data1/gl.account.trans_000005 insize=1600
 090928:110921:sorttrans5: file: GLSUM=tmp/account.trans_sum bytes=1420
 addup1 - add a column of numbers in a text file
 uop=b14c11e2 - default options
     b14      - begin column# (zero relative)
        c11   - columns wide
           e0 - edit 0 decimals
           e2 - edit 2 decimals
 090928:110921:sorttrans5: uvcopy ver=20090909 pf=/home/uvadm/pf/demo/addup1
 uvcopy DISAM ext=dat LNX L64  license=090909_00V_930630 site=UV_Software
 EOF Total  7,886.77
 090928:110921:sorttrans5: EOF fili01 rds=20 size=1600: data1/gl.account.trans_000005
 090928:110921:sorttrans5: EOF filo01 wrts=21 size=1420: tmp/account.trans_sum
 090928:110921:sorttrans5: Job Times: Begun=11:09:21 End=11:09:21 Elapsed=00:00:00
 090928:110921:sorttrans5: EOF filr01 rds=5 upds=3 size=10240: /home/mvstest/testdata/ctl/gdgctl51I
 090928:110921:sorttrans5: JobEnd=Normal, StepsExecuted=0, LastStep=S0000

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

Part_9 MVS JCL Conversion to Korn shell scripts

Part 9 - conversion support scripts & uvcopy jobs


9A0. Conversion support 'scripts'
- most scripts are listed in detail

9B0. Conversion support 'uvcopy jobs'
- important uvcopy job names are given
- only 1 job is listed in detail
  (since uvcopy jobs are longer than scripts)

There are over 500 scripts & uvcopy jobs supplied with the Vancouver Utilities. We will name the most important scripts & uvcopy jobs here in Part 9, that are directly involved in JCL conversion.

You can inspect any of these with 'vi' or print with 'uvlp12', for example:


 vi /home/uvadm/sf/IBM/jcl2ksh51   <-- view script to convert 1 JCL to ksh
 ===============================

 uvlp12 /home/uvadm/pf/IBM/procNF  <-- print uvcopy to summarize missing PROCs
 ================================

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

9A0. MVS JCL Conversion to Korn shell scripts

conversion support scripts

Here is a list of some of the script names used for JCL conversion, followed by a detail listing of the most important scripts (those with links).


9A1. jcl2ksh51 - convert 1 MVS JCL thru all stages
- cleanup, PROC/INCLUDE expansion, JCL conversion, copy to jcls
- jcl0 ---> jcl1 ---> jcl2 ---> jcl3 ---> jcls

9A2. jcl2ksh51A - convert all JCL from jcl0 thru jcl3

9A3. jcldata51A - creates ctl/datajcl51, ctl/datajcl52 & sorts 6 files together:
(datactl52+datacat52+dataxl151+dataxl252+dataedt52+datacnv52)
- creates datactl53 & loads indexed file datactl53I
- to supply record-sizes, keys, file types to the JCL converter

9A4. jclpx51 - expand PROCs & INCLUDEs while copying JCL from jcl1 to jcl2

9A5. jclxx51 - convert all JCLs from jcl2 --> jcl3

9A6. jobstop - pause a JCL/script at the next step or a specified step

9A7. jobclear - clear the pause condition
cnvMF51
  • convert 1 COBOL program thru all stages & optionally compile
  • cleanup, conversion,& compile: cbl0 --> cbl1 --> cbl2 --> cbls
  • see COBOL conversion & compile scripts listed in MVSCOBOL.htm.
cnvMF51A
  • convert All COBOL programs from cbl0 --> cbl1 --> cbl2
mfcbl1
  • compile 1 COBOL program
mfcblA
  • compile All COBOL programs

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

9A1. JCL conversion support scripts

jcl2ksh51 - convert 1 JCL thru all stages

 #!/bin/ksh
 # jcl2ksh51 - convert 1 job at a time (by OT, UVSI, Aug2004)
 #           - recommend converting all JCL's in directory (page 1Q1 MVSJCL.doc)
 #           - might use this to convert new jobs brought over from mainframe
 #           - see page 1Q8 MVSJCL.doc or www.uvsoftware.ca/mvsjcl.htm#1Q8
 # jcl2ksh51 does NOT Add datafileinfo in jcl4 (see jcl2ksh51a)
 #
 # - assumes input JCL has been stored in subdir 'jcl0'
 # - assumes any PROC's present in procs (cleaned up from proc0)
 # - assumes any control card members present in parms (cleanup from parm0)
 # - assumes control file ctl/datactl53I previously created
 #   to supply file info (recsizes, key loc/lth, ID GDG files, etc)
 # - will convert JCL from jcl0 --> jcl1 --> jcl2 --> jcl3
 # - you will then manually copy to subdir jcls for test/debug
 #
 if [[ -d jcl1 && -d jcl2 && -d jcl3 && -f "$1" ]]; then :
 else echo "usage: jcl2ksh51 jcl0/JCLfilename [options]"
      echo "       ===================================="
      echo "- arg1 must be a file (usually in jcl0)"
      echo "- arg2 (optional) override options in ctl/jclunixop51"
      echo "- subdirs jcl1,jcl2,jcl3 must be present"
      exit 1; fi
 #
 typeset -l fn="$1"      # convert filename to lower case
 fx=$(basename $fn)      # strip off jcl0/ directory from left side
 f=${fx%.*}              # strip off .extension from right side
 #
 uvcopy cleanup,fili1=$1,filo1=jcl1/$f.jcl,uop=q0i7g8n1
 #=====================================================
 # - cleanup JCL, strip CR's, clear cols 73-80,& shorten to last nonblank
 #
 jclproc51 jcl1/$f.jcl jcl2/$f.jcl procs parms
 #===============================================
 # - expand PROCs & INCLUDEs as we copy jcl from subdir jcl1 to subdir jcl2
 #
 jclunix51 jcl2/$f.jcl jcl3/$f.ksh $2
 #===================================
 # - convert expanded mainframe JCL to Korn shell script
 # - any '$2' options override options in ctl/jclunixop51
 #
 echo "jcl0/$f.jcl converted to jcl3/$f.ksh OK to copy to jcls (overwriting) ?"
 reply=n; read reply
 until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "OK to copy to jcls subdir (overwrite prior) y/n ?"; read reply; done
 if [[ "$reply" = "n" ]]; then echo "reply=$reply, exiting"; exit 1; fi
 cp jcl3/$f.ksh jcls
 #==================
 exit 0

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

9A2. JCL conversion support scripts

jcl2ksh51A - convert all JCL from jcl0 thru jcl3

 #!/bin/ksh
 # jcl2ksh51A - convert All MVS JCL to Korn shell scripts
 #            - by Owen Townsend, UVSI, uppdated July 2014
 #            - see www.uvsoftware.ca/mvsjcltest1.htm#3E1
 # Assumes: mainframe JCL stored in subdir jcl0/... PROC's in proc0/...
 #          control card members SYSINs stored in parm0/...
 # Converts from: jcl0 ---> jcl1 ---> jcl2 ---> jcl3 -x-> jcls
 # - manually copy to subdir jcls 1 at a time for test/debug
 #
 #Jul31/14 - jcldata5A changed to jcldata51A
 # - jcldata51A creates ctl/ctldata53I to supply recsizes, etc to JCL converter
 # - from 3 sources: ctl/datajcl52, ctl/datacat52I,& ctl/dataadd52I
 # - see more explanations in $UV/sf/IBM/jcldata51A
 #
 if [[ -d jcl0 && -d jcl1 && -d jcl2 && -d jcl3 && -d proc0\
    && -d procs && -d parm0 && -d parms && "$1" = "all"\
    && -f ctl/jclunixop51 ]]; then :
 else echo "usage: jcl2ksh51A all"
      echo "       =============="
      echo "subdirs required: jcl0/1/2/3,proc0/1,parm0/s,"
      echo "use script \$UV/sf/IBM/mvslibsdirs to create required subdirs"
      echo "see www.uvsoftware.ca/mvsjcltest1.htm#3E1 for prompt responses"
      exit 91; fi
 #
 echo " "
 echo "\$RUNLIBS/ctl/jclunixop51 - JCL converter options file must be present"
 echo "datafile info control files required (recsize, type, keys, gdgs)"
 echo "1. ctl/datacat52I - datafile info created from mainframe LISTCATs"
 echo "   OR--> makeISF0 ctl/datacat52I 191 0,44 <-- create emty file"
 echo "2. ctl/add/...               <-- additional control files of datafile info"
 echo "   \$UV/ctl/add/dummy_readme   - use this if no additional files"
 echo "Run 'copymvsctls' (\$UV/sf/IBM/copymvsctls) to create empty/dummy files"
 echo " - if you have not transferred LISTCAT reports & created additional files"
 echo " - see script \$UV/sf/IBM/catdata50 to extract datafile info from LISTCATs"
 echo " "
 reply=x;
 until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "Have you created ctl/datacat52I & ctl/add/... additional info ?"
       echo " OR have you run 'copymvsctls' to create empty/dummy files"
       echo " - proceed y/n ?"; read reply; done
 if [[ "$reply" = "n" ]]; then exit 92; fi
 #
 echo "jcl2ksh51A to perform all steps of JCL conversion to Korn shell scripts"
 echo "jcl0--------->jcl1------------->jcl2----------->jcl3---------->jcls"
 echo "     cleanup       Proc-Expand        convert         manual       "
 echo "see www.uvsoftware.ca/mvsjcltest1.htm#3E1 for operating instructions"
 echo "can reconvert JCL without reconvert parms/procs if no changes to parms/procs"
 echo "- convert proc0-->procs & parm0-->parms y/n ? "
 reply=x; read reply
 until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "cleanup proc0-->procs & parm0-->parms y/n ?"; read reply; done
 #
 if [[ "$reply" = "y" ]]; then
    reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "OK to remove all files (cleanup output) from procs & parms ? y/n";
       read reply; done
    if [[ "$reply" = "y" ]]; then rm -f procs/*; rm -f parms/*; fi
    #
    reply=x; g=g8;  # default to clear cols 73-80
    until [[ "$reply" = "y" || "$reply" = "n" ]]
       do echo "clear cols 73-80 of procs & parms y/n ?"; read reply; done
    if [[ "$reply" = "n" ]]; then g=g0; fi
    uvcopyx cleanup proc0 procs uop=q0i7n1$g,arg1=.prc  #<-- cleanup PROCs
    #=================================================
    echo "cleanup procs complete, enter to cleanup parms"; read reply
    uvcopyx cleanup parm0 parms uop=q0i7n5$g  #<-- cleanup parms
    #=======================================
 fi
 #
 echo "now cleanup jcl0--->jcl1 & expand PROCs jcl1--->jcl2"
 reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "OK to remove all files from jcl1,jcl2,jcl3 ? y/n"; read reply; done
 if [[ "$reply" = "y" ]]; then rm -f jcl1/*; rm -f jcl2/*; rm -f jcl3/*; fi
 #
 # 1. cleanup JCL, strip CR's, clear cols 73-80,& shorten to last nonblank
 uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl     #<-- cleanup JCL
 #===============================================
 echo "cleanup complete, enter to perform PROC expansion"; read reply
 #
 # 2. expand procs as we copy JCL from subdir jcl1 to subdir jcl2
 jclpx51 jcl1 jcl2 procs parms
 #===============================
 echo "PROC expansion complete, enter to continue"; read reply
 #
 # 3. generate data info file (ctl/datactl53I) for JCL converter
 #    - major changes July 2014, see explanations lines 25-40 above
 #
 echo "- create data conversion info datactl53I y/n ? "
 reply=x; read reply
 until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "create data conversion info file datactl53I y/n ?"; read reply; done
 #
 if [[ "$reply" = "y" ]]; then
    jcldata51A  #<-- script to create datactl53I (4 uvcopy jobs)
    #=========
    if (($?)); then
       echo "jcldata51I failed, missing files ? (make null files if N/A)"
       echo "ctl/datajcl52 + ctl/datacat52I + ctl/add/... --> ctl/datactl53I"
       exit 93; fi
    echo " "
 fi
 echo "enter to convert JCL to ksh "; read reply
 #
 # 4. convert expanded JCL to Korn shell scripts (jclxx51/jclunix51 July2006)
 jclxx51 jcl2 jcl3
 #================
 #
 #Aug09/14 - jclunix51 updates ctl/datactl53I, save as ctl/add/datactl53a
 # - reconversion will combine any updated recsizes into new ctl/datactl53I
 # cp ctl/datactl53I.dat ctl/add/datactl53a #Sep14/15 drop trailing blanks
 uvcp "fili1=ctl/datactl53I,typ=ISF,rcs=191,filo1=ctl/add/datactl53a,typ=LSTt"
 #============================================================================
 #
 echo "uvlp12 errs/procNF.rpt     <-- print summary report of PROCs Not Found"
 echo "uvlp12 errs/includeNF.rpt  <-- print summary report INCLUDEs Not Found"
 echo "uvlp12 errs/parmNF.rpt     <-- print summary report of PARMs Not Found"
 echo "all JCLs converted from jcl0 --> jcl1 --> jcl2 --> jcl3 (Not to jcls)"
 echo "copy scripts from jcl3 to jcls (in PATH) 1 by 1 as you test/debug"
 #
 #Aug19/14 - add code here at end jcl2ksh51A to load gdgctl51I.dat/.idx
 # - with GDG files extracted from JCL & default generations gdg=07
 # - previously run as per www.uvsoftware.ca/mvsjcltest1.htm#3I1 & 3I2
 # - should be later updated manually or from LISTCAT reports
 # - see $UV/pf/catdata51 & catdata52
 echo "End JCL conversion - create GDG control file"
 echo "Extract GDG files from JCL/scripts & Load \$GDGCTL/gdgctl51I"
 echo "\$GDGCTL=$GDGCTL"
 echo "\$GDGCTL defined in profile as \$RUNDATA/ctl or \$APPSADM/ctl"
 echo "- generations default to 7, later update gdgctl51 & reload gdgctl51I"
 echo "- OR extract from LISTCAT (see $UV/pf/datacat51)"
 #
 uvcopy jclgdgctl51,fild1=jcl3,filo2=ctl/gdgctl51,rop=r0
 #======================================================
 # - extract exportgen0/1 files from all JCL/scripts into ctl/...
 #
 reply=x;
 until [[ "$reply" = "y" || "$reply" = "n" ]]
   do echo "answer 'y' below to overwrite/reload any existing \$GDGCTL/gdgctl51I ?"
      echo "answer 'n' below if you have edited gdgctl51 with desired generations & reloaded gdgctl51I"
      echo "- will save any existing \$GDGCTL/gdgctl51 file with date/time stamp"
      echo "overwrite/reload any existing \$GDGCTL/gdgctl51I y/n ?"; read reply; done
 if [[ "$reply" == "y" ]]; then
    mv $GDGCTL/gdgctl51 $GDGCTL/gdgctl51_$(date +%Y%m%d_%H%M%S)
    cp ctl/gdgctl51 $GDGCTL/
    #=======================
    # copy from $RUNLIBS/ctl to $GDGCTL ($RUNDATA/ctl or $APPSADM/ctl)
    uvcopy gdgload51,fili1=$GDGCTL/gdgctl51,filo1=$GDGCTL/gdgctl51I
    #==============================================================
    # - load Indexed file GDG generations to JCL/scripts function exportgen1
 fi
 echo "Recommend running 'testdatainit' script before initial testing each JCL/script:"
 echo "testdatainit           #<-- init various subdirs & reload gdgctl51I"
 echo "xrefall cbls jcl3 ksh  #<-- recommend running JCL & COBOL cross-references"
 exit 0

Goto:   Begin this doc End this doc Index this doc Contents this library UVSI Home-Page

9A3. JCL conversion support scripts

jcldata51A

 # jcldata51A - extract datafile info (record-sizes,etc) from all JCL
 #              & re-create 'datactl53I' Indexed file for JCL converter
 #            - see  http://uvsoftware.ca/mvsjcltest1.htm#Part_6
 #            - by Owen Townsend, updated Jan 2015
 # jcldata51A - (this script) called by script jcl2ksh51A (for Micro Focus COBOL)
 #            - also called by jcl2ksh53A for AIX COBOL
 #
 #              ** uvcopy jobs & datafiles used by this script **
 #
 # 1. uvcopy jcldata51 extracts DSNs from all JCLs in jcl2/...
 #    & writes control file ctl/datajcl51
 #
 # 2. uvcopy jcldata52 copies ctl/datajcl51 to ctl/datajcl52, converting the
 #    filenames from mainframe to unix/linux script & VU standards
 #
 # 3. uvcopy ctldata53 copies ctl/datajcl52 to ctl/ctldata53, updating keyword
 #    info by lookup Indexed files ctl/datacat52I & ctl/dataadd52I
 #    Following files must/may exist before this script is run
 #
 # 3a. ctl/datacat52I - Indexed file created by script catdata50
 #                      from multiple mainframe LISTCAT reports
 #                    - empty file created by copymvsctls (in case no LISTCAT)
 #
 # 3b. ctl/add/... - may be multiple sequential files in ctl/add/... subdir
 #                 - will be combined by uvcopy catcat51 & loaded into
 #                   Indexed file ctl/dataadd52I
 #
 # 3c. ctl/dataadd52I - Indexed file (interim) created by this script
 #                      from all additional info files in ctl/add/...
 #
 # 3d. $UV/ctl/add/dummy_readme supplied if no additional info
 #              - copied to ctl/add by copymvsctls (in case no other files)
 #
 # 3e. additional files that you may create, name as you like, for example:
 #     ctl/datacpy52 - datafilenames & copybooknames
 #     ctl/dataedt52 - make with editor to supply missing info as desired
 #     ctl/datagdg52 - make with editor to supply missing GDG gnerations
 #
 # 3f. ctl/add/datactl53a - input from any prior jcl2ksh51A
 #                        - saves updates to datactl53I made by JCL converter
 #                          for reconversions by jcl2ksh51A
 #
 # 4. ctl/datactl53I - Indexed file (final result) created by this script
 #                     to supply datafile info to JCL converter
 #                     (record sizes, Indexed keylocs/keylens, file types, etc)
 #
 #                             ** Notes **
 #
 # 1. all uvcopy jobs stored at $UV/pf/IBM/... ($UV usually /home/uvadm)
 #    all scripts are stored at $UV/sf/IBM/...
 #
 # 2. This script is called by jcl2ksh51A which performs all steps
 #    of JCL conversion
 #
 # 3. You may run this script separately anytime you want to update
 #    the JCL conversion control file (ctl/datactl53 & ctl/datactl53I)
 #    when any 1 of the source files has been updated
 #
 # 4. You may then run script 'jclxx51 jcl2 jcl3' to reconvert all JCL
 #    (if no new JCLs have been added to jcl0,jcl1,jcl2)
 #
 # 5. If new JCLs have been added, use 'jcl2ksh51A' (which calls this jcldata51A)
 #    before it reconverts all JCL to ksh scripts
 #
 # 6. How To change record-sizes & file-types in the control files:
 #
 #    jcl2ksh51A saves updated ctl/datactl53I.dat in ctl/add/datactl53a as follows:
 #
 #       cp ctl/datactl53I.dat ctl/add/datactl53a
 #       ========================================
 #
 # If you want to make recsize & file type updates, you can rename & update:
 #
 # 1. mv ctl/add/datactl53a ctl/add/datactl53b
 #    ========================================
 #    - rename saved control file to prevent overwrite on next re-convert
 #
 # 2. vi ctl/add/datactl53b
 #    =====================
 #    - update record-sizes & file-types in renamed file (wont be overwritten)
 #    - will be combined into ctl/datactl53I on rerun of jcl2ksh51A or jcldata51A
 #
 # 3. jcl2ksh51A all     <-- re-convert to affect ctl file updates
 #    ==============       - the slow way if hundreds of JCLs,procs,parms
 #
 #     --> OR as follows (faster, saves cleanups of JCLs,procs,parms)
 #
 # 3a. jcldata51A        <-- re-create Indexed control file from updated ctl files
 #     ==========
 #
 # 3b. jclxx51 jcl2 jcl3 <-- re-convert all JCL to ksh
 #     =================
 #
 #                     ** sources for data info files **
 #
 # 1. JCL, all DSNs extracted, sorted,& reduce to 1 record
 #    per unique datafilename with available file info keyworded on right side
 #    (rca=avg-recsize, rcm=max-recsize, key=..., etc)
 #    uvcopy job#1: jcldata51 reads all JCL, writes ctl/datajcl51
 #    uvcopy job#2: jcldata52 reads ctl/datajcl51, writes ctl/datajcl52
 #
 # 2. LISTCAT report from mainframe transfered to unix/linux,
 #    - reformated similarily to the JCL info
 #    - see script 'catdata50' to extract LISTCAT info & load Indexed file
 #      (runs uvcopy catdata51,catdata52,catcat51,uvcp to load Indexed file)
 #    - must be executed BEFORE JCL conversion
 #    OPTIONAL, if not available make empty file so JCL conversion will run
 #    --------> makeISF0 ctl/datacat52I 191 0,44
 #
 # 3. Additional file info ctl/dataadd53I
 #    uvcopy job catcat51  - combines all files in ctl/add/...
 #    - creates 1 record per filename collecting significant info from multi records
 #    Info files from various sources, filename on left, keyword info on right
 #
 #    Control filenames in ctl/add/... anything you like, such as:
 #
 # 3a. ctl/add/dataedt52 - create with editor, add info not found in JCL
 #                       - record sizes of input only files
 # 3b. ctl/add/datagdg52 - number of generations for GDG files
 # 3c. ctl/add/datacpy52 - copybook names, record sizes, filetypes
 #          - copybooks not required for JCL convert, required for DATA convert
 # 3d. ctl/add/datacnv52 - Data conversion control file (created from data-files)
 #     uvcopy job cnvdata51 - reads ctl/datacnv.txt, writes ctl/datacnv51
 #     uvcopy job cnvdata52 - reads ctl/datacnv51, writes ctl/datacnv52
 #     - this file indicates which files have packed or binary fields
 #     - 1st 5000 bytes of EBCDIC datafiles are scanned for x'0C' & x'00
 #     - result coded on src=... as 'Dp' or 'Db'
 #
 # 3. Additional file info - OPTIONAL
 #    If not available make at least 1 dummy file so JCL conversion will run
 #    - $UV/ctl/add/dummy_readme supplied, copied by copymvsctls script to
 #      $RUNLIBS/ctl/add/dummy_readme
 #
 #                     ** sample input#1 - new datajcl52 **
 #
 # gl.account.acntlist_       rcs=00133 typ=RSF data=____ job=jgl230 prg=CGL100
 # gl.account.master2         rcs=00080 typ=ISF data=____ job=jgl360 prg=IDCAMS key=(0,6)
 # gl.account.master_         rcs=00080 typ=RSF data=____ job=jgl230 prg=CGL200
 # gl.account.master_         rcs=00000 typ=RSF data=____ job=jgl230 prg=CGL200
 # gl.account.tran1           rcs=00000 typ=RSF data=____ job=jgl230 prg=SORT
 # gl.account.trans_          rcs=00080 typ=RSF data=____ job=jgl230 prg=SORT
 #
 #Note - see samples of all control files at beginning of $UV/pf/IBM/ctldata53
 #     - filenames in control files must match filenames output by JCL converter
 #     - lower case, mainframe '$' keyed as '_' underscores
 #     - GDG files Identified by trailing '_' underscores
 #
 echo "jcldata51A - create 'datactl53I' data file info for JCL converter"
 echo "           - data file info may be supplied from 3 sources"
 echo "JCL + LISTCAT + ADDitional sources (combined into 1 Indexed file)"
 echo "datajcl52 + datacat52I + dataadd53I"
 echo "         - combined to ctl/datactl53 & loaded Indexed file ctl/datactl53I"
 echo " 1. this script runs jcldata51 & jcldata52 to cre