MvsJclPerl Documentation in 9 parts


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
- 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
- several of these can be run using the supplied test files

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

Part_4 - Directory Design & Operating Instructions for YOUR conversions
  (vs the test/demo conversions in Part 1)
- improving your JCL conversion, by modifying the control files, etc
- scripts to reconvert JCL - jcl2perl61 & jcl2perl6A
- scripts to reconvert COBOL - cnvMF51c/cnvMF51Ac & cnvMF51/cnvMF51A

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

MvsJclPerl.doc - Converting MVS JCL to Perl scripts - Contents

Note
  • In Jan 2008, MVSJCL.doc was split into 2 documents (books)
  • Parts 6,7,8 were moved to a separate book MVSJCL2.htm
  • Parts 6,7,8 names changed to Parts 26,27,28 to avoid any confusion
  • Part 9 (cross-refs) removed since there is now separate XREFjobs.htm
  • Part 5 changed to GDG implementation
Note
  • Parts 5,6,7,8,9 were removed from this MvsJclPerl to avoid duplication
  • As of Jan 2008, I have not yet had time to bring MvsJclPerl.doc up to
    the current level of Parts 1,2,3,4,5 of MVSJCL.doc.

MVSJCL2.doc (separate book)

 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 (ftriger51)
         - 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.
 XREFjobs.htm - Cross-References
         - copybooks, called programs, JCL files & programs
         - COBOL files info, reads all programs in directory & for each program
           reports: file Org,Access,Open mode,rec-size,copybook,int/ext names
Note
  • Cross-References were moved from original MVSJCL.doc#Part 9
    to a separate book XREFjobs.doc (in Jan 2008).

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

MvsJclPerl.doc - Converting MVS JCL to Perl 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).

MvsJclPerl.htm - MVS JCL Conversion to Perl script (This Document)


MVSJCL.htm - MVS JCL Conversion to Korn shell script

VSEJCL.htm - VSE JCL Conversion to Korn shell script

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-2006

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

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

mailto:owen@uvsoftware.ca

https://www.uvsoftware.ca

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

Part_0 MvsJclPerl Conversion - Major Features

MvsJclPerl.doc is the detailed step by step instructions for converting IBM MVS JCL to Perl scripts, using the Vancouver Utilities from UV Software Inc.

MvsJclPerl Conversion - Major Features

  1. MVS JCL is automatically converted to Perl 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 Perl scripts provides much more flexibility for future enhancements than the 'emulations' offered by some other conversion alternatives. Perl scripts allow you to use the full power of your unix/linux system. Perl 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.pl STEP=S0020 (4 digit step#s incremented by 10).

  5. The JCL converter uses the 'logmsg61' subrtn 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 acknowledgement is requested.

  6. The 'jcpause' script is provided to allow operators to pause jobs at the next step or at any desired step. 'jcpause' 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 Perl 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 Perl 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 Perl scripts.

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

0A2. MVS JCL Conversion to Perl scripts - Major Features

  1. Cross-References of JCL/scripts & COBOL programs/copybooks. Part_9 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 Perl Modules have been written to provide the essential functionality of the IBM cataloged generation files. Please see exportgen0,1,etc which are discussed & listed beginning on page '3D0'.

  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 Part_5 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 subrtn (jobset61) 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 'jobset61' subrtn (part of Perl Module UVjobs61.pm) which is inserted by the JCL converter at the beginning of each JCL/Perl script.

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

0A3. MVS JCL Conversion to Perl 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 beginning on page ADMjobs.htm#1B1.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.

  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 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 Perl 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 approriate 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.

     uvLS1  - 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
     uvLS1C - prints Landscape Simplex (same as above), but allows multiple
              copies to be specified as arg2 on the command line
     uvLD1  - prints Landscape Duplex
     uvLA1  - prints Landscape Simplex if < 500 lines, but Duplex if > 500 lines

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

0A5. MVS JCL Conversion to Perl 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 Perl subrtns (exportgen0, exportgen1, exportgenp,& 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 perl scripts, the (0),(+1),(-1) is indicated by subrtns exportgen0,1,p and a filename will be suffixed with an '_' underscore. The converted data files will be suffixed by '_######' (underscore & 6 digit gen#). Please see Part_8 for further discussion & rerun considerations.

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

0A6. Conversion - Recent Enhancements

Test/Demo files provided

In October 2003, the MVS JCL conversion package and this documentation were significantly enhanced. Test/Demo JCL, PROCs, COBOL programs,& DATA files are now 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 Vancouver Utility versions Oct 2003 or later, 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 copy all test/demo subdirs & files from /home/uvadm/mvstest to /home/mvstest/testlibs.

Although you could copy the 'mvstest' directory to a subdir within your home directory, we recommend the new user 'mvstest', so you will not have to modify your own profile yet. When you decide to proceed with your own conversions, you will be adding the supplied addition to your profile and the profiles of all programmers & operators involved.

Compile 'C' programs if not Linux

As of October 2003, 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 any 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

0A7. MVS JCL Conversion to Windows

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 https://www.microsoft.com/windows/sfu,
 UWIN from https://www.wipro.com/uwin,
 and CYGWIN from https://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'.

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

Part_1. MVS JCL Conversion to Perl 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. This will help you understand these tools & ensure they work at your site.

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

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

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
- jcl2perl61 & jcl2perl6A
1V2.  scripts to reconvert COBOL - 1 at a time or All in directory
- cnvMF51c & cnvMF51Ac for copybooks, cnvMF51 & cnvMF51A for programs

We will illustrate the original mainframe JCL & the converted Perl script equivalents for 6 test/demo JCLs. Then we present the Operating Instructions to Convert, Execute,& Check the 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
 :--*--Csub              - C subroutines for COBOL programs
 :--*--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
 :-----cbls              - copy here (standard source library) before compiling
 :-----cblst             - cobol source listings from compiles
 :-----cblx              - compiled COBOL programs (.int's)
 :--*--parm0             - control cards & includes (SORT FIELDS, etc)
 :-----parms             - control cards with 73-80 cleared
 :-----cpy0              - for COBOL copybooks
 :-----cpy1              - cleaned up, cols 1-6 & 73-80 cleared, etc
 :-----cpy2              - cnvMF5 converts mainframe COBOL to MicroFocus COBOL
 :-----cpys              - copy here (standard copybook library)
 :--*--ctl               - conversion control files (jclperlop61, datafiles51)
 :-----errs              - JCL converter writes ERROR reports here
 :--*--jcl0              - test/demo JCLs supplied
 :-----jcl1              - intermediate conversion 73-80 cleared
 :-----jcl2              - PROCs expanded from procs
 :-----jcl3              - JCLs converted to Perl scripts
 :-----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)
 :--*--proc0             - test/demo PROCs supplied
 :-----procs             - will be merged with jcl1, output to jcl2
 :-----perlm             - Perl Modules (UVjobs61.pm, UVexport61.pm)
 :-----perls             - Perl Scripts (very few, most scripts are ksh)
 :-----rpts              - for optional statistics reports
 :-----sf                - for misc scripts you may wish to write
 :--*--sfun              - Korn shell functions (jobset61,stepctl51,etc)
 :--*--testdata          - test/demo data files supplied
 :     :--*--ap          - Accounts Payable
 :     :--*--ar          - Accounts Receivable
 :     :--*--gl          - General Ledger
 :     :-----jobtmp      - temporary files for SYSIN instream data
 :     :-----sysout      - SYSOUT printer files
 :     :     :----030926 - new sysout subdir created on 1st run of day
 :     :-----tmp         - tmp subdir for uvsort & misc use
 :     :-----wrk         - interstep temporary work files
 :-----tmp               - tmp subdir used by various conversions
 :-----xref              - cross-references (see Part_9)

These directories are supplied as part of the Vancouver Utility package. They allow you to test/demo the conversion procedures, to give you a clear understanding of the process, before converting your own JCL's.

You will be later instructed to setup a test/demo userid/login 'mvstest' and copy all above subdirs from /home/uvadm/mvstest to /home/mvstest/testlibs before running the various conversion jobs.

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/testlibs. 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 (Perl 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 (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 on page '4A1'. The big difference is that you should assign your data directories to a separate file system from the libraries.

creating mvstest sub-directories

If you wish to create the (empty) sub-dirs shown on the previous page for your own conversions (vs these test/demos), you can use the 'mvstestdirs' script: I recommend you setup a separate user/login for your conversions.

  1. login to user desired, make super-dir (if not login home), & change into it.


 2. mvstestdirs
    ===========

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 this test/demo listed at ADMjobs.htm#1B2.

$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 at ADMjobs.htm#1C2 defines RUNLIBS & RUNDATA as follows:


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

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


 export RUNLIBS=/home/mvstest
 #===========================
 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/user_?_/mvstest
 #===================================
 export RUNDATA=/home/user_?_/mvstest/testdata
 #============================================

Note that setting up RUNLIBS & RUNDATA in a HOME dir & RUNDATA as a subdir of RUNLIBS 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 '4A1' thru '4A6'

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

1B1. Sample Conversions of MVS JCL to Perl scripts

test/demo JCL PROCs,& COBOL

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, '.proc' for PROCs, '.pl' for converted perl scripts,& '.cbl' for COBOL programs).

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

1B2. Sample Conversions of MVS JCL to Perl 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/
 :     :-----ar/
 :     :     :--customer.master
 :     :     :--sales.items
 :     :-----gl/
 :     :     :--account.master
 :     :     :--account.trans
 :     :-----py/
 :     :     :--payroll.master
 :     :     :--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 Perl 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  (1234),'TEST MVS2UNIX CONVERSION'                       00000010
 //* CREATE CUSTOMER NAME & ADDRESS LISTING                              00000020
 //STEP010  EXEC PGM=CAR100,PARM=2003                                    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#01 //JAR100   JOB  (1234),'TEST MVS2UNIX CONVERSION'
 j#02 //* CREATE CUSTOMER NAME & ADDRESS LISTING
 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=*

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 Perl script sequence#s with 'p##'.

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 Perl 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.pl - JCL after conversion

 p#001 #!/usr/bin/perl
 p#002 ##JAR100   JOB  (1234),'TEST MVS2UNIX CONVERSION'
 p#003 $JOBID2 = "JAR100"; $ENV{JOBID2} = "$JOBID2";
 p#004 if ($ENV{JOBID1} == "") {$ENV{JOBID1} = "JAR100";}
 p#005 use Env; use UVjobs61; use UVexport62;
 p#006 logmsg61 ("Begin Job=$JOBID2");
 p#007 jobset61();
 p#008 $XSTEP=0; $JCC=0; $SCC=0; $LCC=0;
 p#009 goto $restep;
 p#010 S0000: { ; }
 p#011 # * CREATE CUSTOMER NAME & ADDRESS LISTING
 p#012 #1======================= begin step#S0010 CAR100 ========================
 p#013 S0010:
 p#014 $JSTEP="S0010"; $XSTEP++; $SCC=0; $LCC=0;
 p#015 logmsg61("Begin Step $JSTEP car100 (#$XSTEP)");
 p#016 ##STEP010  EXEC PGM=CAR100,PARM=2003
 p#017 $PROGID="car100"; $ENV{PROGID} = "$PROGID";
 p#018 $PARM="2003";
 p#019 $ENV{PARM} = "$PARM";
 p#020 exportfile("CUSTMAS","ar/customer.master");
 p#021 $CUSTMAS = $ENV{CUSTMAS};
 p#022 exportfile("NALIST","ar/customer.nameadrs.list100");
 p#023 $NALIST = $ENV{NALIST};
 p#024 exportfile("SYSOUT","$SYOT/${JSTEP}_SYSOUT");
 p#025 logmsg61("Executing: $RLX/car100");
 p#026 #3----------------------------------------------------------------------
 p#027 system("cobrun $ANIM $RLX/car100");
 p#028 #4----------------------------------------------------------------------
 p#029 $LCC=$?; $S0010C=$LCC; $SCC+=$LCC; $JCC+=$LCC; $S0010R=1;
 p#030 if ($S0010C != 0)
 p#031   { logmsg61("step#$JSTEP car100 abterm $SCC");
 p#032     goto S9900;
 p#033   }
 p#034 #8======================================================================
 p#035 S9000:
 p#036 jobend61();
 p#037 logmsg61("JobEnd Normal: StepsExecuted=$XSTEP, LastStep=$JSTEP");
 p#038 exit(0); #jclperl61 ver: 20060707 optns: b0c0d0g15i1j0m1n3p0r0s0t1u0w0x0y0z0
 p#039 #9======================================================================
 p#040 S9900:
 p#041 jobend61();
 p#042 logmsg61("JobEnd Abnormal: JCC=$JCC,StepsEx=$XSTEP,LastStep=$JSTEP","RV");
 p#043 exit($JCC);  #end jar100.pl 43 lines.

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

1C3. MVS JCL conversion to Unix/Linux Perl scripts

front end code in output script

The following block of front end code is inserted at the beginning of each Perl 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 2 & 4 below. (I have inserted a line# on the left side to aid the following discussion).

 p#001 #!/usr/bin/perl
 p#002 ##JAR100   JOB  (1234),'TEST MVS2UNIX CONVERSION'
 p#003 $JOBID2 = "JAR100"; $ENV{JOBID2} = "$JOBID2";
 p#004 if ($ENV{JOBID1} == "") {$ENV{JOBID1} = "JAR100";}
 p#005 use Env; use UVjobs61; use UVexport62;
 p#006 logmsg61 ("Begin Job=$JOBID2");
 p#007 jobset61();                            #<-- vital subrtn, see notes below
 p#008 $XSTEP=0; $JCC=0; $SCC=0; $LCC=0;
 p#009 goto $restep;
 p#010 S0000: { ; }

JOBID1 & JOBID2

 p#003 $JOBID2 = "JAR100"; $ENV{JOBID2} = "$JOBID2";
 p#004 if ($ENV{JOBID1} == "") {$ENV{JOBID1} = "JAR100";}

'$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 holds the name of the 1st job in a series of called jobs).

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

1C4. MVS JCL conversion to Unix/Linux Perl scripts

JCL/script arguments

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


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

 #2. jobname.pl 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 jobset61 which is called at the begining of all perl scripts converted from JCL.

jobset61 subrtn to setup job environment

Note the call to the 'jobset61' subrtn on line p#007. This subrtn is vital to the Perl script operation since it establishes the COBOL program search path & changes to the data file super directory. 'jobset61' is listed further ahead on page '3C1'.

Here is an extracted & shortened version of the code that examines each command line argument and exports only if it contains an '=' sign.

 # process command line arguments
 # - enter any 'symbol=value's into the ENVironment
 if (@ARGV)
   { foreach (@ARGV)
       { if ($_ =~ "=")
           { @arg1 = split(/=/,$_);
             $ENV{$arg1[0]} = "$arg1[1]";
           } } }

jobset61 displays critical variables

jobset61 displays the values of critical variables. Here are the relevant lines extracted from jobset61 (full listing begining on page '3C1').

 logmsg61 ("$0");                     <-- displays path of JCL/perl script
 logmsg61 ("$argvs");                 <-- displays any arguments on command line
 logmsg61 ("RUNLIBS=$RUNLIBS");       <-- displays your LIBS superdir
 logmsg61 ("RUNDATA=$RUNDATA");       <-- displays your DATA files superdir
 logmsg61 ("JTMP=$JTMP SYOT=$SYOT");  <-- displays your jobtmp & sysout dirs
 logmsg61 ("RUNDATE=$RUNDATE");       <-- displays RUNDATA (may modify on cmd line)

'$RUNDATA & $RUNLIBS' are critical environmental variables that define the super directories for the DATA files & for the LIBRARIES (JCL, COBOL, etc). They may be different for operators & programmers. For operators they would point to the production data & libraries, but for programmers they would point to the test data & libraries. See page '4A1' for more.

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

1C5. MVS JCL conversion to Unix/Linux Perl scripts

step restart

You can restart at any desired step as shown in the following example:

Note that step number codes are 4 digits incremented by 10 & are prefixed with UPPER case letter 'S'.

 --> jar200.pl              <-- runs all steps

--> jar200.pl STEP=S0020 <-- runs from step 2

Step restart is implemented via the following lines of code inserted at the begining of all Perl scripts converted from JCL.

 p#007 jobset61();      #<-- jobset61 in UVjobs61.pm captures restart step#
 p#009 goto $restep;    #<-- $restep defaults to S0000 if no step=.... spcfd
 p#010 S0000: { ; }
 p#011 #
 p#012 #1======================= begin step#S0010 CAR100 ========================
 p#013 S0010:
       ........... step 1 code ...........
 p#042 S0020:
       ........... step 2 code ...........

jobset61 vital to restart

A call to the 'jobset61' subrtn is inserted by the JCL converter at the begining of all perl scripts converted from JCL. 'jobset61' is part of Perl module 'UVjob61.pm' supplied in /home/uvadm/perlm/...

You can see UVjob61.pm listed on begining on page '3C1', but here are the relevant lines of code for step restart:

 # process command line arguments
 # - capture any restart step=S.... or STEP=S.... in $restep
 $restep = "S0000";    # init restart step to step "S0000"
 if (@ARGV)
   { foreach (@ARGV)
       { if ($_ =~ "=")
           { @arg1 = split(/=/,$_);
             $ENV{$arg1[0]} = "$arg1[1]";
             if ($arg1[0] == "step" || $arg1[0] == "STEP")
               { $restep = "$arg1[1]";
               } } } }
 # verify restart step# format (must be 'S9999' 'S' + 4 digits)
 if ($restep !~ /^S[0-9][0-9][0-9][0-9]$/)
   { logmsg61 ("restart STEP=$STEP invalid (not S0000-S9999)");
     exit(90); }
 # issue warning msg if restarting
 # - remove files from jobtmp & sysout subdirs if not restarting
 if ($restep != "S0000")
   { logmsg61("**restarting** at STEP=$STEP"); }
 else
   { system("rm -f $JTMP/*; rm -f $SYOT/*"); }

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

1C6. MVS JCL conversion to Unix/Linux Perl scripts

sample conversion of 1 step COBOL JCL

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

 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=*
 p#012 #1======================= begin step#S0010 CAR100 ========================
 p#013 S0010:
 p#014 $JSTEP="S0010"; $XSTEP++; $SCC=0; $LCC=0;
 p#015 logmsg61("Begin Step $JSTEP car100 (#$XSTEP)");
 p#016 ##STEP010  EXEC PGM=CAR100,PARM=2003
 p#017 $PROGID="car100"; $ENV{PROGID} = "$PROGID";
 p#018 $PARM="2003";
 p#019 $ENV{PARM} = "$PARM";
 p#020 exportfile("CUSTMAS","ar/customer.master");
 p#021 $CUSTMAS = $ENV{CUSTMAS};
 p#022 exportfile("NALIST","ar/customer.nameadrs.list100");
 p#023 $NALIST = $ENV{NALIST};
 p#024 exportfile("SYSOUT","$SYOT/${JSTEP}_SYSOUT");
 p#025 logmsg61("Executing: $RLX/car100");
 p#026 #3----------------------------------------------------------------------
 p#027 system("cobrun $ANIM $RLX/car100");
 p#028 #4----------------------------------------------------------------------
 p#029 $LCC=$?; $S0010C=$LCC; $SCC+=$LCC; $JCC+=$LCC; $S0010R=1;
 p#030 if ($S0010C != 0)
 p#031   { logmsg61("step#$JSTEP car100 abterm $SCC");
 p#032     goto S9900;
 p#033   }

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

1C7. MVS JCL conversion to Unix/Linux Perl 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)

p#020 exportfile("CUSTMAS","ar/customer.master"); p#021 $CUSTMAS = $ENV{CUSTMAS};

p#022 exportfile("NALIST","ar/customer.nameadrs.list100"); p#023 $NALIST = $ENV{NALIST};

p#024 exportfile("SYSOUT","$SYOT/${JSTEP}_SYSOUT");

'exportfile' is a subrtn (see listing on page '3D1') that displays file-names & file-sizes (for the console log), in addition to 'export'ing the logical = physical filenames for Micro Focus COBOL.

For those readers more familiar with the Korn shell (vs perl scripts), the equivalent Korn shell exports would be as follows:

p#021 export CUSTMAS=ar/customer.master

p#023 export NALIST=ar/customer.nameadrs.list100

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 '1C11'

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

1C8. MVS JCL conversion to Unix/Linux Perl scripts

COBOL EXECs converted to 'cobrun's

 j#03 //STEP010  EXEC PGM=CAR100,PARM=2003
 p#016 ##STEP010  EXEC PGM=CAR100,PARM=2003
 ..... ............. file exports here ................
 p#025 logmsg61("Executing: $RLX/car100");
 p#026 #3----------------------------------------------------------------------
 p#027 system("cobrun $ANIM $RLX/car100");
 p#028 #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.pl              <-- 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 an executable & remove the 'cobrun $ANIM' from the script.

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

1C9. MVS JCL conversion to Unix/Linux Perl 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'
 p#026 #3----------------------------------------------------------------------
 p#027 system("cobrun $ANIM $RLX/car100");
 p#028 #4----------------------------------------------------------------------
 p#029 $LCC=$?; $S0010C=$LCC; $SCC+=$LCC; $JCC+=$LCC; $S0010R=1;
 p#030 if ($S0010C != 0)
 p#031   { logmsg61("step#$JSTEP car100 abterm $SCC");
 p#032     goto S9900;
 p#033   }

Perl 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.

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

1C10. MVS JCL conversion to Unix/Linux Perl scripts


                    ** EOJ Terminated Normally/Abnormally **
 p#034 #8======================================================================
 p#035 S9000:
 p#036 jobend61();
 p#037 logmsg61("JobEnd Normal: StepsExecuted=$XSTEP, LastStep=$JSTEP");
 p#038 exit(0); #jclperl61 ver: 20060707 optns: b0c0d0g15i1j0m1n3p0r0s0t1u0w0x0y0z0
 p#039 #9======================================================================
 p#040 S9900:
 p#041 jobend61();
 p#042 logmsg61("JobEnd Abnormal: JCC=$JCC,StepsEx=$XSTEP,LastStep=$JSTEP","RV");
 p#043 exit($JCC);  #end jar100.pl 43 lines.

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 p#040 above), display 'JobEnd Abnormal',& exit with the error-code from the error step. '$JCC' is an accumulator of all step status codes in the job but is usually the same as the error step status, since 1st non-zero usually causes 'goto S9900'.

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

1C11. MVS JCL conversion to Unix/Linux Perl 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' do 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=*

 p#024 exportfile("SYSOUT","$SYOT/${JSTEP}_SYSOUT"); <-- see $expansions below
 p#024 exportfile("SYSOUT","sysout/JAR100/S0010_SYSOUT");          <-- for test
 p#024 exportfile("SYSOUT","sysout/JAR100_yymmddHHMMSS/S0010_SYSOUT"); <-- prod

'SYOT' is assigned in the 'jobset61' subrtn called at the begining of each script (see UVjobs61.pm listed begining on page '3C1'). 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 preevious 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 Perl scripts

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

ex#2 jcl0/JAR200 - original JCL

 j#01 //JAR200   JOB  (1234),'TEST/DEMO MVS JCL CONVERT'
 j#02 //* SORT AR.SALES.ITEMS BY PRODUCT CODE FOR LISTING
 j#03 //STEP010  EXEC PGM=SORT,REGION=2048K
 j#04 //SORTIN   DD DSN=AR.SALES.ITEMS,DISP=SHR
 j#05 //SORTOUT  DD DSN=&&TEMPSLS,DISP=(NEW,PASS),
 j#06 //            DCB=(LRECL=64,BLKSIZE=6400,RECFM=FB),
 j#07 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK
 j#08 //SYSIN    DD *
 j#09 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 j#10 /*
 j#11 //* LIST AR.SALES.ITEMS IN PRODUCT CODE SEQUENCE
 j#12 //STEP020  EXEC PGM=CAR200,COND=(4,LT,STEP010),PARM=2003
 j#13 //SALEDTL  DD DSN=&&TEMPSLS,DISP=(OLD,PASS)
 j#14 //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER.INDEXED,DISP=SHR
 j#15 //SALELST  DD DSN=AR.SALES.LIST,DISP=(,CATLG,DELETE),
 j#16 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),
 j#17 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)

Please see the converted equivalent Perl script on the next page ---->

We have omitted the front end 10 lines & the back end 10 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 Perl scripts

ex#2 jcl3/jar200.pl - converted equivalent

 p#012 #1======================= begin step#S0010 SORT ========================
 p#013 S0010:
 p#014 $JSTEP="S0010"; $XSTEP++; $SCC=0; $LCC=0;
 p#015 logmsg61("Begin Step $JSTEP sort (#$XSTEP)");
 p#016 ##STEP010  EXEC PGM=SORT,REGION=2048K
 p#017 $PROGID="sort"; $ENV{PROGID} = "$PROGID";
 p#018 $PARM=""; $ENV{PARM} = "$PARM";
 p#020 exportfile("SORTIN","ar/sales.items");
 p#021 $SORTIN = $ENV{SORTIN};
 p#022 exportfile("SORTOUT","$JTMP/__tempsls");
 p#023 $SORTOUT = $ENV{SORTOUT};
 p#024 $SYSIN = "$JTMP/${JSTEP}_${PROGID}_SYSIN";
 p#025 open (SYSIN,">$SYSIN") || die "cant open SYSIN=$SYSIN";
 p#026 print SYSIN <<EoD;
 p#027 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 p#028 EoD
 p#029 close(SYSIN);
 p#030 exportfile("SYSIN","$SYSIN");
 p#031 #3----------------------------------------------------------------------
 p#032 uvsort("fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\
 p#033 ,keys=(30,6,c,a,0,6,c,a)");
 p#034 #4----------------------------------------------------------------------
 p#035 $LCC=$?; $S0010C=$LCC; $SCC+=$LCC; $JCC+=$LCC; $S0010R=1;
 p#036 if ($S0010C >  4)      # modified by COND step S0020
 p#037   { logmsg61("step#$JSTEP sort abterm $SCC");
 p#038     goto S9900;
 p#039   }
 p#040 ##* LIST AR.SALES.ITEMS IN PRODUCT CODE SEQUENCE
 p#041 #1======================= begin step#S0020 CAR200 ========================
 p#042 S0020:
 p#043 $JSTEP="S0020"; $XSTEP++; $SCC=0; $LCC=0;
 p#044 if ($S0010C <= 4) {     # COND=(4,LT,STEP010)
 p#045 logmsg61("Begin Step $JSTEP car200 (#$XSTEP)");
 p#046 ##STEP020  EXEC PGM=CAR200,COND=(4,LT,STEP010),PARM=2003
 p#047 $PROGID="car200"; $ENV{PROGID} = "$PROGID";
 p#048 $PARM="2003"; $ENV{PARM} = "$PARM";
 p#050 exportfile("SALEDTL","$JTMP/__tempsls");
 p#051 $SALEDTL = $ENV{SALEDTL};
 p#052 exportfile("CUSTMAS","ar/customer.master.indexed");
 p#053 $CUSTMAS = $ENV{CUSTMAS};
 p#054 exportfile("SALELST","ar/sales.list");
 p#055 $SALELST = $ENV{SALELST};
 p#056 logmsg61("Executing: $RLX/car200");
 p#057 #3----------------------------------------------------------------------
 p#058 system("cobrun $ANIM $RLX/car200");
 p#059 #4----------------------------------------------------------------------
 p#060 $LCC=$?; $S0020C=$LCC; $SCC+=$LCC; $JCC+=$LCC; $S0020R=1;
 p#061 }   #endof: COND=(4,LT,STEP010)
 p#062 if ($S0020C != 0)
 p#063   { logmsg61("step#$JSTEP car200 abterm $SCC");
 p#064     goto S9900;
 p#065   }

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

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

SORT conversion to uvsort

 j#03 //STEP010  EXEC PGM=SORT,REGION=2048K
 j#04 //SORTIN   DD DSN=AR.SALES.ITEMS,DISP=SHR
 j#05 //SORTOUT  DD DSN=&&TEMP,DISP=(NEW,PASS),
 j#06 //            DCB=(LRECL=64,BLKSIZE=6400,RECFM=FB),
 j#07 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK
 j#08 //SYSIN    DD *
 j#09 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 j#10 /*
 p#016 ##STEP010  EXEC PGM=SORT,REGION=2048K
 p#020 exportfile("SORTIN","ar/sales.items");
 p#021 $SORTIN = $ENV{SORTIN};
 p#022 exportfile("SORTOUT","$JTMP/__tempsls");
 p#023 $SORTOUT = $ENV{SORTOUT};
 p#024 $SYSIN = "$JTMP/${JSTEP}_${PROGID}_SYSIN";
 p#025 open (SYSIN,">$SYSIN") || die "cant open SYSIN=$SYSIN";
 p#026 print SYSIN <<EoD;
 p#027 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
 p#028 EoD
 p#029 close(SYSIN);
 p#030 exportfile("SYSIN","$SYSIN");
 p#031 #3----------------------------------------------------------------------
 p#032 uvsort("fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\
 p#033 ,keys=(30,6,c,a,0,6,c,a)");
 p#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).

 p#020 exportfile("SORTIN","ar/sales.items");
 p#021 $SORTIN = $ENV{SORTIN};
 p#022 exportfile("SORTOUT","$JTMP/__tempsls");
 p#023 $SORTOUT = $ENV{SORTOUT};
 p#031 #3----------------------------------------------------------------------
 p#032 uvsort("fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\
 p#033 ,keys=(30,6,c,a,0,6,c,a)");
 p#034 #4----------------------------------------------------------------------

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


    SORT FIELDS=(31,6,A,1,6,A)
    ==========================
    keys=(30,6,c,a,0,6,c,a)"

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 Perl 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 Perl 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=GLTEST,YEAREND=2002                                 00000010
 //* LIST G/L CHART OF ACCOUNTS FROM ACCOUNT.MASTER                      00000020
 //STEP010  EXEC PGM=CGL100,COND=(4,LT),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 .proc).

The 2nd procedure is the 1 time expansion of PROCs and the 3rd procedure will convert the expanded JCL to Perl 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 Perl 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 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003        #<-- PROC call
 j#04 //PGL100   PROC HLQ=GLTEST,YEAREND=2002
 j#05 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003        #<-- PROC exp
 j#06 //STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003
 j#07 //* LIST G/L CHART OF ACCOUNTS FROM ACCOUNT.MASTER
 j#08 //STEP010  EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND
 j#09 //ACCTMAS  DD DSN=GL.ACCOUNT.MASTER(0),DISP=SHR
 j#10 //ACTLIST  DD DSN=GL.ACCOUNT.ACNTLIST(+1),DISP=(,CATLG,DELETE),
 j#11 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),
 j#12 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)
 j#13 //SYSOUT   DD SYSOUT=*

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 Perl script (jcl3/jgl100.pl).

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

1E3. Sample Conversion of MVS JCL to Perl Script

jcl3/jgl100.pl - JCL after conversion to perl script

 p#011 # * MVS JCL CONVERSION DEMO - PROCs & GDG files
 p#012 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003                  #<-- PROC call
 p#013 ##PGL100   PROC HLQ=GL,YEAREND=2002
 p#014 $HLQ="GL";$YEAREND="2002";
 p#015 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003                  #<-- PROC exp
 p#016 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003
 p#017 $HLQ="GL";$YEAREND="2003";
 p#018 ##PGL100   PROC HLQ=GL,YEAREND=2002
 p#019 $HLQ="GL";$YEAREND="2002";
 p#020 # * LIST G/L CHART OF ACCOUNTS FROM ACCOUNT.MASTER
 p#021 #1======================= begin step#S0010 CGL100 ========================
 p#022 S0010:
 p#023 $JSTEP="S0010"; $XSTEP++; $SCC=0; $LCC=0;
 p#024 logmsg61("Begin Step $JSTEP cgl100 (#$XSTEP)");
 p#025 ##STEP010  EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND
 p#026 $PROGID="cgl100"; $ENV{PROGID} = "$PROGID";
 p#027 $PARM="$YEAREND";
 p#028 $ENV{PARM} = "$PARM";
 p#029 exportgen0("ACCTMAS","gl/account.master_","gdg=15");
 p#030 $ACCTMAS = $ENV{ACCTMAS};
 p#031 exportgen1("ACTLIST","gl/account.acntlist_","gdg=15");
 p#032 $ACTLIST = $ENV{ACTLIST};
 p#033 exportfile("SYSOUT","$SYOT/${JSTEP}_SYSOUT");
 p#034 logmsg61("Executing: $RLX/cgl100");
 p#035 #3----------------------------------------------------------------------
 p#036 system("cobrun $ANIM $RLX/cgl100");
 p#037 #4----------------------------------------------------------------------
 p#038 $LCC=$?; $S0010C=$LCC; $SCC+=$LCC; $JCC+=$LCC; $S0010R=1;
 p#039 if ($S0010C != 0)
 p#040   { logmsg61("step#$JSTEP cgl100 abterm $SCC");
 p#041     goto S9900;
 p#042   }

We have omitted the front end 10 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 Perl 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 Perl 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)

p#029 exportgen0("ACCTMAS","gl/account.master_","gdg=15"); p#030 $ACCTMAS = $ENV{ACCTMAS}; p#031 exportgen1("ACTLIST","gl/account.acntlist_","gdg=15"); p#032 $ACTLIST = $ENV{ACTLIST};

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

You can see exportgen0 & exportgen1 listed in UVexport61.pm begining on page '3D1'. Also see the discussions in Part_8 re exportgen0/1 generation# increment differences & rerun considerations.

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

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 Perl 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 Perl 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
 //STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003                              00000030

proc0/PGL200 - PROC called by JGL200

 //PGL200   PROC HLQ=GLTEST,YEAREND=2002                                 00000010
 //* SORT GL TRANSACTIONS BEFORE UPDATING ACCOUNT MASTER                 00000020
 //STEP010  EXEC PGM=SORT,REGION=2048K                                   00000030
 //SORTIN   DD DSN=&HLQ..ACCOUNT.TRANS,DISP=SHR                          00000040
 //SORTOUT  DD DSN=&&TEMPGLT,DISP=(NEW,PASS),                            00000050
 //            DCB=(LRECL=80,BLKSIZE=8000,RECFM=FB),                     00000060
 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK                        00000070
 //SYSIN    DD DSN=&HLQ..CTLCDLIB(PGL200S1)                              00000080
 //* UPDATE ACCOUNT.MASTER WITH TRANSACTION DETAIL                       00000090
 //STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND            00000100
 //GLTRANS  DD DSN=&&TEMPGLT,DISP=(OLD,PASS)                             00000110
 //GLMSOLD   DD DSN=&HLQ..ACCOUNT.MASTER(0),DISP=SHR                     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 .proc).

  3. The 2nd procedure is the 1 time expansion of PROCs and the 3rd procedure will convert the expanded JCL to Perl 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 Perl Script

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

 j#01 //JGL200   JOB  (1234),'TEST/DEMO MVS JCL CONVERSION'
 j#02 //* SORT TRANSACTIONS & UPDATE GL ACCOUNT MASTER
 j#03 ##STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003        #<-- PROC call
 j#04 //PGL200   PROC HLQ=GLTEST,YEAREND=2002
 j#05 ##STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003        #<-- PROC exp
 j#06 //STEPA    EXEC PGL200,HLQ=GL,YEAREND=2003
 j#07 //* SORT GL TRANSACTIONS BEFORE UPDATING ACCOUNT MASTER
 j#08 //STEP010  EXEC PGM=SORT,REGION=2048K
 j#09 //SORTIN   DD DSN=GL.ACCOUNT.TRANS,DISP=SHR
 j#10 //SORTOUT  DD DSN=&&TEMPGLT,DISP=(NEW,PASS),
 j#11 //            DCB=(LRECL=80,BLKSIZE=8000,RECFM=FB),
 j#12 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK
 j#13 //SYSIN    DD DSN=GL.CTLCDLIB(PGL200S1)
 j#14 /=* UPDATE ACCOUNT.MASTER WITH TRANSACTION DETAIL
 j#15 //*============================ step# 002 ============================
 j#16 //STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
 j#17 //GLTRANS  DD DSN=&&TEMPGLT,DISP=(OLD,PASS)
 j#18 //GLMSOLD   DD DSN=GL.ACCOUNT.MASTER(0),DISP=SHR
 j#19 //GLMSNEW   DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE),
 j#20 //            UNIT=DISK,SPACE=(TRK,(50,50),RLSE),
 j#21 //            DCB=(MODEL.DSCB,LRECL=80,BLKSIZE=6118,RECFM=FBA)

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 subrtns exportgen0 & exportgen1. Note lines p#059-p#62 on the next page & see these subrtns listed begining on page '3D1' ahead.

  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. Sample Conversion of MVS JCL to Perl Script

jcl3/jgl200.pl - JCL after conversion to ksh script

 p#021 #1======================= begin step#S0010 SORT ========================
 p#022 S0010:
 p#023 $JSTEP="S0010"; $XSTEP++; $SCC=0; $LCC=0;
 p#024 logmsg61("Begin Step $JSTEP sort (#$XSTEP)");
 p#025 ##STEP010  EXEC PGM=SORT,REGION=2048K
 p#026 $PROGID="sort"; $ENV{PROGID} = "$PROGID";
 p#027 $PARM="";
 p#028 $ENV{PARM} = "$PARM";
 p#029 exportfile("SORTIN","gl/account.trans");
 p#030 $SORTIN = $ENV{SORTIN};
 p#031 exportfile("SORTOUT","$JTMP/__tempglt");
 p#032 $SORTOUT = $ENV{SORTOUT};
 p#033 exportfile("SYSIN","gl/ctlcdlib/pgl200s1");
 p#034 $SYSIN = $ENV{SYSIN};
 p#035 exportfile("SYSIN","$RUNLIBS/parms/pgl200s1");
 p#036 #2-------------------------- parms/pgl200s1 ---------------------------
 p#037 # SORT FIELDS=(1,8,CH,A,69,12,CH,A)
 p#038 #3----------------------------------------------------------------------
 p#039 uvsort("fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\
 p#040 ,keys=(0,8,c,a,68,12,c,a)");
 p#041 #4----------------------------------------------------------------------
 p#042 $LCC=$?; $S0010C=$LCC; $SCC+=$LCC; $JCC+=$LCC; $S0010R=1;
 p#043 if ($S0010C >  4)      # modified by COND step S0020
 p#044   { logmsg61("step#$JSTEP sort abterm $SCC");
 p#045     goto S9900;
 p#046   }
 p#047 ##* UPDATE ACCOUNT.MASTER WITH TRANSACTION DETAIL
 p#048 #1======================= begin step#S0020 CGL200 ========================
 p#049 S0020:
 p#050 $JSTEP="S0020"; $XSTEP++; $SCC=0; $LCC=0;
 p#051 if ($S0010C <= 4) {     # COND=(4,LT,STEP010)
 p#052 logmsg61("Begin Step $JSTEP cgl200 (#$XSTEP)");
 p#053 ##STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
 p#054 $PROGID="cgl200"; $ENV{PROGID} = "$PROGID";
 p#055 $PARM="$YEAREND";
 p#056 $ENV{PARM} = "$PARM";
 p#057 exportfile("GLTRANS","$JTMP/__tempglt");
 p#058 $GLTRANS = $ENV{GLTRANS};
 p#059 exportgen0("GLMSOLD","gl/account.master_","gdg=15");
 p#060 $GLMSOLD = $ENV{GLMSOLD};
 p#061 exportgen1("GLMSNEW","gl/account.master_","gdg=15");
 p#062 $GLMSNEW = $ENV{GLMSNEW};
 p#063 logmsg61("Executing: $RLX/cgl200");
 p#064 #3----------------------------------------------------------------------
 p#065 system("cobrun $ANIM $RLX/cgl200");
 p#066 #4----------------------------------------------------------------------

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

1F4. Sample Conversion of MVS JCL to Perl 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)

 p#029 exportfile("SORTIN","gl/account.trans");
 p#030 $SORTIN = $ENV{SORTIN};
 p#031 exportfile("SORTOUT","$JTMP/__tempglt");
 p#032 $SORTOUT = $ENV{SORTOUT};
 p#033 exportfile("SYSIN","gl/ctlcdlib/pgl200s1");
 p#034 $SYSIN = $ENV{SYSIN};
 p#035 exportfile("SYSIN","$RUNLIBS/parms/pgl200s1");
 p#036 #2-------------------------- parms/pgl200s1 ---------------------------
 p#037 # SORT FIELDS=(1,8,CH,A,69,12,CH,A)
 p#038 #3----------------------------------------------------------------------
 p#039 uvsort("fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\
 p#040 ,keys=(0,8,c,a,68,12,c,a)");
 p#041 #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 '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 '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 Perl Script

jcl1/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 //STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 j#10 //TEMPGLM  DD   DSN=&&TEMPGLM,DISP=(OLD,PASS)
 j#11 //ACNTMAS  DD   DSN=GL.ACCOUNT.MASTER(+1),DISP=(NEW,CATLG),LRECL=80
 j#12 //SYSIN    DD   *
 j#13    REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS)
 j#14 /*
  1. See the converted output Perl 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' subrtn. When copied back to gl/account.master(+1), the 'exportgen1' subrtn will create a new generation as 'account.master_000004'.

  4. We have omitted the front end 10 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)' on line p#040 & endif '}' on line p#064 below. 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' except for the '=' condition which is reversed.

  6. The 'fi' placement may seem odd, since it is inserted after step 2 return code has been captured, but before it is tested. This is because the 'goto' (possible if step2 executes but fails) must not be between any outstanding if...fi. Placing the ENDIF/fi here means the Return Code from step 2 is tested before it is stored, but this works OK since undefineds test = 0.

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

  8. See more 'COND' discussion beginning on page MVSJCL.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 Perl Script

jcl3/jgl300.pl - JCL/script

 p#014 #1======================= begin step#S0010 IEBGENER ======================
 p#015 S0010:
 p#016 $JSTEP="S0010"; $XSTEP++; $SCC=0; $LCC=0;
 p#017 logmsg61("Begin Step $JSTEP iebgener (#$XSTEP)");
 p#018 ##STEP010  EXEC PGM=IEBGENER
 p#019 $PROGID="iebgener"; $ENV{PROGID} = "$PROGID";
 p#020 $PARM=""; $ENV{PARM} = "$PARM";
 p#022 exportgen0("SYSUT1","gl/account.master_","gdg=15");
 p#023 $SYSUT1 = $ENV{SYSUT1};
 p#024 exportfile("SYSUT2","$JTMP/__tempglm");
 p#025 $SYSUT2 = $ENV{SYSUT2};
 p#026 #3----------------------------------------------------------------------
 p#027 system("cp -f $SYSUT1 $SYSUT2");
 p#028 $LCC=$?; $SCC+=$LCC;
 p#029 logmsg61("cp -f $SYSUT1 $SYSUT2");
 p#030 system("ls -l $SYSUT2");
 p#031 #4----------------------------------------------------------------------
 p#032 $S0010C=$SCC; $JCC+=$SCC; $S0010R=1;
 p#033 if ($S0010C >  4)      # modified by COND step S0020   <-- status MODIFIED
 p#034   { logmsg61("step#$JSTEP iebgener abterm $SCC");
 p#035     goto S9900;
 p#036   }
 p#037 #1======================= begin step#S0020 IDCAMS ========================
 p#038 S0020:
 p#039 $JSTEP="S0020"; $XSTEP++; $SCC=0; $LCC=0;
 p#040 if ($S0010C <= 4) {     # COND=(4,LT,STEP010)                 <-- COND if
 p#041 logmsg61("Begin Step $JSTEP idcams (#$XSTEP)");
 p#042 ##STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 p#043 $PROGID="idcams"; $ENV{PROGID} = "$PROGID";
 p#044 $PARM=""; $ENV{PARM} = "$PARM";
 p#046 exportfile("TEMPGLM","$JTMP/__tempglm");
 p#047 $TEMPGLM = $ENV{TEMPGLM};
 p#048 exportgen1("ACNTMAS","gl/account.master_","gdg=15");
 p#049 $ACNTMAS = $ENV{ACNTMAS};
 p#050 $SYSIN = "$JTMP/${JSTEP}_${PROGID}_SYSIN";
 p#051 open (SYSIN,">$SYSIN") || die "cant open SYSIN=$SYSIN";
 p#052 print SYSIN <<EoD;
 p#053   REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS) RECORDSIZE(80)
 p#054 EoD
 p#055 close(SYSIN);
 p#056 exportfile("SYSIN","$SYSIN");
 p#057 #3----------------------------------------------------------------------
 p#058 system("cp -f $TEMPGLM $ACNTMAS");
 p#059 $LCC=$?; $SCC+=$LCC;
 p#060 logmsg61("cp -f $TEMPGLM $ACNTMAS");
 p#061 system("ls -l $ACNTMAS");
 p#062 #4----------------------------------------------------------------------
 p#063 $S0020C=$SCC; $JCC+=$SCC; $S0020R=1;
 p#064 }   #endof: COND=(4,LT,STEP010)                           <-- COND endif
 p#065 if ($S0020C != 0)
 p#066   { logmsg61("step#$JSTEP idcams abterm $SCC");
 p#067     goto S9900;
 p#068   }

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 Perl 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#073.

  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 that the condition code test at the end of step 1 on line k#034 has been changed 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 beginning on page MVSJCL.htm#28G1.

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

1G4. Sample Conversion of MVS JCL to Unix/Linux Perl Script

jcl3/jgl320.pl - demo IF/THEN/ENDIF

 p#013 # * - demos IF/THEN/ENDIF (vs CONDition codes in JGL320)
 p#014 # * - change input filename (step1 will fail) & step2 will be skipped
 p#015 #1======================= begin step#S0010 IEBGENER ======================
 p#016 S0010:
 p#017 $JSTEP="S0010"; $XSTEP++; $SCC=0; $LCC=0;
 p#018 logmsg61("Begin Step $JSTEP iebgener (#$XSTEP)");
 p#019 ##STEP010  EXEC PGM=IEBGENER
 p#020 $PROGID="iebgener"; $ENV{PROGID} = "$PROGID";
 p#021 $PARM="";
 p#022 $ENV{PARM} = "$PARM";
 p#023 exportgen0("SYSUT1","gl/account.master_","gdg=15");
 p#024 $SYSUT1 = $ENV{SYSUT1};
 p#025 exportfile("SYSUT2","$JTMP/__tempglm");
 p#026 $SYSUT2 = $ENV{SYSUT2};
 p#027 #3----------------------------------------------------------------------
 p#028 system("cp -f $SYSUT1 $SYSUT2");
 p#029 $LCC=$?; $SCC+=$LCC;
 p#030 logmsg61("cp -f $SYSUT1 $SYSUT2");
 p#031 system("ls -l $SYSUT2");
 p#032 #4----------------------------------------------------------------------
 p#033 $S0010C=$SCC; $JCC+=$SCC; $S0010R=1;
 p#034 if ($S0010C >  4)      # modified by COND step S0020 <-- step status MOD
 p#035   { logmsg61("step#$JSTEP iebgener abterm $SCC");
 p#036     goto S9900;
 p#037   }
 p#038 if ($S0010C == 0)  {  # IF (RC = 0) THEN                        <-- IF
 p#039 #1======================= begin step#S0020 IDCAMS ========================
 p#040 S0020:
 p#041 $JSTEP="S0020"; $XSTEP++; $SCC=0; $LCC=0;
 p#042 if ($S0010C <= 4) {     # COND=(4,LT,STEP010)
 p#043 logmsg61("Begin Step $JSTEP idcams (#$XSTEP)");
 p#044 ##STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 p#045 $PROGID="idcams"; $ENV{PROGID} = "$PROGID";
 p#046 $PARM="";
 p#047 $ENV{PARM} = "$PARM";
 p#048 exportfile("TEMPGLM","$JTMP/__tempglm");
 p#049 $TEMPGLM = $ENV{TEMPGLM};
 p#050 exportgen1("ACNTMAS","gl/account.master_","gdg=15");
 p#051 $ACNTMAS = $ENV{ACNTMAS};
 p#052 $SYSIN = "$JTMP/${JSTEP}_${PROGID}_SYSIN";
 p#053 open (SYSIN,">$SYSIN") || die "cant open SYSIN=$SYSIN";
 p#054 print SYSIN <<EoD;
 p#055   REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS) RECORDSIZE(80) -
 p#056         INDEXED KEYS(6 0)
 p#057 EoD
 p#058 close(SYSIN);
 p#059 exportfile("SYSIN","$SYSIN");
 p#060 #3----------------------------------------------------------------------
 p#061 system("cp -f $TEMPGLM $ACNTMAS");
 p#062 $LCC=$?; $SCC+=$LCC;
 p#063 logmsg61("cp -f $TEMPGLM $ACNTMAS");
 p#064 system("ls -l $ACNTMAS");
 p#065 #4----------------------------------------------------------------------
 p#066 $S0020C=$SCC; $JCC+=$SCC; $S0020R=1;
 p#067 }   #endof: COND=(4,LT,STEP010)
 p#068 if ($S0020C != 0)
 p#069   { logmsg61("step#$JSTEP idcams abterm $SCC");
 p#070     goto S9900;
 p#071   }
 p#072 ##*.
 p#073 }   #ENDIF: IF (RC = 0) THEN                                    <-- ENDIF

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

1G5. sample MVS JCL Conversions to Perl 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 Perl scripts

jgl360.pl IDCAMS DEFINE CLUSTER converted to uvcp

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


 p#011 # * CREATE VSAM INDEXED FILE (INIT EMPTY FILE FOR RANDOM UPDATES)
 p#012 #1======================= begin step#S0010 IDCAMS ========================
 p#013 S0010:
 p#014 $JSTEP="S0010"; $XSTEP++; $SCC=0; $LCC=0;
 p#015 logmsg61("Begin Step $JSTEP idcams (#$XSTEP)");
 p#016 ##STEP010  EXEC PGM=IDCAMS
 p#017 $PROGID="idcams"; $ENV{PROGID} = "$PROGID";
 p#018 $PARM="";
 p#019 $ENV{PARM} = "$PARM";
 p#020 $SYSIN = "$JTMP/${JSTEP}_${PROGID}_SYSIN";
 p#021 open (SYSIN,">$SYSIN") || die "cant open SYSIN=$SYSIN";
 p#022 print SYSIN <<EoD;
 p#023    DELETE (GL.ACCOUNT.MASTER2) PURGE CLUSTER CATALOG (USERCAT5)
 p#024    DEFINE CLUSTER (NAME (GL.ACCOUNT.MASTER2) -
 p#025                    RECORDSIZE(80) -
 p#026                    KEYS(6 0) )
 p#027 EoD
 p#028 close(SYSIN);
 p#029 exportfile("SYSIN","$SYSIN");
 p#030 #3----------------------------------------------------------------------
 p#031 system("rm -f gl/account.master2");
 p#032 uvcp("fili1=wrk/nullfile,typ=RSF,rcs=80,filo1=gl/account.master2,typ=ISF,rcs=80\
 p#033 ,isk1=0(6)");
 p#034 $LCC=$?; $SCC+=$LCC;
 p#035 #4----------------------------------------------------------------------
 p#036 $S0010C=$SCC; $JCC+=$SCC; $S0010R=1;
 p#037 if ($S0010C != 0)
 p#038   { logmsg61("step#$JSTEP idcams abterm $SCC");
 p#039     goto S9900;
 p#040   }

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 Perl 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 genertion 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.pl - script equivalent

 p#011 #1======================= begin step#S0010 IEFBR14 ======================
 p#012 S0010:
 p#013 $JSTEP="S0010"; $XSTEP++; $SCC=0; $LCC=0;
 p#014 logmsg61("Begin Step $JSTEP iefbr14 (#$XSTEP)");
 p#015 ##STEP010  EXEC PGM=IEFBR14
 p#016 $PROGID="iefbr14"; $ENV{PROGID} = "$PROGID";
 p#017 $PARM="";
 p#018 $ENV{PARM} = "$PARM";
 p#019 exportfile("ACTEXPT","gl/account.export");
 p#020 $ACTEXPT = $ENV{ACTEXPT};
 p#021 exportgenall("ACTLIST","gl/account.acntlist_","gdg=15");
 p#022 $ACTLIST = $ENV{ACTLIST};
 p#023 #3----------------------------------------------------------------------
 p#024 system("rm -f $ACTEXPT");
 p#025 system("rm -f ${ACTLIST}[0-9][0-9][0-9][0-9][0-9][0-9]");
 p#026 #4----------------------------------------------------------------------
 p#027 $? = 0;  #set status code 0 (after 'rm's)
 p#028 $LCC=$?; $S0010C=$LCC; $SCC+=$LCC; $JCC+=$LCC; $S0010R=1;
 p#029 if ($S0010C != 0)
 p#030   { logmsg61("step#$JSTEP iefbr14 abterm $SCC");
 p#031     goto S9900;
 p#032   }

Regular file DELETE - JCL & script equivalent

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

p#019 exportfile("ACTEXPT","gl/account.export"); p#020 $ACTEXPT = $ENV{ACTEXPT};

p#024 system("rm -f $ACTEXPT");

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 Perl Script

GDG file DELETE - JCL & script equivalent

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

p#021 exportgenall("ACTLIST","gl/account.acntlist_","gdg=15"); p#022 $ACTLIST = $ENV{ACTLIST};

 p#025 system("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 indentifying suffix (0) (1).

Control file to IDentify GDG files

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/datafiles51' which is read by the JCL converter & stored in a memory table. The JCL converter can then lookup this memory table to determine which files are GDG.

You can edit ctl/datafiles51 to specify your desired number of generations for the various GDG files. You would then reconvert the JCL so your preferences will be encoded in the output scripts.

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

 gl.account.acntlist                         cnt=0001
 gl.account.acntlist(+1) gdg=15              cnt=0001
 gl.account.export                           cnt=0001
 gl.account.master(+1) gdg=30                cnt=0005
 gl.account.master(0) gdg=30                 cnt=0006
 gl.account.trans                            cnt=0001
 gl.ctlcdlib(pgl200s1)                       cnt=0001
 py.ctlcdlib(ppy200s1)           topr=payroll cnt=0001
 py.payroll.master(0) gdg=15     topr=payroll cnt=0001 rcs=256 keys=(0,6)
 py.time.cards                   topr=payroll cnt=0001 rcs=80
 py.timecard.edit(+1) gdg=15     topr=payroll cnt=0001

The 'gdg=15' is the default number of generations, which was determined from the options on line 1 of 'ctl/jclperlop61' (the primary control file for the JCL converter). You can see that file listed on page '3E1'.

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 Perl Script

Modifying GDG no of generations

You can modify the gdg=?? values in the ctl/datafiles51 control file, and then re-convert the JCL. For example we changed gdg=15 to gdg=30 on the gl.account.master file. If we then reconvert the JCL the exportgens will be as follows:

exportgen1("ACTLIST","gl/account.acntlist_","gdg=15");

exportgen1("ACTMSTR","gl/account.master_","gdg=30");

Also note that ctl/datafiles51 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' subrtn which concatentates all members of the file.

exportgenall("ACTLIST","gl/account.acntlist_","gdg=15");

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 Perl 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.jcl - converted script

 p#011 #1======================= begin step#S0010 IKJEFT01 ======================
 p#012 S0010:
 p#013 $JSTEP="S0010"; $XSTEP++; $SCC=0; $LCC=0;
 p#014 logmsg61("Begin Step $JSTEP ikjeft01 (#$XSTEP)");
 p#015 ##STEP0010 EXEC PGM=IKJEFT01,DYNAMNBR=20
 p#016 $PROGID="ikjeft01"; $ENV{PROGID} = "$PROGID";
 p#017 $PARM="";
 p#018 $ENV{PARM} = "$PARM";
 p#019 # *note - for demo simplicity all files commented out except SYSTSIN
 p#020 # *SYSTSPRT DD  SYSOUT=&SYSOUT1
 p#021 # *SYSOUT,SYSPRINT,SYSABOUT,SYSDBOUT,SYSUDUMP,PRT(all similar SYSTSPRT)
 p#022 # *SXH      DD  DSN=MXP.PSXH.KSVSAM.MAST,DISP=SHR
 p#023 exportfile("SYSTSIN","$WRK/mxplib/ikjdemo1");
 p#024 $SYSTSIN = $ENV{SYSTSIN};
 p#025 #2-------------------------- parms/ikjdemo1 ---------------------------
 p#026 # DSN SYSTEM(DB2P)
 p#027 # RUN PROGRAM(CAR100) PLAN(IKJPROG1) LIB('MEPP.WXS91.LOADLIB')
 p#028 # END
 p#029 #3----------------------------------------------------------------------
 p#030 system("cobrun $ANIM $RLX/car100");
 p#031 #4----------------------------------------------------------------------
 p#032 $LCC=$?; $S0010C=$LCC; $SCC+=$LCC; $JCC+=$LCC; $S0010R=1;
 p#033 if ($S0010C != 0)
 p#034   { logmsg61("step#$JSTEP ikjeft01 abterm $SCC");
 p#035     goto S9900;
 p#036   }

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. Setup 'appsadm' & modify profiles as documented in Part 1 of ADMjobs.htm.

You must have installed the Vancouver Utilities, 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 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 (profiles, jobset61, jclperlop61, etc). We recommend either the 'bash' shell, or the Korn shell (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#1C2 or see a more detailed discussion at ADMjobs.htm.

  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).

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. cp /home/uvadm/env/stub_profile /home/mvstest/.bash_profile
     ===========================================================
     - copy supplied 'stub' profile to mvstest homedir & rename for bash

 #4a. cp /home/uvadm/env/stub_profile /home/mvstest/.profile
      ======================================================
      - alternative if you are using 'ksh' (vs bash)
Note
  • stub profile calls a common profile /home/uvadm/common_profile

 #5. modify the common profile if required & if not already performed when
     installing Vancouver Utilities or setting up 'appsadm'.

 #5a. vi /home/uvadm/common_profile       <-- modify common profile
      =============================

      export COBDIR=/home/cobadm/cobol    <-- change COBDIR for your site
      ================================

      export UVLPDEST="-dlp0"             <-- change 'lp0' to your laser printer
      =======================

      export UVLPDEST="-dLPT1"            <-- for Windows SFU
      =======================

 #6. Logout & back in to activate the new profile

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

Your home directory 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'

If you later want to create these subdirs for your own use (without demo files) you can use the 'mvstestdirs' script. You can also use the 'mvstestinit' to rerun the test/demos.


 mvstestdirs      <-- create an empty set of the conversion subdirs
 ===========

 mvstestinit      <-- clear conversion subdirs
 ===========        -  except '0' subdirs, ctl,perlm,sfun,& testdata/ar/gl

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.

  1. 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 .proc).

  2. The 2nd procedure is the 1 time expansion of PROCs

  3. The 3rd procedure converts the expanded JCL to Perl scripts. Any &SYMBOLS will be assigned their default values.

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


 #1. strip sequence#s:
 #1a. proc0 -----> procs
 #1b. jcl0 ------> jcl1
 #1c. 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

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

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 .proc 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=.proc  <-- 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 '.proc'

 #1c. uvcopyx cleanup parm0 parms uop=q0i7g8n5 <-- control card & includes
      ========================================
      - strip any CR's, clear cols 73-80,& shorten back to last nonblank
      - ensure output filenames are translated to lower case
      Sep2006 - includes combined with parms (include0/include1 dropped)
Note
  • the 'cleanup' job has many more options than used here (uop=qoi7g8n1)
  • 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
      Sep2006 - INCLUDES now in parms subdir (no separate include0/1 subdir)

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 - GDG control file


 #3.  uvcopy jcldata51,fild1=jcl2,filo2=ctl/datafiles51
      =================================================
      - generate GDG control file, so jcl converter can recognize GDG files
        to DELETE all members of a GDG when no gen# specified.

 #3a. uvcopy jcldata51   <-- easier alternative (files default as shown above)
      ================

Edit control file to specify generations


 #4. vi ctl/datafiles51   <-- modify no of generations for various files
     ==================     - see sample control file on page '3E3'

You wont have to modify, for the test/demos, but you might want to modify for your own conversions. Also note that there is an alternative way to adjust the gdg=.. values later if you dont have time to edit this file before the conversion. There is similar system designed to modify the scripts after conversion (before you go live). See uvcopy jcldata52, ctl/datafiles52,& gdgmod2 presented on page '3E5' & '3E6'.

load Indexed data control file


 #5. uvcopy loaddf51,fili1=ctl/datafiles51,filo1=ctl/datafiles51
     ===========================================================
     - load datafiles51 into an Indexed file for lokkup by JCL converter
     - to get data file attributes (recsize, indexed keys, gdgs, file type)

 #5a. uvcopy loaddf51   <-- same as above, but easier (files default as above)
      ===============

From #5 above it appears as if the input & output files are the same, BUT loading an indexed file creates 2 partitions with different suffixes as follows:

ctl/datafiles51
  • input text file
ctl/datafiles51.dat
  • output Indexed file (data partition)
ctl/datafiles51.idx
  • output Indexed file (index partition)

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

Control files for JCL conversion

The next step (#5 below) is the actual JCL conversion to unix/linux scripts. The obvious inputs are: JCLs, PROCs, & control card libraries. The conversion also depends on 2 vital control files in the 'ctl/' subdir.

See listings of ctl/jclperlop61 on page '3E1' & ctl/datafiles51 on '3E3'. You will NOT have to modify for the test/demos on Unix/Linux, but you will probably want to modify for your own JCL conversions.

change JCL conversion option for Windows SFU

If you are using Windows SFU, Cygwin, or Uwin, you must change option 'r' in the control file (ctl/jclperlop61), 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/jclperlop61. 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.


 vi ctl/jclperlop61         <-- edit change only for Windows SFU/Cygwin/Uwin
 ==================

 jclperlop61: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


 #6. jclxx61 jcl2 jcl3    <-- convert all JCL in jcl2 to Perl scripts in jcl3
     =================

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

jclxx61 requires control files: ctl/jclperlop61, ctl/datafiles51, parms/... The control files may need changes. See discussion on the next page.

Note
  • you will get 1 error (intentional) in conversion of 'jpy200.jcl'
  • please see the console log & explanation on page '1Q6' ---->

 #7. 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.pl) are listed on page '1C2'.


 #8. Copy converted scripts to execution subdir - see next page
     ==========================================================

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'.

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

copy converted scripts to execution subdir


 #8. 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 jclperlop61), 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

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

JCL Conversion Errors

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


 jclxx61 jcl2 jcl3   <-- convert all JCL in jcl2 to Perl scripts in jcl3
 =================

script to convert mainframe JCLs to Perl scripts jclperl61 jcl2/jar100.jcl jclperl61 jcl3/jar100.pl 8 in, 55 out, 0 errs jclperl61 jcl2/jar200.jcl jclperl61 jcl3/jar200.pl 16 in, 79 out, 0 errs jclperl61 jcl2/jgl100.jcl jclperl61 jcl3/jgl100.pl 12 in, 64 out, 0 errs jclperl61 jcl2/jgl200.jcl jclperl61 jcl3/jgl200.pl 20 in, 87 out, 0 errs jclperl61 jcl2/jgl300.jcl jclperl61 jcl3/jgl300.pl 14 in, 79 out, 0 errs jclperl61 jcl2/jgl320.jcl jclperl61 jcl3/jgl320.pl 17 in, 83 out, 0 errs jclperl61 jcl2/jpy200.jcl ERR: SYSIN parms/member not found: parms/ppy200s1 ERR@ in#13 out#43 file: jpy200.jcl jclperl61 jcl3/jpy200.pl 20 in, 88 out, 1 errs jclperl61 jcl2/ordr320d.jcl jclperl61 jcl3/ordr320d.pl 94 in, 151 out, 0 errs jclperl61 jcl2/splitsl1.jcl jclperl61 jcl3/splitsl1.pl 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 'jclxx61' script. The error should go away.

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

JCL Conversion Error Log

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


 vi tmp/jclperl61.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.pl


 uvlp12 tmp/jclperl61.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 '4F1' & '4F2').

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/jclperlop61) to improve re conversions.

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

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,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.proc,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.  uvcopy jcldata51,fild1=jcl2,filo2=ctl/datafiles51
      =================================================
      - generate GDG control file, so jcl converter can recognize GDG files
        to DELETE all members of a GDG when no gen# specified.
      - this job processes the entire directory (not just 1 jcl)

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

 #5. cp jcl3/jgl200.pl 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

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

scripts to convert JCL

JCL conversion scripts are listed in Part_3:


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

3F2. jcl2perl6A - convert all JCL from jcl0 thru jcl3

3F3. jclpx51 - expand PROCs & INCLUDEs while copying JCL from jcl1 to jcl2

3F4. jclxx61 - convert all JCLs from jcl2 --> 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 'jcl2perl6A' script. Script 'jcl2perl61' 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, and that ctl/datafiles51 includes all DSN's for which require non-default generations (via gdg=..).

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 Perl 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, 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.pl' demo job. The 1st step will work since it is a SORT.

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 the 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

1R2. 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

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

copy converted programs to compile library


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

 #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

1R4. 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.pl' 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 profile, depending on where COBOL is installed at your site. The supplied common_profile (listed at ADMjobs.htm#1B2) defines COBDIR as follows:


 export COBDIR=/home3/cobadm/cobol     <-- COBDIR at UV Software
 =================================

 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
 MicroFocus Net Express V4
 Version 4.0.38 Copyright (C) 1984-2003 MicroFocus International Ltd.
 * Checking complete with no errors - starting code generation
 * Generating car200
 * Data:        1824     Code:        1624     Literals:         520
 #compile #2 - car200.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

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

export RUNDATA=/home/mvstest/testdata

 /home/mvstest
 :-----testdata        <-- $RUNDATA
 :     :-----ap          - Accounts Payable
 :     :-----ar          - Accounts Receivable
 :     :-----gl          - General Ledger
 :     :-----jobtmp      - temp files for SYSIN instream data
 :     :-----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.pl
  • simple 1 step COBOL (no PROCs, no GDG files, no instream data)
jar200.pl
  • 2 steps (SORT+COBOL), uses instream data for SORT FIELDS
jgl100.pl
  • 1 step COBOL, demos: PROCS & GDG files
jgl200.pl
  • 2 steps (SORT+COBOL), demos control card member for SORT FIELDS
 jgl300.pl - demos conversion of IEBGENER & IDCAMS to 'uvcp' & 'cp'
            - demonstrates CONDition codes
jgl320.pl
  • 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 Part_9 & 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 Part_9.


 #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, DLBLname1, COBOL info(above), DLBLname2

These will be explained in more detail in Part_9 with Operating Instructions to generate them using the test/demo files supplied. You will aslo 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.pl        <-- execute test/demo JCL/script 'jar100'
 ==========
 060709:014918:JAR100: Begin Job=JAR100
 060709:014918:JAR100: /home/mvstest/jcls/jar100.pl
 060709:014918:JAR100: Arguments:
 060709:014918:JAR100: RUNLIBS=/home/mvstest
 060709:014918:JAR100: RUNDATA=/home/mvstest/testdata
 060709:014918:JAR100: JTMP=jobtmp/JAR100 SYOT=sysout/JAR100
 060709:014918:JAR100: RUNDATE=20060709
 060709:014918:JAR100: Begin Step S0010 car100 (#1)
 060709:014918:JAR100: file: CUSTMAS=ar/customer.master bytes=8192
 060709:014918:JAR100: file: NALIST=ar/customer.nameadrs.list100 bytes=2809
 060709:014918:JAR100: file: SYSOUT=sysout/JAR100/S0010_SYSOUT bytes=0
 060709:014918:JAR100: Executing: /home/mvstest/cblx/car100
 060709:014918:JAR100: Elapsed time = 0 seconds
 060709:014918:JAR100: JobEnd Normal: StepsExecuted=1, LastStep=S0010

 jar200.pl        <-- execute JCL/script 'jar200'
 ==========
 060709:014929:JAR200: Begin Job=JAR200
 060709:014929:JAR200: /home/mvstest/jcls/jar200.pl
 060709:014929:JAR200: Arguments:
 060709:014929:JAR200: RUNLIBS=/home/mvstest
 060709:014929:JAR200: RUNDATA=/home/mvstest/testdata
 060709:014929:JAR200: JTMP=jobtmp/JAR200 SYOT=sysout/JAR200
 060709:014929:JAR200: RUNDATE=20060709
 060709:014929:JAR200: Begin Step S0010 sort (#1)
 060709:014929:JAR200: file: SORTIN=ar/sales.items bytes=1280
 060709:014929:JAR200: file: SORTOUT=jobtmp/JAR200/__tempsls bytes=0
 060709:014929:JAR200: file: SYSIN=jobtmp/JAR200/S0010_sort_SYSIN bytes=33
 060709:014929:JAR200: uvsort fili1=ar/sales.items,filo1=jobtmp/JAR200/__tempsls
 060709:014929:JAR200: EOF fili01 20 rds, 1280 size; ar/sales.items
 060709:014929:JAR200: sort phase complete, used 64 megabytes, sort output begin
 060709:014929:JAR200: EOF filo01 20 wrts, 1280 size; jobtmp/JAR200/__tempsls
 060709:014929:JAR200: Begin Step S0020 car200 (#2)
 060709:014929:JAR200: file: SALEDTL=jobtmp/JAR200/__tempsls bytes=1280
 060709:014929:JAR200: file: CUSTMAS=ar/customer.master.indexed bytes=0
 060709:014929:JAR200: file: SALELST=ar/sales.list bytes=89
 060709:014929:JAR200: Executing: /home/mvstest/cblx/car200
 060709:014929:JAR200: Elapsed time = 0 seconds
 060709:014929:JAR200: JobEnd Normal: StepsExecuted=2, LastStep=S0020

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

Execute demo scripts (continued)


 jgl100.pl        <-- execute JCL/script 'jgl100'
 ==========
 060709:014940:JGL100: Begin Job=JGL100
 060709:014940:JGL100: /home/mvstest/jcls/jgl100.pl
 060709:014940:JGL100: Arguments:
 060709:014940:JGL100: RUNLIBS=/home/mvstest
 060709:014940:JGL100: RUNDATA=/home/mvstest/testdata
 060709:014940:JGL100: JTMP=jobtmp/JGL100 SYOT=sysout/JGL100
 060709:014940:JGL100: RUNDATE=20060709
 060709:014940:JGL100: Begin Step S0010 cgl100 (#1)
 060709:014940:JGL100: gen0: ACCTMAS=gl/account.master_000006 bytes=8720
 060709:014940:JGL100: gen1: ACTLIST=gl/account.acntlist_000001 bytes=0
 060709:014940:JGL100: file: SYSOUT=sysout/JGL100/S0010_SYSOUT bytes=0
 060709:014940:JGL100: Executing: /home/mvstest/cblx/cgl100
 060709:014940:JGL100: Elapsed time = 0 seconds
 060709:014940:JGL100: JobEnd Normal: StepsExecuted=1, LastStep=S0010

 jgl200.pl        <-- execute JCL/script 'jgl200'
 ==========
 060709:014953:JGL200: Begin Job=JGL200
 060709:014953:JGL200: /home/mvstest/jcls/jgl200.pl
 060709:014953:JGL200: Arguments:
 060709:014953:JGL200: RUNLIBS=/home/mvstest
 060709:014953:JGL200: RUNDATA=/home/mvstest/testdata
 060709:014953:JGL200: JTMP=jobtmp/JGL200 SYOT=sysout/JGL200
 060709:014953:JGL200: RUNDATE=20060709
 060709:014953:JGL200: Begin Step S0010 sort (#1)
 060709:014953:JGL200: file: SORTIN=gl/account.trans bytes=1600
 060709:014953:JGL200: file: SORTOUT=jobtmp/JGL200/__tempglt bytes=0
 060709:014953:JGL200: file: SYSIN=gl/ctlcdlib/pgl200s1 bytes=0
 060709:014953:JGL200: file: SYSIN=/home/mvstest/parms/pgl200s1 bytes=0
 060709:014953:JGL200: uvsort fili1=gl/account.trans,filo1=jobtmp/JGL200/__tempglt
 060709:014953:JGL200: EOF fili01 20 rds, 1600 size; gl/account.trans
 060709:014953:JGL200: sort phase complete, used 64 megabytes, sort output begin
 060709:014953:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/JGL200/__tempglt
 060709:014953:JGL200: Begin Step S0020 cgl200 (#2)
 060709:014953:JGL200: file: GLTRANS=jobtmp/JGL200/__tempglt bytes=1600
 060709:014953:JGL200: gen0: GLMSOLD=gl/account.master_000006 bytes=8720
 060709:014953:JGL200: gen1: GLMSNEW=gl/account.master_000007 bytes=0
 060709:014953:JGL200: Executing: /home/mvstest/cblx/cgl200
 060709:014953:JGL200: Elapsed time = 0 seconds
 060709:014953:JGL200: JobEnd Normal: 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

Generation files in jgl100 & jgl200

  1. Note the difference in the filename displays between jar100/jar200 (no GDG files) on the previous page & jgl100/jgl200 (GDG files) on this page.

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

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

  4. The GDG file displays are important since they identify the generation# read or written.

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

1S6. Executing the Test/Demo JCL/scripts

Execute demo scripts (continued)


 jgl300.pl        <-- execute JCL/script 'jgl300'
 ==========
 060709:014959:JGL300: Begin Job=JGL300
 060709:014959:JGL300: /home/mvstest/jcls/jgl300.pl
 060709:014959:JGL300: Arguments:
 060709:014959:JGL300: RUNLIBS=/home/mvstest
 060709:014959:JGL300: RUNDATA=/home/mvstest/testdata
 060709:014959:JGL300: JTMP=jobtmp/JGL300 SYOT=sysout/JGL300
 060709:014959:JGL300: RUNDATE=20060709
 060709:014959:JGL300: Begin Step S0010 iebgener (#1)
 060709:014959:JGL300: gen0: SYSUT1=gl/account.master_000007 bytes=8720
 060709:014959:JGL300: file: SYSUT2=jobtmp/JGL300/__tempglm bytes=0
 060709:014959:JGL300: cp -f gl/account.master_000007 jobtmp/JGL300/__tempglm
 -rw-rw-r--    1 mvstest  users        8720 Jul  9 01:49 jobtmp/JGL300/__tempglm
 060709:014959:JGL300: Begin Step S0020 idcams (#2)
 060709:014959:JGL300: file: TEMPGLM=jobtmp/JGL300/__tempglm bytes=8720
 060709:014959:JGL300: gen1: ACNTMAS=gl/account.master_000008 bytes=0
 060709:014959:JGL300: file: SYSIN=jobtmp/JGL300/S0020_idcams_SYSIN bytes=56
 060709:014959:JGL300: cp -f jobtmp/JGL300/__tempglm gl/account.master_000008
 -rw-rw-r--    1 mvstest  users        8720 Jul  9 01:49 gl/account.master_000008
 060709:014959:JGL300: Elapsed time = 0 seconds
 060709:014959:JGL300: JobEnd Normal: StepsExecuted=2, LastStep=S0020

 jgl320.pl        <-- execute JCL/script 'jgl320'
 ==========
 060709:015007:JGL320: Begin Job=JGL320
 060709:015007:JGL320: /home/mvstest/jcls/jgl320.pl
 060709:015007:JGL320: Arguments:
 060709:015007:JGL320: RUNLIBS=/home/mvstest
 060709:015007:JGL320: RUNDATA=/home/mvstest/testdata
 060709:015007:JGL320: JTMP=jobtmp/JGL320 SYOT=sysout/JGL320
 060709:015007:JGL320: RUNDATE=20060709
 060709:015007:JGL320: Begin Step S0010 iebgener (#1)
 060709:015007:JGL320: gen0: SYSUT1=gl/account.master_000008 bytes=8720
 060709:015007:JGL320: file: SYSUT2=jobtmp/JGL320/__tempglm bytes=0
 060709:015007:JGL320: cp -f gl/account.master_000008 jobtmp/JGL320/__tempglm
 -rw-rw-r--    1 mvstest  users        8720 Jul  9 01:50 jobtmp/JGL320/__tempglm
 060709:015007:JGL320: Begin Step S0020 idcams (#2)
 060709:015007:JGL320: file: TEMPGLM=jobtmp/JGL320/__tempglm bytes=8720
 060709:015007:JGL320: gen1: ACNTMAS=gl/account.master_000009 bytes=0
 060709:015007:JGL320: file: SYSIN=jobtmp/JGL320/S0020_idcams_SYSIN bytes=84
 060709:015007:JGL320: cp -f jobtmp/JGL320/__tempglm gl/account.master_000009
 -rw-rw-r--    1 mvstest  users        8720 Jul  9 01:50 gl/account.master_000009
 060709:015007:JGL320: Elapsed time = 0 seconds
 060709:015007:JGL320: JobEnd Normal: 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
 :-----cblx                <-- executable (compiled) COBOL programs
 :-----jcls                <-- JCLs converted to Perl scripts
 :-----perlm               <-- Perl Module of common subrtns called by scripts
 :-----testdata            <-- super directory for test/data subdirs & files
 :     :-----ar
 :     :     :--I--customer.master
 :     :     :--O--customer.namelist     <-- report created by jar100.pl
 :     :     :--I--sales.items
 :     :-----gl
 :     :     :--O--account.acntlist      <-- report created by jgl100.pl
 :     :     :--I--account.master_000001
 :     :     :--I--account.master_000002
 :     :     :--I--account.master_000003
 :     :     :--O--account.master_000004 <-- updated master from jgl200.pl
 :     :     :--O--account.master_000005 <-- new generation from jcl300.pl
 :     :     :--O--account.master_000006 <-- new generation from jcl320.pl
 :     :     :--I--account.trans
 :     :-----jobtmp                      <-- temp files for SYSIN instream data
 :     :     :--O--JAR200_1_sort_SYSIN   <-- instream data stored by jar200.pl
 :     :     :--O--JGL200_1_sort_SYSIN   <-- instream data stored by jgl200.pl
 :     :-----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.pl
 :     :     :--O--JGL200_tempglt        <-- sorted GLtransctns from jgl200.pl
 :     :     :--O--JGL300_tempglm        <-- copy out backup from jgl300.pl
 :     :     :--O--JGL320_tempglm        <-- copy out backup from jgl320.pl

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.pl


 #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 ar/customer.master r256  <-- investigate input to jar100.pl
     ============================    - 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 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

Investigate output report


 #3. vi ar/customer.namelist      <-- inspect output (Name & Address List)
     =======================
 130140    EVERGREEN MOTORS LTD.    1815 BOWEN ROAD          NANAIMO          BC V9S1H1    250-754-5531 LARRY WRENCH
 132588    GEECOE GENERATOR SERVICESUNIT 170 - 2851 SIMPSON  RICHMOND         BC V6X2R2    604-278-4488 HARRY LIGHT
 139923    JOHNSTONE BOILER & TANKS 1250 EAST PENDER STREET  VANCOUVER        BC V5L1W1    604-320-1845GEORGE BROWN
 142175    LILLY ELECTRIC (1973) LTD16809 - 24TH AVENUE      SURREY           BC V4B5E7    604-534-9787 FRITZ BERNAUS
 145264  D MAGRATH SUPPLIES LTD.    1939 KIRSCHNER ROAD      KELOWNA          BC V1Y4N7    250-843-2987
    --------------- 1st 5 & last record (omitted 26 records) -------------------
 406082    PRECAM RENTALS LTD:      10116-94TH AVE           FORT ST. JOHN    BC V1G5G6    250-637-6351

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

1T3. Checking Test/Demo Output Results

Check I/O for jcls/jar200.pl

'jar200' sorts 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.

We could use 'uvhd' (as we did for ar/customer.master), but we will use this opportunity to demonstrate 'listrec2' (a uvcopy pre-programmed job).


 #1. uvcopy listrec2,fili1=ar/sales.items,uop=r64 <-- list file with no LineFeeds
     ============================================
                    ,filo1=tmp/sales.items.lst    <-- output report default name
 listrec2 - list (100 bytes/line) file=ar/sales.items 2004/04/29_18:18:26
           1         2         3         4         5         6
 0123456789012345678901234567890123456789012345678901234567890123
 130140    21 940802 IN111001  HAM001  000020 0000001 000000020
 130140    21 940802 IN111001  SCR012  000021 0001001 000021021
 130140    21 940802 IN111001  CHR001  000022 0002001 000044022
 139923    35 950802 IN111002  TAB013  000023 0003001 000069023
 139923    35 950807 IN111002  TAB013  000024 0004001 000096024
    ---------- 1st 5 & last 3 records (omitting 12) -----------
 406082    35 020815 IN33001   BBQ001  00001w 0007001 00011901w
 406082    35 020815 IN33001   TAB013  00001x 0008001 00014401x
 406082    65 020816 IN441     HAM001  00001y 0009001 00017101y

inspect Output Report


 #2. vi ar/sales.list       <-- use vi to inspect output report
     ================
 406082    35 020815 IN33001   BBQ001  00001w 0007001 00011901w
 223240    65 980816 IN441     BIT001  000029 0009001 000261029
 139923    35 950802 IN111002  CHR001  000022 0002001 000044022
 130140    21 940802 IN111001  HAM001  000020 0000001 000000020
 150825    44 960804 IN1122    HAM001  000025 0005001 000125025
    ---------- 1st 5 & last 3 records (omitting 12) -----------
 201120    44 970807 CR5234    WHIP75  000027 0007001 000189027
 308685    21 990812 IN6605    WID115  00001q 0001001 00001101q
 315512    44 000805 IN2255    WID115  00001u 0005001 00007501u
                                          100           4,501.00

Note that the output file has been sorted into product code sequence (bytes 30-35) and total quantity & amount are printed at EOF.

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 sample profile (listed at ADMjobs.htm#1B2). 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.pl
     ==========

 5b. jgl100.pl
     ==========

 5c. jgl200.pl
     ==========
  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 Sun 09 Jul 2006 03:18:15 AM PDT

 <@:mvstest:/home/mvstest> jar100.pl
 060709:031833:JAR100: Begin Job=JAR100
 060709:031833:JAR100: /home/mvstest/jcls/jar100.pl
 060709:031833:JAR100: Arguments:
 060709:031833:JAR100: RUNLIBS=/home/mvstest
 060709:031833:JAR100: RUNDATA=/home/mvstest/testdata
 060709:031833:JAR100: JTMP=jobtmp/JAR100 SYOT=sysout/JAR100
 060709:031833:JAR100: RUNDATE=20060709
 060709:031833:JAR100: Begin Step S0010 car100 (#1)
 060709:031833:JAR100: file: CUSTMAS=ar/customer.master bytes=8192
 060709:031833:JAR100: file: NALIST=ar/customer.nameadrs.list100 bytes=2809
 060709:031833:JAR100: file: SYSOUT=sysout/JAR100/S0010_SYSOUT bytes=0
 060709:031833:JAR100: Executing: /home/mvstest/cblx/car100
 060709:031833:JAR100: Elapsed time = 0 seconds
 060709:031833:JAR100: JobEnd Normal: StepsExecuted=1, LastStep=S0010
 <@:mvstest:/home/mvstest> jar200.pl
 060709:031926:JAR200: Begin Job=JAR200
 060709:031926:JAR200: /home/mvstest/jcls/jar200.pl
 060709:031926:JAR200: Arguments:
 060709:031926:JAR200: RUNLIBS=/home/mvstest
 060709:031926:JAR200: RUNDATA=/home/mvstest/testdata
 060709:031926:JAR200: JTMP=jobtmp/JAR200 SYOT=sysout/JAR200
 060709:031926:JAR200: RUNDATE=20060709
 060709:031926:JAR200: Begin Step S0010 sort (#1)
 060709:031926:JAR200: file: SORTIN=ar/sales.items bytes=1280
 060709:031926:JAR200: file: SORTOUT=jobtmp/JAR200/__tempsls bytes=0
 060709:031926:JAR200: file: SYSIN=jobtmp/JAR200/S0010_sort_SYSIN bytes=33
 060709:031926:JAR200: uvsort fili1=ar/sales.items,filo1=jobtmp/JAR200/__tempsls
 060709:031926:JAR200: EOF fili01 20 rds, 1280 size; ar/sales.items
 060709:031926:JAR200: sort phase complete, used 64 megabytes, sort output begin
 060709:031926:JAR200: EOF filo01 20 wrts, 1280 size; jobtmp/JAR200/__tempsls
 060709:031926:JAR200: Begin Step S0020 car200 (#2)
 060709:031926:JAR200: file: SALEDTL=jobtmp/JAR200/__tempsls bytes=1280
 060709:031926:JAR200: file: CUSTMAS=ar/customer.master.indexed bytes=0
 060709:031926:JAR200: file: SALELST=ar/sales.list bytes=1879
 060709:031926:JAR200: Executing: /home/mvstest/cblx/car200
 060709:031926:JAR200: Elapsed time = 0 seconds
 060709:031926:JAR200: JobEnd Normal: StepsExecuted=2, LastStep=S0020

<@:mvstest:/home/mvstest> exit Script done on Sun 09 Jul 2006 03:19:29 AM 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


 jcl2perl61 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


 jcl2perl6A 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/datafiles51 ? --> n <-- reply 'n' if you have spent considerable time adding recsizes, etc

 --> 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


 cnvMF51c 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


 cnvMF51Ac 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

Part_2 JCL Conversion Aids

Note
  • as of Jan 2008, the conversion aids are a separate document
  • CNVaids.htm is intended to be shared by JCL, COBOL,& DATA conversions
  • references below are all links into the common shared CNVaids.htm

CNVaids.doc - Contents by Part#

CNVaids.htm#Part_0 - Introduction & Overview

CNVaids.htm#Part_1 - General Purpose aids, using Unix/Linux utilities

CNVaids.htm#Part_2 - General Purpose aids using Vancouver Utilities

CNVaids.htm#Part_3 - Cross-References for COBOL & JCL

xcobcopy1
  • list all 'copy'books used in each program
xcobcopy2
  • shows all programs using each 'copy'book
xcobcall1
  • list all 'call'ed programs in each program
xcobcall2
  • shows all programs 'call'ing each program
xkshprog1
  • list all programs executed in each JCL/ksh/script
xkshprog2
  • shows all JCL/ksh/scripts executing each program
xkshfile1
  • list all datafiles in each JCL/ksh/script
xkshfile2
  • shows all JCL/ksh/scripts using each data-file

CNVaids.htm#Part_4 - Table Summaries & Statistics

statallmvs1
  • table summaries of COBOL, MVS JCL,& Korn shell scripts
statallvse1
  • same, but for VSE JCL
statmvsjcl1
  • table summarize programs & top-nodes used in all JCLs
statksh1
  • table summarize programs & top-nodes used in all JCL/scripts
statlogin1
  • create table summary report of user logins by month & userid.
table2
  • general purpose table summary by any argument & acum 2 fields
table3d
  • table summary via 'key-word', preceding a 'target-word'.
tblexts1
  • table summary counts of file extensions in a subdir
recsizes1
  • create summary table of record-sizes in a text file

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

JCL/COBOL/DATA Conversion/Test/Debug Aids

CNVaids.doc - Contents by Part# (continued)

CNVaids.htm#Part_5 - COBOL Aids

CNVaids.htm#Part_6 - JCL/script Test/Debug aids

CNVaids.htm#Part_7 - Data file investigation/manipulation aids

CNVaids.htm#Part_9 - Aids & Tips for users new to Unix/Linux

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

JCL/COBOL/DATA Conversion/Test/Debug Aids

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, this separate document (CNVaids) was created to avoid the duplications in the original documents, which now have links to this document.

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 here is to give you a short (1 or 2 page) 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

common_defines
  • defines TESTLIBS,TESTDATA,PRODLIBS,PRODDATA,etc
stub_profile
  • defines RUNLIBS=TESTLIBS/TESTDATA, RUNDATA=PRODLIBS/PRODDATA
  • copied to homedirs, renamed as .bash_profile or .profile
common_profile
  • defines PATHs using RUNLIBS/RUNDATA

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

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 - tblexts1

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#5E1 - Micro Focus COBOL 'file status' error codes

CNVaids.htm#5E2 - Micro Focus COBOL 'run time' error codes

https://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 - joblog1

joblog1
  • writes the log file to $RUNLIBS/log/jobname.log
joblog2
  • writes the log file to $RUNDATA/log/jobname.log
joblog3
  • writes the log file to $HOME/log/jobname.log

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

CNVaids.htm#7K1 repage1

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
 common_defines - called by stub_profile to define TEST/PROD LIBS/DATA
 stub_profile - copied to homedirs, renamed as .bash_profile or .profile
 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
3C1.  UVjobs61.pm - Perl Module containing following:
- jobset61, jobend61, logmsg61,

3D0. UVexport61.pm - Perl Module containing following subrtns:
- exportfile, exportgen0, exportgen1, etc
Note
  • Functions for (GDG) files (exportgen0,exportgen1,etc) moved to Part_5.
  • greatly enhanced in May 2007 & documented separately.

3E0. Options control file for JCL conversion
3E1. jclperlop61 - options for the JCL/script converter
3E2. - customizing the options file for your site

3F0. DataFile Info Control files for JCL & Data conversion
- created from up to 6 sources
- see following in MVSJCL.htm
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

3G0. Scripts for JCL conversion
- jcl2perl61 jcl2perl6A, jclpx51, jclxx61, jcpause, jcclear

3H0. uvcopy jobs for JCL conversion
procNF - table summary of PROCs not found
gen56pk - sample of job to create test data file

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 chnages 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            <-- uvcopy jobs used by JCL conversion (& much more)
 :     :-----adm
 :     :-----demo
 :     :-----IBM
 :     :-----util
 :-----sf            <-- scripts used by JCL conversion (& much more)
 :     :-----adm
 :     :-----demo
 :     :-----IBM
 :     :-----util
 :-----sfun           <-- functions for JCL/scripts & GDG files
 :-----src
 :-----srcf
 :-----tf
 :-----tmp
 :-----mvstest
 :     :-----testlibs
 :     :     :-----archive
 :     :     :-----cbl0
 :     :     :-----cpy0
 :     :     :-----Csub
 :     :     :-----ctl
 :     :     :-----jcl0
 :     :     :-----pf
 :     :     :-----proc0
 :     :     :-----sf
 :     :     :-----sfun
 :     :-----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          <--- env subdir of profiles
 :-----bashrc               - bash 'rc' aliases req'd if console logging
 :     kshrc                - rename as kshrc for Korn shell (vs bash shell)
 :-----common_defines       - defines TEST/PROD LIBS/DATA so stub_profile
 :                            can use $symbols to define RUNLIBS/RUNDATA
 :-----common_profile       - common profile (called by stub_profile)
 :                            defines PATH's etc using $RUNLIBS/$RUNDATA
 :-----stub_profile         - stub profile (rename to .profile or .bash_profile)
                            - modify RUNLIBS/RUNDATA for programmers & operators
 :-----stub_profile_test    - could make diff versions for prgmrs & oprtrs
 :-----stub_profile_prod    - for copying to homedirs of new users

We recommend the concept of 'stub' & 'common' profiles. The shell profile in each user's homedir is a 'stub' that calls the longer 'common' profile which is stored in /home/appsadm/env/...

This is a big advantage for any site with multiple users, it means you can update the common profile once in 1 place & those changes are effective for all users. The 'stub' profiles in each user's homedir contain only user variable items such as: TERM, stty erase character, aliases, console logging on/off.

For mainframe conversion sites the stub_profile would define RUNLIBS & RUNDATA which point to either the 'test' or 'prod'uction libraries & data files.

The stub profiles call 'common_defines' & 'common_profile' using the '.' (dot execution), which means the 'export's made in the common_profile will still be effective on return to the users profile.

The common_profile will use $RUNLIBS & $RUNDATA to define PATH's to scripts & data directories.

Note
  • RUNLIBS & RUNDATA are only required for 'your' JCL conversions.
  • No need to change if you are just using the basic utilities.
  • No need to change to run the test/demo conversions in MVSJCL.htm.

Mainframe conversion sites should copy /home/uvadm/env/* to /home/appsadm/env and make changes there depending on the locations of their libraries & data.

It might be convenient to copy the supplied stub_profile to stub_profile_test & stub_profile_prod, and modify RUNLIBS/RUNDATA for programmers or operators. Then you could copy/rename whichever appropriate to .profile or .bash_profile whenever you setup new users.

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 - common_defines
      - critical environmental variables for TESTING & PRODUCTION
      - defines TESTLIBS,PRODLIBS,TESTDATA,PRODDATA so stub_profile can use
        $TESTLIBS,$PRODLIBS to define RUNLIBS/RUNDATA, for use by common_profile
      - not required to use only the basic Vancouver Utilities
      - not used for the test/demos in Part_1 of MVSJCL.doc
      - strongly recommended for 'your' JCL conversion test & prod
      - see suggested directory designs in ADMjobs.doc
 ADMjobs.htm#1C2 - 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
      - 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#1C3 - common_profile
      - 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#1C4 - 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

3B2. 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


      export COBDIR=/home/cobadm/cobol  <-- change for your site
      ================================
Note
  • COBDIR is defined only in the 'common_profile'
  • since there is no need to have different COBDIRs for different users

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 definitly 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 subrtns - for JCL/scripts

Perl modules (packages) to support Perl scripts

These Perl subrtns are supplied in subdir /home/uvadm/perlm/... and the common_profile includes the following line so perl scripts will find them.


 export PERL5LIB=/home/uvadm/perlm:$PERL5LIB
 ===========================================

You should copy them to /home/appsadm/perlm/... and modify the common_profile correspondingly, in case you need to modify the perl modules. This will protect your modifications from being wiped out by new versions of Vancouver Utilities.

Perl Modules - used by JCL/scripts


3C1. UVjobs61.pm - Perl Module containing following subrtns:
      jobset61 - setup job environment for scripts converted from IBM MVS JCL
               - JCL converter inserts a call to this subrtn at begin script
               - changes directory to $RUNDATA, sets up subdirs, etc
      jobend61 - common subrtn called at end each converted JCL/Perl script
               - calculates & displays Elapsed time
      logmsg61 - display console messages with date:time:JOBID2: stamps

3C4. stepctl51 - step control function, providing pause/go facility
- JCL converter optionally inserts this function at begin step
- also see scripts jcpause/jcclear used by operator to
write/clear jobctl records tested by this function
- jcpause to stop at next step or at a specified step#
- see jclpause & jcclear listed on pages '3F5' & '3F6'
(with the scripts, not here with the functions)

3C6. Customizing the Perl subrtns

3D0. UVexport61.pm - Perl Module containing following subrtns:
- for COBOL program data file definitions
- also displays filename & filesize for the console log
      exportfile   - subrtn to export Logical-FileName=Physical-FileName
      exportgen_   - subrtn to emulate GDG files on unix/linux
      exportgen0   - get the latest generation for input
      exportgen1   - get the next generation for output
      exportgenp   - get the previous generation for input
      exportgenall - get all generations for input

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

3C1. conversion support modules - UVjobs61.pm

UVjobs61.pm - called by all JCL/Perl scripts

 # UVjobs61.pm - perl subrtns to support perl scripts converted from MVS JCL
 #             - see doc at: www.uvsoftware.ca/mvs2unix.htm
 #             - this perl module distributed in $UV/perlm (UV=/hom/uvadm)
 # - this perl module should be copied $APPSADM/perlm (APPSADM=/home/appsadm)
 # - modify as required in $APPSADM/perlm (avoid overwrite by new uvadm)
 # - profile might include following so perl modules will be found
 #
 # export PERL5LIB=$UV/perlm:$PERL5LIB  # perl modules 'use'd by perl scripts
 # ===================================
 #
 #---------------------------------------------------------------------------
 package UVjobs61;
 use Env; use Exporter;
 our (@Export, @ISA);
 @ISA = qw(Exporter);
 @EXPORT = qw(jobset61 $restep AUTOLOAD
              $RLX $WRK $PRMS $TPD $MSTR $JTMP $SYOT $ANIM
              jobend61 logmsg61 getdatetime $dateymd8);
 #
 #---------------------------------------------------------------------------
 # Global variables for UVjobs61.pm
 $jobtimebgn = 0;
 $jobtimeend = 0;
 $jobelapsed = 0;
 #
 #---------------------------------------------------------------------------
 # AUTOLOAD - for any undefined subrtn to be called with system
 #          - see Programming Perl page 298
 sub AUTOLOAD
 { my $program = our $AUTOLOAD;
   $program =~ s/.*:://;      # trim pkg name
   system($program, @_);      # call undefined subrtn with system
 }
 # AUTOLOAD allows us to call uvcp, uvsort, etc without using 'system'
 # 1. system("uvcp fili1=..."); <-- need system w/o AUTOLOAD
 # 2. uvcp("fili1=...");        <-- call like this with AUTOLOAD code above
 #                                - no need to declare subrtn prototypes
 # 3. uvcp "fili1=...";         <-- could call like this if prototype declared
 #                                - But would need to declare prototypes
 #
 # could declare prototypes for uvcp, uvsort, etc
 # sub uvcp ($@);
 # sub uvsort ($@);
 #---------------------------------------------------------------------------
 #

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

 # jobset61.pm - setup environment for perl scripts converted from IBM MVS JCL
 # jobset61    - called at the begining of each JCL/script
 # - inserted by JCL converter from the ctl/jclperlop61 control file
 # - RUNLIBS & RUNDATA are exported in the user profile & are VITAL
 # - must modify for various systems, examples follow:
 #
 # export RUNLIBS=/u1/apps/prodlibs/app? #<-- example for production libraries
 # export RUNDATA=/u2/apps/proddata/app? #<-- example for production data
 # export RUNLIBS=/home/mvstest          #<-- for MvsJclPerl test/demo libs
 # export RUNDATA=/home/mvstest/testdata #<-- for MvsJclPerl conversion testdata
 #
 #---------------------------------------------------------------------------
 sub jobset61
 {
 chdir $RUNDATA;          #change to working dir for production (or test)
 $cdstatus=$?;            # capture status of cd $RUNDATA
 if ($cdstatus != 0)      # ERR if cdstatus not zero (OK)
   { print "cd \$RUNDATA ($RUNDATA) failed in jobset61\n";
     print "- investigate, RUNDATA definition in profiles\n";
     print "- enter to exit\n";
     $reply = <STDIN>;
     exit(91);
   }
 #
 # chdir $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 represent applications (ap,ar,gl,etc)
 #

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

 $RLX="$RUNLIBS/cblx";       #setup path for loading programs
 # - COBOL programs are found via $RLX/progname in JCL/scripts
 # - JCL/scripts are found via $RUNLIBS/jcls in the profile PATH
 # - this allows programs to have same names as JCL/scripts
 #
 # define subdirs referenced in JCL by $symbols
 $WRK=wrk;                 # interstep temp/work files or see $JTMP
 $TPD=tape;                # tape files (originally on mainframe)
 $MSTR=mstr;               # alternative to using multiple HLQs for directories
 $PRMS=parms;              # control card library files (members)
 # JTMP=...;               # see def of JTMP subdir further below
 # SYOT=...;               # see def of SYOT subdir further below
 #
 # ensure $WRK/nullfile present
 if (! -f "$WRK/nullfile")
   { system ("touch \"$WRK/nullfile\""); }
 #
 if ( ! "$ANIM" ) { $ANIM="-F"; }
 # 'ANIM=-F' inhibits non-numeric field checks (could change to +F ?)
 #
 # make subdir for inter-step work files & instream data files
 # $RUNDATA/$JTMP/tempworkfilename (where JTMP=jobtmp/JOBNAME)
 $JTMP="jobtmp/$main::JOBID2";
 if ( ! -d $JTMP ) { mkdir $JTMP; }
 #
 # make subdir for SYSOUT files (or any file w/o DSN=...)
 # $RUNDATA/$SYOT/step#_SYSOUT (where SYOT=sysout/JOBNAME)
 $SYOT="sysout/$main::JOBID2";
 if ( ! -d $SYOT ) { mkdir $SYOT; }
 #
 #Note - in code above we create $JTMP & $SYOT if not already existing
 #     - we also want to clean out any prior run files if they do exist
 # - BUT not on a 'RESTART', so clean out moved to JCL/script front end
 # - see 'rm -f $JTMP/*' & 'rm -f $SYOT/*' about line 25 if 'NOT RESTART'
 #
 # $JTMP & $SYOT are vital - ensure created successfully else exit
 if ( -d $JTMP && -d $SYOT ) { ; } else
   { print "$JTMP &/or $SYOT failed creation (in jobset61)\n";
     print "- investigate (permissions?, JTMP/SYOT dirnames changed?\n";
     print "- enter to exit";
     $reply = <STDIN>;
     exit(92);
   }
 #Note - $JTMP & $SYOT subdirs (for jobtmp & SYSOUT) may be date/time stamped
 #     - if multiple copies of same job must run at same time
 #

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

 $argvs = sprintf("Arguments: %s",@ARGV);  # save ARGVs for later print
 # process command line arguments
 # - enter any 'symbol=value's into the ENVironment
 # - capture any restart step=S.... or STEP=S.... in $restep
 $restep = "S0000";    # init restart step to step "S0000"
 if (@ARGV)
   { foreach (@ARGV)
       { if ($_ =~ "=")
           { @arg1 = split(/=/,$_);
             $ENV{$arg1[0]} = "$arg1[1]";
             if ($arg1[0] == "step" || $arg1[0] == "STEP")
               { $restep = "$arg1[1]";
               }
           }
       }
   }
 # verify restart step# format (must be 'S9999' 'S' + 4 digits)
 if ($restep !~ /^S[0-9][0-9][0-9][0-9]$/)
   { logmsg61 ("restart STEP=$STEP invalid (not S0000-S9999)");
     exit(90);
   }
 # default RUNDATE to current date - if not specified in ENV (or cmd line)
 if ($ENV{RUNDATE} == "")
   { $RUNDATE = "$dateymd8";
     $ENV{RUNDATE} = "$RUNDATE";
   }
 # logmsg61 ("Begin Job=$JOBID2");  #<-- already issued above
 logmsg61 ("$0");
 logmsg61 ("$argvs");
 logmsg61 ("RUNLIBS=$RUNLIBS");
 logmsg61 ("RUNDATA=$RUNDATA");
 logmsg61 ("JTMP=$JTMP SYOT=$SYOT");
 logmsg61 ("RUNDATE=$RUNDATE");
 #----------------------------------------------------------------------
 # store start time for elapsed calc at EOJ
 $jobtimebgn = time();   # capture job begin time (for elapsed calc at end)
 #
 # issue warning msg if restarting
 # - remove files from jobtmp & sysout subdirs if not restarting
 if ($restep != "S0000")
   { logmsg61("**restarting** at STEP=$STEP"); }
 else
   { system("rm -f $JTMP/*; rm -f $SYOT/*"); }
 #
 return(0);
 }

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

 # jobend61 - subrtn called at end JCL/scripts
 #          - to calc & display elapsed time
 #
 sub jobend61
 {
 # system ("sleep 2");         #<-- to test elapsed time calc
 $jobtimeend = time();       # capture job end time (for elapsed calc)
 $jobelapsed = ($jobtimeend - $jobtimebgn);
 logmsg61 ("Elapsed time = $jobelapsed seconds");
 return(0)
 }
 #
 #-----------------------------------------------------------------------------
 # logmsg61 - module to prefix echo/print messages with jobname & date/time
 #         - calling script must have defined symbol "JOBID2"
 #
 # logmsg61 ("x---message---x");            <-- sample command in calling JOBXXX
 # 051011:124700:JOBXXXXX x---message---x  <-- sample output (at 12:47 Oct 11/05)
 # logmsg61 ("x---message---x","RV");       <-- arg2 "RV" for Reverse Video
 #
 sub logmsg61
 {
 $REV='\033[7m';
 $OFF='\033[0m';
 $datetime = getdatetime();
 $logmsg = "$datetime:$main::JOBID2: $_[0]";
 if ( "$_[1]" eq "RV" )
   { print("\a$logmsg\n");
   }
 else
   { print("$logmsg\n");
   }
 return(1);
 }
 #Note - cant get the reverse video to work on print ??
 #       print("\a$REV$logmsg$OFF\n");
 #       =============================
 # - it did work on the ksh version & I tried following but no luck
 #       system("print(\"$REV$logmsg$OFF\n\");");
 #       ========================================
 #

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

 # getdatetime - get current date formatted as yyyymmdd:HHMMSS
 #             - store date/time in ENVironment as follows:
 # DTYMDHMS15 = yyyymmdd:HHMMSS
 # DTYMDHMS13 = yymmdd:HHMMSS     <-- returns this format
 # DATEYMD8   = yyyymmdd
 # DATEYMD6   = yymmdd
 # TIMEHMS6   = HHMMSS
 #
 sub getdatetime
 {
 local ($ltSS,$ltMM,$ltHH,$ltdd,$ltmm,$ltyy,$ltwd,$ltyd,$ltis);
 local ($year,$month,$day,$today);
 ($ltSS,$ltMM,$ltHH,$ltdd,$ltmm,$ltyy,$ltwd,$ltyd,$ltis) = localtime;
 $year  = $ltyy + 1900;
 $month = $ltmm + 1;
 $day   = $ltdd;
 $dtymdhms15 = sprintf("%04s%02s%02s:%02s%02s%02s"
                     ,$year,$month,$day,$ltHH,$ltMM,$ltSS);
 $dtymdhms13 = substr($dtymdhms15,2,13);
 $dateymd8 = substr($dtymdhms15,0,8);
 $dateymd6 = substr($dtymdhms15,2,6);
 $timehms6 = substr($dtymdhms15,9,6);
 $ENV{DTYMDHMS15} = "$dtymdhms15";
 $ENV{DTYMDHMS13} = "$dtymdhms13";
 $ENV{DATEYMD8} = "$dateymd8";
 $ENV{DATEYMD6} = "$dateymd6";
 $ENV{TIMEYMD6} = "$timeymd6";
 return($dtymdhms13);
 }
 1;
 #

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

3C4. conversion support functions - stepctl51

stepctl51 - JCL/script step control pause/go

 # stepctl51 - step control function
 #           - for UNIX scripts converted from IBM MVS JCL
 #           - this KORN shell function stored in $RUNLIBS/sfun
 #           - see more doc at: www.uvsoftware.ca/mvsjclperl.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 'jcppause' & 'jcclear' are provided to pause & restart jobs
 #
 # jcpause jobname.pl        <-- 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'
 # jcpause jobname.pl 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
 # jcclear jobname.pl        <-- 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 .pl)
 # - jcpause writes 1 line in the control file with: jobname.pl step# date_time
 # - step# is the step# specified by oprtr as arg#2 on jclpause script command
 # - step# is S0000 if no step# spcfd on jcpause (indicates stop at all steps)
 function stepctl51 {
 # create control filename
 typeset -l cbn=$JOBID2
 cfn=$cbn.ctl
 cfpn=jobctl/$cfn
 jfn=$cbn.pl
 # 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
 while ((1))
 do if [[ ! -f $cfpn ]]; then break; fi
    exec 3< $cfpn                # open step control file
    openstat=$?                  # capture open file status
    if (($openstat)); then break; fi
    read -u3 job step date
    exec 3<&-                    # close step control file
    if [[ $step != S0000 && $step != $JSTEP ]]; then break; fi
    logmsg1 "$jfn paused by job control file: $cfpn"
    logmsg1 "- job control record: $job $step $date"
    logmsg1 "- waiting until reply 'go' or 'clear' "
    read reply
    if [[ "$reply" == "go" ]]; then break; fi
    if [[ "$reply" == "clear" ]]; then rm $cfpn; break; fi
    sleep 1
 done
 return 0
 }

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

3D0. Modules Required to Execute Converted JCL/scripts

UVexport61.pm & UVexport62.pm

Perl modules are supplied in subdir /home/uvadm/perlm/... and the common_profile includes the following line so perl scripts will find them.


 export PERL5LIB=/home/uvadm/perlm:$PERL5LIB
 ===========================================

You should copy them to /home/appsadm/perlm/... and modify the common_profile correspondingly, in case you need to modify the perl modules. This will protect your modifications from being wiped out by new versions of Vancouver Utilities.

subrtns in UVexport61.pm & UVexport62.pm

exportfile
  • generates export for non-generation file
  • to display (filename & filesize) on console log
exportgen0
  • for current generation (0) highest gen#
exportgen1
  • for next generation (+1) not yet existing
exportgenp
  • for prior generation (-1)
exportgenx
  • errmsg if original gen not 0,+1,-1
exportgenall
  • concatenates all existing generations
lastgenr
  • script to display latest generation of a file

These subrtns (in module UVexport62.pm) are listed on the following pages . The only difference between UVexport61.pm & UVexport62.pm is that the subrtns in UVexport62.pm display the file-sizes as well as the file-names to be included on the console log.

UVexport61.pm
  • subrtns display file-names (but not file-sizes).
UVexport62.pm
  • subrtns display file-names and file-sizes.

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

3D1. Perl Modules Required to Execute Converted JCL/scripts

 # UVexport62.pm - perl subrtns to support perl scripts converted from MVS JCL
 #               - see doc at: www.uvsoftware.ca/mvs2unix.htm
 # - this perl module distributed in $UV/perlm (UV=/hom/uvadm)
 # - this perl module should be copied $APPSADM/perlm (APPSADM=/home/appsadm)
 # - modify as required in $APPSADM/perlm (avoid overwrite by new uvadm)
 # - profile should include following so perl modules will be found
 #   export PERL5LIB=$UV/perlm:$PERL5LIB  # perl modules 'use'd by perl scripts
 #   ===================================
 #
 #                   ** UVexport62.pm vs UVexport61.pm **
 #
 # UVexport62 - shows file-size in bytes (following filename)
 # UVexport61 - does not show filesize, shows filename only
 #
 #---------------------------------------------------------------------------
 # UVexport62.pm - exports files for Micro Focus COBOL
 #               - export LOGICAL-filenames with physical-filenames
 #               - including emulation of mainframe gneration (GDG) files
 # exportfile    - same as native export, but displays filename fro console log
 # exportgen0    - determines latest generation for reading
 # exportgen1    - determines next generation for writing
 # exportgenp    - determines previous generation for reading
 # exportgenall  - concatentates all generations for reading
 # exportgenx    - displays errmsg for non-supported GDG files
 #               - (+2) or more, (-2) or more
 #
 #---------------------------------------------------------------------------
 package UVexport62;
 use Env; use Exporter;
 our (@Export, @ISA);
 @ISA = qw(Exporter);
 @EXPORT = qw(exportfile exportgen0 exportgen1 exportgenp
              exportgenall exportgenx);
 #

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

 #---------------------------------------------------------------------------
 # exportfile - subrtn to export DDname=DSName for Micro Focus external names
 #              DDname (logical name in program) = DSName (physical filename)
 #
 # exportfile CUSTMAS ap/customer.master    #<-- JCL/script call
 # =====================================
 #
 # export CUSTMAS=ap/customer.master        #<-- result
 # =================================
 #
 #Note - main reason for using this subrtn (vs coding export directly)
 #       is to display the DDname & DSNname on the console log
 #
 sub exportfile
 {
 $lfd=$_[0]; $lbl=$_[1];        # capture args into named variables
 #
 if ( "$lfd" && "$lbl" ) { ; }
 else { UVjobs61::logmsg61
        ("exportfile requires 2 args: DDNname=$lfd, DSName=$lbl");
        exit(81);
      }
 #
 $ENV{$lfd} = "$lbl";     # export LogicalName = PhysicalName
 #===================     # COBOL programs need LFD in environment
 #
 # display result for console log
 # - with filesize in this UVexport62 (vs UVexport61 which does not)
 $fsize = (-s "$RUNDATA/$lbl");
 $fmsg = sprintf("file: %s=%s bytes=%d",$lfd,$lbl,$fsize);
 UVjobs61::logmsg61 ("$fmsg");
 return(0);
 }
 #

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

 # exportgen0 - subrtn to export the latest existing generation of a filename
 #            - for example, assume $RUNDATA directory contains following files:
 # ap/account.master_000001
 # ap/account.master_000002
 # ap/account.master_000003
 #
 # exportgen0 (CUSTMAS, ap/account.master_);   #<-- JCL/script coding
 # =========================================
 # export CUSTMAS=ap/account.master_000003     #<-- effective result
 # =======================================
 #
 sub exportgen0
 {
 $lfd=$_[0]; $lbl=$_[1];        # capture args into named variables
 if ( "$lfd" && "$lbl" ) { ; }
 else { UVjobs61::logmsg61
        ("exportgen0 requires 2 args: DDNname=$lfd, DSName=$lbl");
        exit(81);
      }
 # verify that filename (arg2 on call) ends with '_'
 if ($lbl !~ /.*_$/)
  { logmsg61 ("gen0 filenames must end with '_', enter to exit (fix&rerun)");
    $reply = <STDIN>;
    exit(82);
  }
 # read all generations of file into an array, sort,& select last filename
 @files1 = glob("${lbl}[0-9][0-9][0-9][0-9][0-9][0-9]");
 @files2 = sort(@files1);          # sort array
 $f2n = @files2;                   # get number of entries
 $f2i = ($f2n - 1);                # calc index of last entry
 #
 # verify at least 1 generation exists, else errmsg,& exit
 if ($f2i < 0)
   { $lblgen1 = "${lbl}000001";    # create filename for 1st generation
     $ENV{$lfd} = "$lblgen1";      # export LFD=lbl of next generation
     logmsg61 ("gen0: No existing file, gen_000001 exported, $lfd=$lblgen1");
     logmsg61 ("gen0: May continue, need fix?");
     $reply = <STDIN>;             # wait for oprtr to reply
     return(1);                    # return 1 if no files existing
   }
 $lblgen2 = $files2[$f2i];         # retrieve last entry in array
 #
 $ENV{$lfd} = "$lblgen2";          # export LogicalName = PhysicalName
 #=======================
 #
 # display result for console log
 # - with filesize in this UVexport62 (vs UVexport61 which does not)
 $fsize = (-s "$RUNDATA/$lblgen2");
 $fmsg = sprintf("gen0: %s=%s bytes=%d",$lfd,$lblgen2,$fsize);
 UVjobs61::logmsg61 ("$fmsg");
 return 0             # return 0 if file found & verified_
 }

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

 # exportgenp - subrtn to export the previous generation of a filename
 #            - for example, assume $RUNDATA directory contains following files:
 # ap/account.master_000001
 # ap/account.master_000002
 # ap/account.master_000003
 #
 # exportgenp (CUSTMAS, ap/account.master_);   #<-- JCL/script coding
 # =========================================
 # export CUSTMAS=ap/account.master_000002     #<-- effective result
 # =======================================
 #
 sub exportgenp
 {
 $lfd=$_[0]; $lbl=$_[1];        # capture args into named variables
 if ( "$lfd" && "$lbl" ) { ; }
 else { UVjobs61::logmsg61
        ("exportgenp requires 2 args: DDNname=$lfd, DSName=$lbl");
        exit(81);
      }
 #
 # verify that filename (arg2 on call) ends with '_'
 if ($lbl !~ /.*_$/)
   { logmsg61 ("genp filenames must end with '_', enter to exit (fix&rerun)");
     $reply = <STDIN>;
     exit(82);
   }
 # read all generations of file into an array, sort,& select last filename
 @files1 = glob("${lbl}[0-9][0-9][0-9][0-9][0-9][0-9]");
 @files2 = sort(@files1);          # sort array
 $f2n = @files2;                   # get number of entries
 $f2i = ($f2n - 2);                # calc index of previous to last entry
 #
 # verify at least 1 generation exists, else errmsg,& exit
 if ($f2i < 0)
   { $lblgen1 = "${lbl}000001";    # create filename for 1st generation
     $ENV{$lfd} = "$lblgen1";      # export LFD=lbl of next generation
     logmsg61 ("genp: No existing file, gen_000001 exported, $lfd=$lblgen1");
     logmsg61 ("genp: May continue, need fix?");
     $reply = <STDIN>;             # wait for oprtr to reply
     return(1);                    # return 1 if no files existing
   }
 $lblgen2 = $files2[$f2i];         # retrieve next to last entry in array
 #
 $ENV{$lfd} = "$lblgen2";          # export LogicalName = PhysicalName
 #=======================
 #
 # display result for console log
 # - with filesize in this UVexport62 (vs UVexport61 which does not)
 $fsize = (-s "$RUNDATA/$lblgen2");
 $fmsg = sprintf("genp: %s=%s bytes=%d",$lfd,$lblgen2,$fsize);
 UVjobs61::logmsg61 ("$fmsg");
 return 0             # return 0 if file found & verified_
 }

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

 # exportgen1 - subrtn to determine the next generation of a file
 #            - for example, assume $RUNDATA directory contains following files:
 # ap/account.master_000001
 # ap/account.master_000002
 # ap/account.master_000003
 #
 # exportgen1 (CUSTMAS, ap/account.master_, gdg=15); #<-- JCL/script coding
 # =====================================
 # export CUSTMAS=ap/account.master_000004           #<-- effective result
 # =======================================
 #
 sub exportgen1
 {
 $lfd=$_[0]; $lbl=$_[1]; $gdg=$_[2];  # capture args into named variables
 #
 if ( "$lfd" && "$lbl" ) { ; }
 else { UVjobs61::logmsg61
        ("exportgen1 requires 2 args min: DDNname=$lfd, DSName=$lbl");
        exit(81);
      }
 #
 # default arg3 gdg=15 if not present, verify valid range if prsent
 if (! "$gdg")
   { $gdg = "gdg=15";
   }
 $gdgn = ($gdg =~ s/gdg=//);    # get no of gens by drop prefix gdg=
 if ($gdgn < 4 || $gdgn > 249)
   { $gdgn = 15;
   }
 # verify that filename (arg2 on call) ends with '_'
 if ($lbl !~ /.*_$/)
   { logmsg61 ("gen1 filenames must end with '_', enter to exit (fix&rerun)");
     $reply = <STDIN>;
     exit(82);
   }
 # avoid problem when no matching files present
 # - by creating dummy gen 000000 before & removing after
 if (! -f "${lbl}000000")
   { system("touch ${lbl}000000");
   }
 #

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

 # read all generations of file into an array, sort,& select last filename
 @files1 = glob("${lbl}[0-9][0-9][0-9][0-9][0-9][0-9]");
 @files2 = sort(@files1);          # sort array
 $f2n = @files2;                   # get number of entries
 $f2i = ($f2n - 1);                # calc index of last entry
 $lblgen2 = $files2[$f2i];         # retrieve last entry in array
 #
 # extract gen# from end of highest existing file & calc gen# for next
 $gen2 = substr($lblgen2,-6,6);
 $gen3 = ($gen2 + 1);              # calc next generation
 $gen36 = sprintf("%06d",$gen3);   # format in 6 digits
 $lblgen3 = $lbl.$gen36;           # format next gen filename
 #
 $ENV{$lfd} = "$lblgen3";          # export LogicalName = PhysicalName
 #=======================
 #
 # display result for console log
 # - with filesize in this UVexport62 (vs UVexport61 which does not)
 # - might not display filesize for exportgen1 (would be 0)
 $fsize = (-s "$RUNDATA/$lblgen3");
 $fmsg = sprintf("gen1: %s=%s bytes=%d",$lfd,$lblgen3,$fsize);
 UVjobs61::logmsg61 ("$fmsg");
 #
 # remove the dummy gen 000000 create above
 if ( -f "${lbl}000000")
   { system("rm -f ${lbl}000000");
   }
 # delete excess files to maintain no of gens spcfd by gdg=... (or dflt 15)
 $excess = ($f2n - $gdgn);
 if ($excess > 0)
   { for ($ii=0; $ii < $excess; $ii++)
       { system("rm -f $files2[$ii]");
       }
   }
 #
 return(0);
 }

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

 # exportgenall - subrtn to export the latest existing generation of a filename
 #              - for example, assume $RUNDATA directory contains following:
 # ap/account.trans_000001
 # ap/account.trans_000002
 # ap/account.trans_000003
 #
 # exportgenall (CUSTRANS, ap/account.trans_);   #<-- JCL/script coding
 # ===========================================
 #
 # - will concatentate all files into & export base filename
 #
 # export CUSTRANS=ap/account.trans_             #<-- effective result
 # =================================
 #
 sub exportgenall
 {
 $lfd=$_[0]; $lbl=$_[1];        # capture args into named variables
 if ( "$lfd" && "$lbl" ) { ; }
 else { UVjobs61::logmsg61
        ("exportgenall requires 2 args: DDNname=$lfd, DSName=$lbl");
        exit(81);
      }
 #
 # verify that filename (arg2 on call) ends with '_'
 if ($lbl !~ /.*_$/)
   { logmsg61 ("genall filenames must end with '_', enter to exit (fix&rerun)");
     $reply = <STDIN>;
     exit(82);
   }
 #
 # concatentate all existing generations into the base filename
 system ("cat /dev/null > $lbl");
 system ("cat ${lbl}[0-9][0-9][0-9][0-9][0-9][0-9] > $lbl");
 #==========================================================
 #
 $ENV{$lfd} = "$lbl";        # export LogicalName = PhysicalName
 #===================
 #
 # display result for console log
 # - with filesize in this UVexport62 (vs UVexport61 which does not)
 $fsize = (-s "$RUNDATA/$lbl");
 $fmsg = sprintf("genall: %s=%s bytes=%d",$lfd,$lbl,$fsize);
 UVjobs61::logmsg61 ("$fmsg");
 return 0             # return 0 if file found & verified_
 }

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

 # exportgenx - subrtn to report error in JCL to script conversion
 #            - when generation on end of filename not as expected
 #
 # Only exportgen0,1,p,all are valid for converted JCL scripts
 # - since exportgen1 increments gen# immediately vs end of job on mainframe
 # - see explanations in Part_8 of www.uvsoftware.ca/mvsjclperl.htm
 #
 # 1. //DDNAME DD DSN=filename(0)  --> 'exportgen0' current/latest generation
 # 2. //FDNAME DD DSN=filename(+1) --> 'exportgen1' next generation
 #*3. //DDNAME DD DSN=filename(+2) --> 'exportgenx' report err if gen# +2,+3,etc
 #
 # this 'exportgenx' reports an error if script run before manual correction
 #
 sub exportgenx
 {
 $lfd=$_[0]; $lbl=$_[1];     # capture args into named variables
 logmsg61 ("exportgenx - ERR in JCL to Perl script conversion");
 logmsg61 ("- (gen) on end of filename was not (0) or (+1)");
 logmsg61 ("- LFD=$lfd, LBL=$lbl");
 logmsg61 ("- any (+2),(+3),etc should probably be changed to exportgen1");
 logmsg61 ("- see more explanations in Part_8 of MvsJclPerl.doc");
 logmsg61 ("- correct script $JOBID2 & rerun");
 logmsg61 ("- enter to continue, or kill job by interrupt key (del or ^C)");
 $reply = <STDIN>;            # wait for operator to enter or kill
 return(89);
 }
 #
 1;
 #

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

3E0. conversion support files - Control Files


3E1. ctl/jclperlop61 - JCL Conversion control file
  - options to control many aspects of JCL conversion
- includes tables for search/replace, #comment out, drop lines, etc

3E2. customizing the JCL Conversion control file
- the supplied ctl/jclperlop61 is correct for the test/demo conversions
- But you may want to modify for your own JCL conversions.

3E3. ctl/datafiles51 - JCL conversion control file #2 - for data files
- the JCL converter uses this file to determine file characteristics
- also used to override the default use of topnode as the subdir

3E4. Generating ctl/datafiles51

3E5. datafiles52 - extracts data file attributes from scripts AFTER conversion

3E6. gdgmod2 - can use to modify gdg generations AFTER conversion
- based on modified datafiles52

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

3E1. conversion support files - ctl/jclperlop61

ctl/jclperlop61 JCL Conversion control file

 jclperlop61:b0c0d0g15i1j0m1n3p0r0s0t1u0w0x0y0z0 #<-- options for JCL converter
 #        b1                  - generate blank line between steps
 #          c1                - force program names to UPPER case
 #          c2                - force filenames to UPPER case
 #          c4                - force control card modulenames to UPPER case
 #            d1              - debug, generate 'echo's for 'cobrun's
 #              g15           - default gens if jclfiles gdg=___ not coded
 #                 i1         - use DISAM ctl/datafiles51 vs memory table
 #                   j1       - insert stepctl51 on each step (for jcpause)
 #                     m1     - inhibit errmsg "unsupported SORT parameter"
 #                       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
 #                         p1 - append PARM data on COBOL EXECute command
 #                       r0   - gen cobrun for unix/linux .ints (allow animation)
 #                       r1   - gen runw for .ints NetExpress/Windows/UWIN/CYGWIN
 #                       r2   - assume executable programs either unix/windows
 #                       r4   - assume executables in PATH (progname only)
 #                       r8   - generate 'findexec' Multi-Level program search
 #                     s1     - convert SORT for SYNCSORT (not uvsort)
 #                   t0       - no topnode subdirs except &&files in $JTMP
 #                   t1       - topnode subdir, except TOPDIRINSERT/TOPDIRDEFAULT
 #                 u1         - use uvcp for IEBGENER & IDCAMS REPRO (vs unix cp)
 #                 u2         - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 files
 #               w1           - $JSTEP at end vs begin on SYSOUT files for RRD
 #             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 w no / sep
 # jclperlop61:b0c0d0g15i1j0m1n3p0r0s0t1u1w0x0y0z0 #<-- options for mvstest
 # jclperlop61:b1c2d0g15i1j0m1n3p0r0s1t0u2w1x8y0z0 #<-- options for EDS/RRD
 # ----------------------------------------------------------------------------
 # uvadm/ctl/jclperlop61 - control file for IBM JCL to perl script converter
 # - must copy/modify to ctl/ subdir where jclperl61 converter executed
 # Following lines will be inserted in scripts until :ENDINSERT
 # - except for '# ' comment (col1 '#', col2 ' ' blank)
 # '#!/.......' is 1st line out on all scripts (could specify perl version)
 # ------------------------------------------------------------------------
 #!/usr/bin/perl
 # ... #JOB ... (JOB card as #comment from original JCL)
 #         "JobIdX" below replaced by JOBname from original JCL
 $JOBID2 = "JobIdX"; $ENV{JOBID2} = "$JOBID2";
 if ($ENV{JOBID1} == "") {$ENV{JOBID1} = "JobIdX";}
 use Env; use UVjobs61; use UVexport62;
 logmsg61 ("Begin Job=$JOBID2");
 jobset61();
 $XSTEP=0; $JCC=0; $SCC=0; $LCC=0;
 goto $restep;
 S0000: { ; }
 :ENDINSERT: - above non #comment lines inserted at begin output scripts
 #----------------------------------------------------------------------
 #Notes re: Perl Modules UVjobs61,UVexport61/62 (stored at /home/uvadm/perlm)
 # - profile must "export PERL5LIB=$UV/perlm:$PERL5LIB"
 # jobset61 function (in UVjobs61.pm, see above) 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)
 # UVexport61/62 - include subrtns exportfile,exportgen0,1,p,all
 # UVexport61 - shows filenames, determines next GDG, does not display filesize
 # UVexport62 - same as UVexport61, but also displays filesizes
 #
 #----------------------- control table --------------------------------
 # controls various conversion actions (added SEP2003)
 # TOPDIRDEFAULT - used if only 1 node (no High Level Qualifier) in DSN
 #               - should specify in case no HLQ present on DSN
 #               - recommend $WRK=wrk files with only 1 node (temp work files)
 # TOPDIRINSERT - if specified, will be inserted above HLQ, retaining all '.'s
 #              - vs replacing HLQ (action prior to July2004)
 #              - recommend null to convert HLQ's to subdirs
 #                could use REPTBL2 to convert any unwanted HLQs as desired
 #              - if specified, I recommend 'mstr'
 :CTLTBL:
 TOPDIRDEFAULT~~~~~~~~~~~~~~~~~$WRK~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINSERT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 #---------------------- search/replace tables -------------------------
 # - 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
 .DSN=~~~~~~~~~~~~~~~~~~~~~~~~~.,DSN=~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 :REPTBL2:     search/replace table for output UNIX script
 oldHLQ/~~~~~~~~~~~~~~~~~~~~~~~newHLQ/~~~~~~~~~~~~~~~~~~~~~~~qualifier~~~~~~~~~~~
 BLKSIZE=6400~~~~~~~~~~~~~~~~~~BLKSIZE=6300~~~~~~~~~~~~~~~~~~INPFIL~~~~~~~~~~~~~~
 BLKSIZE=6400~~~~~~~~~~~~~~~~~~BLKSIZE=6500~~~~~~~~~~~~~~~~~~OUTFIL~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # might use REPTBL2 to modify HLQ (High Level Qualifier) directory assignments
 # - often used to convert production & test HLQs to 1 common code
 #   (since testing now provided for by $RUNLIBS & $RUNDATA in .profiles)
 # - patterns 'BLKSIZE=6400' etc for test/demo conversions in MVSJCL.doc
 #
 # comment lines in output script by search patterns & qualifiers
 # - inserts '# ' in cols 1 & 2 if search & qualifier patterns present
 :CMTTBL:
 cmtsearch~~~~~~~~~~~~~~~~~~~~~cmtqualifier~~~~~~~~~~~~~~~~~~
 BLKSIZE=6300~~~~~~~~~~~~~~~~~~INPFIL~~~~~~~~~~~~~~~~~~~~~~~~
 BLKSIZE=6500~~~~~~~~~~~~~~~~~~OUTFIL~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 :DROPDDN:    drop DDnames on input //DDname DD
 PROCLIB~~~~~~~~~~~~~~~~~~~~~~~
 STEPLIB~~~~~~~~~~~~~~~~~~~~~~~
 JOBLIB~~~~~~~~~~~~~~~~~~~~~~~~
 SYSLIB~~~~~~~~~~~~~~~~~~~~~~~~
 ESYLIB~~~~~~~~~~~~~~~~~~~~~~~~
 RESLIB~~~~~~~~~~~~~~~~~~~~~~~~
 DFSRESLB~~~~~~~~~~~~~~~~~~~~~~
 SORTLIB~~~~~~~~~~~~~~~~~~~~~~~
 SORTWK*~~~~~~~~~~~~~~~~~~~~~~~
 SYSUDUMP~~~~~~~~~~~~~~~~~~~~~~
 SYSABEND~~~~~~~~~~~~~~~~~~~~~~
 SYSOUX~~~~~~~~~~~~~~~~~~~~~~~~
 SYSDBOUT~~~~~~~~~~~~~~~~~~~~~~
 SYSABOUT~~~~~~~~~~~~~~~~~~~~~~
 SYSTSPRT~~~~~~~~~~~~~~~~~~~~~~
 SYSPRINT~~~~~~~~~~~~~~~~~~~~~~
 CEEDUMP~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # Table of DSNnames to drop if pattern matched anywhere in filename
 # - optionally qualified by EXECname in cols 31-38
 # - 2nd line below drops .DBIMS files only if step DFSRRC00
 #   unnecessary since 1st line drops .DBIMS in filenames regardless of EXEC
 :DROPDSN:
 LINKLIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 LOADLIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 JCLLIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 JCL.LIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 PROD.LOAD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TEST.LOAD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 EMER.LOAD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 COBOLMVS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 STREAMW~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 LOADRUN~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 PROD.JCL~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # Table of STEP names to be #commented out
 :COMMENTSTEP:
 BMCSIU~~~~~~~~~~~~~~~~~~~~~~~~
 IDCAMS~~~~~~~~~~~~~~~~~~~~~~~~
 IEFBR14~~~~~~~~~~~~~~~~~~~~~~~
 XMOPEN~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # Table of symbols whose value is to be translated to lower case
 :LOWERCASE:
 APPLID~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 #May06/06 - add table of 3rd party programs for EDS/RRD
 #         - to modify presumption of COBOL (construct cobrun)
 :3RDPARTY:
 CDEXEC~~~~~~~~~~~~~~$P3_CDEXEC/bin/cdexec~~~~~~~~~~~~~~~~~~~~~~~
 ENGEXE~~~~~~~~~~~~~~$P3_ENGEXE/version/Engine~~~~~~~~~~~~~~~~~~~
 FILEAID~~~~~~~~~~~~~$P3_FILEAID/bin/fileaid~~~~~~~~~~~~~~~~~~~~~
 FTUCMD~~~~~~~~~~~~~~$P3_FTUCMD/bin/ftucmd~~~~~~~~~~~~~~~~~~~~~~~
 INFOMOVR~~~~~~~~~~~~$P3_INFOMOVR/bin/infomovr~~~~~~~~~~~~~~~~~~~
 MACH~~~~~~~~~~~~~~~~$P3_MACH/bin/mach~~~~~~~~~~~~~~~~~~~~~~~~~~~
 NDMEXEC~~~~~~~~~~~~~$P3_NDMEXEC/bin/ndmexec~~~~~~~~~~~~~~~~~~~~~
 PDRFILES~~~~~~~~~~~~$P3_PDRFILES/bin/pdrfiles~~~~~~~~~~~~~~~~~~~
 PDRSW000~~~~~~~~~~~~$P3_PDRSW000/bin/sweaver~~~~~~~~~~~~~~~~~~~~
 PKZIP~~~~~~~~~~~~~~~$P3_PKZIP/bin/pkzip~~~~~~~~~~~~~~~~~~~~~~~~~
 SYNCsort~~~~~~~~~~~~$P3_SYNCsort/bin/syncsort~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # user would define the $EXECNAMEs in the common_profile
 # - as the PATH to the 3rd party apps dirs
 # - & modify above table depending on bin, etc
 # export P3_PDRSW000=/apps/StreamWeaver
 # export P3_ENGEXE=/apps/dialogue
 # - ENGEXE(dialogue) is special case with version subdir
 # - taken from DSN of MSGSYM DDN, for example
 # //MSGSYM DD DSN=STS2.EXSTREAM.V4R0M060.MESSAGES
 #
 #------------------------ end jclperlop61 ---------------------------

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

3E2. conversion support files - ctl/jclperlop61

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/jclperlop61) controls various activities performed by the jclperl61 conversion program. Several options are specified on line 1:

 jclperlop61:b0c0d0g15i1j0m1n3p0r0s0t1u0w0x0y0z0 #<-- options for JCL converter
 #        b1                  - generate blank line between steps
 #          c1                - force program names to UPPER case
 #          c2                - force filenames to UPPER case
 #          c4                - force control card modulenames to UPPER case
 #            d1              - debug, generate 'echo's for 'cobrun's
 #              g15           - default gens if jclfiles gdg=___ not coded
 #                 i1         - use DISAM ctl/datafiles51 vs memory table
 #                   j1       - insert stepctl51 on each step (for jcpause)
 #                     m1     - inhibit errmsg "unsupported SORT parameter"
 #                       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
 #                         p1 - append PARM data on COBOL EXECute command
 #                       r0   - gen cobrun for unix/linux .ints (allow animation)
 #                       r1   - gen runw for .ints NetExpress/Windows/UWIN/CYGWIN
 #                       r2   - assume executable programs either unix/windows
 #                       r4   - assume executables in PATH (progname only)
 #                       r8   - generate 'findexec' Multi-Level program search
 #                     s1     - convert SORT for SYNCSORT (not uvsort)
 #                   t0       - no topnode subdirs except &&files in $JTMP
 #                   t1       - topnode subdir, except TOPDIRINSERT/TOPDIRDEFAULT
 #                 u1         - use uvcp for IEBGENER & IDCAMS REPRO (vs unix cp)
 #                 u2         - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 files
 #               w1           - $JSTEP at end vs begin on SYSOUT files for RRD
 #             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 w no / sep
 # jclperlop61:b0c0d0g15i1j0m1n3p0r0s0t1u1w0x0y0z0 #<-- options for mvstest
 # jclperlop61:b1c2d0g15i1j0m1n3p0r0s1t0u2w1x8y0z0 #<-- options for EDS/RRD

includes search/replace tables to modify conversion for site variances you can use REPTBL2 to modify the directory name taken from the HLQ (High Level Qualifier of DSN file-id).

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

3E3. JCL Conversion Control Files

ctl/datafiles51 - JCL conversion control file #2

 &&TEMPGLT                               cnt=0002 rfm=FB_ rcs=00080
 &&TEMPSLS                               cnt=0002 rfm=FB_ rcs=00064
 AR.CUSTOMER.MASTER                      cnt=0006 rfm=___ rcs=_____
 AR.CUSTOMER.MASTER.INDEXED              cnt=0001 rfm=___ rcs=_____
 AR.CUSTOMER.NAMEADRS.LIST100            cnt=0001 rfm=FBA rcs=00133
 AR.SALES.ITEMS                          cnt=0002 rfm=___ rcs=_____
 AR.SALES.LIST                           cnt=0001 rfm=FBA rcs=00133
 FTP.CUSTOMER.MASTER                     cnt=0001 rfm=___ rcs=_____
 GL.ACCOUNT.ACNTLIST                     cnt=0001 rfm=___ rcs=_____
 GL.ACCOUNT.ACNTLIST(+1)                 cnt=0001 rfm=FBA rcs=00133 gdg=15
 GL.ACCOUNT.EXPORT                       cnt=0001 rfm=___ rcs=_____
 GL.ACCOUNT.MASTER(+1)                   cnt=0009 rfm=FBA rcs=00080 gdg=15
 GL.ACCOUNT.MASTER(0)                    cnt=0014 rfm=___ rcs=_____ gdg=15
 GL.ACCOUNT.MASTER2                      cnt=0002 rfm=FIS rcs=00080 keys=(0,6)
 GL.ACCOUNT.TRANS                        cnt=0001 rfm=___ rcs=_____
 GL.CTLCDLIB(PGL200S1)                   cnt=0001 rfm=___ rcs=_____
 MXPLIB(IKJDEMO1)                        cnt=0001 rfm=___ rcs=_____
 ORDR.ORDR400F.B18416.WEEKLY(+1)         cnt=0001 rfm=FBA rcs=00133 gdg=15
 ORDR.ORDR400F.B18416.WEEKLY(0)          cnt=0001 rfm=___ rcs=_____ gdg=15
 ORDR.ORDR400F.FTP.WEEKLY                cnt=0002 rfm=FBA rcs=00133
 PYTEST.CTLCDLIB(PPY200S1)               cnt=0001 rfm=___ rcs=_____
 PYTEST.PAYROLL.MASTER(0)                cnt=0002 rfm=___ rcs=_____ gdg=15
 PYTEST.PAYROLL.REGISTER(+1)             cnt=0001 rfm=FBA rcs=00120 gdg=15
 PYTEST.TIME.CARDS                       cnt=0001 rfm=___ rcs=_____
 PYTEST.TIMECARD.EDIT(+1)                cnt=0001 rfm=FBA rcs=00120 gdg=15
 WORK.SALES.GROUP1                       cnt=0001 rfm=FB_ rcs=00064
 WORK.SALES.GROUP2                       cnt=0001 rfm=FB_ rcs=00064

Notes

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

3E4. JCL Conversion Control Files

ctl/datafiles51 - Notes

 <----- Please see ctl/datafiles51 listed on the previous page.

The JCL converter uses this file to determine file types (GDG or not).

This control file is generated by the 'jcldata51' uvcopy job, which must be run after the PROC expansion & before the JCL conversion. 'jcldata51' reads the jcl2 subdir of expanded JCLs, extracting all DSN filenames from all JCLs, & writes them into 1 file ctl/datafiles51.

Here is the uvcopy command line to generate this file, but it also included elsewhere in the proper sequence with the conversion Operating Instructions.


 #4. uvcopy jcldata51,fild1=jcl2,filo2=ctl/datafiles51
     =================================================

 #5. vi ctl/datafiles51    <-- edit to modify the gdg=.. values as desired
     ==================

sample changes to datafiles51

 gl.account.acntlist                         cnt=0001
 gl.account.acntlist(+1) gdg=15              cnt=0001
 gl.account.export                           cnt=0001
 gl.account.master(+1) gdg=30                cnt=0005
 gl.account.master(0) gdg=30                 cnt=0006
 gl.account.trans                            cnt=0001
 gl.ctlcdlib(pgl200s1)                       cnt=0001
 py.ctlcdlib(ppy200s1)           topr=payroll cnt=0001
 py.payroll.master(0) gdg=15     topr=payroll cnt=0001 rcs=256 keys=(0,6)
 py.time.cards                   topr=payroll cnt=0001 rcs=80
 py.timecard.edit(+1) gdg=15     topr=payroll cnt=0001

Compare the 'gl' & 'py' entries to the originals listed on the previous page and not the changes made (to test the JCL converter).

  1. We changed gl.account.master from gdg=15 to 'gdg=30'.

  2. We added 'topr=payroll' on all 'py.' files. The JCL converter will then reassign the topnode/subdir as 'payroll/...' on all original py files.

  3. We added 'rcs=256 keys=(0,6)' onto the py.payroll master to ensure the JCL converter has the correct info for this file.

If the JCL converter cannot find the record size (from LRECL=...), it will assign 'rcs=99999' on 'uvsort's or 'uvcp's. If you see a lot of 'rcs=99999's on your 1st conversion, you should add the appropriate info to the control file & reconvert the JCL.

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

3E5. JCL Conversion Control Files

ctl/datafiles52 - JCL conversion control file #2a

 &&TEMPGLT                               cnt=0002 rfm=FB_ rcs=00080
 &&TEMPSLS                               cnt=0002 rfm=FB_ rcs=00064
 AR.CUSTOMER.MASTER                      cnt=0006 rfm=___ rcs=_____
 AR.CUSTOMER.MASTER.INDEXED              cnt=0001 rfm=___ rcs=_____
 AR.CUSTOMER.NAMEADRS.LIST100            cnt=0001 rfm=FBA rcs=00133
 AR.SALES.ITEMS                          cnt=0002 rfm=___ rcs=_____
 AR.SALES.LIST                           cnt=0001 rfm=FBA rcs=00133
 FTP.CUSTOMER.MASTER                     cnt=0001 rfm=___ rcs=_____
 GL.ACCOUNT.ACNTLIST                     cnt=0001 rfm=___ rcs=_____
 GL.ACCOUNT.ACNTLIST(+1)                 cnt=0001 rfm=FBA rcs=00133 gdg=15
 GL.ACCOUNT.EXPORT                       cnt=0001 rfm=___ rcs=_____
 GL.ACCOUNT.MASTER(+1)                   cnt=0009 rfm=FBA rcs=00080 gdg=15
 GL.ACCOUNT.MASTER(0)                    cnt=0014 rfm=___ rcs=_____ gdg=15
 GL.ACCOUNT.MASTER2                      cnt=0002 rfm=FIS rcs=00080 keys=(0,6)
 GL.ACCOUNT.TRANS                        cnt=0001 rfm=___ rcs=_____
 GL.CTLCDLIB(PGL200S1)                   cnt=0001 rfm=___ rcs=_____
 MXPLIB(IKJDEMO1)                        cnt=0001 rfm=___ rcs=_____
 ORDR.ORDR400F.B18416.WEEKLY(+1)         cnt=0001 rfm=FBA rcs=00133 gdg=15
 ORDR.ORDR400F.B18416.WEEKLY(0)          cnt=0001 rfm=___ rcs=_____ gdg=15
 ORDR.ORDR400F.FTP.WEEKLY                cnt=0002 rfm=FBA rcs=00133
 PYTEST.CTLCDLIB(PPY200S1)               cnt=0001 rfm=___ rcs=_____
 PYTEST.PAYROLL.MASTER(0)                cnt=0002 rfm=___ rcs=_____ gdg=15
 PYTEST.PAYROLL.REGISTER(+1)             cnt=0001 rfm=FBA rcs=00120 gdg=15
 PYTEST.TIME.CARDS                       cnt=0001 rfm=___ rcs=_____
 PYTEST.TIMECARD.EDIT(+1)                cnt=0001 rfm=FBA rcs=00120 gdg=15
 WORK.SALES.GROUP1                       cnt=0001 rfm=FB_ rcs=00064
 WORK.SALES.GROUP2                       cnt=0001 rfm=FB_ rcs=00064

ctl/datafiles52 - Notes

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

3E6. JCL Conversion Control Files

Generate ctl/datafiles52 & modify gdg=..

You might use this file (with uvcopy job gdgmod2) to modify the gdg=.. values in the converted JCL/scripts (long after the conversion has been completed).


 #5. uvcopy jcldata52,fild1=jcl3,filo2=ctl/datafiles52
     =================================================

 #6. vi ctl/datafiles52       - edit to modify GDG no of generations
     ==================

 #7. mv jcls jcls.old        - change name of existing jcl/scripts subdir
     ================

 #8. mkdir jcls              - make new subdir to receive modified jcls
     ==========

 #9. uvcopy gdgmod2,fild1=jcls.old,fild2=jcls,fili3=ctl/datafiles52
     ==============================================================
     - copy JCL/scripts from jcls.old to jcls, modifying generations
       as specified by gdg=.. on matching filenames in ctl/datafiles52

sample ctl/datafiles52

 gl/account.acntlist_ gdg=20                                        cnt=0002
 gl/account.export                                                  cnt=0001
 gl/account.master_ gdg=35                                          cnt=0013

sample input lines

exportgen1 ACTLIST gl/account.acntlist_ gdg=10 exportgen1 ACCTMAS gl/account.master_ gdg=10

sample output lines

exportgen1 ACTLIST gl/account.acntlist_ gdg=020 exportgen1 ACCTMAS gl/account.master_ gdg=025

You might find it useful to edit & add record-sizes & indexed file keys on the right hand side (might be used in future by the converter), for example:

   ar/customer.master          cnt=0001 cpy=custmas.cpy rcs=256 keys=(0,6,10,25)
   gl/account.master_          cnt=0004 cpy=acntmas.cpy rcs=80 keys=(0,8)

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

3F0. conversion support scripts - adm, demo, IBM, util

conversion support scripts

There are over 200 scripts supplied with the Vancouver Utilities. They are stored at /home/uvadm/sf/... (subdirectoried to adm, demo, IBM,& util). Most of the JCL conversion scripts would be in the 'IBM' subdir.

Here is a list of some of the scripts used for JCL conversion, followed by a detail listing of a few scripts (jcl2perl61, jcl2perl6A, jclxx61, jcpause, jcclear).


3F1. jcl2perl61 - convert 1 MVS JCL to Perl (all steps)
- cleanup, PROC/INCLUDE expansion, JCL conversion, copy to jcls
- jcl0 ---> jcl1 ---> jcl2 ---> jcl3 ---> jcls

3F2. jcl2perl6A - convert all JCL to Perl scripts from jcl0 thru jcl3

3F3. jclpx51 - expand PROCs & INCLUDEs while copying JCL from jcl1 to jcl2

3F4. jclxx61 - convert all JCLs to Perl scripts from jcl2 --> jcl3

3F5. jcpause - pause a JCL/script at the next step or a specified step

3F6. jcclear - 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

3F1. conversion support scripts - adm, demo, IBM, util

jcl2perl61 - convert 1 JCL thru all stages

 #!/bin/ksh
 # jcl2perl61 - convert 1 job at a time (by OT, UVSI, Aug2004)
 # jcl2perl61 - convert to Perl scripts (vs jcl2ksh51 convert to Korn scripts)
 #           - recommend convert all JCL's in directory (page 1Q1 MvsJclPerl.doc)
 #           - might use this to convert new jobs brought over from mainframe
 #           - see 1Q9 MvsJclPerl.doc or www.uvsoftware.ca/mvsjclperl.htm#1Q9
 #
 # - 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 all DSN's present in ctl/datafiles61 (with gdg=.. preferences)
 # - 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 "arg1 must be a file (in jcl0) & jcl1,jcl2,jcl3 must be present"
      echo "usage: jcl2perl61 jcl0/JCLfilename"
      echo "       =========================="
      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
 #
 jclperl61 jcl2/$f.jcl jcl3/$f.pl
 #================================
 # - convert expanded mainframe JCL to Perl script
 #
 echo "jcl0/$f.jcl converted to jcl3/$f.pl 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.pl jcls      # copy converted JCL/script to jcls (in PATH)
 #==================
 exit 0
 #

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

3F2. conversion support scripts - adm, demo, IBM, util

jcl2perl6A - convert all JCL from jcl0 thru jcl3

 #!/bin/ksh
 # jcl2perl6A - convert All MVS JCL to Perl scripts
 #            - by Owen Townsend, UVSI, July 7/2006
 # jcl2perl6A - convert MVS JCL to Perl (vs jcl2ksh51 convert to Korn script)
 #
 # - assumes input JCL has been stored in subdir 'jcl0'
 # - assumes input PROC's stored in proc0
 # - assumes control card members stored in parm0
 # - assumes INCLUDE modules stored in include0 <-- chg to parms Oct17/06
 # - converts JCL from: jcl0 ---> jcl1 ---> jcl2 ---> jcl3 -x-> jcls
 # - manually copy to subdir jcls for test/debug
 #
 #Note - dont use this script for your 1st conversion
 #     - use the step by step method shown on pages 1Q1-1Q8 of MvsJclPerl.doc
 #       (or www.uvsoftware.ca/mvsjclperl.htm#1Q1 - 1Q8)
 #
 if [[ -d jcl0 && -d jcl1 && -d jcl2 && -d jcl3 && -d proc0 && -d procs\
    && -d parm0 && -d parms && "$1" == "all" && -f ctl/jclperlop61 ]]; then :
 else echo "usage: jcl2perl6A all"
      echo "       ============="
      echo "subdirs required: jcl0/1/2/3,proc0/1,parm0/s"
      echo "& JCL converter control file must be present: ctl/jclperlop61"
      exit 1; fi
 #
 echo "jcl2perl6A for re-conversions (added JCLs in jcl0, option changes, etc)"
 echo "for 1st conversion - see step by step in 1Q1-1Q5 of MvsJclPerl.doc"
 echo "jcl2perl6A can omit cleanup proc0-->procs & parm0-->parms"
 echo "- saves time if no new/modified PROCs, INCLUDEs, or control cards"
 echo "cleanup PROCs, INCLUDEs,& CTLCARDS y/n ? "
 reply=x; read reply
 until [[ "$reply" == "y" || "$reply" == "n" ]]
    do echo "cleanup PROCs, INCLUDEs,& CTLCARDS - y/n ?"; read reply; done
 if [[ "$reply" == "y" ]]; then
    uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.proc  #<-- cleanup PROCs
    #==================================================
    uvcopyx cleanup parm0 parms uop=q0i7g8n5        #<-- cleanup control cards
    #=========================================
    #
    #Oct17/06 - includes combined with parms
    #uvcopyx cleanup include0 include1 uop=q0i7g8n5 #<-- cleanup INCLUDE modules
    #==============================================
 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
 #===============================================
 #
 # 2. expand procs as we copy JCL from subdir jcl1 to subdir jcl2
 jclpx51 jcl1 jcl2 procs parms
 #============================
 #
 # 3. generate data control file (extract datafilenames from all JCL)
 #    - prompt 1st, would not do if ctl/datafiles51 customized
 echo "create ctl/datafiles51 (not if customized) y/n ?"
 reply=x; read reply
 until [[ "$reply" == "y" || "$reply" == "n" ]]
    do echo "create ctl/datafiles51 (not if customized) y/n ?"
       read reply; done
 if [[ "$reply" == "y" ]]; then
    uvcopy jcldata51,fild1=jcl2,filo2=ctl/datafiles51
    #================================================
    uvcopy loaddf51,fili1=ctl/datafiles51,filo1=ctl/datafiles51
    #==========================================================
 fi
 #
 # 4. edit data control file (modify topnodes, GDG generations, etc)
 # vi ctl/datafiles51    #<-- optional, #cmntd out for 1st conversion
 # ==================
 #
 # 5. convert expanded JCL to Perl scripts
 jclxx61 jcl2 jcl3
 #================
 #
 # 6. copy scripts from jcl3 to jcls 1 by 1 as you test/debug
 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"
 exit 0
 #

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

3F3. conversion support scripts - adm, demo, IBM, util

jclpx51 - expand PROCs from procs while copying jcl1 to jcl2

 #!/bin/ksh
 # jclpx51 - Korn shell script from UVSI stored in: /home/uvadm/sf/IBM/
 # jclpx51 - script to execute the jclproc51.c program
 #         - to expand PROCs in IBM MVS JCL
 #         - see MVSJCL.doc, or www.uvsoftware.ca/mvsjcl.htm
 #Oct17/06 - includes combined with parms (chg subdir include1 to parms)
 #
 # usage:  jclpx51 indir outdir [PROCdir INCLUDEdir options]
 #         =================================================
 #example: jclpx51 jcl1 jcl2 procs parms   <-- arg3 & arg4 defaults
 #         =============================
 #
 # indir  - contains the JCL's with PROCs to be expanded
 #        - any file with no // in cols 1&2 of 1st line will be bypassed
 # outdir - will receive the expanded JCL
 #        - output filenames same as input, with .jcl ensured
 #
 # jclproc51 indir/jclfile outdir/jclfile PROCdir INCLUDEdir [options]
 # ===================================================================
 #
 #May2004 - jclproc51 appends to an error message file --> errs/jclproc51.err
 # - init now (1st create errs subdir within current dir if not already present)
 if [[ ! -d errs ]]; then mkdir errs; fi  # make errs subdir if not existing
 >errs/jclproc51.err                      # init errmsg collection file
 #
 echo "script to expand PROCs in MVS JCL"
 if [[ -d "$1" && -d "$2" && -d "$3" && -d "$4" ]]; then :
    else echo "USAGE: jclpx51 indir outdir procdir includes/parmsdir options"
         echo "       ======================================================"
    exit 1; fi
 x=0
 for i in $1/*
 do
     a=${i##*/}
 ##  b=${a%.*}                   #Oct2001 leave .jcl extensions on
     typeset -l c=$a             #Oct2001 was 'c=$b'
     jclproc51 $i $2/$c $3 $4 $5
 ####===========================
     let x=x+1
 done
 echo "$x MVS JCLs in $1 expanded, PROCs $3, INCLUDEs $4, output $2"
 echo "call uvcopy jobs to create reports of PROCs & INCLUDE MEMBERs NOT FOUND"
 uvcopy procNF,fili1=errs/jclproc51.err,filo1=errs/procNF.rpt
 #===========================================================
 uvcopy includeNF,fili1=errs/jclproc51.err,filo1=errs/includeNF.rpt
 #=================================================================
 exit 0

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

3F4. conversion support scripts - adm, demo, IBM, util

jclxx61 - convert all JCL from jcl2 to jcl3

 #!/bin/ksh
 # jclxx61 - script from UVSI stored in: /home/uvadm/sf/IBM/
 # jclxx61 - script to execute the jclperl61 program
 #         - to convert IBM mainframe MVS JCL to 'Perl' scripts
 #         - by OT(UVSI), July7/2006, alternate to jclxx61 (for Korn shell)
 #
 # usage:  jclxx61 indir outdir
 #         ====================
 #example: jclxx61 jcl2 jcl3
 #         =================
 #
 # indir  - contains the JCL's to be converted
 #        - any file with no // in cols 1&2 of 1st line will be bypassed
 # outdir - will receive the converted scripts
 #        - output filenames same as input, with .jcl removed & .pl added
 #
 # This script calls jclperl61 C program using only 1st 2 args of possible 4
 # - jclperl61 will default args 3 & 4 to ctl/jclperlop5 & ctl/jclfiles
 #
 # jclperl61 indir outdir control-file GDG-filelist
 # ===============================================
 #
 #May2004 jclperl61 now appends to an error message file --> errs/jclperl61.err
 # - init now (1st create errs subdir within current dir if not already present)
 if [[ ! -d errs ]]; then mkdir errs; fi  # make errs subdir if not existing
 >errs/jclperl61.err                       # init errmsg collection file
 #
 echo "script to convert mainframe JCLs to Perl scripts"
 if [ -d "$1" -a -d "$2" ]; then :
    else echo "ERROR - usage: jclxx61 indir outdir options"
    exit 1; fi
 x=0
 for i in $1/*
 do
     a=${i##*/}
 ##  b=${a%.*}                #Oct2001 leave .jcl extensions on
     typeset -l c=$a          #Oct2001 was 'c=$b'
     jclperl61 $i $2/$c
     let x=x+1
 done
 echo "$x IBM MVS JCLs converted from $1 to Perl scripts in $2"
 echo "call 'parmNF' to report any control card library members not found"
 #
 uvcopy parmNF,fili1=errs/jclperl61.err,filo1=errs/parmNF
 #============================================================
 exit

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

3F5. conversion support scripts - adm, demo, IBM, util

jcpause - pause a JCL/script

 # jcpause - write control record to pause specified JCL/script
 #         - for UNIX scripts converted from IBM VSE JCL
 #         - this KORN shell script stored at /home/uvadm/sf/IBM/jcpause
 #         - see more doc at: www.uvsoftware.ca/vse2unix.htm
 #
 # JCL converter inserts a call to function 'stepctl41' 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?)
 #
 # Operator would use scripts to pause or restart jobs ('jcpause' & 'jcclear')
 #
 # 1. jcpause jobname.pl       <-- pause specified job at begin next step
 #    ===================
 #
 # 2. jcpause jobname.pl S0050 <-- pause job at step S0050 (step 5, inc by 10)
 #    =========================   - also be used by programmers debugging ?
 #
 # 3. jcclear jobname.pl       <-- clear control file, allow job to proceed
 #    ===================
 #
 # Step Control files are written to $RUNDATA/jobctl/...
 # - named same as JCL/script but with extension '.ctl' (vs .pl)
 # - jcpause writes 1 line in the control file with jobname.pl & step#
 # - step# is the step# specified by oprtr as arg#2 on jclpause script command
 # - step# is S0000 if no step# spcfd on jcpause (indicates stop at next step)
 #
 jfn="$1"               # capture jobfilename from arg1
 if [[ -f $RUNLIBS/jcls/$jfn ]]; then :
    else echo "usage: jcpause jobname.pl S####  jobname mandatory, step# optnl"
         echo "       ========================="
         echo "- JCL/script $jfn not found in $RUNLIBS/jcls/..."
         exit 1; fi
 #
 # capture step# & verify or default to S0000 if not spcfd
 if [[ -n "$2" ]]; then step="$2"; else step="S0000"; fi
 stepl=${#step}       # capture length of step#
 if [[ ($stepl -eq 5) && ($step == S*) ]]; then :
    else echo "usage: jcpause jobname.pl S####  jobname mandatory, step# optnl"
         echo "       ========================="
         echo "- step# must be 'S' followed by 4 digits"
         exit 2; fi
 #
 # create control file name
 jbn=${jfn%.*}                   # strip .pl extension
 cfn=$jbn.ctl                    # append .ctl convention
 #
 # format control record contents & write
 ctlrec="$jfn $step $(date +%y%m%d_%H%M%S)"
 #=========================================
 echo "$ctlrec" >$RUNDATA/jobctl/$cfn
 #===================================
 exit 0

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

3F6. conversion support scripts - adm, demo, IBM, util

jcclear - clear the pause control file

 # jcclear - write control record to pause specified JCL/script
 #         - for UNIX scripts converted from IBM VSE JCL
 #         - this KORN shell script stored at /home/uvadm/sf/IBM/jcclear
 #         - see more doc at: www.uvsoftware.ca/vse2unix.htm
 #
 # JCL converter inserts a call to function 'stepctl41' 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?)
 #
 # Operator would use scripts to pause or restart jobs ('jcpause' & 'jcclear')
 #
 # 1. jcpause jobname.pl       <-- pause specified job at begin next step
 #    ===================
 #
 # 2. jcpause jobname.pl S0050 <-- pause job at step S0050 (step 5, inc by 10)
 #    =========================   - also be used by programmers debugging ?
 #
 # 3. jcclear jobname.pl       <-- clear control file, allow job to proceed
 #    ===================
 #
 # Step Control files are written to $RUNDATA/jobctl/...
 # - named same as JCL/script but with extension '.ctl' (vs .pl)
 # - jcpause writes 1 line in the control file with jobname.pl & step#
 # - step# is the step# specified by oprtr as arg#2 on jclpause script command
 # - step# is S0000 if no step# spcfd on jcpause (indicates stop at next step)
 #
 jfn="$1"               # capture jobfilename from arg1
 if [[ -f $RUNLIBS/jcls/$jfn ]]; then :
    else echo "usage: jcclear jobname.pl S####  jobname mandatory, step# optnl"
         echo "       ========================="
         echo "- JCL/script $jfn not found in $RUNLIBS/jcls/..."
         exit 1; fi
 #
 # create control file name
 jbn=${jfn%.*}                   # strip .pl extension
 cfn=$jbn.ctl                    # append .ctl convention
 #
 # remove control file for specified job
 rm -f $RUNDATA/jobctl/$cfn
 #=========================
 #
 exit 0

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

3G0. conversion support files - uvcopy jobs (adm,demo,IBM,ut il)

conversion support - uvcopy jobs

There are over 500 uvcopy jobs supplied with the Vancouver Utilities. They are stored at /home/uvadm/pf/... (subdirectoried to adm, demo, IBM,& util). Most of the JCL conversion uvcopy jobs would be in the 'IBM' subdir.

Here is a list of some of the uvcopy jobs used for JCL conversion, followed by a detail listing of just 1 uvcopy jobs (procNF)


3G1. uvcopy procNF - create table summary of PROCs Not Found in JCL conversion
- see listing on the next page
uvcopy includeNF
  • create table summary of INCLUDEs Not Found in JCL conversion
uvcopy parmNF
  • create table summary of SYSIN control card modules Not Found
uvcopy tblexts1
  • table summary of extensions used within a directory
uvcopy cleanup
  • cleanup library files transferred from the mainframe
  • options to clear cols 73-80 in JCLs, cols 1-6 in COBOLs, etc
uvcopy jcldata51
  • extract all DSN datafilenames from all JCL
  • creates ctl/datafiles51 used by the JCL converter
uvcopy cnvMF5
  • COBOL converter from mainframe to Micro Focus
  • JCL converter is a C program (large & complex)
  • COBOL conversion not as complex & could be done with uvcopy
uvcopy cobmap1
  • convert COBOL copybooks into 'cobmaps'
  • add record layout info (field start,end,length,type)
    on the right hand side
uvcopy table2
  • perform table analysis on any fixed record data file
  • accepts options for recsize, table argument,& table acums
uvcopy loadctlI
  • load data conversion Indexed control file from a text file

3G2. uvcopy gen56pk - generate a test data file with 56 packed fields
- see listing 3 pages ahead
Note
  • most of the above uvcopy jobs are too long to list here
  • procNF is listed here because it is short
  • yet demonstrates the power of uvcopy

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

3G1. conversion support - uvcopy jobs

procNF - table summary of PROCs Not Found in JCL conversion

 # procNF - create table summary report of 'PROCs NOT FOUND'
 #         - see www.uvsoftware.ca/mvsjcl.htm (mainframe JCL conversion)
 #
 # This uvcopy job is called at end of 'jclpx51'
 # - jclpx51 is the script that performs PROC expansion
 #   by calling the 'jclproc51' C program for all files in the directory
 # - jclproc51 collects errmsgs into errs/jclproc51.err
 # - this job will search for 'PROC1 NOT FOUND' or PROC2 NOT FOUND errmsgs
 #   then extract the PROC name & create table summary report with counts
 # - if desired, you could run this standalone (after jclpx51) as follows:
 #
 # uvcopy procNF,fili1=errs/jclproc51.err,filo1=errs/procNF.rpt
 # ==============================================================
 #
 # procNF  2005/08/15_10:19:56  summary table of PROCs NOT FOUND
 # tbl#001 pg#001     -argument-
 # line#  count    %  PROCname not found
 #     1     780  14  &WRTPROC
 #     2       7   0  ARCHIVE
 #   - - - many lines omitted - - -
 #   272       1   0  TCKRBDCI
 #   273     101   1  WRTPROC
 #         5,420*100   *TOTAL*
 #
 fili1=errs/jclproc51.err,rcs=128,typ=LST
 filo1=errs/procNF.rpt,rcs=128,typ=LSTt
 @run
        opn     all
 # begin loop to get lines from errmsg file until EOF reached
 man20  get     fili1,a0(128)          get next line from errfile
        skp>    eof                    (cc set > at EOF)
 # select only lines with 'PROC1 NOT FOUND' or PROC2 NOT FOUND
 # extract the procname following EXEC
 # & build summary table of procnames with counts
       clr     b0(32),' '              clear work area for procname extract
       sqzc1   a0(128),' '             squeeze input to 1 blank btwn words
       scn     a0(120),'PROC1 NOT FOUND'
       skp=    man30
       scn     a0(120),'PROC2 NOT FOUND'
       skp=    man30
       skp     man20
 man30 scn     a0(80),' EXEC '         set rgstr 'x' to ' EXEC '
       mvum    b0(32),ax6,' ,'         move until blank or comma at end procname
       rep     b0(32),'PROC=',''       remove any 'PROC='procname
       rep     b0(32),'PGM=',''        cnvrtr may chg PROC= to PGM=
       tblt1f4 b0(32),'PROCname not found'
       skp     man20                   repeat loop til EOF
 #

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

 # EOF - write out table to a file for viewing & printing
 eof   tbpt1s1 filo1,'summary table of PROCs NOT FOUND'
       cls     all
       msgv1   'vi $filo1      <-- to view report of PROCs not found'
       msgv1   'uvlp12 $filo1  <-- to print report of PROCs not found'
       eoj

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

3G2. conversion support - uvcopy jobs

Creating Test files using uvcopy

'uvcopy' makes it easy to create test data files when you do not yet have the actual data files available. You cannot use the 'vi' editor to create mainframe type test files for COBOL & SORT, because these files usually have no LineFeeds, are usually fixed length record size,& may have packed decimal fields.

The example below shows how I created the input file to test the 'SUM' feature illustrated in a SORT example (see page MVSJCL.htm#27J1). That example was included to prove that the JCL converter & uvsort could correctly process 56 SUM fields.

uvcopy job - gen56pk

 # gen56pk - uvcopy Parameter File from UVSI stored in: /home/uvadm/pf/IBM/
 # gen56pk - uvcopy job to generate test data file
 #         - to test a SORT (converted to uvsort) with 56 'sum' fields
 #         - create input text file & run this job as follows:
 #
 # 1. vi tmp/test56pk.txt     - use vi to create input to this gen56pk job
 #
 # 2. uvcopy pf/gen56pk,fili1=tmp/test56pk.txt,filo1=tmp/test56pk.dat
 #    ===============================================================
 #
 fili1=?input,rcs=80,typ=LST    # input text file (actual rcs determined by LF)
 filo1=?tmp/output,rcs=346,typ=RSF  # output Fixed length no linefeeds
 @run
        opn    all
 #
 # begin loop to get/process/output records until EOF
 man20  get    fili1,a0           get next record into area 'a'
        skp>   eof
        mvc    b0(8),a0           move inrec (8 byte key) to outrec area 'b'
        mvnx56 b8(6p),1           init 56 packed fields to x'000000001C'
        addx56 b14(6p),b8(6p)     add overlap (creates 2 in 2nd, 3 in 3rd, etc)
        clr    b344(2),' '        clear extra 2 bytes to spaces
        put    filo1,b0           write output
        skp    man20
 #
 # EOF - close files & end job
 eof    cls    all
        eoj

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

Part_4 Converting 'YOUR' MVS JCL to Perl scripts


4A1. Directory Design for Your Conversion, Testing,& Production
- Libraries (JCL,COBOL,Copybooks) & Data file subdirs
4A6. - Programmer & Operator login profiles
- RUNLIBS & RUNDATA point to libs & data for testing or production

4B1. Overview of Converting & Customizing for your particular JCLs

4C1. Preparation for conversion & testing of JCLs & programs.
- Setup dedicated logins to run production systems
- Activate Console Logging for production logins
4C2.  Transfer/FTP Your JCL,PROCs,COBOL,etc from mainframe to unix/linux
4C3.  Converting & Compiling Your COBOL programs
- Transfer & Convert your DATA

4D1. Standardizing filenames & extensions for COBOL programs, copybooks,& JCL
- resolve duplicate filenames when extensions standardized

4E1. Operating Instructions to Convert Your JCLs to scripts (vs demo JCL)
4E2.  Expand PROCs & SLIs in all JCL
- Create/modify the Data control file (filenames extracted from all JCL)
4E4.  Coding Alternate topnodes/subdirs
4E5.  extract data file characteristics from mainframe LISTCAT report
4E6.  Appending LISTCAT info (file type,keys,recsize) onto JCL data-file-names
4E7.  Convert ALL JCLS in directory
- using Data Control file to assign desired alternate topnode/subdirs
4E8.  Replace Control-M %%symbols to test on unix/linux w/o control-M
4E9.  Create script to make subdirs for topnodes used in JCL datafilenames

4F1. Improving JCL conversion by Modifying the Control file (ctl/jclperlop61)
- might change REPTBL2 to modify High Level Qualifiers in filenames

4G1. Verifying Re-conversions via 'alldiff' script
- runs the unix 'diff' utility on all scripts in the old & new subdirs

4H1. Recommendations for Testing & Possible Re-Conversion
- Executing, Testing,& Debugging Your JCL/scripts

4I1. Testing & Debugging Aids (review of earlier presentation in Part_2)
- be sure to see COBOL animation on page CNVaids.htm#2E1.

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

Part4 Converting 'YOUR' MVS JCL (vs test/demos) - Contents Continued


4J1. Change Management - using the 'alldiff' script to determine changes
made on the mainframe during the test/debug period.

4K0. Before going live - checklist
- add date/time stamps on jobtmp & sysout subdirs.

4L1. scripts to reconvert JCL - 1 at a time or All in directory
- jcl2perl61 & jcl2perl6A
4L2.  scripts to reconvert COBOL - 1 at a time or All in directory
- cnvMF51c & cnvMF51Ac for copybooks, cnvMF51 & cnvMF51A for programs
Note
  • Before proceeding with your own conversions (vs test/demos in Part_1)
  • you must study part 1 of ADMjobs.htm, especially pages '1D1'- '1D6'.
  • setup 'appsadm' & copy profiles from uvadm/env to appsadm/env
  • modify profiles as documented & as appropriate for your site

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

4A1. File System Design for YOUR Conversion, Testing,& Productio n

File System Design for YOUR Testing,& Production

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           <-- $RUNLIBS
 :    :----cbls
 :    :----jcls
 :    :-----etc-
 :    :----testdata     <-- $RUNDATA
 :    :    :----ar
 :    :    :----gl
 :    :    :----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/testlibs       <-- testlibs/testdata for programmers

export RUNDATA=/p1/testdata

 export RUNLIBS=/p2/prodlibs       <-- prodlibs/proddata for operators

export RUNDATA=/p2/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

4A2. Directory Design for YOUR Conversion, Testing,& Production

File System Design Overview

 /root
 /...              <-- unix/linux O/S directories
 /...
 /home             <-- home directories
 :----user1
 :----user2
 :----etc---
 :
 /p1               <-- /p1 file system mount point
 :----testlibs       - test-libraries & test-data
 :----testdata
 /p2               <-- /p2 file system mount point
 :----prodlibs       - production-libraries & production-data
 :----proddata
 /p3               <-- /p3 file system mount point
 :----backup         - backup & restore directories
 :----restore
 /p4               <-- /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,& proddatta.

  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 that discuss provisions for multiple companies &/or multiple separate applications.

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

4A3. Directory Design for YOUR Conversion, Testing,& Production

Libraries for Your Conversion & Testing

 /p1/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          - cnvMF4 converts mainframe COBOL to Micro Focus COBOL
 :-----cbls          - copy here (standard source library) before compiling
 :-----cblst         - cobol source listings from compiles
 :-----cblx          - compiled COBOL programs (.int's)
 :-----parm0         - control cards & includes from mainframe
 :-----parms         - control cards after cleanup
 :-MF--cpy0          - for COBOL copybooks
 :-----cpy1          - cleaned up, cols 1-6 & 73-80 cleared, etc
 :-----cpy2          - cnvMF4 converts mainframe COBOL to Micro Focus COBOL
 :-----cpys          - copy here (standard copybook library)
 :-UV--ctl           - conversion control files (jclperlop61, datafiles41)
 :-----errs          - JCL converter writes ERROR reports here
 :-----ftp           - subdir for FTP transfers
 :-MF--jcl0          - your JCLs transferred from mainframe
 :-----jcl1          - intermediate conversion 73-80 cleared
 :-----jcl2          - PROCs expanded from procs
 :-----jcl3          - JCLs converted to Perl scripts
 :-----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         - your PROCs transferred from mainframe
 :-----procs         - will be merged with jcl1, output to jcl2
 :-----perlm         - Perl Modules (UVjobs61.pm, UVexport61.pm)
 :-----perls         - Perl Scripts (very few, most scripts are ksh)
 :-----rpts          - for optional statistics reports
 :-----sf            - for misc scripts you may wish to write
 :-UV--sfun          - Korn shell functions (jobset61,stepctl51,etc)
 :-----tmp           - tmp subdir used by various conversions
 :-----xref          - cross-references (see Part_9)

DATA Directories for Your Testing

 /p1/testdata
 :-----ap          <-- directories created for topnodes of filenames
 :-----ar
 :-----gl
 :-----jobctl      <-- standard directories shared by all applications
 :-----joblog
 :-----jobtmp
 :-----rpts
 :-----sysout
 :-----tmp
 :-----wrk

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

4A4. Directory Design for YOUR Conversion, Testing,& Production

Libraries for Your Production

 /p2/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 Perl scripts
 :-----jcls          - copy here manually 1 by 1 during test/debug
 :-----perlm         - Perl Modules (UVjobs61.pm, UVexport61.pm)
 :-----perls         - Perl Scripts (very few, most scripts are ksh)
 :-----pf            - uvcopy jobs to replace utilities (easytrieve,etc)
 :-----sf            - for misc scripts you may wish to write
 :-----sfun          - Korn shell functions (jobset61,stepctl51,etc)
 :-----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 Perl scripts).

DATA Directories for Your Production

 /p2/proddata
 :-----ap          <-- directories created for topnodes of filenames
 :-----ar
 :-----gl
 :-----py
 :-----jobctl      <-- standard directories shared by all applications
 :-----joblog
 :-----jobtmp
 :-----rpts
 :-----sysout
 :-----tmp
 :-----wrk

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

4A5. Directory Design for YOUR Conversion, Testing,& Production

Backup/Restore Directories

 /p3                    <-- /p3 file system mount point
 :----backup              - backup directories (on-disc)
 :    :----proddataBN1  <-- proddata Backup Before Night batch
 :    :    :----ap
 :    :    :------etc
 :    :    :----wrk
 :----:----proddataBN2  <-- proddata Backup After Night batch
 :    :    :----ap
 :    :    :------etc
 :    :    :----wrk
 :----:----proddataBM   <-- proddata Backup at Month end
 :    :    :----ap
 :    :    :------etc
 :    :    :----wrk
 :    :
 :----:----prodlibsBN   <-- prodlibs Backup as of last night
 :    :    :----cbls
 :    :    :------etc
 :    :    :----jcls
 :----:----prodlibsBNY  <-- prodlibs Backup as of 2 nights ago
 :    :    :----cbls
 :    :    :------etc
 :    :    :----jcls
 :----:----prodlibsBM   <-- prodlibs Backup as of last Month end
 :    :    :----cbls
 :    :    :------etc
 :    :    :----jcls
 :    :
 :----restore           <-- restore directories (from tape)
 :    :----????????       - use as required

Data Conversion Directories

 /p4
 :----cnvdata
 :    :-----d1ebc         <-- EBCDIC files from mainframe (FTP binary)
 :    :
 :    :-----d2asc         <-- ASCII files converted from EBCDIC
 :    :                     - same format as on mainframe
 :    :
 :    :-----d4pipe        <-- converted to ASCII all text pipe delimited
 :    :                     - packed/binary fields unpacked & edited with
 :    :                     - separate signs & decimal points to load RDBMSs

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

4A6. Directory Design for YOUR Conversion, Testing,& Production

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               <-- /p1 file system mount point
 :----testlibs       - test-libraries & test-data
 :----testdata
 /p2               <-- /p2 file system mount point
 :----prodlibs       - production-libraries & production-data
 :----proddata
 /p3               <-- /p3 file system mount point
 :----backup         - backup & restore directories
 :----restore
 /p4               <-- /p4 file system mount point
 :----cnvdata        - data conversion directories

RUNLIBS/RUNDATA = testlibs/testdata OR prodlibs/proddata

'common_defines' ('ADMjobs.doc#1C3') defines TEST/PROD LIBS/DATA as follows:

export TESTLIBS=/p1/testlibs export TESTDATA=/p1/testdata export PRODLIBS=/p2/prodlibs export PRODDATA=/p2/proddata

'stub_profile's ('ADMjobs.doc#1C1') define RUNLIBS/RUNDATA as follows: (depending on whether user is a programmer or an operator)

     export RUNLIBS=$TESTLIBS      <-- common_profile for programmers
     export RUNDATA=$TESTDATA
     export RUNLIBS=$PRODLIBS       <-- common_profile for operators
     export RUNDATA=$PRODDATA

aliases for quick changes

The profiles also define several aliases that make it easy for programmers & operators to get to various frequently used directories. 'cdl' & 'cdd' are especially convenient.

 alias cdl='cd $RUNLIBS'    <-- /p1/testlibs(prgmrs) or /p2/prodlibs(oprtrs)
 alias cdd='cd $RUNDATA'    <-- /p1/testdata(prgmrs) or /p2/proddata(oprtrs)
 alias cdb='cd $BACKUP'     <-- /p3/backup
 alias cdr='cd $RESTORE'    <-- /p3/restore
 alias cdc='cd $CNVDATA'    <-- /p4/cnvdata

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

4B1. Converting YOUR JCL to Unix/Linux Perl scripts

Overview of Converting & Fine Tuning for your JCL


4C1.A - Setup Directories for Your Libraries (JCL,PROCs,COBOL,etc) & Data files.

4C1.B - Modify profiles to provide access to the Vancouver Utilities
- for conversion & testing of JCLs & programs.

4C1.C - Setup login user accounts to run testing & production systems

4C1.D - Activate Console Logging for production logins

4C2.E - Transfer Your JCL,PROCs,COBOL,etc from mainframe to unix/linux

4C3.F - Converting & Compiling Your COBOL programs

4C3.G - Transfer & Convert your DATA

4D1.H - Standardizing filenames for JCL, COBOL programs,& copybooks

4E1.I - Cleanup mainframe JCLs & PROCs

4E2.J - expand PROCs in all JCL

4E2.K - Creating the JCL Data control file (extracted from all JCL)

4E3.L - Modifying the Data control file (topnodes, GDG generations, etc)

4E4.M - Creating top-node (subdir) replacement table (if desired)

4E5.N - Create Data Conversion Control File from LISTCAT

4E6.O - Append LISTCAT file characteristics onto JCL Data control file

4E7.P - Convert ALL JCLS in directory

4E7.Q - Check the conversion Error file (tmp/jclperl61.err)

4E8.R - Replace Control-M %%symbols via search/replace table to allow testing

4F1.S - Improving Your JCL Conversion

4F2.T - Modifying High Level Qualifiers (subdirs in converted scripts)

4G1.U - Verifying Re-conversions using the 'alldiff' script

4H1.V - Recommendations for Testing & Possible Re-Conversion

4I1.W - Testing & Debugging Aids (review of earlier presenetation in Part_2)
- be sure to see COBOL animation on page CNVaids.htm#2E1.

4J1.X - Change Management, using 'alldiff' to determine changes on mainframe

4K1.Y - Checklist before 'going live'

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

4C1. Converting YOUR JCL to Unix/Linux Perl scripts

These Operating Instructions are for converting 'Your JCL' versus the supplied test/demo JCLs that were converted earlier beginning on page '1Q1'.

Preparation Required for Your Conversion, Testing,& Production

A. Setup Directories for Your Libraries (JCL,PROCs,COBOL,etc) & Data files. Please see the recommended Directory Design beginning on page '4A3'.

B. Modify the profiles of your programmers to provide access to the Vancouver Utilities & allow conversion & testing of JCLs & programs.

Setup logins to run test &/or production systems

These setups are best documented at ADMjobs.htm#1D1 thru page 1D7.

The most important thing is the definition of RUNLIBS & RUNDATA in the stub profiles to point to TESTLIBS/TESTDATA or PRODLIBS/PRODDATA depending on programmers or operators.

For your testing & production RUNLIBS & RUNDATA should be in a separate file system (not in /home/mvstest as per the demos).

Page '4A1' & '4A2' suggest a file design using mount points (p1,p2,p3,p4). If you have only 1 major application, you could use the directories shown on pages '4A3' & '4A4'.

If you have multiple applications, you could add another level between p1/p2 & testlibs/testdata or after testlibs/testdata. See Part_5 for some alternative designs.

Activate Console Logging

Console Logging is essential for production & recommended for testing. See Console logging Activation instructions beginning on page '1U1'. Activation requires setting up subdirs matching the logins within $LOGDIR (recommended as /home/appsadm/log1,log2,log3). Then uncomment the last few lines of the supplied profile. See the profile listed at ADMjobs.htm#1C2 & note the critical line near the end:


 # exec script $LOGDIR/log1/$LOGNAME/$(date +%y%m%d:%H%M%S)
 ==========================================================

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

4C2. Converting YOUR JCL to Perl scripts

E. Transfer Your JCL,PROCs,COBOL,etc from mainframe to unix/linux

I assume you will have FTP connections from the mainframe to unix/linux, but if not UV Software can provide uvcopy jobs to extract your JCLs,PROCs,etc from magnetic tape. Please see page '4A3' 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'. For your convenience, page '4A3' is repeated here.

 /p1/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 MicroFocus COBOL
 :    :-----cbl3          - sysin1 converts instream ACCEPTs to READs from a file
 :    :-----cbl4          - sysout1 converts DISPLAY on SYSOUT to WRITE to a file
 :    :-----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
 :    :-----cpys          - copy here (standard copybook library)
 :    :-UV--ctl           - conversion control files (jclperlop61, datafiles51)
 :    :-----errs          - JCL converter writes ERROR reports here
 :    :-MF--jcl0          - your JCLs transferred from mainframe
 :    :-----jcl1          - intermediate conversion 73-80 cleared
 :    :-----jcl2          - PROCs expanded from procs
 :    :-----jcl3          - JCLs converted to Perl scripts
 :    :-----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         - your PROCs transferred from mainframe
 :    :-----procs         - will be merged with jcl1, output to jcl2
 :    :-UV--perlm         - Perl Modules (UVjobs61.pm, UVexport61.pm)
 :    :-----perls         - Perl Scripts (very few, most scripts are ksh)
 :    :-----rpts          - for optional statistics reports
 :    :-----sf            - for misc scripts you may wish to write
 :    :-UV--sfun          - Korn shell functions (jobset61,stepctl51,etc)
 :    :-----tmp           - tmp subdir used by various conversions
 :    :-----xref          - cross-references (see Part_9)

'MF' marks subdirs transferred from your mainframe for conversion 'UV' marks control files & functions supplied by UV Software '--' marks subdirs used for conversions, but initially empty

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

4C3. Converting YOUR JCL to Perl scripts

F. Converting & Compiling Your COBOL programs

Converting & Compiling your COBOL programs is fully documented in MVSCOBOL.htm. It was also briefly documented on page '1R1', since it was required before we could execute the test/demo JCLs supplied by UV Software.

We remind you about the COBOL conversion here (before the JCL conversion), so that after your JCL conversion, you can proceed directly to JCL testing.

G. Transfer & Convert your DATA

Transferring & Converting your DATA files is fully documented in Part 4 of MVSDATA.htm#Part_4. We remind you about the DATA conversion here (before the JCL conversion), so that after your JCL conversion, you can proceed directly to JCL testing.

You will need to setup data directories to receive your mainframe data files & convert from EBCDIC to ASCII, while preserving packed & binary fields. Part 4 of MVSDATA.doc illustrates these procedures which are automatically generated from the COBOL copybooks.

I can not know what names you might wish to assign to your data directories, but here is an example based on the data files required for the 'ordr320d' sample JCL which will be illustrated after completing the JCL conversion operating instructions.

 /p4/cnvdata/
 :-----:d1ebc               <-- EBCDIC data from mainframe
 :     :----data files
 :-----:d2asc               <-- data converted to ASCII
 :     :----data files          - copy to /p1/testdata/...
 /p1/testdata                <-- data converted to ASCII
 :     :-----apay             - subdirectoried by High Level Qualifier
 :     :-----arcv
 :     :-----ordr
 :     :-----jobtmp
 :     :-----sysout
 :     :-----tmp
 :     :-----wrk

Data conversion is a major project documented in MVSDATA.htm. Also see COBOL conversion documented in MVSCOBOL.htm.

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

4D1. Converting YOUR JCL (vs test/demos)

H. Standardizing Filenames

For COBOL programs & copybooks, please see VSECOBOL.htm#6D1 thru page 6D6. Here in VSEJCL.doc, we will present the Operating Instructions only for JCL.

Standardizing JCL

These Op. Instrns. will copy JCL from 'jc0' to 'jcl0' while standardizing filenames to all UPPER case with no extensions. Note that we will later standardize all converted filenames to lower case (IE - UPPER case signifies mainframe versions, lower case signifies converted to unix/linux versions).


 #1. renameU jc0    <-- ensure mainframe JCL filenames UPPER case
     ===========

 #2. cp jc0/* jcl0  <-- copy JCL from jc0 (unzip lib)
     =============      to jcl0 (where standard conversions begin)
     - in this case, we could have transferred/unzipped in jcl0 (vs jc0)
       (since we did not have to shift JCL columns as we did for COBOL)
     - But it is better to provide for sites that might need to shift, etc

 #3.  rename-XX jcl0     <-- remove all extensions
      ==============
               - will prompt for overwrite if removing extension causes duplicate
      --> n  <-- reply 'n' to avoid overwriting 1st program of duplicate pair

 #4a. ls -l jcl0                 <-- investigate to see duplicate filenames
      ==========

 #4b. vi jcl0/XXX                  - might use vi to check contents
      ===========

 #4c. diff jcl0/XXX jcl0/XXX.XXX <-- might use diff to see if same & drop 1
      ==========================

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

4E1. Converting YOUR JCL to Perl scripts

Convert Your JCL, PROCs,& Control Cards to Perl scripts


 #1a. login: yourid --> your home dir

 #1b. cdl --> /p1/testlibs   <-- alias cdl='cd $RUNLIBS'
      ===

I. Cleanup mainframe JCL,PROCs,& Control Cards

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


 #2a. 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'

 #2b. uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.proc  <-- 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 '.proc'

 #2c. 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
      Sep2006 - includes combined with parms (include0/include1 dropped)
Note
  • the 'cleanup' job has many more options than used here (uop=qoi7g8n1)
  • 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.

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

4E2. Converting YOUR JCL (vs test/demos)

J. expand PROCs & include INCLUDEs in ALL JCL


 #2.  jclpx51 jcl1 jcl2 procs parms
      =============================
      - copy all jcl from jcl1 to jcl2,
      - expanding PROCs from arg3 subdir
      - including any INCLUDE files from arg4 subdir
      Sep2006 - INCLUDES now in parms subdir (no separate include0/1 subdir)

K. Creating JCL Data control file


 #4.  uvcopy jcldata51,fild1=jcl2,filo2=ctl/datafiles51
      =================================================
      - generate JCL Data control file to provide file characteristics
      - when file type, record size, keys,& GDG are not explicit in JCL

 #4a. uvcopy jcldata51   <-- easier alternative (files default as shown above)
      ================

 #4b. vi ctl/datafiles51   <-- modify no of generations for various files
      ==================     - see sample control file on page '3E3'

sample Data Control File

 &&TEMPGLT                               cnt=0002 rfm=FB_ rcs=00080
 &&TEMPSLS                               cnt=0002 rfm=FB_ rcs=00064
 AR.CUSTOMER.MASTER                      cnt=0006 rfm=___ rcs=_____
 AR.CUSTOMER.MASTER.INDEXED              cnt=0001 rfm=___ rcs=_____
 AR.CUSTOMER.NAMEADRS.LIST100            cnt=0001 rfm=FBA rcs=00133
 AR.SALES.ITEMS                          cnt=0002 rfm=___ rcs=_____
 AR.SALES.LIST                           cnt=0001 rfm=FBA rcs=00133
 FTP.CUSTOMER.MASTER                     cnt=0001 rfm=___ rcs=_____
 GL.ACCOUNT.ACNTLIST                     cnt=0001 rfm=___ rcs=_____
 GL.ACCOUNT.ACNTLIST(+1)                 cnt=0001 rfm=FBA rcs=00133 gdg=15
 GL.ACCOUNT.EXPORT                       cnt=0001 rfm=___ rcs=_____
 GL.ACCOUNT.MASTER(+1)                   cnt=0009 rfm=FBA rcs=00080 gdg=15
 GL.ACCOUNT.MASTER(0)                    cnt=0014 rfm=___ rcs=_____ gdg=15
 GL.ACCOUNT.MASTER2                      cnt=0002 rfm=FIS rcs=00080 keys=(0,6)
 GL.ACCOUNT.TRANS                        cnt=0001 rfm=___ rcs=_____
 GL.CTLCDLIB(PGL200S1)                   cnt=0001 rfm=___ rcs=_____
 MXPLIB(IKJDEMO1)                        cnt=0001 rfm=___ rcs=_____
 ORDR.ORDR400F.B18416.WEEKLY(+1)         cnt=0001 rfm=FBA rcs=00133 gdg=15
 ORDR.ORDR400F.B18416.WEEKLY(0)          cnt=0001 rfm=___ rcs=_____ gdg=15
 ORDR.ORDR400F.FTP.WEEKLY                cnt=0002 rfm=FBA rcs=00133
 PYTEST.CTLCDLIB(PPY200S1)               cnt=0001 rfm=___ rcs=_____
 PYTEST.PAYROLL.MASTER(0)                cnt=0002 rfm=___ rcs=_____ gdg=15
 PYTEST.PAYROLL.REGISTER(+1)             cnt=0001 rfm=FBA rcs=00120 gdg=15
 PYTEST.TIME.CARDS                       cnt=0001 rfm=___ rcs=_____
 PYTEST.TIMECARD.EDIT(+1)                cnt=0001 rfm=FBA rcs=00120 gdg=15
 WORK.SALES.GROUP1                       cnt=0001 rfm=FB_ rcs=00064
 WORK.SALES.GROUP2                       cnt=0001 rfm=FB_ rcs=00064

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

4E3. Converting YOUR JCL (vs test/demos)

load Indexed data control file


 #4c. uvcopy loaddf51,fili1=ctl/datafiles51,filo1=ctl/datafiles51
      ===========================================================
      - load datafiles51 into an Indexed file for lookup by JCL converter
      - to get data file attributes (recsize, indexed keys, gdgs, file type)

      uvcopy loaddf51   <-- same as above, but easier (files default as above)
      ===============

From above it appears as if the input & output files are the same, BUT loading an indexed file creates 2 partitions with different suffixes as follows:

ctl/datafiles51
  • input text file
ctl/datafiles51.dat
  • output Indexed file (data partition)
ctl/datafiles51.idx
  • output Indexed file (index partition)

early conversion of JCLs to scripts

If you are anxious to get the JCLs converted & see what your scripts look like, You could run the JCL converter now to convert all JCLs to scripts as follows:

      =================
 #11. jclxx61 jcl2 jcl3   <-- convert all JCL in jcl2 to scripts in jcl3
      =================

Note that there are several more steps (before we get to #11), that may be used to improve the JCL conversions for your site.

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

4E4. Converting YOUR JCL (vs test/demos)

L. Modifying the Data Control file

The data control file (ctl/datafiles51) is vital to the following conversions of JCL & DATA. The idea here is to modify the control file to cause automatic reassignment of the topnodes of filenames to desired subdirectories. Optional, Not Required if you are happy with the existing top-nodes.

We will illustrate the following jobs & modifications using a few lines (as shown above) from the control file created from the test/demo JCLs shown in Part_1.

create topnodes table summary report


 #5a. uvcopy topnode51,fili1=ctl/datafiles51,filo2=ctl/topnodes1
      ==========================================================
      - create topnodes table summary report (1 line for each topnode)
 topnode51  2006/03/12_08:08:32  table summary of topnodes & counts
 tbl#001 pg#001     -argument-
 line#  count    %  topnode
     1       2  10  &&
     2       5  25  AR
     3       1   5  FTP
     4       6  30  GL
     5       4  20  PY
     6       2  10  WORK
            20*100   *TOTAL*

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

4E4. Converting Test/Demo JCL to Unix/Linux scripts

Coding Alternate 'topnodes'


 #5b. uvcopy topnode53,fili1=ctl/topnodes1,filo2=ctl/topnodes2
      ========================================================
      - copy topnodes report inserting 'topr=...' on right side
      - dumplicating topnode so you can make replacements where desired

 #5c. vi ctl/topnodes2  <-- make desired replacements on the right side
      ================
 topnode52  2006/03/12_08:08:32  table summary of topnodes & counts
 tbl#001 pg#001     -argument-
 line#  count    %  topnode
     1       2  10  &&                   topr=&&
     2       5  25  AR                   topr=AR
     3       1   5  FTP                  topr=FTP
     4       6  30  GL                   topr=GL
     5       4  20  PY                   topr=PY
     6       2  10  WORK                 topr=WORK
            20*100   *TOTAL*

For illustration we coded arbitrary alternates on the last 2 table items. Note how these cause alternate subdirs to be assigned to any files whose original topnode was 'gl' or 'work'.

Creating topnode replacement table


 #6. uvcopy topnode53,fili1=ctl/topnodes2,filo2=ctl/topnodes3
     ========================================================
     - create a 2 column table of topnodes & replacements
       (to be used as a lookup table in the next job)
 &&                  topr=&&
 AR                  topr=AR
 FTP                 topr=FTP
 GL                  topr=GL
 PY                  topr=PY
 WORK                topr=WORK

Note that the orignal topnodes are in columns 1-20 & the replacements are in columns 21-40. It did not matter which column you coded the replacements on the original summary report, but if you further modify the replacement table you must maintain these columns.

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

4E5. Converting Test/Demo JCL to Unix/Linux scripts

N. Create data conversion control file from LISTCAT

Part 4 of MVSDATA.doc documents the procedure to extract data file information from the mainframe LISTCAT report into a format that we can use to improve JCL conversion.

Here in MvsJclPerl.doc, we will list the operating instructions without illustrations, but please see MVSDATA.htm#4C4 to better understand the procedures.


 #7a.  FTP mainframe LISTCAT report to unix/linux & store as ctl/listcat0
       ==================================================================

 #7b.  uvcopy catgut51,fili1=ctl/listcat0,filo2=ctl/ctlfile1
       =====================================================
       - extract desired info from LISTCAT report to guide data file conversions

       uvcopy catgut51        <-- easier (I/O files default as above)
       ===============

 #7c.  uvsort "fili1=ctl/ctlfile1,rcs=200,typ=LSTt,filo1=ctl/ctlfile2\
       ===============================================================
               ,key1u2=0(44),key2=44(80),del1=0(1):#"
               ======================================
       - sort control file, dropping any duplicate filenames (1st 44)
       - the 'u2' option on 'key1u2=0(44) drops duplicate filenames

 #7d.  uvcopy catgut52,fili1=ctl/ctlfile2,fili2=ctl/topnodes3,filo3=ctl/ctlfile3
       =========================================================================
       - copy data conversion control file from ctl/ctlfile2 to ctl/ctlfile3
       - appending topnode replacements from lookup table
       - see illustrations on the previous page
 AR.CUSTOMER.MASTER            cpy=custmas.cpy  rcs=00256 topr=AR
 AR.CUSTOMER.MASTER.INDEXED    cpy=custmas.cpy  rcs=00256 keys=(000,006) topr=AR
 AR.CUSTOMER.MASTER.UPDATES    cpy=_______      rcs=00120 topr=AR
 AR.SALES.ITEMS                cpy=saledtl.cpy  rcs=00080 topr=AR
 GL.ACCOUNT.MASTER             cpy=acntmas.cpy  rcs=00080 keys=(0,8) topr=GL
 GL.ACCOUNT.TRANS              cpy=_______      rcs=00080 topr=GL

 #7e.  vi ctl/ctlfile3       <-- edit data conversion control file
       ===============         - drop unwanted filenames
                               - drop any rcs=00000 uninitialized LISTCAT recs
                               - add copybook names where required

 #7f.  uvlp12L ctl/ctlfile3  <-- list output file Landscape (optional)
       ====================    - 12 cpi Landscape fits 132 cols on 11" wide

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

4E6. Converting Test/Demo JCL to Unix/Linux scripts

O. create Index file to encode recsize & keys

We will now load the control file extracted from the mainframe LISTCAT report into an indexed file so the following job 'jcldata54' can retrieve the record size & keys for matching datafiles.


 #8.  uvcopy loadctlI,fili1=ctl/ctlfile3,filo1=ctl/ctlfile3I
      ======================================================
      - load LISTCAT info to indexed file to get recsize & keys into datafiles51

 #8a. uvcopy loadctlI   <-- same but easier (I/O files default as above)
      ===============

encoding Data Control file with Alternate topnodes


 #9.  cp ctl/datafiles51 ctl/datafiles51a
      ===================================
      - save data control file so we can process back to original name

 #10.  uvcopy jcldata54,fili1=ctl/datafiles51a,fili2=ctl/topnodes3\
       ============================================================
                     ,filr3=ctl/ctlfile3I,filo4=ctl/datafiles51
                     ==========================================

 #10a. uvcopy jcldata54  <-- same, but easier (I/O files default as above)
       ================
 &&TEMPGLM                             cnt=0012
 &&TEMPSLS                             cnt=0002
 AR.CUSTOMER.MASTER                    cnt=0006 rcs=00256 topr=AR1
 AR.CUSTOMER.MASTER.INDEXED            cnt=0001 rcs=00256 keys=(000,006) topr=AR2
 AR.CUSTOMER.NAMEADRS.LIST100          cnt=0001 topr=AR3
 AR.SALES.ITEMS                        cnt=0002 rcs=00080 topr=AR4
 AR.SALES.LIST                         cnt=0001 topr=AR5
 GL.ACCOUNT.ACNTLIST                   cnt=0001 topr=GL
 GL.ACCOUNT.ACNTLIST(+1) gdg=15        cnt=0001 topr=GL
 GL.ACCOUNT.MASTER(+1) gdg=15          cnt=0007 topr=GL
 GL.ACCOUNT.MASTER(0) gdg=15           cnt=0010 topr=GL
 GL.ACCOUNT.TRANS                      cnt=0001 rcs=00080 topr=GL
 GL.CTLCDLIB(PGL200S1)                 cnt=0001 topr=GL
 WORK.SALES.GROUP1                     cnt=0001 topr=WORK

Note that jcldata54 has appended recsize, keys,& new topnode on the right hand side. The JCL converter will use this to replace the original topnode when assigning a subdirectory to matching datafiles.

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

4E7. Converting YOUR JCL to Perl scripts

P. Convert ALL JCLS in directory

The next step is the actual JCL conversion to unix/linux scripts. This obvious inputs are: JCLs, PROCs, & control card libraries. The conversion also depends on 2 vital control files in subdir ctl See listings of ctl/jclperlop61 beginning on page '3E1'.

You did not have to modify the control files for the demo conversions beginning on page '1Q1', but you will probably need to modify for your own JCL conversions. I recommend you first convert all JCL, inspect some sample outputs, then modify ctl/jclperlop61,& re-convert the JCL.

      =================
 #11. jclxx61 jcl2 jcl3    <-- convert all JCL in jcl2 to scripts in jcl3
      =================

'jclxx61' is a script that executes the 'jclperl61' conversion program for each file found in input subdir & copy results to output subdir. jclxx61 requires control files: ctl/jclperlop61, ctl/datafiles51, parms/...

Q. Check the conversion Error File


 vi tmp/jclperl61.err          <-- inspect JCL conversion Error File
 ===================

Inspect the conversion Error File & make the appropriate corrections. See page '4H1' for the recommended procedures. Briefly as follows:

  1. Never correct scripts in subdir jcl3, but rather in jcls, after you manually copy each script from jcl3 to jcls, immediately before you are ready to test/debug that particular script.

  2. This protects our corrected scripts in jcls from being overwritten if we reconvert all JCL (from jcl2 to jcl3), due to improvements in the conversion tables (based on experience debugging 1st few JCLs).

  3. This gives us a measure our test/debug progress. Just list the directory of jcls to see how many have been tested/debugged vs the total in jcl3.

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

4E8. Converting YOUR JCL to Perl scripts

R. Replace Control-M %%symbols to allow testing

uvcopy jobs 'ctlmjcl51' & 'ctlmjcl52' are provided to allow you to test the converted scripts from JCL containing BMC Control-M scheduler %%coding.

We assume here that you do want to retain the %%coding for later production and that you want to test the converted scripts before you install Control-M on the unix/linux system.

ctlmjcl51
  • extract %%symbols from Control-M JCL (step 1 of 2 steps)
  • writes a search/replace table to be used by following ctlmjcl52
  • created with search & replace patterns the same (original %%symbols)
  • you will edit, changing replacements as required for testing
    (to match datafilenames available for testing)
ctlmjcl52
  • Control-M JCL processor for JCL/scripts converted from JCL
  • copies the converted JCL/script, substituting %% symbols
  • processing %%IF's to include or drop JCL/script lines

Here are the brief operating instructions to replace %%symbols & process %%IFs. Please see pages MVSJCL.htm#28L1 thru 28L5 for detailed explanations & sample outputs.

Operating Instrns - for ALL JCLs in directory


 1. jcl2perl6A all    <-- convert ALL JCL jcl0 -> jcl1 -> jcl2 -> jcl3
    =============

 2. uvcopyx ctlmjcl51 jcl3 ctlm uop=q0i7j2
    ======================================
    - ctlmjcl51 creates %%symbol search/replace tables for all in subdir jcl3

 3. vi ctlm/*            <-- edit symbol/value search/replace tables
    =========              - replace right hand values as desired

 4. uvcopyx ctlmjcl52 jcl3 jcls uop=q0i7 <-- process %%SYMBOLS & %%IFs
    ===================================    - converting all jcl3 to jcls

ctlm/hphrecon3.cm sample search/replace table

    %%$CENTURY~~~~~~~~~~~~~~~001~~%%$CENTURY~~~~~~~~~~~~~~~~~~~~
    %%FFILE~~~~~~~~~~~~~~~~~~006~~WINP~~~~~~~~~~~~~~~~~~~~~~~~~~
    %%LVL~~~~~~~~~~~~~~~~~~~~030~~P~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    %.ON~~~~~~~~~~~~~~~~~~~~~027~~2937~~~~~~~~~~~~~~~~~~~~~~~~~~
Note
  • see pages MVSJCL.htm#28L1 thru '28L6' for details, but briefly:
  • search/replace table generated by uvcopy 'ctlmjcl51'
  • generated with right side symbols same as left side
  • the 001,003,etc are occurrences, ignored for substitutions
  • manually edited to insert desired values on right side
  • for demo we make %%LVL 'T' for Test (vs 'P' for Production)
  • we set other %%symbols to match the test data files provided

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

4E9. Converting YOUR JCL to Perl scripts

create script to make data subdirs

'jcldata55' will make the topnode directories to hold the datafiles. We would not need to run it until we convert the data files in MVSDATA.htm but we document it here since it is based on the topnodes3 control file that is 1st created above.


 #12. uvcopy jcldata55,fili1=ctl/topnodes3,filo2=sf/mktopdirs      <-- This Job
      =======================================================
     - create script to make the topnode directories
     - sorts & drops duplicates in the topnode replacement table file
 #!/bin/ksh
 # mktopdirs - make directories for topnodes in JCL/scripts
 #           - this script created by jcldata55 on 20050425
 #           - see www.uvsoftware.ca/mvsjclperl.htm
 #
 mkdir $RUNDATA/ar
 mkdir $RUNDATA/ftp
 mkdir $RUNDATA/gl2
 mkdir $RUNDATA/work2

This script does not have to be run until the data files are transferred & converted to ASCII. Please see these procedures in MVSDATA.htm.

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

4F1. Converting YOUR JCL to Perl scripts

S. Improving Your JCL Conversion

You should expect to perform the JCL conversion several times to achieve the best results possible before you begin testing & debugging. After converting all JCL for the first time, you should inspect & test a few jobs to determine what corrections are required & whether the converter could do more conversions automatically to lessen manual corrections.

Significant improvements can be gained by modifying the various search, replace,& drop tables in the control file. See ctl/jclperlop61 listed beginning on page '3E1' & read the #comments before or after :CTLTBL:, :REPTBL1:, :DROPDDN:, :DROPDSN:,& :COMMENTSTEP:.

Most sites will need to modify the filename High Level Qualifiers (HLQs), which become sub-directories in the converted JCL/scripts. You can do this by adding table entries to :REPTBL2: in ctl/jclperlop61 & reconverting.

Please see the example of HLQ modification on the next few pages --->

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

4F2. Converting YOUR JCL to Perl scripts

T. Modifying High Level Qualifier sub-directories

We will illustrate this using the demo JCL 'ordr320d' (see the JCL on page '5M1' & the Perl script on page '5N1'). After the 1st conversion (before any adjustment to :REPTBL2: in ctl/jclperlop61) some sample converted filenames are:

 //DLYTRAN  DD DSN=&NODE..ORDR280F.DLYTRAN(0),DISP=SHR
 //OLDMTD   DD DSN=&NODE..ORDR040I.MTHSUM(0),DISP=SHR
 //NEWMTD   DD DSN=&NODE..ORDR040I.MTHSUM(+1),...

We can't usually analyze the mainframe JCL (sample above), since the HLQ is often a &SYMBOL. But we can analyze the converted jcl/script (sample below), since the converter replaces the &SYMBOLs with the defaults.

exportgen0 DLYTRAN pordr/ordr280f.dlytran_ gdg=10 exportgen0 OLDMTD pordr/ordr040i.mthsum_ gdg=10 exportgen1 NEWMTD pordr/ordr040i.mthsum_ gdg=10

We would like to change HLQ 'pordr' to 'ordr'. The 'p' prefix was used on the mainframe to indicate 'production' files ('t' was used for 'test' files). Our new system does not require different subdirs or filenames, since environmental variable $RUNDATA will define the super-directory above either production or test files.

But how can we determine what HLQ's are currently coded on your filenames so we can prepare the search/replace table entries in ctl/jclperlop61 ? You can use 'uvcopy hlqsum52' to summarize the HLQ's used in all JCL/scripts.


 uvcopy hlqsum52,fild1=jcl3,filo1=xref/jcl3_jcls
 ===============================================

 uvcopy hlqsum52     <-- easier alternative (defaults as shown above)
 ===============

hlqsum52 sample report (using demo JCLs)

 hlqsum52  2004/04/24_15:34:45  HLQ/subdir summary for MVS JCL
 tbl#001 pg#001     -argument-            -acum#1-    %
 line#  count    %  HLQ/subdir               count
     1       7  13  $DP                          7   13
     2      11  21  $DW                         11   21
     3       3   5  ap                           3    5
     4       7  13  ar                           7   13
     5       2   3  gl                           2    3
     6      15  29  pordr                       15   29
     7       4   7  tmp                          4    7
     8       2   3  work                         2    3
            51*100   *TOTAL*                    51 *100

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

4F3. Improving Your JCL Conversion

From the hlqsum52 summary report on the previous page, you can see that there were 15 occurrences of 'pordr' in demo job jcl3/ordr320d.pl. We will now modify REPTBL2 in ctl/jclperlop61 to convert to 'ordr'. Since this demo was limited to just ordr320d, we will allow for HLQ possibilities (to convert 'papay' & 'parcv' to 'apay' & 'arcv').

REPTBL2 original from ctl/jclperlop61

 :REPTBL2:     search/replace table for output Unix/Linux script
 oldHLQ/~~~~~~~~~~~~~~~~~~~~~~~newHLQ/~~~~~~~~~~~~~~~~~~~~~~~
 pact/~~~~~~~~~~~~~~~~~~~~~~~~~act/~~~~~~~~~~~~~~~~~~~~~~~~~~
 tact/~~~~~~~~~~~~~~~~~~~~~~~~~act/~~~~~~~~~~~~~~~~~~~~~~~~~~
 pmfg/~~~~~~~~~~~~~~~~~~~~~~~~~mfg/~~~~~~~~~~~~~~~~~~~~~~~~~~
 tmfg/~~~~~~~~~~~~~~~~~~~~~~~~~mfg/~~~~~~~~~~~~~~~~~~~~~~~~~~
 :ENDTBL2:
 # Use REPTBL2 to modify the HLQ (High Level Qualifier) directory assignments
 # - often used to convert production & test HLQs to 1 common code
 #   (since testing now provided for by $RUNLIBS & $RUNDATA in profiles)
 # Ex - HLQ for accounting might be 'act'
 #    - HLQ for Production accounting might have been 'pact'
 #    - HLQ for Testing accounting might have been 'tact'
 #    - above samples would convert 'pact/' & 'tact/' to 'act/'

REPTBL2 modified to improve conversion

 :REPTBL2:     search/replace table for output Unix/Linux script
 pordr/~~~~~~~~~~~~~~~~~~~~~~~~ordr/~~~~~~~~~~~~~~~~~~~~~~~~~
 tordr/~~~~~~~~~~~~~~~~~~~~~~~~ordr/~~~~~~~~~~~~~~~~~~~~~~~~~
 :ENDTBL2:

The above changes were made for a the demo JCL conversion of 'ordr320d.jcl' which is listed ahead, beginning on page '5M1'. From these examples you can understand how to modify the tables in ctl/jclperlop61 to improve your conversions.

If you have problems that you cannot resolve by modifying ctl/jclperlop61, please discuss with UV Software who are always willing to consider changes to the JCL converter program (jclperl61.c), especially if it will improve the conversion for future customers.

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

4G1. Improving YOUR JCL Conversion

U. Verifying Re-conversion

The previous page gave an example of modifying ctl/jclperlop61 :REPTBL2: to improve the JCL conversion. Whenever you make such changes & before you re-convert, I recommend the following procedure to verify the change results.

Verifying Re-conversions via 'alldiff' script

Here is a very effective method of verifying modifications to ctl/jclperlop61 or src/jclperl61.c. The JCL mass conversion step #10 (from page '4E6') will be repeated here for clarity.


 #5a. \rm -r jcl3.old        - remove any existing jcl3.old
      ===============

 #5b. mv jcl3 jcl3.old       - save (rename) prior conversion results
      ================

 #5c. mkdir jcl3             - re-make output directory for re-conversion
      ==========

 #6.  jclxx61 jcl2 jcl3       - re-convert all JCL (same as prior page)
      =================

 #7.  alldiff jcl3.old jcl3 >tmp/jcl3.dif  - create difference report
      ===================================

 #8.  vi tmp/jcl3.dif        - inspect difference report to determine
      ===============          if changes to jclperlop61 & jclperl61.c
                               have had the desired effects

The heart of this verification procedure is the 'alldiff' script which may be found at /home/uvadm/sf/util/alldiff & is listed at 'scripts1.doc4A1'. As you would expect it is based on the Unix/Linux 'diff' utility (1 of the greatest Unix/Linux utilities).

Please see a sample jcl3.dif report listed on the next page --->

This sample is based on the changes made to :REPTBL2: in ctl/jclperlop61 & illustrated on page '4F3'. We wanted to modify the High Level Qualifier directory assigned by the JCL converter (combining pordr & tordr into ordr). The new lines inserted into :REPTBL2: were as follows:

 pordr/~~~~~~~~~~~~~~~~~~~~~~~~ordr/~~~~~~~~~~~~~~~~~~~~~~~~~
 tordr/~~~~~~~~~~~~~~~~~~~~~~~~ordr/~~~~~~~~~~~~~~~~~~~~~~~~~

Now run the re-conversion procedure documented above, and you should get the result shown on the next page --->

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

4G2. Improving YOUR JCL Conversion

sample jcl3.dif report


 #8.  vi tmp/jcl3.dif        - inspect difference report to determine
      ===============          if changes to jclperlop61 were successful
 68,72c68,72
 < exportgen0 RETURNS01 pordr/ordr010i.returns.rr_
 < exportgen0 RETURNS02 pordr/ordr010i.returns.ue_
 < exportgen0 RETURNS03 pordr/ordr010i.returns.uo_
 < exportgen0 RETURNS04 pordr/ordr010i.returns.ud_
 < exportgen0 RETURNS05 pordr/ordr010i.returns.no_
    ---
 > exportgen0 RETURNS01 ordr/ordr010i.returns.rr_
 > exportgen0 RETURNS02 ordr/ordr010i.returns.ue_
 > exportgen0 RETURNS03 ordr/ordr010i.returns.uo_
 > exportgen0 RETURNS04 ordr/ordr010i.returns.ud_
 > exportgen0 RETURNS05 ordr/ordr010i.returns.no_
 76c76
 < exportgen1 REPTFILE pordr/ordr270f.report_ gdg=5
    ---
 > exportgen1 REPTFILE ordr/ordr270f.report_ gdg=5
 95,97c95,97
 < exportgen0 RETURNS pordr/ordr010i.returns.ud_
 < exportgen1 DLYTRAN pordr/ordr280f.dlytran_ gdg=10
 < exportgen1 REPORT1 pordr/ordr280f.report_ gdg=7
    ---
 > exportgen0 RETURNS ordr/ordr010i.returns.ud_
 > exportgen1 DLYTRAN ordr/ordr280f.dlytran_ gdg=10
 > exportgen1 REPORT1 ordr/ordr280f.report_ gdg=7
 diff file# 96   - jcl3.old/ordr320d.pl

Since 'jcl3.old' is the 1st directory & 'jcl3' is the 2nd directory on the alldiff script, the '<' marks lines in jcl3.old that would have to be changed or deleted to make the same as lines in jcl3 which are marked with the '>' symbol ('<' is old & '>' is new).

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

4H1. Improving YOUR JCL Conversion

V. Recommendations for Testing & Re-Conversion

  1. Modify the converted Perl scripts only in 'jcls' (never in jcl3). You should manually copy each script from jcl3 to jcls, immediately before you are ready to test/debug that particular script.

  2. This protects our corrected scripts in 'jcls' from being overwritten, if we need to reconvert all JCL (from jcl2 to jcl3). Note that you may have invested considerable time & effort in modifying the scripts in 'jcls' during test/debug, and you dont want to lose that effort.

  3. We may need to reconvert due to improvements in the conversion tables (based on experience debugging 1st few JCLs).

  4. We might also be reconverting all JCL because we have added more JCLs from the mainframe. The automatic JCL conversions are very fast & it is better to keep all our JCL together rather than have multiple sets of our conversion subdirs (jcl0,jcl1,jcl2,jcl3,proc0,procs,parm0,parms).

  5. 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.

 :-----parm0              - control cards & includes (SORT FIELDS,etc)
 :-----parms              - control card library after cleanup (73-80 cleared)
 :-----proc0              - PROCs transferred from the mainframe
 :-----procs              - PROCs after cleanup (73-80 lceared)
 :-----jcl0               - JCL transferred from the mainframe
 :-----jcl1               - intermediate conversion 73-80 cleared
 :-----jcl2               - PROCs expanded from procs
 :-----jcl3               - JCLs converted to Perl scripts
 :-----jcls               - copy here manually 1 by 1 during test/debug

 cp jcl3/xxxxxx.pl jcls  - copy 1 job at a time to the LIVE jcls library
 =======================    just before you test/debug each job

Improving the JCL/script Conversion

Before getting too far into testing, you should investigate to see if the conversion process can be improved to minimize any manual modifications required. Most sites have been able to make substantial improvements by fine tuning the conversion control file ctl/jclperlop61. Please see the example given on the previous pages.

You may also find situations in your JCL that could be improved by changes to the JCL converter. UV Software is always willing to consider these, especially if the changes will benefit future conversions.

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

4H2. Testing & Debugging Your JCL

Now you are ready to test & debug your converted JCLs & COBOL programs. The preceding pages have discussed all necessary requirements:

  1. JCL&PROCs have been converted to Perl scripts in /p1/testlibs/jcl3
  2. COBOL programs have been converted to /p1/testlibs/cbls & compiled to cblx.
  3. Data has been converted into subdirs (within superdir /p1/testdata) that match the HLQs (High Level Qualifiers) in the JCL.
 /p1/testlibs           <-- $RUNLIBS for programmers testing JCL/scripts
 :    :-----cbls          - end point for converted COBOL programs
 :    :-----cblx          - compiled COBOL programs (.int's)
 :    :-----parms         - control cards & includes with 73-80 cleared
 :    :-----cpys          - converted, ready for compiles
 :    :-----jcl1          - intermediate conversion 73-80 cleared
 :    :-----jcl2          - PROCs expanded from procs
 :    :-----jcl3          - JCLs converted to Perl scripts
 :    :-----jcls          - copy here manually 1 by 1 during test/debug
 :    :-----maps          - 'cobmaps' record layouts generated from copybooks
 :    :-----procs         - will be merged with jcl1, output to jcl2
 :    :-----perlm         - Perl Modules (UVjobs61.pm, UVexport61.pm)
 :    :-----perls         - Perl Scripts (very few, most scripts are ksh)
 :    :-----sf            - for misc scripts you may wish to write
 :    :-----sfun          - Korn shell functions (jobset61,stepctl51,etc)
 :    :-----xref          - cross-references (see Part_9)
 /p1/testdata           <-- $RUNDATA for programmers testing
 :     :-----ordr         - subdir for data files with HLQ 'ordr'
 :     :-----apay         - etc
 :     :-----arcv         - etc
 :     :-----jobtmp       - temp files for SYSIN instream data
 :     :-----sysout       - SYSOUT reports in subdirs by yymmdd
 :     :-----tmp          - for uvsort
 :     :-----wrk          - temporary interstep files

Recommendations for Testing & Debugging

  1. When ready to test/debug any given JCL/script, you will 1st copy from subdir 'jcl3' (all auto converted JCLs) to 'jcls' where we may modify. Modify the converted Perl scripts only in 'jcls' (never in jcl3)

  2. If we need to reconvert (after improving converter or tables of drops in jclperlop61), we will always reconvert jcl2 -> jcl3 (never to jcls). Then we will manually copy desired jobs from 'jcl3' to 'jcls'. This protects us 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.


 cp jcl3/xxxxxx.pl jcls  - copy 1 job at a time to the LIVE jcls library
 =======================    just before you test/debug each job

 xxxxxx.pl               - execute the JCL/script to be debugged
 ==========                 $RUNLIBS/jcls is in the PATH for programmers

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

4I1. MVS JCL Conversion - Testing & Debugging Aids

The following test/debug aids were 1st presented in 'Part_2', where they were illustrated with the supplied test files (JCL, COBOL,& DATA).

A few of the most useful aids are repeated here as a reminder to try them with your own files. But please review all aids in 'Part_2' to decide for yourself.

W. Testing & Debugging Aids - CONTENTS

cobmap1
  • create record layouts from COBOL copybooks
  • another of the favorite tools in Vancouver Utilities
  • short demo here, fully documented in COBaids1.htm.
uvhd
  • file browse/search utility for mainframe type files that do
    not have LineFeeds & may contain Packed/Binary data
  • the all time favorite tool in Vancouver Utilities
  • short demo here, fully documented in uvhd.htm.
uvhdcob
  • similar to uvhd, but also shows the COBOL copybook fieldnames
    beside the data contents. Excellent for verifying data
    conversions. You can see at a glance any mismatches between
    the actual data fields & the COBOL field definitions.
  • short demo here, fully documented in uvhdcob.htm.
Animation
  • essential for debugging MicroFocus COBOL programs
  • animation illustrated for Server Express under Unix/Linux
  • also illustrated for Net Express under SFU/UWIN/CYGWIN/Windows
  • This discussion shows you how our JCL/script conversion
    makes it easy for you to turn animation on & off.
  • Animation is fully documented in the MicroFocus manuals
cobfil51
  • COBOL Files Report
  • information extracted from all COBOL programs in directory
  • filenames, Input/Output, Org, Access, record size, copybook
  • all programmers should have a copy before starting test/debug
jobflow51
  • JCL data files with COBOL file information inserted
  • jobname,progname,LFD,org,access,I/O,rcsz,copybook,datafilename
  • illustrates data file usage in multi-step jobs
  • invaluable aid to debugging converted JCL
  • short demo here, fully documented in 'Part_9'
alldiff
  • powerful script to confirm the results of any mass changes
    to entire directories of JCL/scripts or COBOL source programs
  • this script is supplied in /home/uvadm/sf/util/alldiff
  • it employs the marvelous unix/linux system 'diff' utility,
    repeating it for each pair of files found in the directory.
  • see example on page '4J3'.
listrec2
  • uvcopy job to list Fixed Length files (from the mainframe)
    that do not have LineFeeds & cannot be viewed/printed with
    the usual unix/linux tools (vi, cat, more, lp, etc).
  • listrec2 inserts page headings with a scale & lists records
    in 100 byte segments if the record size is > 100.
  • see the example given on page MVSJCL.htm#26H3

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

4J1. MVS JCL Conversion - Testing & Debugging Aids

X. Change Management

How do you allow for continued updates to mainframe JCL during the test/debug period on the new unix/linux/windows system ? You can't just retransfer & reconvert because you probably have made changes to the JCL on the new system during testing & debugging.

If you have good change management on the mainframe, you might know exactly what changes have been made to which JCLs. If the changes to a mainframe JCL were extensive, but the changes on the new system were minimal, then you would use the reconverted JCL/script. For the opposite situation, you might apply the equivalent changes to the script to reflect the minor changes made on the mainframe.

The 'alldiff' script can help you to determine which route to go. See the alldiff sample presented on page '4J3'.

Here is a suggested scenario for a typical conversion. We will assume you spend a couple of weeks investigating & deciding whether to go ahead with the converison. Then you spend 3 to 6 months testing/debugging. Then you are ready to retransfer & go live. You certainly need to retransfer the data files. We will also retransfer the JCL & programs, but mostly to identify any updates that have been made during the test/debug period.

Initial investigation

Decision to go ahead with conversion

Test/Debug complete, Ready to go live

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

4J2. MVS JCL Conversion - Testing & Debugging Aids

alldiff to determine changes on the mainframe

You can run alldiff between jcl0, proc0, parm0 & their .Feb versions to determine changes that have been made on the mainframe since the conversion started. If you have not changed the conversion procedure & control tables we would only need to run alldiff between jcl3.Feb & jcl3. This would make it easier to update the scripts in 'jcls'.


 alldiff jcl3.Feb jcl3 >tmp/jcl3.dif
 ===================================

 uvlp12 tmp/jcl3.dif     - print the difference report
 ===================

alldiff to determine changes made during test/debug

Run alldiff between the re-converted jcl3 & 'jcls' (with test/debug changes) to deteremine changes made during the test/debug period.


 alldiff jcl3 jcls >tmp/jcls.dif
 ===============================

 uvlp12 tmp/jcls.dif     - print the difference report
 ===================

make updates required

From the alldiff reports, you can decide whether to use the new jcl3 version or the existing jcls version for each JCL - depending on where the most changes have been made during the test/debug period.


 cp  jcl3/xxxxx.pl jcls    - copy re-converted script if extensive changes
 =======================      on mainframe & minimal changes on new system

 vi jcls/xxxxx.pl          - make the minimal updates made on new system
 =================

Or make updates only to jcls module


 vi jcls/xxxxx.pl          - make the minimal updates made on mainframe
 =================            to modules with extensive changes on new system

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

4J3. MVS JCL Conversion - Testing & Debugging Aids

diff & alldiff illustrations

The unix/linux 'diff' is a marvelous utility to help you determine the differences between text files. Assume we had saved our jcl2 directory of JCL at the begining of our project (or we have restored from a backup tape). Assume we are now at the end of the project & wish to determine if any changes were made on the mainframe during our test/debug period. We can rerun the mass conversion jobs & then perform diff & alldiff between the old & new libraries. We will illustrate with JCL since it is shorter, but it might be better to diff the converted scripts (jcl3), since we wish to update the scripts (in jcls).

jcl2.Feb/jar100.jcl - original mainframe

 //JAR100   JOB  (1234)
 //* CREATE CUSTOMER NAME & ADDRESS LISTING
 //STEP010  EXEC PGM=CAR100,PARM='March 10, 2005'
 //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER,DISP=SHR
 //NALIST   DD DSN=AR.CUSTOMER.NAMELIST,DISP=(,CATLG,DELETE)

jcl2.Jun/jar100.jcl - retransferred

 //JAR100   JOB  (1234)
 //* CREATE CUSTOMER NAME & ADDRESS LISTING
 //STEP010  EXEC PGM=CAR105,PARM='March 10, 2005'
 //CUSTMAS  DD DSN=AR.CUSTOMER.MASTER,DISP=SHR
 //NALIST   DD DSN=AR.CUSTOMER.NAMELIST,DISP=(,CATLG,DELETE)

 diff jcl2.Feb/jar100.jcl jcl2.Jun/jar100.jcl
 ============================================
       - sample output report shown below:
 3c3
 < //STEP010  EXEC PGM=CAR100
 ---
 > //STEP010  EXEC PGM=CAR105

alldiff script to diff all files between 2 subdirs

Assume we have 200 JCLs in our 2 subdirs. We will use the 'alldiff' script which repeats the 'diff' command for all files found in the 1st directory (looking for a matching filename in the 2nd directory). It will report files that dont have a match in the 2nd subdir, but we should also rerun the script with directories reversed to determine if any new files had been added to the 2nd directory.


 alldiff jcl2.Feb jcl2.Jun
 ==========================
 3c3
 < //STEP010  EXEC PGM=CAR100
 ---
 > //STEP010  EXEC PGM=CAR105
 diff file# 1 - jcl1.Feb/jar100.jcl
 1 different of 200 files compared jcl1.Feb to jcl1

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

4K1. Before Going Live Checklist - After Testing & Before Producti on

Y. Adding date/time stamps for Production

If your applications must allow for the possibility of the same job being run more than once at the same time, then you must add date/time stamps to certain critical files or subdirectories.

'jobset61' (in Perl Module UVexport62.pm & called at begin JCL/scripts) sets up subdirs 'jobtmp' & 'sysout' (within $RUNDATA) that are used for temporary workfiles & SYSOUT files.

You can see the complete listings begining on page '3D1' but here is a brief description. You might need to use alternate versions of jobset61 depending on how you intend to run your production JCL/Perl scripts.

jobset61
  • does not date/time stamp jobtmp & sysout files
  • better for testing (easier to investigate files)
  • OK for production at sites that do not run multiple jobs at same time
  • 1 production operator, using 1 login, not running jobs in background
jobset62
  • appends date/time stamps to jobtmp & sysout subdirs
  • does not allow same job to be scheduled at same second
jobset63
  • appends date/time stamps to jobtmp & sysout subdirs
  • allows same job to be scheduled at same second
  • by incrementing the seconds from 61 until unique subdir found

Notes

  1. It is more convenient for testing not to date/time stamp jobtmp & sysout. This makes it easier to check your temporary work files and SYSOUT reports.

  2. Some sites might not have to add the date/time stamps for production if there is no possibility of running the same job more than once at the same time. This is true if only 1 operator runs a batch shift using only 1 login session & not running jobs in the background.

  3. When you add the timestamps, you will neded to setup cron scripts to delete jobtmp/sysout subdirs older than a specified no of days. See the sample crontab & script ('crontab1' & 'nightly1') listed on pages '3H1' & '3H2'

  4. As of July 2006, the alternate versions (jobset62 & jobset63) are not yet provided.

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

4K2. Before Going Live Checklist - After Testing & Before Producti on

sample workfile in jobtmp subdir

Sample JCL/script JAR200/jar200.pl (on page '1D1') uses workfile DSN=&&TEMPSLS for the SORT output & input to following COBOL program. We will show you the actual workfile names created for jobset61 & jobset62. We will also show the full path names assuming RUNDATA=/p2/proddata.

jobset61 creation of jobtmp subdir

You can see the complete listing of jobset61 on page '3C1' but here are the two lines that create the jobtmp subdir & the effective result assuming that JOBID=JAR100 & RUNDATA=/p2/proddata.

$JTMP="jobtmp/$main::JOBID2"; if ( ! -d $JTMP ) { mkdir $JTMP; }

 JTMP relative path --> jobtmp/JAR200
 JTMP full path ------> /p2/proddata/jobtmp/JAR200
 sample workfile -----> /p2/proddata/jobtmp/JAR200/__tempsls

jobset63 creation of jobtmp subdir

You can see the complete jobset62 in /home/uvadm/perlm/UVjobs61.pm but here are the four lines that create the jobtmp subdir & the effective result assuming that JOBID=JAR100, RUNDATA=/p2/proddata, & date/time = July 19/05 10:30:55

     $JTMP="jobtmp/${main::JOBID2}_$UVjobs61::YMDHMS13";
     if ( ! -d $JTMP ) { mkdir $JTMP; }
        || die "jobset63 aborted to not share $JTMP, please retry";
 JTMP relative path ---> jobtmp/JAR200_050719103055
 JTMP full path -------> /p2/proddata/jobtmp/JAR200_050719103055
 sample workfile ----> /p2/proddata/jobtmp/JAR200_050719103055/__tempsls

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

4L1. Reconverting Your JCL/scripts

reconverting JCL - 1 at a time


 jcl2perl61 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


 jcl2perl6A 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/datafiles51 ? --> n <-- reply 'n' if you have spent considerable time adding recsizes, etc

 --> 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

4L2. Reconvert/Recompile Your COBOL copybooks/programs

reconvert COBOL copybook - 1 at a time


 cnvMF51c 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


 cnvMF51Ac 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

Parts 5,6,7,8,9


Part_5
Part_6
Part_7
Part_8
Part_9
Note
  • In Jan 2008, MVSJCL.doc was split into 2 documents (books)
  • Parts 6,7,8 were moved to a separate book MVSJCL2.htm
  • Parts 6,7,8 names changed to Parts 26,27,28 to avoid any confusion
  • Part 9 (cross-refs) removed since there is now separate XREFjobs.htm
  • Part 5 changed to GDG implementation
Note
  • Parts 5,6,7,8,9 were removed from this MvsJclPerl to avoid duplication
  • As of Jan 2008, I have not yet had time to bring MvsJclPerl.doc up to
    the current level of Parts 1,2,3,4,5 of MVSJCL.doc.

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

Visitor Counters for ThisYear and LastYear