VSEJCL.doc - Converting VSE JCL to Unix/Linux scripts - Contents

VSE JCL Documentation in 10 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

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

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

Part_4 - Directory Design & Operating Instructions for YOUR conversions
  (vs the demos in Part_1 for UV Software supplied test files)
- Conversion procedures for a sample customer (City of Lynn Valley)
- reviews all procedures required during conversion period
- includes summaries & scripts for COBOL & DATA re-conversions
  (1st time, use step by step procedures in VSECOBOL.doc & VSEDATA.doc)
- suggests several aids & techniques to test/debug your JCL/scripts

Part_5 - GDG files (Generation Data Group) files
- enhanced in May 2007, some features surpass mainframe implementation
- new generations written to jobtmp, copied to $RUNDATA on Normal EOJ
  so Abterms do not create some new generations making reruns difficult
  but if you can restart at the step, you will be prompted to copy back
- Indexed control file provides for number of generations per file
- may update control file to process prior gens 1 time or by expiry date
- may update control file to increment thru a range of prior generations
- option to prompt operator to confirm gen# or enter an alternate gen#
Note
  • Part_5 here in VSEJCL.doc is a duplicate of Part_5 in MVSJCL.doc
    since the GDG file system is the same.

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

VSEJCL.doc - Converting VSE JCL to Unix/Linux scripts - Contents

VSE JCL - Contents (continued)


Part_6 - optional conversions (referenced from Part 4 as needed)
 Jobparmx1/Jobparms1 - extract control cards (for dates, etc) from JCL
- to separate files (easier to update, without modifying JCL)
 JCLstrip1 - cleanup converted JCL/scripts
- remove non-essential mainframe code & extraeous comments
- remove original JCL stmnts that may have been useful during debug
 Changing data file-types & record-sizes AFTER conversion
- advantages changing some fixed-length files to Text files
- can use unix/linux system utilities (vi,lp,more,etc)
- convenient for input files, parameter files, date control files, etc
- not possible for files with packed &/or binary fields.
- change DATA files, JCL/scripts,& COBOL programs (ORG LINE Seqntl)

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

Part_9 - scripts & uvcopy jobs used in MVS JCL conversion

Part_10 - Pilot Project before high volume conversions
- select a few JCL,COBOL,DATA files for a small standalone system
- can compare output reports to the mainframe (proof of concept)
- use JCL & COBOL cross-references (provided with Vancouver Utilities)
  to determine data-files, program,& copybooks required

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

VSEJCL.doc - Converting VSE JCL to Unix/Linux scripts - Contents

Note
  • In Jan 2008, VSEJCL.doc was modified to reduce duplication
    with other documents (such as MVSJCL.doc & CNVaids.doc)
  • MVSJCL.doc was reduced by splitting Parts 6,7,8 to separate MVSJCL2.doc
    & Parts 6,7,8 names changed to Parts 26,27,28 to avoid any confusion
  • We also removed Parts 6,7,8 from VSEJCL, replacing with refs to MVSJCL2
  • Part 9 was removed from both & replaced by references to XREFjobs.doc
  • for convenience Part_5 (GDG system) is duplicated here from MVSJCL.doc
    (because any VSE tape files are converted to GDG generation files).

Parts 6,7,8,9 replaced by references to:

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

VSE/MVS documentation differences

  1. The JCL conversions are very different, so we need separate conversion manuals VSEJCL.doc & MVSJCL.doc (Parts 1,2,3,4,5 different).

  2. Most of the items covered by MVSJCL2.doc (Parts 26,27,28) are common to both MVSJCL & VSEJCL, so we will refer to MVSJCL2 from VSEJCL.

  3. Some utility scripts/jobs are different for VSE/MVS & our convention is to use a '4' to identify VSE jobs & a '5' to identify MVS jobs. For example the script to convert a VSE JCL is 'jcl2ksh41' & for MVS it is 'jcl2ksh51'.

  4. Keep this in mind when reading common doc in MVSJCL2.doc & XREFjobs.doc. Before you execute a script or uvcopy job with a '5' in its name you should check to see if there is an equivalent jobname with a '4'.

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

VSEJCL.doc - Converting VSE JCL to Unix/Linux scripts - Contents

Documentation for Mainframe Conversions

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


MVSJCL.htm - MVS JCL Conversion

MVSJCL2.htm - MVS/VSE JCL Conversion Parts 26,27,28

VSEJCL.htm - VSE JCL Conversion <--- This Document

MVSCOBOL.htm - VSE COBOL Conversion

VSECOBOL.htm - MVS COBOL Conversion

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

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

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

Copyright UV Software Inc. 1993-2013

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

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

mailto:owen@uvsoftware.ca

http://www.uvsoftware.ca

re Part 5 GDG files duplicated from MVSJCL.doc

The VSE mainframe did not have GDG files, but we have found them useful to supply tape generation handling for VSE conversions. The Vancouver Utility GDG system was enhanced in May 2007, and some features now surpass the MVS mainframe implementation.

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

Part_0 VSE JCL Conversion - Introduction & Summary of Major Features

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

VSE JCL Conversion - Major Features

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

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

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

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

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

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

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

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

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

  2. Job-Flow reports extract File Info from both JCLs & COBOL programs. One line is printed for each datafile in each step. From the JCL we show: Step#, Program-name, DLBL-name1,& DLBL-name2. 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. 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 3 or 4 levels of sub-directories before files are assigned. This gives us more flexibility & better file protection. See ADMjobs.htm#Part2 for a discussion of RAID & file system design.

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

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

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

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

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

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

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

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

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

  4. IDCAMS replacement. IDCAMS 'REPRO' (file copy) is converted to the Vancouver Utility 'uvcp'. Most of the other IDCAMS functions are not required for Micro Focus COBOL on Unix/Linux/Windows systems. For example 'DEFINE CLUSTER' was required by the mainframe to create a VSAM file, but Micro Focus 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, etc. The uvcopy & uvqrpg utilities supply more functionality than most of these mainframe utilities.

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

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

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

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

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

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

  1. Print Spooling for SYSOUT type files. The first job of the day creates a new subdirectory for all SYSOUT files created that day. For example /p2/proddata/rpts/030930 would hold reports for the act system created on September 30/2003. These reports 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. 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.
     uvlp13L  - 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
     uvlp13LD - prints Landscape Duplex (otherwise similar to uvlpLS1)
     uvlpLA1  - prints Landscape Simplex if < 500 lines, Duplex if > 500 lines
     uvlpLS1C - prints Landscape Simplex (same as above), but allows multiple
                copies to be specified as arg2 on the command line

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

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

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

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

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

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

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

0A7. VSE JCL Conversion - Recent Enhancements

GDG processing

The Vancouver Utilities provides GDG (Generation Data Group) processing similar to the mainframe facility. GDG was not part of the VSE system. GDG was a feature of the MVS O/S, and it is fully documented for the MVS JCL conversions at: http://www.uvsoftware.ca/mvsjcl.htm#Part_5

The VU GDG system is mentioned here because VSE sites converting to Unix/Linux may be able to use the VU GDG system to supply the functionality of their tape management system on the mainframe.

All tape files are converted to disc files & we have an option to convert the TLBL references to the GDG format, which uses function exportgen0 to read the latest generation & exportgen1 to write the next generation.

The VU GDG system has some features that go well beyond the original features provided on the mainframe.

  1. You can specify a prior generation of a file to be defined by exportgen0 for the next run only, or until a specified expiry date/time is reached.

  2. You can specify range processing for a series of prior generations This is a powerful feature that customers can make good use of. For example if on the mainframe you had 30 tapes that had to be processed 1 at a time by a batch COBOL program, the operator could simply mount the tapes in turn.

  3. With the VU GDG system, you can edit the control file specifying the low to high range of generation#s to be processed. You can then run the batch job 30 times to process the 30 files (with no changes to JCL/scripts & no operator generation# keyins).

  4. This is possible because 'exportgen0' uses the current next generation#, which is incremented by the 'jobend51' function at normal EOJ. At the high end of the range, processing returns to normal, but an historical record is maintained in the indexed file database, making it easier to reactivate if the same cycle is repeated periodically.

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

0A7. VSE JCL Conversion - Recent Enhancements

Test/Demo files provided

In March of 2004, the VSE 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 March 2004 or later, the test/demo subdirs & files will be found in directory 'vsetest' (/home/uvadm/vsetest if installed as recommended).

We recommend you do not run the test/demos in /home/uvadm/vsetest, since any updated installation of Vancouver Utilities would wipe this out. So we advise you to setup a new user 'vsetest' (/home/vsetest) and copy all the test/demo subdirs & files from /home/uvadm/vsetest to /home/vsetest.

Although you could copy the 'vsetest' directory to a subdir within your home directory, we recommend the new user 'vsetest', 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 3.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

0A8. VSE JCL Conversion - Recent Enhancements

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

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

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

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

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

SFU/UWIN/CYGWIN differences to Unix/Linux

COBOL compile scripts are different since the Micro Focus 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 VSECOBOL.htm#5E0). To compile all programs in a directory the scripts are 'mfcblA' & 'mfnxcblA'.

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

Download/Install Korn shell (1993)

Please see pages F9 & F10 of the VU installation guide install.htm#F9 to download ksh93 from http://www.kornshell.com, and add the required files to the CYGWIN /bin.

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

Part_1 VSEJCL.doc - Converting VSE JCL to Unix/Linux scripts - Test/Demo


1A1. Directory Design for UV test/demo JCL Conversion

1B1. JCL test/demo conversion Overview

1C1. Sample Conversion of test/demo JCL JAR100 (typical 1 step COBOL)
1C2. Sample Korn shell script 'jar100.ksh' output of JCL conversion above
1C3. Front end code inserted into all output scripts
1C4. Arguments on command line
1C5. jobset51 function called at begin all JCL/scripts
1C6. jobset51 functions explained

1C8. sample conversion of a COBOL step (JCL & equivalent ksh script)
1C9. DLBL conversion to exportfile
1C10. TLBL conversion to date/time stamped file in tape subdir
1C11. COBOL EXEC conversion to 'cobrun' for easy animation (debugging)
1C12. Testing program return status
1C13. EOJ Terminated Normally & Abnormally
1C14. SYSOUT printer file inserted into all steps

1D1. Sample conversion of test/demo JCL 'JAR120'
- to illustrate conversion of printer ASSGN & LST

1E1. Sample Conversion of test/demo JCL 'JAR200' to Korn Shell Script
- illustrates PROC expansion & SORT conversion to 'uvsort'

1F1. Sample conversion of IDCAMS Utility
1F2. jgl350.jcl - IDCAMS REPRO, copy Tape to Disc
1F3. jgl360.jcl - IDCAMS DEFINE CLUSTER, Create VSAM Indexed file

1G1. jgl600.jcl - tape file conversion to VU GDG generation file system

1P1. Op. Instrns to setup vsetest & copy test/demo files from uvadm
- setup user 'vsetest' & copy supplied test/demo files from 'uvadm/vsetest'

1Q1. Op. Instrns to Convert the Test/Demo JCLs to Korn shell scripts

1R1. Op. Instrns to Convert the Test/Demo COBOL CopyBooks
1R2. COBOL program compile - overview
1R3. Op. Instrns to Convert & Compile the Test/Demo COBOL Programs

1S1. Operating Instructions to Execute the Test/Demo JCL/scripts
- expected console displays

1T1. Checking Test/Demo Output Results

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

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/vsetest         <-- setup user 'vsetest' & copy subdirs from uvadm/vsetest
 :-----testlibs
 :     :--*--Csub        - C subroutines for COBOL programs
 :     :--*--cbl0        - COBOL programs ('*' means files present)
 :     :-----cbl1        - cleaned up, cols 1-6 & 73-80 cleared, etc
 :     :-----cbl2        - cnvMF4 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        - cnvMF4 converts mainframe COBOL to MicroFocus COBOL
 :     :-----cpys        - copy here (standard copybook library)
 :     :--*--ctl         - conversion control files (jclunixop41, datafiles41)
 :     :-----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 Korn shell 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
 :     :-----rpts        - for optional statistics reports
 :     :-----sf          - for misc scripts you may wish to write
 :     :--*--sfun        - korn shell functions (jobset51,exportgen0,etc)
 :     :-----tmp               - tmp subdir used by various conversions
 :     :-----xref              - cross-references (see XREFjobs.htm)
 :--*--testdata          - test/demo data files supplied
 :     :--*--ap          - Accounts Payable
 :     :--*--ar          - Accounts Receivable
 :     :--*--gl          - General Ledger
 :     :-----jobtmp      - temporary files for SYSIN instream data
 :     :     :----030926 - jobtmp subdir created in jobset51 (script line 10)
 :     :-----sysout      - SYSOUT printer files
 :     :-----tmp         - tmp subdir for uvsort & misc use
 :     :-----wrk         - interstep temporary work files

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 'vsetest' and copy all above subdirs from /home/uvadm/vsetest to /home/vsetest 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/vsetest (1 of about 20 directories in the package).

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

The above structure is for test/demo convenience. Please see the directory design suggested for your own conversions & production beginning on page '4A2'. Note that the DATA directories will be repositioned to a separate file system. The Library & Data directories used by the converted JCL/scripts is determined by environmental variables 'RUNLIBS' & 'RUNDATA' defined in user profiles.

The following pages will list several test/demo JCLs & PROCs provided and their converted equivalents (Korn shell scripts). Studying the Before/After (JCL/script) examples given starting on page '1C1' will give you a good understanding of the JCL conversion process.

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

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

creating vsetest sub-directories

If you wish to create the (empty) sub-dirs shown on the previous page for testing in your homedir (or elsewhere), you can use the scripts provided (vselibsdirs & vsedatadirs).

  1. login to user desired, make super-dirs & change into them before running.

 2. mkdir testlibs testdata   <-- make superdirs
    =======================
 3a. cd testlibs       <-- change into superdir for libraries

 3b. vselibsdirs       <-- make library subdirs (cbl0,cbl1,etc...)
     ===========

4a. cd ../testdata <-- change into superdir for data


 4b. vsedatadirs        <-- make data subdirs (ap,ar,gl,etc)
     ===========

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#3B1.

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

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

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

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


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

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


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

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


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

Note that setting up RUNLIBS & RUNDATA as subdirs in your homedir 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 VSE JCL to Korn shell 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 instream data
JAR200
  • sort A/R sales details (by product code) & list
  • 2 step JCL (SORT + COBOL CAR200)
  • uses instream data for SORT FIELDS
  • uses a 20 line PROC called by 3 line JCL

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

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

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

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

test/demo DATA files

The test/demo JCLs reference the following data files:

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

The JCL conversion will assume the 1st node (High Level Qualifier or HLQ) is to be a sub-directory containing data files (named from the remaining nodes). See TOPDIRDFL1/2 in the conversion control file listed later on page '3E1'.

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

 /home/vsetest/
 :-----testdata/
 :     :-----ar/
 :     :     :--customer.master
 :     :     :--sales.items
 :     :-----gl/
 :     :     :--account.master
 :     :     :--account.trans

Our test/demo data files have already been converted from EBCDIC to ASCII, preserving packed fields & correcting zoned signed fields to Micro Focus COBOL standards. You can see the details of the data conversions in DATAcnv1.htm & VSEDATA.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. VSE JCL conversion to Unix/Linux Korn shell scripts

sample conversion VSE JCL to Unix/Linux Korn shell script

We will illustrate the conversion of VSE JCL to Unix/Linux Korn shell scripts with the input & output listings of a simple 1 step COBOL VSE JOB.

Note that we have inserted a sequence# on the left side to facilitate references. We have prefixed the JCL sequence#s with 'j#' and the Korn shell script sequence#s with 'k#'.

The detailed operating instructions for the conversion will be presented later beginning on page '1Q1'.

                    ** sample input - VSE JCL (1 step COBOL) **
 // JOB  JAR100   TEST VSE JCL CONVERSION TO UNIX/LINUX KORN SHELL       00000010
 *       EXECUTES COBOL CAR100 CUSTOMER NAME&ADDRESS LISTING             00000020
 // DATE 03/20/08     *COBOL program has ACCEPT FROM DATE                00000030
 // DLBL CUSTMAS,'AR.CUSTOMER.MASTER',,VSAM,CAT=UCAT01                   00000040
 // DLBL NALIST,'AR.CUSTOMER.NAMEADRS.LIST100',0,SD                      00000050
 // EXTENT SYS017,DYNWRK,1,0,1,10                                        00000060
 // EXEC PGM=CAR100,SIZE=AUTO                                            00000070
 /&                                                                      00000080

See the output (Korn shell script equivalent) on the next page --->

The Korn shell output for a 1 step job is much longer than the JCL input, since there are about 30 lines of front end code & 10 lines of back end code that are inserted into all output scripts.

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

1C2. sample output - Korn shell script

 k#001 #!/bin/ksh
 k#002 ##JOB  JAR100   TEST VSE JCL CONVERSION TO UNIX/LINUX KORN SHELL
 k#003 export JOBID2=JAR100; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$JOBID1" ]]; then JOBID1=JAR100; fi; export JOBID1
 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#006 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 exportfile
 k#008 autoload exportgen0 exportgenall exportgenx exportgen1
 k#010 jobset51  # call function to setup: directory equates, UPSI, etc
 k#011 #jobset51 stores any restart step# in alias 'goto'
 k#012 goto
 k#013 S0000=A
 k#014 #1======================== begin step#S0010_CAR100 =========================
 k#015 S0010=A
 k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 k#017 logmsg2 "Begin Step $JSTEP CAR100 (#$XSTEP)"
 k#018 stepctl51  # test oprtr jcpause/jcclear
 k#019 export PROGID=CAR100
 k#020 export PARM="";
 k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 k#022 logmsg1 "      EXECUTES COBOL CAR100 CUSTOMER NAME&ADDRESS LISTING"
 k#023 export RUNDATE=03/20/08
 k#024 exportfile CUSTMAS ar/customer.master
 k#025 exportfile NALIST ar/customer.nameadrs.list100
 k#026 ## EXEC PGM=CAR100,SIZE=AUTO
 k#027 #3----------------------------------------------------------------------
 k#028 cobrun $ANIM $RLX/car100
 k#029 #4----------------------------------------------------------------------
 k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 k#031 if ((SCC != 0))
 k#032    then logmsg2 "ERR: step $JSTEP CAR100 abterm $SCC"
 k#033    alias goto="<<S9900=A"; fi
 k#034 goto
 k#035 #8======================================================================
 k#036 S9000=A
 k#037 jobend51 #move any GDG files from jobtmp/subdirs to RUNDATA/subdirs
 k#038 logmsg2 "EOJ Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 k#039 exit 0  #UVSI jclunix41 ver: 20080930  options: d0e1j1l1p0r0s0t12u1y0
 k#040 #9======================================================================
 k#041 S9900=A
 k#042 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
 k#043 jobabend51 #report GDGs NOT moved from jobtmp/JOBID/GDG to outdirs
 k#044 exit $JCC

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

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

front end code in output script

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

 k#001 #!/bin/ksh
 k#002 ##JOB  JAR100   TEST VSE JCL CONVERSION TO UNIX/LINUX KORN SHELL
 k#003 export JOBID2=JAR100; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$JOBID1" ]]; then JOBID1=JAR100; fi; export JOBID1
 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#006 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 exportfile
 k#008 autoload exportgen0  exportgenall exportgenx exportgen1
       ========
 k#010 jobset51  # call function to setup: directory equates, UPSI, etc
       ========
 k#011 #jobset51 stores any restart step# in alias 'goto'
 k#012 goto
 k#013 S0000=A
Note
  • 'jobset51' is a vital function that setsup the job environment
  • see much more discussion on the following few pages

JOBID1 & JOBID2

 k#003 export JOBID2=JAR100; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$JOBID1" ]]; then JOBID1=JAR100; fi; export 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).

scriptpath & args

'$scriptpath' & '$args' will be displayed by the 'jobset51' function which is listed on page '1C5' & 1C6 (see lines js#111 & js#112).

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

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

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

JCL/script arguments

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


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

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

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


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

jobset51 function - explained

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

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

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

jobset51 'extract' listing

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

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

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

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

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

 js#001 # jobset51 - setup environment for UNIX scripts converted from MVS JCL
 js#005 function jobset51
 js#006 { # jobset51 - called at the begining of each JCL/script
 js#007 #            - inserted by JCL converter from the ctl/jclunixop51
 js#008 # jobset51 uses $RUNLIBS & $RUNDATA (exported in prgmr/oprtr profiles)
 js#009 #          to define Libraries & Data dirs for 'test' or 'prod'uction
 js#010 #
 js#011 #        - - - sample RUNLIBS/RUNDATA for programer testing - - -
 js#012 # export RUNLIBS=/home/mvstest/testlibs #<-- test/demo Libraries
 js#013 # export RUNDATA=/home/mvstest/testdata #<-- test/demo Data superdir
 js#014 #
 js#015 #        - - - sample RUNLIBS/RUNDATA for production operators - - -
 js#016 # export RUNLIBS=/p2/prodlibs           #<-- production libraries
 js#017 # export RUNDATA=/p2/proddata           #<-- production Data superdir
 js#018 #
 js#019 # - JCL/scripts are found via $RUNLIBS/jcls in the profile PATH
 js#020 # - COBOL program subdir defined here in jobset51 as '$RUNLIBS/cblx'
 js#021 #   (this allows programs to have same names as JCL/scripts)
 js#022 #
 js#044 cd $RUNDATA         #change to working dir for production or test      **
 js#045 cdstatus=$?         # capture status of cd $RUNDATA
 js#046 if ((cdstatus))     # ERR if cdstatus not zero (OK)
 js#047    then logmsg2 "ERR: cd \$RUNDATA ($RUNDATA) failed in jobset51"
 js#048         logmsg2 "- investigate, RUNDATA definition in profiles"
 js#049         logmsg1 "- enter to exit"; read reply; exit 91; fi
 js#050 #
 js#051 # cd $RUNDATA means all files are referenced relative to $RUNDATA      **
 js#052 # - allows switching between prod & test files by changing $RUNDATA
 js#053 # - JCL converter has converted HLQs of DSNs to subdirs in $RUNDATA
 js#054 # - High Level Qualifiers might be applications (ar,gl,mstr,tape,etc)
 js#055 #
 js#056 export RLX=$RUNLIBS/cblx      # path for loading COBOL programs        **
 js#057 export RPX=$RUNLIBS/rpgx      # path for loading RPG programs
 js#061 # - COBOL programs are found via $RLX/progname in JCL/scripts
 js#062 # - RPG   programs are found via $RPX/progname in JCL/scripts
 js#064 #
 js#065 if [ -z "$ANIM" ]; then ANIM=-F; fi
 js#066 # 'ANIM=-F' inhibits non-numeric field checks (could change to +F ?)
 js#067 # - cobol programs are called via ---> cobrun $ANIM $RLX/progname <---
 js#068 #
 js#069 # Make subdirs for work files, instream data files,& GDG subdirs       **
 js#079 export JTMP=jobtmp/$JOBID2                                             **
 js#080 export RPTS=rpts                                                        *
 js#081 export SYOT=sysout/$JOBID2                                              *
 js#086 #
 js#087 # Define jobtmp/subdirs for new GDG files                              **
 js#088 umask 002  # ensure perms to create dirs/files 775/664 (group share)    *
 js#089 export JGDG=$JTMP/GDG                                                   *
 js#090 export GTMP=$JTMP/gtmp                                                  *
 js#091 if [[ ! -d $JTMP ]]; then mkdir $JTMP; fi                              **
 js#092 if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi                              **
 js#093 if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi                               *
 js#094 # JTMP/...     - for work files & instream data files
 js#095 # GTMP/...     - for exportgen0,1,etc 'ls' output files
 js#096 #                GDG matching filenames readback to determine latest gen#
 js#097 # JGDG/subdirs - store new GDGs for move back at Normal EOJ
 js#098 #              - see $RUNDATA/ctl/GDGmkdirs called later in jobset51
 js#102 #
 js#110 # Define subdir that might be used for printer output                  **
 js#111 # - some sites might sub-directory by date rpts/yymmdd/...              *
 js#112 # export RPTS=rpts/$(date +%y%m%d)  # use this for subdirs by date      *
 js#113 if [[ ! -d $RPTS ]]; then mkdir $RPTS; fi                              **
 js#114 #
 js#115 # make subdir for SYSOUT files (or any file w/o DSN=...)
 js#116 # $RUNDATA/$SYOT/step#_SYSOUT (where SYOT=sysout/JOBNAME)
 js#117 if [[ ! -d $SYOT ]]; then mkdir $SYOT; fi
 js#118 #
 js#119 # $JTMP & $SYOT are vital - ensure created successfully else exit
 js#120 if [[ -d $JTMP && -d $SYOT ]]; then :
 js#121    else logmsg2 "ERR: $JTMP &/or $SYOT failed creation (in jobset51)"
 js#122         logmsg2 "- investigate: permissions,JTMP,SYOT dirnames changed?"
 js#123         logmsg1 "- enter to exit"; read reply; exit 92; fi
 js#128 #
 js#129 # define subdir for interstep temp/work files & in IDCAMS conversions
 js#130 # ensure wrk/nullfile present & empty, for use on DD DUMMY
 js#131 >wrk/nullfile    # ensure present & empty
 js#132 # could use /dev/null, but some unix variants had problems with that
 js#133 #
 js#134 # Begin code to preserve GDGs if jobs abort
 js#135 # - see doc at www.uvsoftware.ca/mvsjcl.htm#Part_5
        # --> GDG explanations omitted here in Part 1 <--
        #
 js#190 # Default RUNDATE to system date yyyymmdd, but allow cmd line override **
 js#191 # --> jobname.ksh RUNDATE=20091120  <-- override sysdate for this job   *
 js#192 # See explanations at www.uvsoftware.ca/mvscobol.htm#2E1 - 2E9          *
 js#193 # COBOL converter inserts unixwork1.cpy,unixproc1.cpy,perform unixproc1 *
 js#194 # - unixproc1 reformats $RUNDATE into various date formats for COBOL    *
 js#195 if [[ -z "$RUNDATE" ]]; then RUNDATE=$(date +%Y%m%d); fi; export RUNDATE*
 js#197 #
 js#198 # Display various information at begining of JCL/script execution      **
 js#199 # - for the console log, info may be useful to debug problems           *
 js#200 logmsg2 "Begin Job=$JOBID2"                                             *
 js#201 logmsg1 "$scriptpath"                                                   *
 js#202 logmsg1 "Arguments: $args"                                              *
 js#203 logmsg1 "RUNLIBS=$RUNLIBS"                                              *
 js#204 logmsg1 "RUNDATA=$RUNDATA"                                              *
 js#205 logmsg1 "JTMP=$JTMP SYOT=$SYOT"                                         *
 js#206 logmsg1 "RUNDATE=$RUNDATE"                                              *
 js#207 uvtime W1D0 $JTMP/jobbgn
 js#208 export JSTEP=S0000 XSTEP=0
 js#209 integer JCC=0 SCC=0 LCC=0;
 js#210 #
 js#211 # Allow for RESTART at any step by step=... argument on command line:  **
 js#212 # --> jobname.ksh step=S0020   <-- restart at step 2                    *
 js#213 if [[ -n "$step" ]]; then STEP="$step"; fi                              *
 js#214 if [[ -z "$STEP" ]]; then export STEP=S0000; fi                         *
 js#215 if [[ $STEP != S[0-9][0-9][0-9][0-9] ]]                                 *
 js#216    then logmsg2 "ERR: STEP=$STEP invalid"; exit 91; fi                  *
 js#217 alias goto="<<${STEP}=A"                                               **
 js#218 return 0
 js#219 }
 js#220 #----------------------------- end jobset51 -----------------------------

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

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

jobset51 function - explained

js#044--> cd $RUNDATA #change to working dir for production (or test)

js#056--> export RLX=$RUNLIBS/cblx #setup path for loading programs


   cobrun $ANIM $RLX/progname
   ==========================
 js#065--> if [ -z "$ANIM" ]; then ANIM=-F; fi  #inhibit non-num field check

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

js#079 export JTMP=jobtmp/$JOBID2 js#089 export JGDG=$JTMP/GDG js#090 export GTMP=$JTMP/gtmp js#091 if [[ ! -d $JTMP ]]; then mkdir $JTMP; fi js#092 if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi js#093 if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi

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

jobset51 function explained (continued)

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

js#131 >wrk/nullfile # ensure present & empty

 js#190--> if [ -z "$RUNDATE" ]; then RUNDATE=$(date +%Y%m%d); fi; export RUNDATE

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

js#200 logmsg2 "Begin Job=$JOBID2" js#201 logmsg1 "$scriptpath" js#202 logmsg1 "Arguments: $args" js#203 logmsg1 "RUNLIBS=$RUNLIBS" js#204 logmsg1 "RUNDATA=$RUNDATA" js#205 logmsg1 "JTMP=$JTMP SYOT=$SYOT" js#206 logmsg1 "RUNDATE=$RUNDATE"

 js#213 if [[ -n "$step" ]]; then STEP="$step"; fi
 js#214 if [[ -z "$STEP" ]]; then export STEP=S0000; fi
 js#215 if [[ $STEP != S[0-9][0-9][0-9][0-9] ]]
 js#216    then logmsg2 "ERR: STEP=$STEP invalid"; exit 91; fi
 js#217 alias goto="<<${STEP}=A"

   payroll1.ksh step=S0030       <-- restart at step 3
   =======================

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

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

jobset51 & operator prompts for dates, etc

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

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

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

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

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


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

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

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

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

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

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

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

sample conversion of 1 step COBOL JCL

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

 j#001// JOB  JAR100   TEST VSE JCL CONVERSION TO UNIX/LINUX KORN SHELL
 j#002*       EXECUTES COBOL CAR100 CUSTOMER NAME&ADDRESS LISTING
 j#003// DATE 03/20/08     *COBOL program has ACCEPT FROM DATE
 j#004// DLBL CUSTMAS,'AR.CUSTOMER.MASTER',,VSAM,CAT=UCAT01
 j#005// DLBL NALIST,'AR.CUSTOMER.NAMEADRS.LIST100',0,SD
 j#006// EXTENT SYS017,DYNWRK,1,0,1,10
 j#007// EXEC PGM=CAR100,SIZE=AUTO
 j#008/&
 k#014 #1======================== begin step#S0010_CAR100 =======================
 k#015 S0010=A
 k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 k#017 logmsg2 "Begin Step $JSTEP CAR100 (#$XSTEP)"
 k#018 stepctl51  # test oprtr jcpause/jcclear
 k#019 export PROGID=CAR100
 k#020 export PARM="";
 k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 k#022 logmsg1 "      EXECUTES COBOL CAR100 CUSTOMER NAME&ADDRESS LISTING"
 k#023 export RUNDATE=03/20/08
 k#024 exportfile CUSTMAS ar/customer.master
 k#025 exportfile NALIST ar/customer.nameadrs.list100
 k#026 ## EXEC PGM=CAR100,SIZE=AUTO
 k#027 #3----------------------------------------------------------------------
 k#028 cobrun $ANIM $RLX/car100
 k#029 #4----------------------------------------------------------------------
 k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 k#031 if ((SCC != 0))
 k#032    then logmsg2 "ERR: step $JSTEP CAR100 abterm $SCC"
 k#033    alias goto="<<S9900=A"; fi
 k#034 goto

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

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

'DLBL' converted to 'exportfile'

 j#004 // DLBL CUSTMAS,'AR.CUSTOMER.MASTER',,VSAM,CAT=UCAT01
 j#005 // DLBL NALIST,'AR.CUSTOMER.NAMELIST',0,SD
 j#006 // EXTENT SYS017,DYNWRK,1,0,1,10

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

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

       export CUSTMAS=ar/customer.master
       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 EXTENT info is ignored (not applicable to unix/linux).

Filenames with only 1 node (no '.'s) will be assigned to the subdir defined by TOPDIRDFL1/2 in the conversion control file (see ctl/jclunixop41 listed on page '3E1'). The directory may also be specified via TOPDIRINS1/2 or individually by file using topr=... in ctl/datafiles43 (see listing page '3E3' & discussion page '3E4').

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

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

TLBL Tape File conversion options

 // TLBL BERCURB,'TBE0T.BERCURB',,,,,,2
 exportfile BERCURB tape/bercurb_$(date +%y%m%d)_$(date +%H%M%S)

This illustrates all TLBL tape conversion options. Conversion options may be specified in the conversion control file (ctl/jclunixop41) which is listed later on page '3E1'.

t1
  • append 'date' stamp on tape file labels
t2
  • append 'time' stamp on tape file labels
t4
  • replace specified HLQ (top node of filename) with 'tape/'
t7
  • all of above (t1+t2+t4 = t7)
  • the default in the supplied ctl/jclunixop41

We don't want to copy our tape files directly to tape as on the mainframe. We can eliminate a lot of tape file handling by writing all tape files to disc & depending on the enhanced backup systems on the unix/linux systems.

We need to append date/time stamps because the mainframe would have created separate tape reels, but now that we are outputting to disc, we would be overwriting the same file if we did not use the date/time stamps.

If the reason for the tape backup were contingency only & when restore required the tape file was manually selected & input into a restore JCL, then this plan should work even better. We would investigate the console log to identify the backup file required & restore it with a simple unix/linux 'cp'.

Of course we need some plan to remove the old date/time stamped files. We can do this conveniently using a 'cron' script to automatically delete tape files older than a specified number of days. Assigning tape files into a separate directory (tape) allows us to run the cron script on the entire directory. If you could not agree on a set number of days for all tape files, you could probably use wild card matching on the tape filename prefixes to achieve the desired effect.

See the sample 'crontab_appsadm1' & 'nightly1' at ADMjobs.htm#5B1 & 5C1.

Tape conversion alternative - GDG files

Tape conversions have been changed to GDG generation files. Here is an example from JCL/script jgl350 example on pages '1F1' & '1F2'.

 // TLBL DSFO,'GL.ACCOUNT.MASTER',0,,1,1,1

exportgen1 DSFO $JGDG/tape/gl.account.master_

See a more extensive example (jgl600) on pages '1G1' & '1G2'.

See GDG files documented in 'Part_5'

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

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

COBOL EXECs converted to 'cobrun's

j#007 // EXEC PGM=CAR100,SIZE=AUTO

 k#026 ## EXEC PGM=CAR100,SIZE=AUTO
 k#027 #3----------------------------------------------------------------------
 k#028 cobrun $ANIM $RLX/car100
 k#029 #4----------------------------------------------------------------------

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

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

The '.int's usually do not run significantly slower than executables. But if you had some programs doing a lot of memory table indexing, you can compile it to 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

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

testing program Return Condition

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

 j#006 // EXEC PGM=CAR100,SIZE=AUTO,PARM="MARCH 11, 2005"
 k#027 #3----------------------------------------------------------------------
 k#028 cobrun $ANIM $RLX/car100
 k#029 #4----------------------------------------------------------------------
 k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 k#031 if ((SCC != 0))
 k#032    then logmsg1 "step $JSTEP CAR100 abterm $SCC"
 k#033    alias goto="<<S9900=A"; fi
 k#034 goto

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

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

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

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

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

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

EOJ Terminated Normally/Abnormally

 k#035 #8======================================================================
 k#036 S9000=A
 k#037 jobend51 #move any GDG files from jobtmp/subdirs to RUNDATA/subdirs
 k#038 logmsg2 "EOJ Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 k#039 exit 0  #UVSI jclunix41 ver: 20080930  options: d0e1j1l1p0r0s0t12u1y0
 k#040 #9======================================================================
 k#041 S9900=A
 k#042 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
 k#043 jobabend51 #report GDGs NOT moved from jobtmp/JOBID/GDG to outdirs
 k#044 exit $JCC

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

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

This also allows you to add some code here to perform whatever ABTERM steps you wish.

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

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

'SYSOUT' inserted on each step


 k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 =========================================================

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 VSE JCL data file name.

COBOL programs that 'DISPLAY UPON SYSOUT' do not need to declare a printer file, and the VSE JCL did not need to include a DLBL/TLBL for the printer file.

The COBOL converter could convert the 'DISPLAY UPON SYSOUT' to 'WRITE's to a file which is inserted into the COBOL program (using select name 'SYSOUT').

We can now give special treatment to the SYSOUT files. The SYSOUT files directory is converted to '$SYOT', which is assigned to the 'sysout' directory. The expansion might be as follows:


 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}  <-- before expansion
 ====================================================

 export SYSOUT=sysout/JAR100_001_CAR100         <-- after symbol expansion
 ======================================

'SYOT' is assigned to sysout in the 'jobset51' function which is inserted about line 10 of each converted jcl/script. You can see jobset51 listed on page '5K1'. If desired, you could sub-directory by date or jobname.

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, 'uvlp13LD' 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. VSE JCL Conversion to Korn shell scripts - example #2

test/demo Conversion #3 - JAR120 ASSGN & LST

j#001 // JOB JAR120 TEST/DEMO VSE JCL PARM-DATA CONVERSION j#002 * CUSTOMER NAME & ADDRESS LISTING WITH DATE FROM PARM=... j#003 // DLBL CUSTMAS,'AR.CUSTOMER.MASTER',,VSAM,CAT=UCAT01 j#004 // ASSGN SYS020,F93 j#005 * $$ LST LST=F93,CLASS=E,DISP=K,USER=ARDEPT,DEST=(*,ARDEPT),JNM=JAR121 j#006 // EXEC PGM=CAR120,SIZE=AUTO,PARM='MARCH 12, 2005' j#007 FISCALYEAR=2004 j#008 /* j#009 /&

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

1D2. VSE JCL Conversion to Korn shell scripts - example #2

jcl3/jar120.ksh - Korn shell script conversion

k#001 #!/bin/ksh k#002 ##JOB JAR120 TEST/DEMO VSE JCL PARM-DATA CONVERSION

            - - - - lines 3-11 removed (same as ex#1) - - - -
 k#014 #1======================== begin step#S0010_CAR120 =========================
 k#015 S0010=A
 k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 k#017 logmsg2 "Begin Step $JSTEP CAR120 (#$XSTEP)"
 k#018 stepctl51  # test oprtr jcpause/jcclear
 k#019 export PROGID=CAR120
 k#020 export PARM="MARCH 12, 2005"
 k#021 logmsg1 "PARM=MARCH 12, 2005"
 k#022 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 k#023 logmsg1 " CUSTOMER N&A LISTING WITH DATE FROM PARM=... (CAR120.cbl using WS)"
 k#024 logmsg1 " - also see JAR125 & CAR125.cbl using PARM data in LINKAGE SECTION"
 k#025 exportfile CUSTMAS ar/customer.master
 k#026 ## ASSGN SYS020,F93
 k#027 # $$ LST LST=F93,CLASS=E,DISP=K,USER=ARDEPT,DEST=(*,ARDEPT),JNM=JAR121
 k#028 exportfile SYS020 $RPTS/jar121___E_car120_${JSTEP}_01_$(date +%y%m%d%H%M%S)
 k#029 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}
 k#030 cat > $SYSIN <</*EOD
 k#031 FISCALYEAR=2004
 k#032 /*EOD
 k#033 ## EXEC PGM=CAR120,SIZE=AUTO,PARM='MARCH 12, 2005'
 k#034 #3----------------------------------------------------------------------
 k#035 cobrun $ANIM $RLX/car120
 k#036 #4----------------------------------------------------------------------
 k#037 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 k#038 # uvlpLS13 $SYS020
 k#039 if ((SCC != 0))
 k#040    then logmsg2 "ERR: step $JSTEP CAR120 abterm $SCC"
 k#041    alias goto="<<S9900=A"; fi
 k#042 goto
 k#043 #8======================================================================
 k#044 S9000=A
 k#045 jobend51 #move any GDG files from jobtmp/subdirs to RUNDATA/subdirs
 k#046 logmsg2 "EOJ Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 k#047 exit 0  #UVSI jclunix41 ver: 20080930  options: d0e1j1l1p0r0s0t12u1y0
 k#048 #9======================================================================
 k#049 S9900=A
 k#050 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
 k#051 jobabend51 #report GDGs NOT moved from jobtmp/JOBID/GDG to outdirs
 k#052 exit $JCC

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

1D3. VSE JCL Conversion to Korn shell scripts - example #2

control stream data redirected to a file

Control stream data is redirected to a data file in the tmp subdir since Unix/Linux COBOL has no control stream concept. The COBOL converter converts 'ACCEPT's from control stream to 'READ's from a data file (select & FD inserted in COBOL program).

j#006 // EXEC PGM=CAR100,SIZE=AUTO,PARM="MARCH 11, 2005" j#007 FISCALYEAR=2004 j#008 /*

 k#029 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}
 k#030 cat > $SYSIN <</*EOD
 k#031 FISCALYEAR=2004
 k#032 /*EOD
 k#033 ## EXEC PGM=CAR120,SIZE=AUTO,PARM='MARCH 12, 2005'
 k#034 #3----------------------------------------------------------------------
 k#035 cobrun $ANIM $RLX/car120
 k#036 #4----------------------------------------------------------------------

A unique filename is constructed from jobname,step#,& programname which is 'export'ed as logical name 'SYSIN' for the COBOL program name.

The instream data is redirected via the 'cat' & '<</*' into the tmp data file until the ending '/*' is encountered.

Note that control stream data is repositioned ahead of the EXEC/cobrun since it must be redirected into the data file before the COBOL program is executed.

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

1E1. VSE JCL Conversion to Korn shell scripts - example #3

test/demo Conversion #3 - JAR200 (SORT+COBOL)

This example will illustrate the conversion of mainframe SORT to 'uvsort' (Vancouver Utility replacement for SORT & SYNCSORT).

jcl1/jar200.jcl - VSE JCL

 j#001 // JOB JAR200    TEST/DEMO VSE JCL CONVERT & PROC EXPANSION
 j#002 *  PAR200 - TEST/DEMO VSE JCL CONVERT (PROC CALLED BY JAR200)
 j#003 *  SORT SALES ITEMS BY PRODUCT#(MAJOR) & CUSTOMER#(MINOR)
 j#004 // DLBL SORTIN1,'AR.SALES.ITEMS',,VSAM,CAT=UCAT01
 j#005 // DLBL SORTOUT,'%SALES.SORTFILE',0,VSAM,CAT=WKCAT,DISP=(NEW,KEEP),    C
 j#006                RECORDS=(100,1000),RECSIZE=64
 j#007 // DLBL SORTWK1,'%SORTWORK1',0
 j#008 // EXTENT SYS003,DYNWRK,,,1,200
 j#009 // EXEC SORT,SIZE=100K
 j#010    SORT FIELDS=(31,6,A,1,6,A),FORMAT=CH,WORK=1
 j#011    OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
 j#012    RECORD TYPE=F,LENGTH=64
 j#013    INPFIL BLKSIZE=6400
 j#014    OUTFIL BLKSIZE=6400
 j#015    END
 j#016 /*
 j#017 *  STEP2 - LIST SALES ITEMS BY PRODUCT#
 j#018 // DLBL SALEDTL,'%SALES.SORTFILE',0,VSAM,CAT=WKCAT,DISP=(,DELETE)
 j#019 // DLBL CUSTMAS,'AR.CUSTOMER.MASTER.INDEXED',,VSAM
 j#020 // ASSGN  SYS035,F91                       REPORT OUTPUT
 j#021 * $$ LST LST=F91,DISP=D,CLASS=E,DEST=(*,ARDEPT),JNM=SALESRPT
 j#022 // EXEC PGM=CAR200,SIZE=AUTO,PARM='MARCH 11, 2005'
 j#023 FISCALYEAR=2004
 j#024 /&
Note
  • See the converted equivalent Korn shell script on the next page --->
  • We have omitted the standard front end & back code (same as example#1)

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

1E2. VSE JCL Conversion to Korn shell scripts - example #3

jcl3/jar200.ksh - Korn shell script conversion

 k#014 #1======================== begin step#S0010_SORT =========================
 k#015 S0010=A
 k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 k#017 logmsg2 "Begin Step $JSTEP SORT (#$XSTEP)"
 k#018 stepctl51  # test oprtr jcpause/jcclear
 k#019 export PROGID=SORT
 k#020 export PARM="";
 k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 k#022 logmsg1 " PAR200 - TEST/DEMO VSE JCL CONVERT (PROC CALLED BY JAR200)"
 k#023 logmsg1 " SORT SALES ITEMS BY PRODUCT#(MAJOR) & CUSTOMER#(MINOR)"
 k#024 exportfile SORTIN1 ar/sales.items
 k#025 exportfile SORTOUT $JTMP/%sales.sortfile
 k#026 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}
 k#027 cat > $SYSIN <</*EOD
 k#028    SORT FIELDS=(31,6,A,1,6,A),FORMAT=CH,WORK=1
 k#029    OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
 k#030    RECORD TYPE=F,LENGTH=64
 k#031    INPFIL BLKSIZE=6400
 k#032    OUTFIL BLKSIZE=6400
 k#033    END
 k#034 /*EOD
 k#035 ## EXEC SORT,SIZE=100K
 k#036 #3----------------------------------------------------------------------
 k#037 uvsort "fili1=$SORTIN1,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\
 k#038 ,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
 k#039 #4----------------------------------------------------------------------
 k#040 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 k#041 if ((SCC != 0))
 k#042    then logmsg2 "ERR: step $JSTEP SORT abterm $SCC"
 k#043    alias goto="<<S9900=A"; fi
 k#044 goto
 k#045 logmsg1 " STEP2 - LIST SALES ITEMS BY PRODUCT#"
 k#046 #1======================== begin step#S0020_CAR200 =========================
 k#047 S0020=A
 k#048 JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0;
 k#049 logmsg2 "Begin Step $JSTEP CAR200 (#$XSTEP)"
 k#050 stepctl51  # test oprtr jcpause/jcclear
 k#051 export PROGID=CAR200
 k#052 export PARM="MARCH 11, 2005"
 k#053 logmsg1 "PARM=MARCH 11, 2005"
 k#054 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 k#055 exportfile SALEDTL $JTMP/%sales.sortfile
 k#056 exportfile CUSTMAS ar/customer.master.indexed
 k#057 ## ASSGN  SYS035,F91                       REPORT OUTPUT
 k#058 # $$ LST LST=F91,DISP=D,CLASS=E,DEST=(*,ARDEPT),JNM=SALESRPT
 k#059 exportfile SYS035 $RPTS/salesrpt_E_car200_${JSTEP}_01_$(date +%y%m%d%H%M%S)
 k#060 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}
 k#061 cat > $SYSIN <</*EOD
 k#062 FISCALYEAR=2004
 k#063 /*EOD
 k#064 ## EXEC PGM=CAR200,SIZE=AUTO,PARM='MARCH 11, 2005'
 k#065 #3----------------------------------------------------------------------
 k#066 cobrun $ANIM $RLX/car200
 k#067 #4----------------------------------------------------------------------

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

1E4. VSE JCL Conversion to Korn shell scripts - example #3

SORT conversion to uvsort

 k#024 exportfile SORTIN1 ar/sales.items
 k#025 exportfile SORTOUT $JTMP/%sales.sortfile
 k#026 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}
 k#027 cat > $SYSIN <</*EOD
 k#028    SORT FIELDS=(31,6,A,1,6,A),FORMAT=CH,WORK=1
 k#029    OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
 k#030    RECORD TYPE=F,LENGTH=64
 k#031    INPFIL BLKSIZE=6400
 k#032    OUTFIL BLKSIZE=6400
 k#033    END
 k#034 /*EOD
 k#035 ## EXEC SORT,SIZE=100K
 k#036 #3----------------------------------------------------------------------
 k#037 uvsort "fili1=$SORTIN1,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\
 k#038 ,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
 k#039 #4----------------------------------------------------------------------

Notes

The original SORT control cards are seen in the converted script since all control streams are redirected into a temporary file & brought ahead of the program execution. The SYSIN $JTMP(jobtmp) 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 ($SORTIN1 & $SORTOUT).

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

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

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

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

1F1. VSE JCL Conversion to Korn shell scripts - example #4

test/demo #4 jgl350.jcl IDCAMS REPRO

 j#001 // JOB JGL350    * TEST VSE JCL IDCAMS CONVERSION *
 j#002 *  COPY GL.ACCOUNT.MASTER TO TAPE
 j#003 // DLBL DSFI,'GL.ACCOUNT.MASTER',,VSAM,CAT=USRCAT
 j#004 // TLBL DSFO,'GL.ACCOUNT.MASTER',0,,1,1,1
 j#005 // PAUSE // ASSGN SYS005,8809
 j#006 // EXEC PGM=IDCAMS,SIZE=AUTO
 j#007    REPRO INFILE(DSFI) OUTFILE(DSFO) RECORDSIZE(80)
 j#008 /*
 j#009 /&

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

1F2. VSE JCL Conversion to Korn shell scripts - example #4

jgl350.ksh IDCAMS REPRO converted to uvcp

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

k#001 #!/bin/ksh k#002 ##JOB JGL350 * TEST VSE JCL IDCAMS CONVERSION *

             - - - lines 3-11 removed (similar in all output scripts) - - -
 k#014 #1======================== begin step#S0010_IDCAMS =========================
 k#015 S0010=A
 k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 k#017 logmsg2 "Begin Step $JSTEP IDCAMS (#$XSTEP)"
 k#018 stepctl51  # test oprtr jcpause/jcclear
 k#019 export PROGID=IDCAMS
 k#020 export PARM="";
 k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 k#022 logmsg1 " COPY GL.ACCOUNT.MASTER TO TAPE"
 k#023 exportfile DSFI gl/account.master
 k#024 exportgen1 DSFO $JGDG/tape/gl.account.master_
 k#025 #exportgen1 assign to $JGDG/subdir/file, move to subdir/file at Normal EOJ
 k#026 logmsg1 "// ASSGN SYS005,8809"
 k#027 logmsg1 "enter to continue"
 k#028 if [[ "$PAUSE" != "NO" ]]; then read reply; fi
 k#029 exportfile SYS005 $DW/${JOBID2}_${PROGID}_SYS005
 k#030 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}
 k#031 cat > $SYSIN <</*EOD
 k#032    REPRO INFILE(DSFI) OUTFILE(DSFO) RECORDSIZE(80)
 k#033 /*EOD
 k#034 ## EXEC PGM=IDCAMS,SIZE=AUTO
 k#035 #3----------------------------------------------------------------------
 k#036 uvcp "fili1=$DSFI,typ=RSF,rcs=80,filo1=$DSFO,typ=RSF,rcs=80"
 k#037 LCC=$?; ((SCC+=LCC));
 k#038 #4----------------------------------------------------------------------
 k#039 S0010C=$SCC; ((JCC+=SCC)); alias goto="";
 k#040 if ((SCC != 0))
 k#041    then logmsg2 "ERR: step $JSTEP IDCAMS abterm $SCC"
 k#042    alias goto="<<S9900=A"; fi
 k#043 goto

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

1F3. VSE JCL Conversion to Korn shell scripts - example #5

TAPE output files converted to GDG files


 j#004 // TLBL DSFO,'GL.ACCOUNT.MASTER',0,,1,1,1
 ===============================================

 k#024 exportgen1 DSFO $JGDG/tape/gl.account.master_
 ===================================================

TLBL files will be redirected to GDG generation files 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').

Tape file outputs will automatically create a new generation of the file. Tape file inputs will automatically get the latest generation of the file. If you wanted a prior generation, you could temporarily modify the JCL/script to specify the desired generation#.

See GDG generation files documented in Part_5.

alternative to date/time stamp tape files

The default is to convert tape files to GDG generation files, but there is an option to convert to date/time stamped files in a disc directory.

The 'tape' subdir should exist within the $RUNDATA directory. jobset51 performs a 'cd $RUNDATA'.

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

1F4. VSE JCL Conversion to Korn shell scripts - example #5

jgl360.jcl IDCAMS DEFINE CLUSTER - Create VSAM

 j#001 // JOB JGL360    * TEST VSE JCL IDCAMS CONVERSION *
 j#002 *  CREATE VSAM INDEXED FILE
 j#003 // EXEC PGM=IDCAMS,SIZE=AUTO
 j#004    DELETE (GL.ACCOUNT.MASTER2) PURGE CLUSTER CATALOG (USERCAT5)
 j#005    DEFINE CLUSTER (NAME (GL.ACCOUNT.MASTER2) -
 j#006                    INDEXED KEYS(6 0) RECORDSIZE(80) ) -
 j#007                    DATA (NAME (GL.ACCOUNT.MASTER2.DATA) -
 j#008                    INDEX (NAME (GL.ACCOUNT.MASTER2.INDEX) -
 j#009                    CATALOG (USERCAT5)
 j#010 /*
 j#011 /&

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

Most of the IDCAMS functions are not required for Micro Focus COBOL on Unix/Linux/Windows systems. For example 'DEFINE CLUSTER' was required by the mainframe to create a VSAM file, but Micro Focus 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

1F5. VSE JCL Conversion to Korn shell scripts - example #5

jgl360.ksh IDCAMS DEFINE CLUSTER converted to uvcp

k#001 #!/bin/ksh k#002 ##JOB JGL360 * TEST VSE JCL IDCAMS CONVERSION *

             - - - lines 3-11 removed (similar in all output scripts) - - -
 k#014 #1======================== begin step#S0010_IDCAMS =========================
 k#015 S0010=A
 k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 k#017 logmsg2 "Begin Step $JSTEP IDCAMS (#$XSTEP)"
 k#018 stepctl51  # test oprtr jcpause/jcclear
 k#019 export PROGID=IDCAMS
 k#020 export PARM="";
 k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 k#022 logmsg1 " CREATE VSAM INDEXED FILE"
 k#023 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}
 k#024 cat > $SYSIN <</*EOD
 k#025    DELETE (GL.ACCOUNT.MASTER2) PURGE CLUSTER CATALOG (USERCAT5)
 k#026    DEFINE CLUSTER (NAME (GL.ACCOUNT.MASTER2) -
 k#027                    INDEXED KEYS(6 0) RECORDSIZE(80) ) -
 k#028                    DATA (NAME (GL.ACCOUNT.MASTER2.DATA) -
 k#029                    INDEX (NAME (GL.ACCOUNT.MASTER2.INDEX) -
 k#030                    CATALOG (USERCAT5)
 k#031 /*EOD
 k#032 ## EXEC PGM=IDCAMS,SIZE=AUTO
 k#033 #3----------------------------------------------------------------------
 k#034 rm -f gl/account.master2
 k#035 uvcp "fili1=wrk/nullfile,typ=RSF,rcs=80,filo1=gl/account.master2,typ=ISF,rcs=80\
 k#036 ,isk1=0(6)"
 k#037 LCC=$?; ((SCC+=LCC));
 k#038 #4----------------------------------------------------------------------
 k#039 S0010C=$SCC; ((JCC+=SCC)); alias goto="";
 k#040 if ((SCC != 0))
 k#041    then logmsg2 "ERR: step $JSTEP IDCAMS abterm $SCC"
 k#042    alias goto="<<S9900=A"; fi
 k#043 goto

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

1G1. VSE JCL conversion to Unix/Linux Korn shell scripts

converting TAPE files to GDG generation files

The VSE mainframe did not have GDG files, but we have found them useful to supply tape generation handling for VSE conversions.

The Vancouver Utility GDG system was enhanced in May 2007, and some features now surpass the mainframe implementation. Please see the complete writeup for the VU GDG system in: 'Part_5' (duplicated here from MVSJCL.doc).

Here in VSEJCL.doc, we will illustrate just 1 JCL TAPE file conversion to GDG files. Later on, after setup & JCL/script conversions in '1P1' thru '1R4', you can run jgcl600.ksh as for other jobs in '1S1' thru '1S3'.

 j#01 // JOB JGL600
 j#02 /* test converting TLBLs to GDG exportgen0/exportgen1
 j#03 /* VSE did not have GDGs, but JCL conversion will use for tape files
 j#04 /* - assumes exportgen1 for OUTput, unless IN or INPUT found as comment
 j#05 // TLBL GLTRANS,'GL.TRANS'      IN
 j#06 // TLBL GLMSOLD,'GL.MASTER'     IN
 j#07 // TLBL GLMSNEW,'GL.MASTER'     OUT
 j#08 // EXEC CGL200
 j#09 /*

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

1G2. VSE JCL conversion to Unix/Linux Korn shell scripts

converting TAPE files to GDG generation files

 k#001 #!/bin/ksh
 k#002 ##JOB JGL600
 k#003 export JOBID2=JGL600; scriptpath="$0"; args="$*"
 k#004 if [[ -z "$JOBID1" ]]; then JOBID1=JGL600; fi; export JOBID1
 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#006 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 exportfile
 k#008 autoload exportgen0 exportgenall exportgenx exportgen1
 k#010 jobset51  # call function to setup: directory equates, UPSI, etc
 k#011 #jobset51 stores any restart step# in alias 'goto'
 k#012 goto
 k#013 S0000=A
 k#014 #1======================== begin step#S0010_CGL200 =========================
 k#015 S0010=A
 k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 k#017 logmsg2 "Begin Step $JSTEP CGL200 (#$XSTEP)"
 k#018 stepctl51  # test oprtr jcpause/jcclear
 k#019 export PROGID=CGL200
 k#020 export PARM="";
 k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 k#022 # /* test converting TLBLs to GDG exportgen0/exportgen1
 k#023 # /* VSE did not have GDGs, but JCL conversion will use for tape files
 k#024 # /* - assumes exportgen1 for OUTput, unless IN or INPUT found as comment
 k#025 exportgen0 GLTRANS tape/gl.acnt.trans_
 k#026 exportgen0 GLMSOLD tape/gl.acnt.master_
 k#027 exportgen1 GLMSNEW $JGDG/tape/gl.acnt.master_
 k#028 #exportgen1 assign to $JGDG/subdir/file, move to subdir/file at Normal EOJ
 k#029 ## EXEC CGL200
 k#030 #3----------------------------------------------------------------------
 k#031 cobrun $ANIM $RLX/cgl200
 k#032 #4----------------------------------------------------------------------
 k#033 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 k#034 if ((SCC != 0))
 k#035    then logmsg2 "ERR: step $JSTEP CGL200 abterm $SCC"
 k#036    alias goto="<<S9900=A"; fi
 k#037 goto
 k#038 #8======================================================================
 k#039 S9000=A
 k#040 jobend51 #move any GDG files from jobtmp/subdirs to RUNDATA/subdirs
 k#041 logmsg2 "EOJ Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 k#042 exit 0  #UVSI jclunix41 ver: 20080930  options: d0e1j1l1p0r0s0t12u1y0
 k#043 #9======================================================================
 k#044 S9900=A
 k#045 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
 k#046 jobabend51 #report GDGs NOT moved from jobtmp/JOBID/GDG to outdirs
 k#047 exit $JCC

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

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

Preparations for JCL test/demo conversions

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


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

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

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

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

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

setup 'vsetest' - plan/overview

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

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

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

    alternative - setup demo files in your homedir

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

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

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

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

setup 'vsetest' - 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 vsetest  <-- setup 'vsetest' for bash
     =======================================

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

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

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

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

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

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

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

You should realize that the above are the minimum setups for vsetest & 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 vsetest home dir


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

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

scripts for your own conversions (vs test/demos)

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


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

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

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

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

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

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

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

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

converting your own JCL ? (vs test/demos)

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

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

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

alternative - setup demo files in your homedir

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

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

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

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


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

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

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

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

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

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

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

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

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

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

JCL conversion overview

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

script to perform all JCL conversion steps

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

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

jcl2ksh41A procedures illustrated

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

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

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

You must stay in the vsetest home directory. The scripts are designed to work with the various subdirs below you so they can copy between the subdirs. Examine your files by addressing thru 1 level of subdir (vi jcl1/xxx). Do not change into the subdirs, do 1 vi,& change back.

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

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

step by step JCL conversion

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

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

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

cleanup mainframe JCL, PROCs,& Control Cards

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


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

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

 #1c. uvcopyx cleanup sli0 slis uop=q0i7g8n1,arg1=.sli     <-- cleanup SLI code
      ================================================
      - strip any CR's, clear cols 73-80,& shorten back to last nonblank
      - ensure output filenames are translated to lower case
      - assign filename extension '.sli'

 #1d. uvcopyx cleanup parm0 parms uop=q0i7g8n1      <-- cleanup parms
      ========================================
      - strip any CR's, clear cols 73-80,& shorten back to last nonblank
      - ensure output filenames are translated to lower case (n1)
      - do NOT assign extension on filenames in parms subdir
Note
  • the 'cleanup' job has many more options than used here (uop=q0i7g8n1)
  • Please see all options listed on page CNVaids.htm#2D1.
  • You may find other problems in the mainframe files that can be solved
    by using the various options available.

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

expand PROCs & SLIs in all JCL


 #2.  jclpx41 jcl1 jcl2 procs slis
      ============================
      - copy all jcl from jcl1 to jcl2,
      - expanding procs from arg3 & SLIs from arg4

 #2a. jclpx41 jcl1 jcl2 jcl1 jcl1
      ===========================
      - use this command if JCL, PROCs,& SLIs are all in 1 library

Creating the DataFile Info control file


 #3.  uvcopy jcldata41,fild1=jcl2,filo2=ctl/datafiles41
      =================================================
      - generate Data Info file (extracts filenames from all JCL)

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

 #4a. >ctl/datafiles42   <-- create null file for datafile info overrides
      ================

 #4b. sortload43I        <-- create datafile info control file to supply
      ===========            record sizes, keys, file types to JCL converter

Creating the datafile info control file

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

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

If desired you may edit ctl/datafiles42 to add to or override the info available in the existing JCL. Script 'sortload43I' (#4b above) will sort this override file with datafiles41 & indexed file ctl/datafiles43I for random lookup by the JCL converter.

For these test/demos in Part 1 just create a null file for datafiles42 & run the sortload43I script.

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

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

Modifying JCL conversion options - unix/linux

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

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

Modifying JCL conversion options - Windows

If you are testing on windows SFU, Cygwin, or Uwin, you must change option 'r' in the control file (ctl/jclunixop41), 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/jclunixop41. The control file is supplied with option 'r0' to generate 'cobrun' for Micro Focus COBOL Server Express on Unix/Linux systems. 'r1' will cause the converter to generate 'cobw' which is the equivalent for Micro Focus COBOL Net Express on Windows.


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

 jclunixop41:d0e1r0t7u1    #<-- 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

Operating Instructions - Convert ALL JCLS in directory


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

'jclxx41' is a script that executes the 'jclunix4' conversion program for each file found in input subdir & copy results to output subdir. jclxx41 requires control files: ctl/jclunixop41, ctl/listcat3I,& ctl/datafiles43I.


 #6. 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 jclunixop41), the converter converts all JCL from jcl2 to jcl3 (never to jcls). Then you will manually copy desired jobs from 'jcl3' to 'jcls'.

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

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

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

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

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


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

 #1a. uvcopy cleanup,fili1=jcl0/JAR100.jcl,filo1=jcl1/jar100.jcl,uop=g8n1,arg1=.jcl
      =========================================================================
      - 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/PAR100,filo1=procs/par100.prc,uop=g8n1
      ==================================================================
      - cleanup PROCs
      - strip CR's, clear cols 73-80,& shorten back to last nonblank

 #2.  jclproc41 jcl1/jar100.jcl jcl2/jar100.jcl procs slis
      ====================================================
      - expand procs as we copy jcl from subdir jcl1 to subdir jcl2
      - arg3 is the PROC directory & we presume all PROCs are stored
      - arg4 is the SLI directory & we presume all SLI JCLs are stored
        (arg4 could be 'jcl1' the same directory as the input file)

 #3.  uvcopy jcldata41,fild1=jcl2,filo2=ctl/datafiles41
      =================================================
      - generate Data control file (extracts filenames & types form JCL)
      - may add record-size & indexed file keys to improve conversions
      - this job processes the entire directory (not just 1 jcl)

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

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

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

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

Converting 1 JCL at a time

Script 'jcl2ksh41' is provided to convert 1 JCL at a time. 'jcl2ksh41' is listed on page '3F1', and performs the same functions (with 1 command) as the multiple separate steps documented on the previous page.

You would initially convert all JCLs as documented on pages 1Q1 thru 1Q6, but jcl2ksh41 is useful for JCL's subsequently transferred due to updates on the mainframe during the conversion & testing period.

'jcl2ksh41' assumes that all PROCs & SLI members are already present in procs & slis, and that ctl/datafiles41 includes all filenames used.

Here is an example using jcl2ksh41 to convert JCL JAR100.


 jcl2ksh41 jcl0/JAR100.jcl    <-- convert 1 JCL at a time
 =========================
 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      prompt & copy

prompt/overwrite warning

The final destination is 'jcls' where JCL/scripts must be copied to be found by the search PATH. Before overwriting any existing JCL/script, you will be prompted to answer 'y' or 'n'.

If you had made substantial modifications to the existing script, you might want to answer NO. Then you could save modified parts of existing script (in tmp subdir), copy the new script from jcl3 to jcls, then edit the new script in jcls & read in modified parts of the previous script from the saved version (or vice versa if it were easier to read new parts into the existing).

Note
  • see script 'jcl2ksh41' (1 at a time) listed on page '3F1'.
  • also see 'jcl2ksh41A' (All JCLs) listed on page '3F3'.

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

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

Converting Mainframe COBOL to Unix/Linux

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

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

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

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

converting All Copybooks & COBOL programs

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

scripts to perform all COBOL conversion steps


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

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

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

1R2. Converting Mainframe COBOL to Micro Focus - Test/Demo Op. Instrns.

step by step procedures for COBOL conversion

Converting Mainframe COBOL CopyBooks to Unix/Linux

First we will convert the CopyBooks, then the COBOL Programs (on the next page). Our test/demo mainframe copybooks are stored in subdir 'cpy0'. The instructions in Part 3 of VSECOBOL.doc recommended the following procedure:

 cpy0--------->cpy1---------->cpy2--------->cpys
      cleanup       convert        copy(cp)

 #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=q0i7c5e15g8j1k1l3n1s8t1,arg1=.cpy
     ===============================================================
Note
  • See page CNVaids.htm#2D1 for explanations of the options coded above.
  • You only need 's8g8n1' for these demo copybooks.

 #2.  uvcopy cnvMF4,fild1=cpy1,fild2=cpy2,fili3=ctl/cnvcob4.tbl,uop=q0i7m2
      ====================================================================
            - convert COBOL CopyBooks for Unix/Linux Micro Focus 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 #2 & #3 above
       ==============

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

1R3. Converting Mainframe COBOL to Micro Focus - Test/Demo Op. Instrn s.

Convert ALL COBOL programs - Overview

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-------->xref---------->cbl2-***---------->cbls-------->cblx
  #1.cleanup  #2.Id OLS files  #4.convert     #5/6  #7.copy     #8.compile

'***' represents optional conversions for sysin & sysout (see Notes below)

step#1 - cleanup code

step 2&3 - Identify Org Line Seqntl files

The COBOL converter (cnvMF4) provides option 'l1' to lookup an indexed file to identify printer files as 'ORGANIZATION LINE SEQUENTIAL' on 'select' stmnts. Option 'l1' identifies files as 'OLS' if they have 'advancing' on any 'write's, or if the record-size is 133 for outputs, or 80 for inputs. If disabled (l0) the converter would use a table of keywords commonly used in printer & card filenames (print,report,rpt,card,etc). See steps #2 & #3 on the next page (required for option 'l1')

'uvcopy cobfil45' scans all COBOL programs looking for OLS criteria and writes a file (xref/cobfil45a) to identify these files keyed by programname & filename. 'uvsort' is then used to sort & load these records into an indexed file (xref/cobfil45I) for lookup by 'uvcopy cnvMF4'.

Note
  • Jan2010, all cobfil4_ jobs replaced by cobfil5_ jobs, EXCEPT 'cobfil45'
  • to remove unnecessary redundancy (VSE 4_ jobs were same as MVS 5_ jobs)
  • cobfil45 has 'positioning' code, might be moved into 'cobfil55' in future

step 5&6 - optional replacements for SYSIN & SYSOUT

MicroFocus COBOL has options INDD & OUTDD to cause 'ACCEPTs from SYSIN' & 'DISPLAYs upon SYSOUT' to use external files defined by exports for SYSIN & SYSOUT. Please see a test/demo program & JCL begining on page 2F1 of MVSCOBOL.htm#2F1 & the ctl/cobdirectives (options file) on page 5D1.

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

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

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

1R4. Converting Mainframe COBOL to Micro Focus - Test/Demo Op. Instrn s.

Convert ALL programs with option l1 for ORG LINE SEQNTL


 #1. uvcopyx cleanup cbl0 cbl1 uop=q0i7c5e15g8j1k1l1n1s8t1,arg1=.cbl
     ===============================================================
     - cleanup mainframe code, remove CRs, clear cols 1-6 & 73-80, etc

 #2. uvcopy cobfil45,fild1=cbl1,filo2=xref/cobfil45a,uop=q0i7,rop=r0
     ===============================================================
     - scan all programs looking for 'write advancing's
     - create sequential file of file types keyed by program + filename

 #3. uvsort "fili1=xref/cobfil45a,rcs=100,typ=LST,filo1=xref/cobfil45I,typ=ISF\
             ,key1=0(44),isk1=0(44),del1=0(1):*"
     ==========================================================================
     - sort & load sequential file into indexed file for lookup by cnvMF4

 #4. convert mainframe COBOL to Micro Focus COBOL

 #4a. uvcopy cnvMF4,fild1=cbl1,fild2=cbl2,fili3=ctl/cnvcob4.tbl\
     ===========================================================
             ,fili4=xref/cobfil45I,uop=q0i7m1l1
             ==================================

 #4b. uvcopy cnvMF4   <-- easy alternative (files & options default as above)
      =============

optional sysin1 & sysout1


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

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

Optional steps #5 & #6 are not required for Micro Focus COBOL using options INDD & OUTDD. See the 'cobdirectives' file listed at VSECOBOL.htm#5D1.

copy & compile


 #7. copy converted programs to subdir 'cbls' for compile script (mfcblA).

 #7a. cp cbl2/* cbls  - copy from cbl2 if SYSIN/SYSOUT replacements NOT required
      ==============
 #7b. cp cbl3/* cbls  - copy from cbl3 if SYSIN required but not SYSOUT
      ==============
 #7c. cp cbl4/* cbls  - copy from cbl4 if both SYSIN/SYSOUT replacements ARE required
      ==============

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

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

1R5. Converting Mainframe COBOL to Micro Focus - Test/Demo Op. Instrns.

COBOL Compile Error reports

Here is a sample console log from 'mfcblA' (compile all programs in directory).


 #8. mfcblA all      - compile all programs, input from subdir cbls, output to
     ==========        subdir cblx: .int, .idy, .err,& .cbl (copy for animation)

mfcblA started 050317:1236 start compile of: car100.cbl

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

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

#compile #3 - car130.cbl start compile of: car200.cbl

#compile #4 - car200.cbl start compile of: car300.cbl

#compile #5 - car300.cbl start compile of: cgl100.cbl

#compile #6 - cgl100.cbl start compile of: cgl200.cbl

#compile #7 - cgl200.cbl start compile of: cpy100.cbl

 #compile #8 - cpy100.cbl
 *   8-S*****************************                                   (   0)**
 **    Unknown COPY file paymas.cpy specified
 **    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 #8 - cpy100.cbl - *FAILED*
 *** 1 compiles failed, of 8 attempts of 8 total ***
 programs compiled from cbls to cblx
 copylibs=/home/vsetest/cpys:/cpys:/cpys
 compile options file=/home/vsetest/ctl/cobdirectives
 mfcblA started 050317:1236, ended 050317:1236
Note
  • The 1 compile failure is intentional to show you the error report
  • error reports are captured in the compiler output directory
  • the error report for program cpy100.cbl would be cblx/cpy100.err

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

1R6. Converting Mainframe COBOL to Micro Focus - Test/Demo Op. Instrns.

printing compile failure reports

The 'mfcbl1' & 'mfcblA' compile scripts leave the .err reports in the 'cblx' output directory. You can use the 'uvlpd1p' script to print the first page of each .err file in the cblx subdir as follows:


 #9. uvlpd1p cblx .err      <-- print 1st page of all .err reports
     =================

Compile Error Summaries

There could be a lot of errors on the 1st mass compile after conversion. 'cblerrs1' & 'cblerrs2' are provided to extract only the 1st few lines from each .err file into 1 file & to create table summary counts of errors by failure reason.

but here is a brief summary of the operating instructions:


 #10a. uvcopy cblerrs1   <-- extract 5 lines from each .err file
       ===============     - write summary file to errs/cblerrs1.rpt

 #10b. uvcopy cblerrs2   <-- sort by failure reason & create summary table
       ===============

 #10c. uvlp12 errs/cblerrs2.tbl <-- print table summary counts by failure reason
       ========================

 #10d. uvlp12 errs/cblerrs2.rpt  <-- print report sorted by failure reason
       ========================

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.

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 profile (listed at ADMjobs.htm#1C2), defines COBDIR as follows:


 export COBDIR=/home/cobadm/cobol
 ================================

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

 /home/vsetest
 :-----testlibs        <-- $RUNLIBS
 :     :-----cblx        - compiled COBOL programs (.int's)
 :     :-----jcls        - copy here manually 1 by 1 during test/debug
 :     :-----sfun        - korn shell functions (jobset51,logmsg,etc)

export RUNDATA=/home/vsetest/testdata

 /home/vsetest
 :-----testdata        <-- $RUNDATA
 :     :-----ap          - Accounts Payable
 :     :-----ar          - Accounts Receivable
 :     :-----gl          - General Ledger
 :     :-----jobtmp      - temporary files for SYSIN instream data
 :     :-----rpts     - SYSOUT printer files
 :     :-----tmp         - tmp subdir for uvsort
 :     :-----wrk         - interstep temporary work files

Executing the test/demo JCL/scripts

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

jar100.ksh
  • simple 1 step COBOL (no PROCs, no instream data)
jar200.ksh
  • 2 steps (SORT+COBOL), uses instream data for SORT FIELDS
jgl100.ksh
  • 1 step COBOL, demos: PROCS
jgl200.ksh
  • 2 steps (SORT+COBOL),
jgl300.ksh
  • demos conversion of IEBGENER & IDCAMS to 'uvcp' & 'cp'
  • demonstrates CONDition codes
jgl320.ksh
  • same as jgl300, but also demos IF, THEN, ENDIF
jgl600.ksh
  • test/demo for GDG files
  • option to convert tape files to GDG generation files
  • see VU GDG system documented in 'Part_5'

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

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

1S2. Executing the Test/Demo JCL/scripts

BEFORE attempting to Test/Debug YOUR JCL/scripts

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

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

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


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

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

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

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

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

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

Three Ring Binders with Index Tabs

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

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

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

1S3. Executing the Test/Demo JCL/scripts

Execute demo scripts & observe Console Displays


 jar100.ksh
 ==========
 060206:094543:JAR100: Begin Job=JAR100
 060206:094543:JAR100: RUNDATA=/home/vsetest/testdata RUNLIBS=/home/vsetest
 060206:094543:JAR100: JTMP=jobtmp/JAR100 SYOT=sysout
 060206:094543:JAR100: RUNDATE=20060206
 060206:094543:JAR100: Begin Step S0010 car100 (#1)
 060206:094543:JAR100:  TEST/DEMO JCL/COBOL TO CREATE CUSTOMER NAME & ADDRESS LISTING
 060206:094543:JAR100: file: CUSTMAS=ar/customer.master
 060206:094543:JAR100: file: NALIST=ar/customer.nameadrs.list100
 060206:094544:JAR100: Job Times: Begun=09:45:43 End=09:45:44 Elapsed=00:00:01
 060206:094544:JAR100: Normal EOJ StepsExecuted/Last=1/S0010

 jar200.ksh
 ==========
 060206:094552:JAR200: Begin Job=JAR200
 060206:094552:JAR200: RUNDATA=/home/vsetest/testdata RUNLIBS=/home/vsetest
 060206:094552:JAR200: JTMP=jobtmp/JAR200 SYOT=sysout
 060206:094552:JAR200: RUNDATE=20060206
 060206:094552:JAR200: Begin Step S0010 sort (#1)
 060206:094552:JAR200:  PAR200 - TEST/DEMO VSE JCL CONVERT (PROC CALLED BY JAR200)
 060206:094552:JAR200:  SORT SALES ITEMS BY PRODUCT#(MAJOR) & CUSTOMER#(MINOR)
 060206:094552:JAR200: file: SORTIN1=ar/sales.items
 060206:094552:JAR200: file: SORTOUT=jobtmp/JAR200/%sales.sortfile
 060206:094552:JAR200: file: SYSIN=jobtmp/JAR200/S0010_sort
 060206:094552:JAR200: uvsort fili1=ar/sales.items,filo1=jobtmp/JAR200/%sales.sortfile
 060206:094552:JAR200: EOF fili01 20 rds, 1280 size; ar/sales.items
 060206:094552:JAR200: sort phase complete, used 64 megabytes, sort output begin
 060206:094552:JAR200: EOF filo01 20 wrts, 1280 size; jobtmp/JAR200/%sales.sortfile
 060206:094552:JAR200:  STEP2 - LIST SALES ITEMS BY PRODUCT#
 060206:094552:JAR200: Begin Step S0020 car200 (#2)
 060206:094552:JAR200: PARM=MARCH 11, 2005
 060206:094552:JAR200: file: SYSOUT=sysout/JAR200_S0020_car200
 060206:094552:JAR200: file: SALEDTL=jobtmp/JAR200/%sales.sortfile
 060206:094552:JAR200: file: CUSTMAS=ar/customer.master.indexed
 060206:094552:JAR200: file: SYS035=rpts/salesrpt_E_car200_S0020_01_060206094552
 060206:094552:JAR200: file: SYSIN=jobtmp/JAR200/S0020_car200
 060206:094552:JAR200: Job Times: Begun=09:45:52 End=09:45:52 Elapsed=00:00:00
 060206:094552:JAR200: Normal EOJ StepsExecuted/Last=2/S0020
  1. Please see the JCL/scripts listed on pages '1C2' & '1E3' if you wish to relate the console displays to the originating lines in the 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.

  4. Data Filenames are displayed, prefixed by 'file:'. (accomplished by function 'exportfile')

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/vsetest
 :-----testdata            <-- super directory for test libraries
 :     :-----cblx            - executable (compiled) COBOL programs
 :     :-----jcls            - JCLs converted to Korn shell scripts
 :     :-----sfun            - Korn shell common functions called by scripts
 :-----testdata            <-- super directory for test/data subdirs & files
 :     :-----ar
 :     :     :--I--customer.master
 :     :     :--O--customer.namelist     <-- report created by jar100.ksh
 :     :     :--I--sales.items
 :     :-----gl
 :     :     :--O--account.acntlist      <-- report created by jgl100.ksh
 :     :     :--I--account.master_0001
 :     :     :--I--account.master_0002
 :     :     :--I--account.master_0003
 :     :     :--O--account.master_0004   <-- updated master from jgl200.ksh
 :     :     :--O--account.master_0005   <-- new generation from jcl300.ksh
 :     :     :--O--account.master_0006   <-- new generation from jcl320.ksh
 :     :     :--I--account.trans
 :     :-----jobtmp                      <-- temp files for SYSIN instream data
 :     :     :--O--JAR200_1_sort_SYSIN   <-- instream data stored by jar200.ksh
 :     :     :--O--JGL200_1_sort_SYSIN   <-- instream data stored by jgl200.ksh
 :     :-----rpts
 :     :     :-----040429                <-- subdir for today's SYSOUT files
 :     :     :     :-----SYSOUT.files... <-- no SYSOUTs created in these tests
 :     :-----tmp                         <-- temp files for uvsort & misc use
 :     :-----wrk
 :     :     :--O--JAR200_tempsls        <-- sorted sales.items from jar200.ksh
 :     :     :--O--JGL200_tempglt        <-- sorted GLtransctns from jgl200.ksh
 :     :     :--O--JGL300_tempglm        <-- copy out backup from jgl300.ksh
 :     :     :--O--JGL320_tempglm        <-- copy out backup from jgl320.ksh

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

1T2. Checking Test/Demo Output Results

Check I/O for jar100.ksh


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

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

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

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

1T3. Checking Test/Demo Output Results

jar100/car100 - sample output report


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

CAR100: CUSTOMER NAME & ADDRESS LIST 080322

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

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

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

1T4. Checking Test/Demo Output Results

Check I/O for jcls/jar200.ksh

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

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


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

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


 #2. uvcopy listrec2,fili1=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 2  21 940802 IN111001  HAM001  000020 0000001 000000020
 130140 2  21 940802 IN111001  SCR012  000021 0001001 000021021
 130140 2  21 940802 IN111001  CHR001  000022 0002001 000044022
 139923 2  35 950802 IN111002  TAB013  000023 0003001 000069023
 139923 2  35 950807 IN111002  TAB013  000024 0004001 000096024
 150825 2  44 960804 IN1122    HAM001  000025 0005001 000125025
 150825 2  44 960804 IN1122    HAX129  000026 0006001 000156026
 201120 2  44 970807 CR5234    WHIP75  000027 0007001 000189027
 223240 2  65 980816 CR955     HAM001  000028 0008001 000224028
 223240 2  65 980816 IN441     BBQ001  000029 0009001 000261029
 308685 2  21 990812 IN6605    SAW051  00001p 0000001 00000001p
 308685 2  21 990812 IN6605    WHIP75  00001q 0001001 00001101q
 308685 2  21 990812 CR8835    TAB013  00001r 0002001 00002401r
 315512 2  44 000805 IN2251    HAM001  00001s 0003001 00003901s
 315512 2  44 000805 IN2251    SAW051  00001t 0004001 00005601t
 315512 2  44 000805 IN2255    WHIP75  00001u 0005001 00007501u
 400002 2  85 010812 CR245     HAX129  00001v 0006001 00009601v
 406082 2  35 020815 IN33001   BBQ001  00001w 0007001 00011901w
 406082 2  35 020815 IN33001   TAB013  00001x 0008001 00014401x
 406082 2  65 020816 IN441     HAM001  00001y 0009001 00017101y
 ==============================================================
 cust#   slsmn date  invoice   product  qty    price    amount

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

1T5. Checking Test/Demo Output Results

run jar200.ksh & inspect Output


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

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

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

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

1T6. Checking Test/Demo Output Results

gl/account.master_ GDG file

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


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

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

1T7. Checking Test/Demo Output Results

run jgl00.ksh & inspect Output


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

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

gl/account.acntlist_000000

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

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

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

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

UV Console Logging Features

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

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

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

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

    Console Log Collection subdirs

 /home/appsadm
 :-----log1                        <-- log1 superdir for logs in progress
 :     :-----user1                 <-- subdir for each userid to be logged
 :     :-----user2
 :     :-----vsetest
             :------030925:080115  <-- sample logfile in progress
             :
 :-----log2                        <-- log2 superdir for current month
 :     :-----user1
 :     :-----user2
 :     :-----vsetest
             :------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)
 :     :-----vsetest

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 profile as for vsetest (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 'vsetest' is the only one required.

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

  4. Logout & back into 'vsetest' 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

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

 5b. jar200.ksh
     ==========
  1. Logoff & back on to process the logfile from log1/vsetest to log2/vsetest (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 vsetest  users      495823 Sep 21 13:01 030921:102652
 -rw-rw-r--    1 vsetest  users       69075 Sep 22 07:11 030922:130116
 -rw-rw-r--    1 vsetest  users      253990 Sep 23 09:02 030923:074559
 -rw-rw-r--    1 vsetest  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/vsetest' subdir.

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

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

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

Console Log from demo JCL/scripts

Script started on Mon 06 Feb 2006 09:53:35 AM PST

 <@:vsetest:/home/vsetest> jar100.ksh
 060206:095339:JAR100: Begin Job=JAR100
 060206:095339:JAR100: Arguments:
 060206:095339:JAR100: RUNDATA=/home/vsetest/testdata RUNLIBS=/home/vsetest
 060206:095339:JAR100: JTMP=jobtmp/JAR100 SYOT=sysout
 060206:095339:JAR100: RUNDATE=20060206
 060206:095339:JAR100: Begin Step S0010 car100 (#1)
 060206:095339:JAR100: file: SYSOUT=sysout/JAR100_S0010_car100
 060206:095339:JAR100:  TEST/DEMO JCL/COBOL TO CREATE CUSTOMER NAME & ADDRESS LISTING
 060206:095339:JAR100: file: CUSTMAS=ar/customer.master
 060206:095339:JAR100: file: NALIST=ar/customer.nameadrs.list100
 060206:095339:JAR100: Job Times: Begun=09:53:39 End=09:53:39Elapsed=00:00:00
 060206:095339:JAR100: Normal EOJ StepsExecuted/Last=1/S0010
 <@:vsetest:/home/vsetest> jar200.ksh
 060206:095345:JAR200: Begin Job=JAR200
 060206:095345:JAR200: Arguments:
 060206:095345:JAR200: RUNDATA=/home/vsetest/testdata RUNLIBS=/home/vsetest
 060206:095345:JAR200: JTMP=jobtmp/JAR200 SYOT=sysout
 060206:095345:JAR200: RUNDATE=20060206
 060206:095345:JAR200: Begin Step S0010 sort (#1)
 060206:095345:JAR200: file: SYSOUT=sysout/JAR200_S0010_sort
 060206:095345:JAR200:  PAR200 - TEST/DEMO VSE JCL CONVERT (PROC CALLED BY JAR200)
 060206:095345:JAR200:  SORT SALES ITEMS BY PRODUCT#(MAJOR) &CUSTOMER#(MINOR)
 060206:095345:JAR200: file: SORTIN1=ar/sales.items
 060206:095345:JAR200: file: SORTOUT=jobtmp/JAR200/%sales.sortfile
 060206:095345:JAR200: file: SYSIN=jobtmp/JAR200/S0010_sort
 060206:095345:JAR200: uvsort fili1=ar/sales.items,filo1=jobtmp/JAR200/%sales.sortfile
 060206:095345:JAR200: EOF fili01 20 rds, 1280 size; ar/sales.items
 060206:095345:JAR200: sort phase complete, used 64 megabytes, sort output begin
 060206:095345:JAR200: EOF filo01 20 wrts, 1280 size; jobtmp/JAR200/%sales.sortfile
 060206:095345:JAR200:  STEP2 - LIST SALES ITEMS BY PRODUCT#
 060206:095345:JAR200: Begin Step S0020 car200 (#2)
 060206:095345:JAR200: PARM=MARCH 11, 2005
 060206:095345:JAR200: file: SYSOUT=sysout/JAR200_S0020_car200
 060206:095345:JAR200: file: SALEDTL=jobtmp/JAR200/%sales.sortfile
 060206:095345:JAR200: file: CUSTMAS=ar/customer.master.indexed
 060206:095345:JAR200: file: SYS035=rpts/salesrpt_E_car200_S0020_01_060206095345
 060206:095345:JAR200: file: SYSIN=jobtmp/JAR200/S0020_car200
 060206:095345:JAR200: Job Times: Begun=09:53:45 End=09:53:45Elapsed=00:00:00
 060206:095345:JAR200: Normal EOJ StepsExecuted/Last=2/S0020

<@:vsetest:/home/vsetest> exit exit Script done on Mon 06 Feb 2006 09:53:47 AM PST

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

1U4. Console Logging Temporary Alternative

joblog1 - capture logs via 'tee'

Console logging is highly recommended (especially for production) since it captures everything that happens on the screen, including operator commands & replies to prompts.

But until you get console logging activates, you could use the joblog1 script (provided in /home/uvadm/sf/IBM/...).

These scripts capture the JCL/script screen displays into a file using the unix/linux 'tee' command. The log filename is created by dropping the '.ksh' extension from the jobname & then appending '.log'.

joblog1

 # joblog1 - run a JCL/script & capture a log file (via tee)
 #         - names the log file by dropping the .ksh & appending .log
 # - writes the logfile into subdir 'joblog' (creates it if not present)
 # - prompts for command to view/print (vi,cat,more,uvlp12,etc)
 #   &/or optionally (save) with a date/time stamp
 #Feb12/10 - reduce to 1 version (joblog1)
 #         - writes to joblog/... wherever you are
 # This script intended only for test/debug when console logging not activated
 # - Console logging is better because it captures everything that happens,
 #   including operator commands & replies to prompts.
 # - to activate console logging, see: www.uvsoftware.ca/admjobs.htm#Part_6
 #
 sf="$1"     # capture the script filename with extension (jclname.ksh)
 if [[ ! -f $RUNLIBS/jcls/$sf ]]
    then
    echo "usage: joblog1 jclname.ksh [args] <-- file not found $RUNLIBS/jcls/$sf"
    echo "       ========================="
    exit; fi
 #
 # setup joblog directory pathname & make joblog subdir if not existing
 #Feb12/10 - use joblog/ wherever you are
 # ld=$RUNLIBS/joblog    # setup joblog directory pathname
 ld=joblog               # setup joblog directory pathname
 if [[ ! -d $ld ]]; then mkdir $ld; fi
 #
 # create logfilename by dropping .ksh & appending .log
 f=${sf%\.*}           # drop extension .ksh from JCL/script filename
 lf=$f.log             # add extension .log to create logfilename
 #
 $sf $2 2>&1 | tee $ld/$lf
 #========================
 echo "enter command to view, print, and/or save logfile"
 echo "logfile: $ld/$lf"
 echo "--> vi,cat,more,uvlp12,etc, and/or 'save' to date/time stamp"
 read reply
 if [[ "$reply" == *save* ]]; then
    cp $ld/$lf $ld/${lf}_$(date +%y%m%d_%H%M%S); fi
 cmd=${reply%save*}
 if [[ -n "$cmd" ]]; then $cmd $ld/$lf; fi
 exit 0

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

Part_2 JCL/COBOL/DATA Conversion Aids

Conversion Aids

Note
  • the conversion aids are in a separate document CNVaids.htm, which
    should be useful to JCL, COBOL,& DATA conversions
  • references below are all links into the common CNVaids.htm

Introduction & Overview

This document is intended to make you aware of the many conversion, testing, & debugging aids supplied by the Vancouver Utilities, that should help you to convert mainframes to unix/linux.

I believe you will find many of these aids essential to the success of your conversion, testing,& debugging.

These aids were originally in several documents (MVSJCL,MVSCOBOL,MVSDATA,etc). In January 2008, a separate document (CNVaids) was created to avoid the duplications in the original documents, which now have links to CNVaids.htm.

Many of these aids are illustrated using supplied test/demo files & you can run many of these once you have installed the Vancouver Utilities. These 'practice sessions' will help you when you start working on your own conversions of JCL, COBOL,& DATA files.

Links to other documents

The intention is to give you a short introduction to the various utilities available, and then give you a link to the complete documentation which could be in various other books.

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

CNVaids.doc Vancouver Utility Conversion Aids

Unix/Linux Aids - Contents

CNVaids.htm#1A1 Profiles

stub_profile
  • modify & copy to user homedirs
common_profile
  • called by 'stub_profile'

CNVaids.htm#1B1 aliases

CNVaids.htm#1C1 Rename scripts

CNVaids.htm#1D1 dtree

CNVaids.htm#1E1 llr

CNVaids.htm#1F1 statdir1

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

Unix/Linux Aids - Contents

CNVaids.htm#1G1 diff

CNVaids.htm#1G2 alldiff

CNVaids.htm#1H1 grep

CNVaids.htm#1I1 dos2unix

CNVaids.htm#1I1 unix2dos

CNVaids.htm#1J1 Vancouver Utility backup scripts scheduled by cron

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

CNVaids.doc Vancouver Utility Conversion Aids

Vancouver Utility General Purpose Aids - Contents

CNVaids.htm#2A1 uvlp__

CNVaids.htm#2B1 listall

CNVaids.htm#2C1 spreadA

CNVaids.htm#2D1 cleanup

CNVaids.htm#2E1 verifytext

CNVaids.htm#2F1 grepsum1

CNVaids.htm#2G1 scan/replace

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

CNVaids.doc Vancouver Utility Conversion Aids

Cross-References - COBOL & JCL/scripts

CNVaids.htm#3A1 cross-refs summary

CNVaids.htm#3B1 - xrefall generate ALL Cross-Ref reports

CNVaids.htm#3B2 - xref... generate any 1 Cross-Ref report

COBOL Cross-Ref sample reports

 CNVaids.htm#3C1 - xcobcopy1 list all COPYBOOKS in any 1 PROGRAM
 CNVaids.htm#3C1 - xcobcopy2 crossref all PROGRAMS copying any 1 COPYBOOK
 CNVaids.htm#3C2 - xcobcall1 list of all CALLED-PROGRAMs in each PROGRAM
 CNVaids.htm#3C2 - xcobcall2 crossref all PROGRAMS calling any 1 CALLED-PROGRAM
 CNVaids.htm#3C3 - xcobfile2 crossref all PROGRAMS using each external-file
 CNVaids.htm#3C4 - xcobsql1 list all SQL Includes in any 1 PROGRAM
 CNVaids.htm#3C4 - xcobsql2 crossref all PROGRAMS using any 1 SQL Include

JCL Cross-Ref sample reports

CNVaids.htm#3D1 - xkshfile1 list all DATAFILES used in any 1 ksh SCRIPT CNVaids.htm#3D1 - xkshfile2 crossref show all SCRIPTs using any 1 DATAFILE CNVaids.htm#3E1 - xkshprog1 list all PROGRAMs executed in any 1 ksh SCRIPT CNVaids.htm#3E1 - xkshprog2 crossref show all SCRIPTS executing any 1 PROGRAM

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

CNVaids.doc Vancouver Utility Conversion Aids

Table Summaries & Statistics - Contents

CNVaids.htm#4B1

statallmvs1
  • table summaries of COBOL, MVS JCL,& Korn shell scripts
statallvse1
  • same, but for VSE JCL
statmvsjcl1
  • table summarize mainframe JCL programs & files
  • counts each program & top-node used in all JCLs
statvsejcl1
  • same, but for VSE JCL
statksh1
  • table summarize converted scripts programs & files
  • counts each program & top-node used in all scripts

CNVaids.htm#4C1 - statlogin1

CNVaids.htm#4D1 - table2

CNVaids.htm#4D2 - table3d

CNVaids.htm#4E1 - 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#5F1 - Micro Focus COBOL 'file status' error codes

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

http://supportline.microfocus.com/Documentation/books/sx40sp1/smpubb.htm

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

CNVaids.doc Vancouver Utility Conversion Aids

JCL/script Test/Debug Aids - Contents

CNVaids.htm#6A1 - jobflow51

CNVaids.htm#6B1 - joblog

CNVaids.htm#6C1 - separate datafiles

CNVaids.htm#6D1 - lastgenr

CNVaids.htm#6E1 - getEtime

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

CNVaids.doc Vancouver Utility Conversion Aids

Data File Aids - Contents

CNVaids.htm#7A1 uvhd

CNVaids.htm#7B1 uvhdcob

CNVaids.htm#7B2 uvhdc

CNVaids.htm#7C1 uvcp

CNVaids.htm#7D1 uvcpF2L

CNVaids.htm#7D2 uvcpL2F

CNVaids.htm#7E1 CMPjobs

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

CNVaids.doc Vancouver Utility Conversion Aids continued

Data File Aids - Contents (continued)

CNVaids.htm#7F1 listrec2

CNVaids.htm#7F2 listhex2

CNVaids.htm#7G1 gentest1

CNVaids.htm#7H1 vtocr1

 - create VTOC report for files converted from mainframe
 - provides record counts, indexed keys, etc
 (information not displayed by the usual unix/linux tools)
 - see sample report & operating instructions in MVSDATA.htm

CNVaids.htm#7I1 uvsort

CNVaids.htm#7J1 uxcp

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

CNVaids.doc Vancouver Utility Conversion Aids

Pre-Programmed uvcopy jobs

CNVaids.htm#Part_8 pre-programmed jobs (written in uvcopy code)

CNVaids.htm#8B1 - tabfix1

CNVaids.htm#8C1 - tolower

CNVaids.htm#8D1 - toascii

CNVaids.htm#8E1 - scand2

CNVaids.htm#8F1 - acum1

CNVaids.htm#8G1 - cmrpt1

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

CNVaids.doc Vancouver Utility Conversion Aids

CNVaids.htm#8H1 - selectf1

CNVaids.htm#8J1 - splitjclproc1

CNVaids.htm#8K1 - splitcblcpy1

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

CNVaids.doc Vancouver Utility Conversion Aids

Tips for users new to Unix/Linux - Contents

CNVaids.htm#9A1 vi editor tutorial for users new to unix/linux

CNVaids.htm#9B1 Work in your working directory & address files thru subdirs

CNVaids.htm#9B2 setup a 'tmp/' subdir in your working directories

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

Part_3. Conversion Support Files - profiles, functions, control files, etc

Part3 - Conversion Support Files


3A0. Vancouver Utilities 'uvadm' directories & contents

3B0. Profiles - profiles & related files in /home/uvadm/env/...
3B1. stub_profile - copied to homedirs, renamed as .bash_profile or .profile
- defines RUNLIBS/RUNDATA as testlibs/prodlibs if programmer
or prodlibs/proddata if operator
common_profile - defines PATHs using RUNLIBS/RUNDATA
bashrc/kshrc - required if console logging to define aliases
3B3. modifying stub_profiles for your site

3C0. Functions used in converted JCL/scripts
- jobset51, jobend51, jobabend51, logmsg1, stepctl51, exportfile
- see listings in Part_5 pages '5K1' to '5K3' (GDG file systems)

3D0. Functions for cataloged Generation (GDG) files
- exportgen0, exportgen1, exportgenall
- see listings in Part_5 pages '5J1' to '5J5' (GDG file systems)

3E0. Control Files
3E1. jclunixop41 - options for the JCL/script converter
3E2. - customizing the JCL converter options file for your site
3E3. datafiles41 - data file attributes (used by JCL converter)
3E4. - generating datafiles41 & loading indexed file for JCL converter
3E5. - modifying topnodes (converter makes topnode a sub-dir)

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,& crontabs/backup scripts).

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

3A0. Conversion Support Files - profiles, functions, control files, etc

Vancouver Utilities - contents after install

 /home/uvadm
 :-----batDOS
 :-----bin
 :-----cobs
 :-----ctl            <-- control files used in JCL conversion
 :-----dat1
 :-----doc
 :-----dochtml
 :-----env            <-- environmental profiles
 :-----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
 :-----vsetest
 :     :-----testlibs
 :     :     :-----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      <--- profiles provided here
 :-----stub_profile      - copy/rename to .profile (ksh) or .bash_profile (bash)
 :                       - defines RUNLIBS/RUNDATA for programmers & operators
 :-----common_profile    - common profile (called by stub_profile)
 :                         defines PATH's etc using $RUNLIBS/$RUNDATA
 :-----root_profile      - profile for root, copy to /root/.bash_profile (RedHat)
 :                         to access Vancouver Utility scripts & uvcopy jobs
 :
 /home/appsadm/env    <--- setup user 'appsadm' & copy from /home/uvadm/env/*
 :-----stub_profile      - customize & copy to homedirs .profile or .bash_profile
 :-----common_profile    - common profile (called by stub_profile)

Mainframe conversion sites should setup an application administrator userid 'appsadm', copy /home/uvadm/env/* to /home/appsadm/env,& customize profiles there depending on the locations of their libraries & data.

Do NOT customize profiles in /home/uvadm/env/... because they would be overwritten when a new version of Vancouver Utilities is installed.

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

  1. The supplied 'stub_profile' is copied to homedirs, renamed as '.bash_profile' for bash shell (Linux) & '.profile' for Korn shell (Unix), and then modified depending on whether the user is a programmer or operator. - defines RUNLIBS as testlibs for programmers OR prodlibs for operators - defines RUNDATA as testdata for programmers OR proddata for operators

  2. 'common_profile' then defines the 'PATH's using $RUNLIBS,$COBDIR,$UV,etc For example: export PATH=$PATH:$RUNLIBS/jcls (converted JCL/scripts). Defines software superdirs (uvadm, COBDIR, ORACLE_BASE, ORACLE_HOME, etc)

  3. '$RUNDATA' determines data-file locations indirectly as follows: $RUNDATA defines the superdir housing all data-files. All JCL/scripts call a common function 'jobset51' which changes directory to $RUNDATA (cd $RUNDATA). The JCL converter inserts jobset51 at the begining of all converted JCL/scripts and then addresses all data files relative to $RUNDATA.

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

This system is a big advantage for any site with multiple users, it means the sysadmin can update common_profile once in 1 place & those changes are effective for all users.

See more explanations at: http://www.uvsoftware.ca/admjobs.htm#1B2

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

3B2. profiles for Vancouver Utilities on Unix/Linux

 ADMjobs.htm#1C1 - stub_profile
      - distributed in /home/uvadm/env/...
      - copy (to user homedirs) & rename depending on the desired shell
        (.bash_profile for bash, .profile for ksh)
      - modify RUNLIBS/RUNDATA differently for programmers or operators
        define RUNLIBS as testlibs for programmers OR prodlibs for operators
        define RUNDATA as testdata for programmers OR proddata for operators
      - contains user aliases, preferences, console logging on or off
      - modify TERM & 'stty erase' character depending on user's terminal
      - modify UVLPDEST to define a laser printer near the user
      - calls common_profile
 ADMjobs.htm#1C2 - common_profile, called by stub_profile
      - defines search PATHs to libraries & data based on $RUNLIBS & $RUNDATA
      - distributed in /home/uvadm/env/...
      - you should copy to /home/appsadm/env/ & customize there
        (to avoid overwriting when new versions of VU installed)
      - contains most items, allows updates in 1 place for all
      - modify TERM & 'stty erase' character depending on user's terminal
        (distribution has TERM=linux & stty erase '^?')
      - the common_profile should be correct for the majority of users
        & the stub profiles can be modified for the exceptions
      - change 'COBDIR' depending on where you have installed Micro Focus COBOL
 ADMjobs.htm#1C6 - bashrc
      - 'rc file' distributed in /home/uvadm/env/...
      - copy (to user homedirs) & rename depending on the desired shell
        (.bashrc for bash, .kshrc for ksh)
      - master version supplied without the '.' for visibility
      - required if you invoke another shell level (console logging script)
      - carries aliases & umask which get lost on another shell level
      - you should customize & store in /home/appsadm/env/...

See profile listings starting at ADMjobs.htm#1C1

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

3B3. conversion support files - profiles

customizing the profile for Unix/Linux conversions

  1. Modify TERM & 'stty erase' character depending on user's terminal (distribution has TERM=linux & stty erase '^?')

      export TERM=linux       # TERM - modify depending on your terminal
      #================       # (vt100,xterm,at386,ansi,etc)
      stty erase '^?'         # erase char - modify depending on your terminal
      #==============         #  '^?' for linux/at386, '^H' for vt100,ansi,xterm
  1. Change the laser printer name defined by 'UVLPDEST' (environmental variable used by uvlist (file list scripts uvlp12, etc), and by uvhd (hexdump file investigation utility).

      export UVLPDEST="-dlp0"     <-- change 'lp0' to your laser printer
      =======================
Note
  • TERM,erase,& UVLPDEST are defined in both stub_profile & common_profile
  • change them both, users may then change their stubs if required
  1. Change 'COBDIR', the environmental variable defining where Micro Focus COBOL is installed on your system

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

setting up profiles in /home/appsadm/env

Please see ADMjobs.htm re setting up profiles in /home/appsadm/env. ADMjobs.doc recommends setting up an 'appsadm' account to store the profiles so they do not get overwritten when a new version of Vancouver Utilities is installed.

ADMjobs.htm recommends copying /home/uvadm/env/* to /home/appsadm/env/... Then make any site specific modifications in appsadm/env. One significant change is to modify the stub profiles to call the common profile from appsadm not uvadm. See the details in ADMjobs.htm.

You can run the test/demo JCL conversions & executions in Part_1 without setting up appsadm, but you definitely should setup appsadm & modify profiles before starting your own JCL conversions.

The most important thing would be to modify RUNLIBS & RUNDATA depending on where you decide to store your Libraries & Data for Testing & Production.

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

3C0. conversion support functions - for JCL/scripts

Note
  • these Korn shell functions are stored in subdir 'sfun'
  • separate from Korn shell scripts (usually stored in subdir 'sf')
  • or JCL/scripts stored in subdir 'jcls'
  • ksh function path is defined by the 'FPATH' variable in the profile

functions - used by JCL/scripts

Note
  • the '51' suffixes on following filenames are NOT a mistake
    (even tho VSE control/function filenames usually have '41' suffixes)
  • because the GDG functions for VSE are common with MVS
jobset51
  • setup job environment for scripts converted from IBM VSE JCL
  • JCL converter inserts a call to this function at begin script
  • changes directory to $RUNDATA, sets up subdirs, etc
jobend51
  • function called at Normal EOJ (May 2007+)
  • to move any GDG jobtmp/subdir/files back to $RUNDATA/subdirs
  • mainframe tape files converted to generation files on disc
jobabend51
  • function called at Abnormal termination (June 2007+)
  • warns that GDG files not moved back to RUNDATA/subdirs
logmsg1
  • display console messages with date:time:JOBID2: stamps
  • this function used instead of 'echo's
stepctl51
  • step control function, providing pause/go facility
  • JCL converter inserts this function at begin each 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 jcpause & jcclear listed on pages '3F5' & '3F6'
    (with the scripts, not here with the functions)
exportfile
  • function to export Logical-FileName=Physical-FileName
  • for the following COBOL program (select external LFN)
  • also displays filename for the console log (using logmsg1)

exportgen_ functions to emulate GDG files on unix/linux exportgen0 - get the latest generation for input exportgen1 - get the next generation for output exportgenall - get all generations for input

Note

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

3C6. conversion support functions - customizing

Customizing Korn shell functions

Here are some important notes re the proper use of Korn shell functions.

These functions reside in the 'sfun' sub-directory of $RUNLIBS. 'sfun' is defined to the Unix/Linux KORN shell by the 'FPATH' variable in your profile, for example:


 export FPATH=$RUNLIBS/sfun
 ==========================

This is separate from the Unix/Linux KORN shell 'PATH' variable which is used to find normal scripts (in jcls & sf) for example:


 export PATH=$PATH:$RUNLIBS/jcls:$RUNLIBS/sf
 ===========================================

'RUNLIBS' is defined in the profile prior to PATH or FPATH. For the 'vsetest' demos this was:


 export RUNLIBS=/home/vsetest
 ============================

But for YOUR conversion & testing/production RUNLIBS might be:


 export RUNLIBS=/p1/testlibs       <-- for Your Testing
 ===========================
 export RUNLIBS=/p2/prodlibs       <-- for Your Production
 ===========================

These functions must be defined as 'autoload' in the calling scripts. Note that the JCL converter inserts the following about line #10 of each converted JCL/script.


 autoload jobset51 logmsg1 exportfile stepctl51
 ==============================================

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

3D0. Functions Required to Execute Converted JCL/scripts

GDG functions exportgen0,exportgen1,etc

VSE did not support GDG files (as did MVS), but you might be able to use the unix GDG functions for new additions to your converted VSE JCL/scripts.

These functions reside in the 'sfun' sub-directory of $RUNLIBS. 'sfun' is defined to the Unix/Linux KORN shell by the 'FPATH' variable in your profile, for example:


 export FPATH=$RUNLIBS/sfun
 ==========================

This is separate from the Unix/Linux KORN shell 'PATH' variable which is used to find normal scripts (in jcls & sf) for example:


 export PATH=$PATH:$RUNLIBS/jcls:$RUNLIBS/sf
 ===========================================

'RUNLIBS' is defined in the profile prior to PATH or FPATH. For the 'vsetest' demos this was:


 export RUNLIBS=/home/vsetest
 ============================

But for YOUR conversion & testing/production RUNLIBS might be:


 export RUNLIBS=/p1/testlibs     <-- for Your Testing
 ===========================
 export RUNLIBS=/p2/prodlibs     <-- for Your Production
 ===========================

These functions must be defined as 'autoload' in the calling scripts. Note that the JCL converter inserts the following at line #8 of each converted JCL/script.

 autoload jobset51 logmsg
 autoload exportgen0 exportgen1 exportgenx exportgenall exportfile
 =================================================================

summary of exportgen functions

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

See these functions listed in Part_5 begining on page '5J0'.

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

3E0. conversion support files - Control Files


3E1. ctl/jclunixop41 - 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/jclunixop41 is correct for the test/demo conversions
- But you may want to modify for your own JCL conversions.

3E3. ctl/datafiles41 - 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/datafiles41 & loading Indexed file datafiles43I

3E5. Topnode (subdir) determination & modification

3E7. extfh.cfg - File Handler Configuration file for Micro Focus COBOL
- IDXNAMETYPE=2 for '.dat' on data partition of indexed files

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

3E1. conversion support files - ctl/jclunixop41

ctl/jclunixop41 JCL Conversion control file

 jclunixop41:d0e1g1j1l1p0q1r0s0t12u1y0 #<-- option dflts for VUdoc test/demos
 #           d1           - debug, generate 'echo's for 'cobrun's
 #             e1         - generate 'exportfile' function (vs export)
 #                        - to display filenames for console log
 #               g0       - create new GDG's in $RUNDATA/subdir/gdgfile_
 #               g1       - new GDGs $JGDG relative move to subdir/ at EOJ
 #               g2       - new GDGs $JGDG absolute $RUNDATA/jobtmp/...
 #                 j1     - insert jobset51 for RUNDATE=ccyymmdd (obsolete ?)
 #                 j2     - jobset52 RUNDATE=mm/dd/ccyy old, jobset52 now $JGDG/
 #                 j4     - might need new optn j4 for RUNDATE=mm/dd/ccyy ?
 #                   l1   - generate logmsg1, show script msgs on screen only
 #                   l2   - generate logmsg2, appends to joblog/jobname.log
 #                   l4   - generate logmsg4 for Bgn/End Job (vs logmsg1/2)
 #                     p1 - on COBOL steps, generate printer files as follows:
 #                        - exportfile SYS010 $JTMP/$JOBID2_step_$PROGID
 #                        - exportfile SYS010L $RPTS/$JOBID2_step_$PROGID_$date
 #                        - uvcopy cnvrpt1,fili1=$SYS010,filo1=$SYS010L
 #                     q1 - apply TOPNODES table replace/verify 1st Qualifier
 #                  r0    - gen cobrun for unix/linux .ints (allow animation)
 #                  r1    - gen runw for .ints NetExpress/Windows/UWIN/CYGWIN
 #                  r2    - assume executables $DX/program either unix/windows
 #                  r16   - execute RPG programs, $RPX/program
 #                s1      - #< comment out SYSIN instream data (for LAVAL)
 #                        - instream data extracted separate files jobparms/..
 #                        - export SYS011 defines jobparms/.. file vs $JTMP/..
 #              t12       - TLBL options for exportgen0/1,tape/,date/time
 #                          (t1=date,t2=time,t4=subdir tape/,t8=exportgen0/1)
 #            u1          - convert IEBGENER to uvcp (vs cp default)
 #            u2          - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 files
 #          y1            - customization for CUCBC (printer class changes)
 # ------------------------------------------------------------------------
 # uvadm/ctl/jclunixop41 - control file for VSE JCL to ksh script converter
 # - must copy/modify to ctl/ subdir where jclunix converter executed
 # non-comment lines below will be inserted in jcl/scripts until :ENDINSERT
 #                            ** change history **
 # Nov18/09 - change back jobset51/jobset52 to relative/absolute
 # Oct03/09 - change back jclunixop42 to jclunixop41 & jclunix42.c to jclunix41.c
 #          - add option q1 to apply TOPNODES table
 # Sep29/09 - option g added g1/g2 inserts $JTMP/ on exportgen1 files (see below)
 #          - jobset51/52 changed to jobset53/54 by option j4 (RUNDATE format)
 # Sep13/09 - jclunix41 copied to jclunix42 & TOPNODES table code added
 #          - jclunixop41 copied to jclunixop42 & TOPNODES table added
 # Aug30/08 - jobset41,jobend41,jobabend41 changed to jobset51,etc
 # ------------------------------------------------------------------------
 #!/bin/ksh
 export JOBID2=JOBIDX; scriptpath="$0"; args="$*"
 if [[ -z "$JOBID1" ]]; then JOBID1=JOBIDX; fi; export JOBID1
 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 autoload jobset51 jobset52 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
 autoload exportfile exportgen0 exportgen1
 jobset51  # call function for JCL/script initialization
 goto
 S0000=A
 :ENDINSERT: - above non #comment lines inserted at begin output scripts
 # jobset51 OR jobset52 function inserted at begin each script
 # - sets up job environment: export subdirs, setup printer subdir/date
 # - RUNDATA & RUNLIBS must have been exported (in .profile or in shell)
 # - .profile must "export FPATH=$RUNLIBS/sfun" to find functions
 # - autoload declares functions called by jcl/scripts
 # - stores any restart step# in alias 'goto' (last line inserted above)
 # jobset51 - option g0 omits $RUNDATA from exportfile/gen
 #          - option g1 defines JTMP/JGDG without $RUNDATA (relative adrsng)
 # jobset52 - option g2 defines JTMP/JGDG with $RUNDATA (full path Essentis)
 #          - option w2 inserts $RUNDATA on exportfile/gen
 #          - g1/g2 same in jclunix51, dif is jobset51 or 52 here in jclunixop41
 #            OR use alt jclunixop42 with JTMP JGDG defined with $RUNDATA/...
 # ---------------------------------------------------------------------
 # VSE standard labels - could add here to insert at begining of all JCL/scripts
 # OR - insert std labels in jobset51/jobset52 (vs insert in all JCL/scripts)
 #    - like VSE, 1 master set that may be changed w/o changing JCL/scripts
 # export STDLBL=vse.standard.label     <-- use export for no display
 # exportfile STDLBL vse.standard.label <-- use exportfile to display filename
 # ---------------------------------------------------------------------
 :ENDINSERT: - above non #comment lines inserted at begin output scripts
 #----------------------- control table --------------------------------
 # controls filename conversion depending on 1 or 2+ nodes ('.'s)
 # TOPDIRDFL1 - used if only 1 node & not typJM in ctl/datafiles43
 #            - 'wrk' since 1 node files usually 'SORTOUT's
 #            - temp files, input to following steps, not needed after job ends
 # TOPDIRDFL2 - used if only 1 node & typJM on ctl/datafiles43 matching filename
 #            - 'M' of typJM stored if ',CAT=' found on DLBL by jcldata41
 # TOPDIRINS1 - if specified & no typJM, insert above top-node (retain all '.'s)
 #            - used for all files with 2+ nodes (TOPDIRDFL1/2 used if only 1)
 #            - if TOPDIRINS1/2 unspecified, topnode becomes a directory
 # TOPDIRINS2 - if specified & typJM, insert above top-node (retain all '.'s)
 #            - OVERRIDDEN if datafiles43I has topr=... or topi=...
 :CTLTBL:
 TOPDIRDFL1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRDFL2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINS1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINS2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 #------------------------ TOPNODES table ------------------------------
 # table of TOPNODES allowed & replacements (optional)
 # 01-30 - topnodes allowed
 # 31-60 - topnode replacements (if col 31 not '~')
 # - if 01-30 of last entry 'ALLOTHER', any others replaced by 31-60
 # - use statmvsjcl1 to create summary table of topnodes used in all JCL
 # - see www.uvsoftware.ca/mvsjcl.htm#6A2
 # - code in lower case since applied at output time(script) vs input(JCL)
 :TOPNODES:
 ar~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 gl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 rpts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 work~~~~~~~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #Note1 - you must also code valid top-nodes in $RUNLIBS/ctl/GDGmkdirs
 #      - called by jobset51 to setup subdirs for new generations of GDG files
 #      - see listing at MVSJCL.htm#4E5
 #
 #---------------------- 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
 // PAUSE.~~~~~~~~~~~~~~~~~~~~~// PAUSE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 :REPDSN:      search/replace table for DSNs - see dsn2dxf()
 .CLUS.VSEPRD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 .CLUS.VSEDEV~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 .CLUS.PRDXFR~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 .VSEPRD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # leaving replace pattern 31-60 tildes will remove search pattern
 #
 # 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~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # Table of STEP names to be #commented out
 # Feb13/07 - TDYNASN for Laval (also gens: exportfile BBBBBB $AAAAAA)
 :COMMENTSTEP:
 LISTLOG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 PRTLOG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TDYNASN~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 DYNUTIL~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 DYNOPEN~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 BSTTWAIT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 E173001C~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 VSECMD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 IPCPBTCH~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 SPOB766~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # Table of symbols whose value is to be translated to lower case
 :LOWERCASE:
 XXXXX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # Sep25/05 - '*' now allowed by searchtbl3
 :DROPDDN:    drop DDnames on input //DDname DD
 SORTWK*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 # Table of DSNnames to drop if pattern matched anywhere in filename
 :DROPDSN:
 USERCAT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 CATALOG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 SORTWK~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ==~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 .DBIMS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #------------------------ end jclunixop41 ---------------------------

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

3E2. conversion support files - ctl/jclunixop41

Customizing the JCL Conversion control file

The files listed above is correct for the 'vsetest' 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 'vsetest' conversions beginning on page '1Q1' (& verify the results match the listings in section 1C1), before modifying for your own JCL conversions.

This file (ctl/jclunixop41) controls various activities performed by the jclunix4 conversion program. Several options are specified on line 1:

 jclunixop41:d0e1g1j1l1p0q1r0s0t12u1y0 #<-- option dflts for VUdoc test/demos
 #           d1           - debug, generate 'echo's for 'cobrun's
 #             e1         - generate 'exportfile' function (vs export)
 #                        - to display filenames for console log
 #               g0       - create new GDG's in $RUNDATA/subdir/gdgfile_
 #               g1       - new GDGs $JGDG relative move to subdir/ at EOJ
 #               g2       - new GDGs $JGDG absolute $RUNDATA/jobtmp/...
 #                 j1     - insert jobset51 for RUNDATE=ccyymmdd (obsolete ?)
 #                 j2     - jobset52 RUNDATE=mm/dd/ccyy old, jobset52 now $JGDG/
 #                 j4     - might need new optn j4 for RUNDATE=mm/dd/ccyy ?
 #                   l1   - generate logmsg1, show script msgs on screen only
 #                   l2   - generate logmsg2, appends to joblog/jobname.log
 #                   l4   - generate logmsg4 for Bgn/End Job (vs logmsg1/2)
 #                     p1 - on COBOL steps, generate printer files as follows:
 #                        - exportfile SYS010 $JTMP/$JOBID2_step_$PROGID
 #                        - exportfile SYS010L $RPTS/$JOBID2_step_$PROGID_$date
 #                        - uvcopy cnvrpt1,fili1=$SYS010,filo1=$SYS010L
 #                     q1 - apply TOPNODES table replace/verify 1st Qualifier
 #                  r0    - gen cobrun for unix/linux .ints (allow animation)
 #                  r1    - gen runw for .ints NetExpress/Windows/UWIN/CYGWIN
 #                  r2    - assume executables $DX/program either unix/windows
 #                  r16   - execute RPG programs, $RPX/program
 #                s1      - #< comment out SYSIN instream data (for LAVAL)
 #                        - instream data extracted separate files jobparms/..
 #                        - export SYS011 defines jobparms/.. file vs $JTMP/..
 #              t12       - TLBL options for exportgen0/1,tape/,date/time
 #                          (t1=date,t2=time,t4=subdir tape/,t8=exportgen0/1)
 #            u1          - convert IEBGENER to uvcp (vs cp default)
 #            u2          - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 files
 #          y1            - customization for CUCBC (printer class changes)

Option 'r' must be synchronized with the COBOL compile script you intend to use: mfcbl1, mfnxcbl1,or mfnxcbl2 (see VSECOBOL.htm#5E0).

The control file 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 DROPDDN & DROPDSN tables to get rid of mainframe file definitions that have no relevance to unix/linux scripts (PROCLIB, STEPLIB, JOBLIB, etc).

See more discussion of options & TOPNODE/subdirs on pages '4E1' - '4E6'

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

3E3. JCL/script conversion control files

ctl/listcat3I - file info #1 for JCL converter

listcat3I is created by transferring the mainframe LISTCAT report, processing (as shown on page '4H1' & '4I12'),& loading into an indexed file.

 e2121653.mtaxe.piscines        rca=00082 rcm=00082 key=000(020) typLMC=IDXf1
 e2121656.itaxe.facturat        rca=00083 rcm=00239 key=000(036) typLMC=IDXf8v
 e2121853.mtaxe.b8409d35        rca=00024 rcm=00024 key=000(011) typLW_=IDXf1
 e2122683.itaxe.degrevem        rca=00158 rcm=00265 key=000(037) typLMC=IDXf8v
 e2122941.mtaxe.permispn        rca=00045 rcm=00045 key=000(022) typLMC=IDXf1
 e2122942.mtaxe.droitmut        rca=00030 rcm=00030 key=000(011) typLMC=IDXf1
 e2123001.itaxe.banqtaxe        rca=00126 rcm=00383 key=000(036) typLMC=IDXf8v
 e2123002.itaxe.taxation        rca=00046 rcm=00383 key=000(035) typLMC=IDXf8v
 e2123003.itaxe.transdam        rca=00464 rcm=00464 key=000(000) typLMC=RSR
 e2123004.itaxe.tranjour        rca=00464 rcm=00464 key=000(000) typLW_=RSF
 e2123005.mtaxe.tpcalcul        rca=00081 rcm=00081 key=000(029) typLMC=IDXf1
 e2123086.itaxe.encapost        rca=00080 rcm=00080 key=000(000) typLW_=RSF
 e2123691.itaxe.indexenc        rca=00036 rcm=00036 key=000(036) typLMC=IDXf1
 e2123692.itaxe.encaisse        rca=00146 rcm=00426 key=000(022) typLMC=IDXf8v
 e2123693.itaxe.tranksds        rca=00168 rcm=00453 key=000(017) typLMC=IDXf8v

ctl/datafiles43I - file info #2 for JCL converter

 e1133081.tfadm.b8306j02        rca=00464 rcm=00464 key=000(000) typJWV=RSF
 e2121653.mtaxe.piscines        rca=_____ rcm=_____ key=000(000) typJWV=RSF
 e2121656.itaxe.facturat        rca=00083 rcm=00239 key=000(036) typJWV=IDXf8v
 e2122680.ttaxe.b8401d30        rca=03180 rcm=03180 key=000(000) typJWV=RSF
 e2122683.itaxe.degrevem        rca=00158 rcm=00265 key=000(037) typJWV=IDXf8v
 e2122951.mtaxe.matrenov        rca=_____ rcm=_____ key=000(000) typJWV=RSF
 e2122958.ttaxe.b8409d36        rca=00236 rcm=00236 key=000(000) typJWV=RSF
 e2123001.itaxe.banqtaxe        rca=00126 rcm=00383 key=000(036) typJWV=IDXf8v
 e2123002.itaxe.taxation        rca=_____ rcm=_____ key=000(000) typJWV=RSF
 e2123003.itaxe.transdam        rca=_____ rcm=_____ key=000(000) typJWD=RSF
 e2123004.itaxe.tranjour        rca=00464 rcm=00464 key=000(000) typJWV=RSF
 e2123005.mtaxe.tpcalcul        rca=00081 rcm=00081 key=000(029) typJWV=IDXf1
 e2123010.ttaxe.sommtrie        rca=00464 rcm=00464 key=000(000) typJWV=RSF
 e2123011.ttaxe.rembours        rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v
 e2123013.ttaxe.c3001d31        rca=00360 rcm=00360 key=000(000) typJWV=RSF
 e2123013.ttaxe.rembtrie        rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v
 tu.f01.e211801.adrpos          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f01.e212-no.eauctr          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f01.e212-no.trperm          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f02.bkfaver.90-m07          rca=_____ rcm=_____ key=000(000) typJWT=RSF

The JCL converter uses the 2 Indexed files above to get file characteristics. 'listcat3I' has priority over 'datafiles43I'. The 'M' in 'typLM...' assigns these files to mstr/..., else to wrk/..., but TLBL files to tape/...

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

3E4. conversion support files - ctl/datafiles41

ctl/datafiles41 - Notes

The JCL converter uses this file to determine the directory to be assigned to the various files. This may be extended in future to carry file types, record-sizes,& indexed keys.

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

Here is the uvcopy command line to generate this file, taken from the operating instructions presented earlier on page '1Q3'.


 #4. uvcopy jcldata41,fild1=jcl2,filo2=ctl/datafiles41
     =================================================

 #4a. cp ctl/datafiles41 ctl/datafiles42  <-- create datafiles42 for edit
      ==================================

 #4a. vi ctl/datafiles42    <-- edit datafiles42, drop most files
      ==================      - retain only files for overrides
                              - modify/add codes as desired

Here are a few lines extracted from the test/demo file created in Part 1

 ar.customer.master       rca=_____ rcm=_____ key=000(000) typJWV=RSF
 ar.sales.items           rca=_____ rcm=_____ key=000(000) typJWV=RSF
 gl.account.master        rca=_____ rcm=_____ key=000(000) typJWT=RSF
 gl.account.trans         rca=_____ rcm=_____ key=000(000) typJWV=RSF

The JCL converter might convert these files as follows:

      exportfile CUSTMAS ar/customer.master
      exportfile CUSTMAS ar/sales.items
      exportfile ACNTMAS gl/account.master
      exportfile GLTRANS gl/account.trans

Note that the topnode or HLQ (High Level Qualifier) is used for the directory & the filename is the remaining nodes. You can replace the directory by coding topr=... or insert a top level directory by coding topi=...

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

3E5. conversion support files - ctl/datafiles41

TOPDIR Determination & Modification

If you wanted most files to go into a 'mstr' directory retaining all existing nodes, you could code that directory in ctl/jclunixop41 on the TOPDIRINS2 line as shown below. You could then modify some files by coding 'topi=...' on desired filenames in ctl/datafiles42 which will override ctl/datafiles41.

 :CTLTBL:
 TOPDIRDFL1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRDFL2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINS1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINS2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

samples from ctl/datafiles41

 ar.customer.master       rca=_____ rcm=_____ key=000(000) typJWV=RSF
 ar.sales.items           rca=_____ rcm=_____ key=000(000) typJWV=RSF topi=trans
 gl.account.master        rca=_____ rcm=_____ key=000(000) typJWT=RSF
 gl.account.trans         rca=_____ rcm=_____ key=000(000) typJWV=RSF topi=trans

sample conversions for above files

      exportfile CUSTMAS mstr/ar.customer.master
      exportfile SALES   trans/ar.sales.items
      exportfile ACNTMAS mstr/gl.account.master
      exportfile GLTRANS trans/gl.account.trans
Note
  • Directory 'trans' assigned from topi=mstr on matching entry in datafiles42

Directory Assignment Rules

  1. Directory wrk/ would be assigned from TOPDIRDFL1 in ctl/jclunixop41 if only 1 node in filename.

  2. Directory mstr assigned from TOPDIRINS1/2 in ctl/jclunixop41 if more than 1 node in filename.

  3. If TOPDIRINS1/2 is NOT specified & the filename has 2+ nodes, then the topnode becomes the directory & the remaining nodes become the filename.

  4. For TLBL filenames, the directory will be assigned as 'tape/'

  5. The above will be overridden if topi=... or topr=... is found on an entry in ctl/datafiles42 matching the filename in the JCL. 'topi=...' will insert the specified directory in front of existing nodes. 'topr=...' will replace the existing top level node.

See more discussion of options & TOPNODE/subdirs on pages '4E1' - '4E6'

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

3E7. conversion support files - ctl/extfh.cfg

extfh.cfg - File Handler Configuration

 # extfh.cfg - File Handler Configuration file for Micro Focus COBOL
 # - see http://supportline.microfocus.com/Documentation/books/sx40sp/fh...
 # - see www.uvsoftware.ca/vsecobol.htm & www.uvsoftware.ca/mvscobol.htm
 # location of this file defined for COBOL by EXTFH, in profiles, for example:
 #        export RUNLIBS=/home/vsetest
 #        export EXTFH=$RUNLIBS/ctl/extfh.cfg
 #
 #---------------------------------------------------------------------------
 # [XFH-DEFAULT]      - following options apply to all files
 #                    - unless over-ridden by [INTERNAL:EXTNAME] (see below)
 #  IDXNAMETYPE=2     - means data partitions have '.dat' extension
 #                    - index partitions always have '.idx' extension
 #                    - IDXFORMAT=8 files have only 1 partition
 #                      & it will have '.dat' extension if IDXNAMETYPE=2
 #                      & does include the indexes (in spite of its name)
 #  IDXFORMAT=1       - create all indexed files as IDX1 (fixed lth < 2 gig)
 #  IDXFORMAT=8       - create all indexed files as IDX8 (allows > 2 gig)
 #    default         - IDXFORMAT unspecified would create fixed lth IDXFORMAT1,
 #                      & variable length as IDXFORMAT3 ? or IDXFORMAT8 ?
 #  FILEPOINTERSIZE=8 - allow IDX8 files > 256 Terrabytes (don't need)
 #
 #---------------------------------------------------------------------------
 # [INTERNAL:EXTNAME] - following options apply to a specific file ID by EXTNAME
 #                      on: 'select cobolFDname assign external EXTNAME'
 #                    - applies only to file defined by EXTNAME matching env-var
 #                      export EXTNAME=pathname (in JCL/script prior to cobrun)
 #                                 - - - examples - - -
 # [INTERNAL:E212853] - example for file whose EXTNAME=E212853 (select external)
 #  IDXFORMAT=1       - force IDXFORMAT1 vs any [XFH-DEFAULT] IDXFORMAT_
 # [INTERNAL:E212002] - example for file whose EXTNAME=E212002 (select external)
 #  IDXFORMAT=8       - force IDXFORMAT8 vs any [XFH-DEFAULT] IDXFORMAT_
 #
 #---------------------------------------------------------------------------
 [XFH-DEFAULT]
 IDXNAMETYPE=2
 # IDXFORMAT=8
 #---------------------------------------------------------------------------

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

Part_4 Converting 'YOUR' VSE JCL to Korn shell scripts

Part 4 Contents


4A1. Introduction & Overview

4B1. Plan Your conversion (vs the 'test/demo' conversions in Part_1)
- also see the 20 point preparation summary in uvprices.htm#G1.
- the Vancouver Utilities makes the conversions fast,
- but you must test all JCL/scripts & COBOL programs
- we suggest allowing 6 months to 1 year for the conversion project
- we suggest 4 to 8 weeks of UV Software onsite training
  & conversion assistance
- install unix/linux O/S software (Red Hat, SUN, AIX, HP, etc)
- setup userid 'uvadm' for the Vancouver Utilities
- setup userid 'appsadm' (administrator for your applications)

4B2. Install the Vancouver Utilities

4B3. Setup the 'profiles' for uvadm, appsadm,& your conversion team members
- stub_profiles in each user homedir (overwrite .profile or .bash_profile)
- common_profile, 'rc' files in /home/appsadm/env

4C1. Design/setup optimum directory structure for Your site
- for conversion, testing,& production
- see several alternative designs at ADMjobs.htm#Part_2

4D1. Copy Vancouver Utility supplied control files & functions
- control files supplied in /home/uvadm/ctl, copy to your $TESTLIBS/ctl/...
  (jclunixop41,cobdirectives,extfh.cfg,cnvcob5.tbl)
- functions supplied in /home/uvadm/sfun, copy to your $TESTLIBS/sfun/...
  (jobset41 logmsg1 exportfile,exportgen0,exportgen1,exportgenall,etc)
4D2.  script to copy supplied control files & functions to your subdirs

4E1. JCL converter control file options - modify for your site
4E2.  control file tables to modify TopNode/subdir assignments
4E3.  TOPNODES table & relative-PATH vs full-PATH
4E4.  Customize JCL conversion by modifying the control file ctl/jclunixop41
4E5.  Running 'statvsejcl1' to create a table summary of Top-Nodes in your JCL
- modify the TOPNODES table to change &/or consolidate topnodes
  (which are usually used as sub-directories for data files)
4E6.  ctl/GDGmkdirs - script to make topnode/subdirs for new generations of GDGs
- must be updated with your TopNode/subdirs

4F1. Transfer JCL, COBOL,& DATA files from the mainframe for initial testing
- suggest zipping all files of the same type
- transfer any PROC's, SLI's, INCLUDE's, Parms, etc
- run LISTCAT on mainframe & transfer to unix to assist datafile convert

4G1. Convert All COBOL copybooks & All COBOL programs
- COBOL conversion is the easiest & it makes sense to do it first
- Initial conversion All programs must be performed as per VSECOBOL.htm
- script cnvMF41A provided for re-conversions during conversion period

4G2. Convert 1 COBOL copybook & 1 COBOL program at a time
- scripts cnvMF41c & cnvMF41

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

Part 4 Converting 'YOUR' VSE JCL to Korn shell scripts

Part 4 Contents (continued)


4H1. Create the data conversion control file (ctl/ctlfile4) from LISTCAT
- record sizes, indexed keys, file types
- need to manually edit the copybook corresponding to each data file

4I1. Convert Your DATA files (at least enough for some initial testing)
- converting DATA before JCL makes sense because the LISTCAT info
  is required 1st for DATA conversion & then for JCL conversion
- see complete details at VSEDATA.htm

4I2. $CNVDATA/ctl/ctlfile4 listed here in VSEJCL.doc for your convenience
- used to generate the 'uvcopy jobs' that perform data conversion
- you must see VSEDATA.doc to generate the jobs & execute 1st time

4I3. Re-executing the jobs to convert all datafiles (refreshed from mainframe)
- may need to do 2 or 3 times during 1 year conversion/test period

4I5. Convert 1 datafile at a time (in $CNVDATA)
- sfload/scripts to copy datafile over to $TESTDATA/mstr

4I10. create the JCL conversion control file from LISTCAT
- $CNVDATA/ctl/listcat2 (from 4H1) is converted to $TESTLIBS/ctl/listcat3I

4J1. Initial conversion of All Your JCL (directories involved)
4J2. Review preparations for conversion (4A1-4F1 above)
4J3. jcl2ksh41A (do everything script) vs step by step method below (4K1-4K4)

4K1. step by step conversion
cleanup mainframe JCL, PROCs, Parms,& expand PROCs

4K2. create the JCL conversion data control file from up to 6 sources
- info extracted from JCL, LISTCAT, spreadsheets,& edited info
- result loaded to Indexed file ctl/datactl53I accessed by JCL converter

4K4. final steps to convert JCL with expanded procs to Korn shell scripts
- guided by data control file & JCL converter options file

4L0. Preparations Required Before you can begin testing/debugging your scripts
 Most of these jobs are 'OPTIONAL' depending on site preferences
- optional jobs are documented briefly here in Part 4
- details & examples given in Part_6.

4L1. Create GDG control file (used to get no of generations for GDG files)
- see complete details & examples in 'Part_5' (also in MVSJCL.doc Part 5).
- could initially create empty Indexed file so you test non-GDG jobs

4L2. Cross References for COBOL & JCL/scripts are a big help for test/debug.
Generate & print the cross-references now before you begin test/debug.

4L3. Job-Flow reports are also a big help for test/debug.
- show the datafile I/O from step to step
- generate all reports in subdir jobflow/... & print as needed

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

Part 4 Converting 'YOUR' VSE JCL to Korn shell scripts

Part 4 Contents (continued)


4L4. Extract control cards from JCL to separate files
- optional jobs to extract control cards from all JCLs so you can update
  them separately form the JCL/scripts.
- control card files are date-stamped to allow updates for future dates.
- see complete details & examples begining on page '6A1'.

4M1. Test/Debug a few JCL/scripts & use this experience to fine tune the
JCL/script conversion options & control files.

4M2. Aids to assist test/debug of JCL/scripts
- testdatatinit, joblog1, llr

4N1. Reconvert 1 JCL at a time as you modify & test/debug the scripts
- script 'jcl2ksh41' to reconvert 1 JCL

4N2. Reconvert All JCL to capture fine tuning benefits
- script 'jcl2ksh41A' reconverts All jcl0->jcl1->jcl2->jcl3
- JCL/scripts are copied 1 at a time from the converted subdir (jcl3)
  to the active-PATH subdir (jcls) only when programmer ready to test/debug

4N4. Assign JCLs to various conversion team members for test/debug

4O1. Aids & Techniques to assist test/debug
- set up testdata in your homedir to avoid conflicts with other programmers

4O2. using uvhd & uvhdcob to dislay your files with packed & binary fields
- uvhd already documented
- uvhdcob displays COBOL copybook fieldnames beside data field contents

4P1. Determine conversion solutions for 3rd party software such as
DITTO, EASYTRIEVE, etc.
The JCL converter does convert SORT, IDCAMS, IEBGENER, and some DITTOs.
An Easytrieve to uvcopy converter is provided for the simpler jobs.
You may have to write COBOL programs for with more complex Easytrieves.

4Q1. Setup Your backup scripts now to protect your programmers from 'oops'
- see several backup scripts in ADMjobs.htm#Part_4
- setup appsadm 'crontabs' to backup cnvdata, testdata,& testlibs
  every night to both tape & disc (see ADMjobs.htm#Part_5
- can have 1 or 2 days backups on disc for immediate recoveries

4R1. Setup console logging (essential for production)
- programmers can use the 'joblog1' script for debugging
- good idea to setup on the test machine to try it out before production

4S1. Run parallels with mainframe when you have enough JCL/scripts debugged
Re-transfer mainframe JCL,COBOL,& DATA a few times during conversion period
 Setup the production machine & Go live (over a weekend usually)
 Need to re-transfer all data files on the 'Go Live' weekend, but JCL &
 COBOL programs should not need re-transfer/reconvert at this point

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

4A1. Converting YOUR VSE JCL to Korn shell scripts

Introduction & Overview

Part 4 is intended to present a plan for you to follow in converting 'YOUR' JCL (vs the test/demo conversions illustrated in Part_1.

Your JCL conversion will be the primary focus in Part 4, but we will refer you to other parts of the documentation for the many other procedures required to make the entire conversion successful.

In fact this (Part 4 of VSEJCL.doc) is probably your best roadmap to follow when planning & executing your conversion.

Note that you must follow the step by step method for your 'first' conversion of all JCL, but for subsequent conversion you may use the handy scripts provided to convert all JCL with 1 command.

Part 4 also gives the operating instructions for the scripts to re-convert All COBOL,& DATA files, but you must use the step by step method for the 'first' conversions as documented in VSECOBOL.htm & VSEDATA.htm.

Part 4 was re-written in Feb 2007 & uses the 'City of Lynn Valley' as a sample customer for conversion.

before digging in to Part 4

Before you dig into this very detailed conversion plan, I recommend you review the very concise '20 point preparation plan' presented in uvprices.htm#G1.

Also review the 'optional conversions' described at uvprices.htm#K0.

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

4B1. Converting YOUR VSE JCL to Korn shell scripts

Planning Your conversion

Part 4 is intended to present a plan for you to follow in converting 'YOUR' JCL (vs the test/demo conversions illustrated in Part_1.

The Vancouver Utilities makes the conversions fast. But since you must test all JCL/scripts & COBOL programs, you should allow from 6 months to 1 year for the conversion project.

We recommend having UV Software personnel onsite for training & conversion assistance. We suggest an initial 4 weeks & perhaps another 3 or 4 weeks after 1 or 2 months later.

setup hardware & install unix/linux

We recommend Red Hat Enterprise Linux, but the Vancouver Utilities will run under most popular unix systems (SUN, AIX, HP, etc).

Please see ADMjobs.htm#Part2 for some suggestions about setting up your unix/linux system (RAID arrays, disc partitioning, etc).

We strongly recommend Micro Focus COBOL and please ensure that your unix/linux O/S is certified by Micro Focus COBOL.

Setup users & groups for programmers & operators

  1. You might setup group 'apps' for all users involved in the conversion project. You need a common group so users can work on a common set of JCL/scripts & programs. Security is extended to the group level (directories 775 & files 664).

  2. Setup userids for your programmers & operators (all with group 'apps')

  3. Also setup userid 'uvadm' for the Vancouver Utilities administrator & setup userid 'appsadm' for your applications administrator.

  4. We are not setting up profiles until the Vancouver Utilities are installed (next page), because the recommended profiles are included on the VU distribution media.

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

4B2. Converting YOUR VSE JCL to Korn shell scripts

Installing the Vancouver Utilities

Please see install.htm for detailed instructions to install the Vancouver Utilities from the distribution CD & to compile the C programs on your machine.

setup 'profiles' for uvadm,appsadm,& your team

The profiles are supplied in /home/appsadm/env/... & consist of multiple parts.

  1. stub_profile - copy to user homedirs overwriting .profile or .bash_profile - defines RUNLIBS as testlibs for programmers OR prodlibs for operators - defines RUNDATA as testdata for programmers OR proddata for operators

  2. common_profile - defines search PATHs to libraries & data based on $RUNLIBS & $RUNDATA (defined in stub_profile)

  3. 'rc' files (.bashrc/.kshrc) - copy to user homedirs. 'rc' files reestablish aliases, that are disabled if console logging is activated.

See the profiles listed at ADMjobs.htm#3B1.

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

4B3. Converting YOUR VSE JCL to Korn shell scripts

profiles

Profiles are split to 2 parts (stub_profile,& common_profile). Profiles are supplied in /home/uvadm/env/... but should be copied to /home/appsadm/env/... & modified there depending on site requirements.

Note that the 'stub_profile' is copied to each users homedir & renamed as .bash_profile for Linux & .profile for unix. You must then modify the stub_profile definitions of RUNLIBS & RUNDATA depending on whether the user is a programmer or an operator.

Please see the profile listings at ADMjobs.htm#1C1 but here are some examples of critical definitions extracted from the profiles.

common_defines

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

stub_profile

RUNLIBS, RUNDATA,& CNVDATA are assigned in the .profile or .bash_profile of programmers & operators. see the stub_profile listed at ADMjobs.htm#1C1.

 export RUNLIBS=/p1/testlibs     <-- for programmers
 export RUNDATA=/p1/testdata
 export CNVDATA=/p1/cnvdata
 export RUNLIBS=/p2/testlibs     <-- for operators
 export RUNDATA=/p2/testdata
 export RUNLIBS=$HOME/testlibs   <-- for programmers, who wish to test
 export RUNDATA=$HOME/testdata       in their homedir, only for education
 export CNVDATA=$HOME/cnvdata        & exception testing (no development)
Note
  • if you modify RUNLIBS,RUNDATA,CNVDATA in your profile:
  • you must logout & back in to make the changes effective
  • $RUNLIBS,$RUNDATA used in many places in PATH common_profile

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

4C1. Converting YOUR VSE JCL to Korn shell scripts

Directories for test/demo conversions in Part_1

Up to this point the directory design was intended only to test/demo the UV conversion procedures using the supplied JCL & PROCs. In Part_1 we setup our test/demo directories in homedir (vsetest) for convenience & simplicity.

 /home
 :----user1
 :----user2
 :-----etc-
 :----vsetest
 :    :----testlibs     <-- $RUNLIBS for demo JCL conversions in Part_1
 :    :    :----cbls
 :    :    :----jcls
 :    :    :-----etc-
 :    :----testdata     <-- $RUNDATA for demo JCL conversions in Part_1
 :    :    :----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

4C2. Converting YOUR VSE JCL to Korn shell scripts

Directories for YOUR Conversion,Testing,& Production

 /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/vsetest) which should not be used for your development & production because:

  1. The /home file system would not usually have sufficient space allocated for your large data files.

  2. You should have separate file systems to protect against runaway COBOL programs filling up the entire file system, rather than just the data file system. Other file systems are also protected against corruption in any 1 file system.

  3. You should have separate file systems designed to facilitate your backup & restore procedures. You should be able to do backup/restores separately for testlibs, testdata, prodlibs,& proddata.

  4. Separate file systems facilitate writing backup tapes with multiple archives. The restore script allows you to restore just the desired archive, rather than the entire tape, saving time & disc space.

    Alternative File System Designs

The next few pages will present the details of this 1st practical yet simple file system design. Also see alternative file designs in ADMjobs.htm#Part_2 that discuss provisions for multiple companies &/or multiple separate applications. ADMjobs also gives a brief description of using RAID for your O/S & applications.

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

4C3. Converting YOUR VSE JCL to Korn shell scripts

Libraries for Your Conversion & Testing

Please understand the preceding notes about these directory structures.

       '--MF--' marks subdirs transferred from your MainFrame for conversion
       '--UV--' marks control files & functions supplied by UV Software
 /p1
 :-----testlibs        <-- RUNLIBS=$TESTLIBS=/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
 :     :------cbl3       - optional to convert accept sysin to read from a file
 :     :------cbls       - copy here (standard source library) before compiling
 :     :------cblst      - cobol source listings from compiles
 :     :------cblx       - compiled COBOL programs (.int's)
 :     :--MF--cpy0       - for COBOL copybooks
 :     :------cpy1       - cleaned up, cols 1-6 & 73-80 cleared, etc
 :     :------cpy2       - cnvMF4 converts mainframe COBOL to Micro Focus COBOL
 :     :------cpys       - copy here (standard copybook library)
 :     :------ditto0     - DITTO jobs from MainFrame
 :     :------ditto1     - DITTO jobs cleaned up
 :     :------dittos     - DITTO jobs converted to uvcopy
 :     :------ezt0       - EasyTrieve jobs from MainFrame
 :     :------ezt1       - EasyTrieve jobs cleaned up
 :     :------ezts       - EasyTrieve jobs converted to uvcopy
 :     :------ftp        - subdir for FTP transfers
 :     :--UV--ctl        - conversion control files (jclunixop41, datafiles41)
 :     :------include1   - optional (PROC expansion allows include files)
 :     :--MF--jcl0       - your JCLs transferred from mainframe
 :     :------jcl1       - intermediate conversion 73-80 cleared
 :     :------jcl2       - PROCs expanded from procs
 :     :------jcl3       - JCLs converted to Korn shell scripts
 :     :------jcls       - copy here manually 1 by 1 during test/debug
 :     :------jobparmx1  - datacards extracted from JCL/scripts (date-stamped)
 :     :------jobparmx2  - datacards extracted from JCL/scripts (no datestamps)
 :     :------maps       - 'cobmaps' record layouts generated from copybooks
 :     :------pf         - uvcopy jobs to replace utilities (easytrieve,etc)
 :     :--MF--proc0      - your PROCs transferred from mainframe
 :     :------procs      - will be merged with jcl1, output to jcl2
 :     :------sf         - for misc scripts you may wish to write
 :     :--UV--sfun       - korn shell functions (jobset51,logmsg,etc)
 :     :------tmp        - tmp subdir used by various conversions
 :     :------xref       - cross-references (see XREFjobs.htm)

 vselibsdirs  <-- script to create above subdirs
 ===========

 copyvsectls  <-- script to copy control files from /home/uvadm/ctl/ to ctl/...
 ===========

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

4C4. Converting YOUR VSE JCL to Korn shell scripts

DATA Directories for Your Testing

 /p1
 :-----testdata             <-- RUNDATA=$TESTDATA=/p1/testdata
 :     :-----ftp
 :     :-----jobctl            - optional, could use to pause jobs at spcfd steps
 :     :-----joblog            - joblog1 script stores .log files here
 :     :-----jobparms1         - current datacards from $RUNLIBS/jobparmx1 at 6PM
 :     :-----jobparms2         - datacards from $RUNLIBS/jobparmx2 at 6PM
 :     :-----jobtmp            - job temporary files
 :     :-----mstr            <-- master files
 :     :-----pf                - user written uvcopy jobs
 :     :-----rpts            <-- reports
 :     :-----sf                - user written Korn shell scripts
 :     :-----sysout            - COBOL DISPLAY upon SYSLST reports
 :     :-----tape            <-- tape files reassigned to disc by JCL converter
 :     :-----tmp               - misc temp files & sort work files
 :     :-----wrk             <-- work files (inter-step)
Note
  • the indicators above '<--' identify primary 'data files' used by JCL/scripts

 vsedatadirs       <-- script to create above subdirs
 ===========
Note
  • the 'dtree' script shows only 'directory' names
  • also see the next page where we have added a few 'filenames'
  • to give you a better understanding of these 'data directories'

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

4C5. Converting YOUR VSE JCL to Korn shell scripts

DATA Directories for Your Testing

Note
  • the 'dtree' script shows only 'directory' names (as on page above)
  • on this page, we have added a few 'filenames'
  • to give you a better understanding of these 'data directories'
 /p1
 :-----testdata             <-- RUNDATA=$TESTDATA=/p1/testdata
 :     :-----ftp
 :     :-----jobctl
 :     :-----joblog
 :     :-----jobparms1         - current datacards from $RUNLIBS/jobparmx1 at 6PM
 :     :     :-----28401T04_S0050_E212540C
 :     :     :-----28401T04_S0080_E212540C
 :     :-----jobparms2         - datacards from $RUNLIBS/jobparmx2 at 6PM
 :     :     :-----24502R01_S0010_E173001C
 :     :     :
 :     :-----jobtmp            - job temporary files
 :     :     :-----jobname     - subdir by jobset51 function
 :     :     :-----28401T04
 :     :     :     :-----S0050_E212540C  - cobol creates w/o LineFeeds
 :     :     :     :-----S0080_E212540C  - uvcopy cnvrpt1 copies to rpts/...
 :     :     :     :-----S0080_E212540C  - inserting LFs, add extnsn .lvl
 :     :     :
 :     :-----mstr                           - master files
 :     :     :-----e2123002.itaxe.taxation  - sample filenames
 :     :     :-----e2125504.mtaxe.paracomp
 :     :-----pf
 :     :-----rpts              - reports
 :     :     :-----070218      - subdir for today's reports
 :     :     :-----070219      - created by function jobset51 on 1st run of day
 :     :     :     :-----28401T04_S0050_E212540C_074648.lvl
 :     :     :     :-----28401T04_S0080_E212540C_074648.lvl
 :     :-----sf
 :     :-----sysout
 :     :-----tape              - tape files reassigned to disc by JCL converter
 :     :     :-----070218      - subdir for today's tape file outputs
 :     :     :-----070219
 :     :-----tmp
 :     :-----wrk                            - work files (inter-step)
 :     :     :-----e2125556.ttaxe.b8401j04  - sample filenames
 :     :     :-----e2125557.ttaxe.b8401j04

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

4C6. Converting YOUR VSE JCL to Korn shell scripts

Libraries for Your Production

 /p2
 :-----prodlibs          <-- RUNLIBS=$PRODLIBS=/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 Korn shell scripts
 :     :-----jcls          - copy here manually 1 by 1 during test/debug
 :     :-----jobparmx1     - datacards extracted from JCL/scripts (date-stamped)
 :     :-----jobparmx2     - datacards extracted from JCL/scripts (no datestamps)
 :     :-----pf            - uvcopy jobs to replace utilities (easytrieve,etc)
 :     :-----sf            - for misc scripts you may wish to write
 :     :-----sfun          - korn shell functions (jobset51,logmsg,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 Korn shell scripts).

DATA Directories for Your Production

 /p2
 :-----proddata             <-- RUNDATA=$PRODDATA=/p2/proddata
 :     :-----ftp
 :     :-----jobctl
 :     :-----joblog
 :     :-----jobparms1         - current datacards from $RUNLIBS/jobparmx1 at 6PM
 :     :-----jobparms2         - datacards from $RUNLIBS/jobparmx2 at 6PM
 :     :-----jobtmp            - job temporary files
 :     :     :-----jobname1    - subdir with jobname created at job init
 :     :     :-----jobname2      by jobset51 function
 :     :-----mstr                           - master files
 :     :     :-----e2123002.itaxe.taxation  - sample filenames
 :     :     :-----e2125504.mtaxe.paracomp    (files not shown by dtree script)
 :     :-----pf
 :     :-----rpts              - reports
 :     :     :-----070218      - subdir for today's reports
 :     :     :-----070219      - created by function jobset51 on 1st run of day
 :     :-----sf
 :     :-----sysout
 :     :-----tape              - tape files reassigned to disc by JCL converter
 :     :     :-----070218      - subdir for today's tape file outputs
 :     :     :-----070219
 :     :-----tmp
 :     :-----wrk                            - work files (inter-step)
 :     :     :-----e2125556.ttaxe.b8401j04  - sample filenames
 :     :     :-----e2125557.ttaxe.b8401j04    (files not shown by dtree script)

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

4C7. Converting YOUR VSE JCL to Korn shell scripts

Backup/Restore Directories

 /p3/backup
 :-----homedirs             <-- $HOMEDIRS backup from last night
 :     :-----appsadm          - showing only 1 user to save lines
 :     :     :-----ctl          & showing only a few subdirs in 1st user
 :     :     :-----env
 :     :     :-----logs
 :     :     :-----...
 :-----homedirs-1           <-- $HOMEDIRS backup from 2 nights ago
 :     :-----...same as above...
 :-----proddata             <-- $PRODDATA backup from last night
 :     :-----ap
 :     :-----ar
 :     :-----gl
 :     :-----rpts
 :     :-----wrk
 :-----proddata-1           <-- $PRODDATA backup from 2 nights ago
 :     :-----...same as above...
 :-----prodlibs             <-- $PRODLIBS backups from last night
 :     :-----cbls
 :     :-----cpys
 :     :-----ctl
 :     :-----jcls
 :     :-----parms
 :-----prodlibs-1           <-- $PRODLIBS backup from 2 nights ago
 :     :-----...same as above...
 :-----zip                  <-- last nights backup (only)
 :     :-----homedirs_070529_0301.zip
 :     :-----proddata_070529_0302.zip  <-- sample for May 29/2007
 :     :-----prodlibs_070529_0303.zip
 :     :-----...
 :-----Day                  <-- Daily backups in .zip files for last 40 days
 :     :-----homedirs_070419_0301.zip
 :     :-----proddata_070419_0302.zip  <-- 40 days ago = April 19/2007
 :     :-----prodlibs_070419_0303.zip
 :     :-----...(39 sets not shown)
 :-----Month                <-- Monthly backups in .zip files for last 15 months
 :     :-----homedirs_060201_0301.zip
 :     :-----proddata_060201_0302.zip  <-- 15 months ago = Feb 1/2006
 :     :-----prodlibs_060201_0303.zip
 :     :-----...(14 sets not shown)
 :-----Year                 <-- Yearly backups in .zip files for last 7 years
 :     :-----homedirs_000501_0301.zip
 :     :-----proddata_000501_0302.zip  <-- 7 years ago = Jan 1/2000
 :     :-----prodlibs_000501_0303.zip
 :     :-----...(6 sets not shown)
Note
  • we show only directories under homedirs, proddata,& prodlibs
  • we do show some files under zip, Day, Month,& Year
  • (inserted manually since the 'dtree' script does not show files)
  • we show zip, Day, Month,& Year out of sequence
  • to better illustrate our backup strategy

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

4C8. Converting YOUR VSE JCL to Korn shell scripts

Data Conversion Directories

 /p4
 :-----cnvdata            - $CNVDATA=/tax/cnvdata ($symbol for PATH independence)
 :     :------archive     - copy unwanted files here for later deletion
 :     :--MF--cpys      <-- COBOL copybooks
 :     :--MF--ctl       <-- control files (LISTCAT from the mainframe)
 :     :--MF--d0        <-- data files FTP'd from mainframe (variable length)
 :     :------d0ebc       - filenames lower case, '.clus.vseprd' dropped
 :     :------d1ebc       - converted to fixed length for conversion
 :     :------d2asc       - converted to ASCII (packed/binary preserved)
 :     :------d3ebc       - possible convert back to EBCDIC to verify
 :     :------errs        - error reports from conversion utilities
 :     :------maps        - copybooks converted to record layouts
 :     :------pf          - misc uvcopy jobs
 :     :------pfv1        - uvcopy jobs to convert varlth to fixlth
 :     :------pfv2        - copied here for execution
 :     :------pfx1        - uvcopy skeleton jobs generated from 'maps'
 :     :------pfx1a       - uvcopy instrns extracted from pfx1 jobs
 :     :------pfx2        - uvcopy jobs completed, datafilenames (vs cpybknms)
 :     :------pfx3        - uvcopy jobs copied here for modify/execute
 :     :------pfx3.bak    - backup before regens to recover modified R/T code
 :     :------pfx4        - optional jobs to convert back to EBCDIC for verify
 :     :------sf          - misc scripts
 :     :------sfload      - scripts to copy/sort/load d2asc/... to $TESTDATA/mstr
 :     :------sfloadalt   - alternates (must be only 1 script per file in sfload)
 :     :------stats       - reports to assist multi record type file conversions
 :     :------tmp         - misc files here (keep working dir clean, rm daily)
 :     :------tmp1        - misc files (remove weekly vs daily)
       '--MF--' indicates subdirs receiving files from the mainframe

 cnvdatadirs     <-- script to create subdirs shown above
 ===========

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

4C9. Converting YOUR VSE JCL to Korn shell scripts

Programmer & Operator Logins

The preceding pages have discussed our file design, which might be summarized as follows:

 /home             <-- home directories
 :----prgmr1
 :----prgmr2
 :----oper1
 :----oper2
 :
 /p1                 <---- /p1 file system mount point
 :-----testlibs        <-- RUNLIBS=$TESTLIBS=/p1/testlibs
 :     :-----cbls        - COBOL programs
 :     :-----jcls        - JCL/scripts
 :     :---etc---        - see other subdirs at ADMjobs.htm#2B1
 :-----testdata      <---- RUNDATA=$TESTDATA=/p1/testdata
 :     :-----mstr        - data files (or use topnodes as subdirs)
 :     :-----jobtmp      - job temporary files
 :     :---etc---        - see other subdirs at ADMjobs.htm#2B2
 :
 /p2                 <---- /p2 file system mount point
 :-----prodlibs        <-- RUNLIBS=$PRODLIBS=/p2/prodlibs
 :     :-----cbls        - COBOL programs (production)
 :     :-----jcls        - JCL/scripts (production)
 :     :---etc---
 :-----proddata
 :     :-----mstr        - data files (or use topnodes as subdirs)
 :     :-----jobtmp      - job temporary files
 :
 /p3                 <---- /p3 file system mount point
 :-----backup            - backup & restore directories
 :-----restore
 :
 /p4                 <---- /p4 file system mount point
 :-----cnvdata           - data conversion directories
 :     :----d1ebc        - EBCDIC data files from mainframe
 :     :----d2asc        - converted to ASCII (preserving packed)

RUNLIBS/RUNDATA defs in 'stub_profiles'

 export RUNLIBS=/p1/testlibs       <-- stub_profile for programmers
 export RUNDATA=/p1/testdata
 export RUNLIBS=/p2/prodlibs       <-- stub_profile for operators
 export RUNDATA=/p2/proddata

aliases in profiles for quick change

alias cdl='cd $RUNLIBS' <-- /p1/testlibs(prgmrs) or /p2/prodlibs(oprtrs) alias cdd='cd $RUNDATA' <-- /p1/testdata(prgmrs) or /p2/proddata(oprtrs)

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

4C10. Converting YOUR VSE JCL to Korn shell scripts

Alternative file system design

The preferred design has separate file systems for testlibs, testdata, prodlibs, proddata,& cnvdata. These file systems are mounted on the root file system at mount points /p1 /p2 /p3 /p4 as shown on the previous page.

City of Lynn Valley Alternative Design

 /home                  <-- home directories
 :-----prgmr1
 :-----prgmr2
 :-----oper1
 :-----oper2
 /tax                     - Lynn Valley superdir for cnvdata, testdata,& testlibs
 :-----cnvdata          <-- $CNVDATA=/tax/cnvdata ($symbol for PATH independence)
 :     :-----d1ebc
 :     :-----d2asc        - see all cnvdata subdirs on page '4D7'
 :     :-----.etc.
 :-----proddata         <-- $PRODDATA
 :     :-----mstr         - see all proddata subdirs on page '4D5'
 :     :-----tape         - proddata will be on separate machine for production
 :     :-----.etc.
 :-----prodlibs         <-- $PRODLIBS
 :     :-----cbls         - see all prodlibs subdirs on page '4D5'
 :     :-----jcls         - prodlibs will be on separate machine for production
 :     :-----.etc.
 :-----testdata         <-- $TESTDATA
 :     :-----mstr
 :     :-----wrk          - see all testdata subdirs on page '4D4'
 :     :-----.etc.
 :-----testlibs         <-- $TESTLIBS
 :     :-----cbls
 :     :-----jcls         - see all testlibs subdirs on page '4D3'
 :     :-----.etc.
 :-----backup           <-- $BACKUP
 :     :-----.....
 :-----restore          <-- $RESTORE
 :     :-----.....

As mentioned above, it is preferable to have multiple file systems, rather than only 1, but the above design is OK for the test phase, & will be improved for production.

From this point forward, we will use the symbols $CNVDATA, $TESTDATA, etc to make our documentation PATH independent.

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

4D1. Converting YOUR VSE JCL to Korn shell scripts

Copying VU control files & functions to Your $TESTLIBS

You must copy some control files & functions (supplied with Vancouver Utilities) over to your $TESTLIBS ctl & sfun subdirs.

Here is a cut-down version of the testlibs dtree shown on page '4D3'. We have omitted most subdirs & descriptions to highlight the 'ctl' & the 'sfun' subdirs.

 /p1
 :-----testlibs        <-- RUNLIBS=$TESTLIBS=/p1/testlibs
 :     :--mf--cbl0
 :     :------
 :     :--mf--cpy0
 :     :------
 :     :--UV--ctl      <-- control files (jclunixop41, listcat3I, datafiles43I)
 :     :------
 :     :--mf--jcl0
 :     :------
 :     :--UV--sfun     <-- Korn shell functions (jobset51,logmsg,etc)

Copying VU ctl/... & sfun/... to Your $TESTLIBS


 #1a. Login as appsadm ---> /home/appsadm
 #1b. cdl  --> $TESTLIBS

 #2. copy control files
 #2a. cp $UV/ctl/cnvcob4.tbl   ctl  # search/replace table for COBOL cnvrtr
 #2b. cp $UV/ctl/cobdirectives ctl  # COBOL DIRECTIVES for compiler
 #2c. cp $UV/ctl/extfh.cfg     ctl  # COBOL file handler configuration
 #2d. cp $UV/ctl/jclunixop41   ctl  # options file for JCL converter

 #3. copy ksh functions
 #3a. cp $UV/sfun/jobset51    sfun  # job init for insert at begin JCL/scripts
 #3b. cp $UV/sfun/logmsg1     sfun  # console msg function (date/time stamp)
 #3c. cp $UV/sfun/exportfile  sfun  # exports Logicalname=Physicalname (non GDG)
 #3d. cp $UV/sfun/exportgen*  sfun  # exports Logicalname=Physicalname (GDG)

Note that exportgen* copies exportgen0, exportgen1, & exportgenall. See listings & descriptions on pages '5J0' to '5J5'.

The JCL converter converts DLBLs & TLBLs to exportfile or exportgen. Examples:

      exportfile E212653 mstr/e2121653.mtaxe.piscines
      exportgen0 E212044 tape/tu.f01.e212-no.auxtxj_

When the JCL/scripts are executed, the export... functions will be called via the Korn shell 'FPATH' variable which is defined in the profile as $RUNLIBS/sfun.

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

4D2. Converting YOUR VSE JCL to Korn shell scripts

script to copy supplied control files & functions

 # copyvsectls - copy Vancouver Utility control files & functions
 #               required to convert mainframe JCL & COBOL
 #             - by Owen Townsend, UV Software, Oct 04/2008
 #
 # Run this script after creating testlibs/subdirs for JCL/COBOL conversion
 #
 # 1. cd $TESTLIBS   - might be /home/userxx/testlibs, /p1/testlibs, or ??
 # 2. vsetestdirs    - setup subdirs required for JCL/COBOL conversion
 # 3. copyvsectls  <-- copy control files & functions for conversion & execution
 #    ===========
 #
 # copy control files
 cp $UV/ctl/cnvcob4.tbl   ctl  # search/replace table for COBOL cnvrtr
 cp $UV/ctl/cobdirectives ctl  # COBOL DIRECTIVES for compiler
 cp $UV/ctl/extfh.cfg     ctl  # COBOL file handler configuration
 cp $UV/ctl/jclunixop41   ctl  # options file for JCL converter
 cp $UV/ctl/gdgctl51      ctl  # GDG control text file
 cp $UV/ctl/gdgctl51I*    ctl  # GDG control Indexed file (.dat & .idx)
 cp $UV/ctl/GDGmkdirs     ctl  # script to make subdirs for new GDG files
 cp $UV/ctl/gdgctl51*     $TESTDATA/ctl # GDG control files moved to $RUNDATA
 cp $UV/ctl/GDGmkdirs     $TESTDATA/ctl # make subdirs for new GDG files
 #Apr16/09 - GDG control files moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/...
 #           to allow multiple $RUNDATA's to have different control files
 #
 # copy all ksh functions
 cp $UV/sfun/* sfun            # copy all ksh functions used in JCL/scripts
 #============================
 # - cp above copies all functions, here are their descriptions
 # jobset51       - job init for insert at begin JCL/scripts
 # jobend51       - job end copy new GDGs from jobtmp to subdirs
 # jobabend51     - job ABend, ERRmsg & warn new GDGs not updated
 # logcron1       - console msg for scripts run by cron (date/time stamped)
 # logmsg1        - console msg (date/time stamp)
 # logmsg2        - console msg (date/time stamp) reverse video
 # exportfile     - exports Logicalname=Physicalname (non GDG)
 # exportgen0     - exports for GDG file for current generation
 #                  or prior generations, -1, -2, etc
 # exportgen1     - exports for next generation, +2, +3, etc
 # stepctl51      - step ctl function for jcpause
 exit 0

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

4E1. Converting YOUR MVS JCL to Korn shell scripts

Modifying JCL converter options

Here are the 1st 30 lines from the JCL converter control file listed on '3E1'. The options are coded on the 1st line & described on the following 29 lines. You must review & modify these options appropriately for your site.

 jclunixop41:d0e1g1i3j1l1p0q0r0s0t12u1y0 #<-- option dflts for VUdoc test/demos
 #           d1             - debug, generate 'echo's for 'cobrun's
 #             e1           - generate 'exportfile' function (vs export)
 #                          - to display filenames for console log
 #               g0         - create new GDG's in $RUNDATA/subdir/gdgfile_
 #               g1         - new GDGs $JGDG relative move to subdir/ at EOJ
 #               g2         - new GDGs $JGDG absolute $RUNDATA/jobtmp/...
 #                 i1       - lookup ctl/listcat3I for file info (rcsz,keys,etc)
 #                 i2       - lookup ctl/datafiles43I for file info (rcsz,keys)
 #                   j1     - insert jobset51 for RUNDATE=ccyymmdd (obsolete ?)
 #                   j2     - jobset52 RUNDATE=mm/dd/ccyy old, jobset52 now $JGDG
 #                   j4     - might need new optn j4 for RUNDATE=mm/dd/ccyy ?
 #                     l1   - generate logmsg1, show script msgs on screen only
 #                     l2   - generate logmsg2, appends to joblog/jobname.log
 #                     l4   - generate logmsg4 for Bgn/End Job (vs logmsg1/2)
 #                       p1 - on COBOL steps, generate printer files as follows:
 #                          - exportfile SYS010 $JTMP/$JOBID2_step_$PROGID
 #                          - exportfile SYS010L $RPTS/$JOBID2_step_$PROGID_$date
 #                          - uvcopy cnvrpt1,fili1=$SYS010,filo1=$SYS010L
 #                       q1 - apply TOPNODES table replace/verify 1st Qualifier
 #                    r0    - gen cobrun for unix/linux .ints (allow animation)
 #                    r1    - gen runw for .ints NetExpress/Windows/UWIN/CYGWIN
 #                    r2    - assume executables $DX/program either unix/windows
 #                    r16   - execute RPG programs, $RPX/program
 #                  s1      - #< comment out SYSIN instream data (for LAVAL)
 #                          - instream data extracted separate files jobparms/..
 #                          - export SYS011 defines jobparms/.. file vs $JTMP/..
 #              t12         - TLBL options for exportgen0/1,tape/,date/time
 #                          (t1=date,t2=time,t4=subdir tape/,t8=exportgen0/1)
 #            u1            - convert IEBGENER to uvcp (vs cp default)
 #            u2            - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 files
 #          y1              - customization for CUCBC (printer class changes)

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

4E2. Converting YOUR MVS JCL to Korn shell scripts

jclunixop41 - topnode/subdir control

Here are lines 77-115 from the JCL converter control file:

 #----------------------- control table --------------------------------
 # controls filename conversion depending on 1 or 2+ nodes ('.'s)
 # TOPDIRDFL1 - used if only 1 node & not typJM in ctl/datafiles43
 #            - 'wrk' since 1 node files usually 'SORTOUT's
 #            - temp files, input to following steps, not needed after job ends
 # TOPDIRDFL2 - used if only 1 node & typJM on ctl/datafiles43 matching filename
 #            - 'M' of typJM stored if ',CAT=' found on DLBL by jcldata41
 # TOPDIRINS1 - if specified & no typJM, insert above top-node (retain all '.'s)
 #            - used for all files with 2+ nodes (TOPDIRDFL1/2 used if only 1)
 #            - if TOPDIRINS1/2 unspecified, topnode becomes a directory
 # TOPDIRINS2 - if specified & typJM, insert above top-node (retain all '.'s)
 #            - OVERRIDDEN if datafiles43I has topr=... or topi=...
 :CTLTBL:
 TOPDIRDFL1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRDFL2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINS1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINS2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 #------------------------ TOPNODES table ------------------------------
 # table of TOPNODES allowed & replacements (optional)
 # 01-30 - topnodes allowed
 # 31-60 - topnode replacements (if col 31 not '~')
 # - if 01-30 of last entry 'ALLOTHER', any others replaced by 31-60
 # - use statmvsjcl1 to create summary table of topnodes used in all JCL
 # - see www.uvsoftware.ca/mvsjcl.htm#6A2
 # - code in lower case since applied at output time(script) vs input(JCL)
 :TOPNODES:
 ar~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 gl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 rpts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 work~~~~~~~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #Note1 - you must also code valid top-nodes in $RUNLIBS/ctl/GDGmkdirs
 #      - called by jobset51 to setup subdirs for new generations of GDG files
 #      - see listing at MVSJCL.htm#4E6
Note
  • TOPNODES activated by option 'q1' 1st line jclunixop41 (see prior page)
  • this example uses 'q0' (disabled)
  • the CTLTBL (above TOPNODES puts all permanent files in subdir mstr/...
    and all temporary files in subdir wrk/...
  • 'M' or 'W' coded in control files for JCL converter (see page '4I11')

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

4E3. Converting YOUR MVS JCL to Korn shell scripts

TOPNODES table

In September 2009, the TOPNODES table feature was added to the VSE JCL converter from similar code in the MVS JCL converter. The TOPNODES table (in the control file, ctl/jclunixop41), allows you to modify the TOPNODES (High Level Qualifiers) on all data filenames (DLBL's & TLBL's).

You might use the :TOPNODES: replace table if you want to use the 'HLQ's as sub-directories in the converted Korn shell scripts. You would also need option 'q1' in ctl/jclunixop41 to activate this feature.

Previously you could use the HLQs as subdirs using 'TOPDIRDFL1/2' in the :CTLTBL: (in ctl/jclunixop41), but this used whatever HLQ was coded on the mainframe filename without modification to a desired set of subdir names.

Note that all TLBL's are automatically converted to GDG files in subdir 'tape/'.

full-PATH or relative-PATH data filenames

We strongly recommend that all data filenames be coded as relative-PATH, since that allows us to use the same script for TESTing & PRODuction &/or to allow different programmers to use different sets of TEST data.

This flexibility is achieved by defining variables RUNDATA=TESTDATA or PRODDATA and RUNLIBS=TESTLIBS or PRODLIBS in the profiles of programmers & operators, It works because the JCL converter inserts function 'jobset51' or 'jobset52' at the begining of all output scripts. These functions perform 'cd $RUNDATA' so all data filenames can be coded relative to $RUNDATA.

However, some customers may need full-PATH data filenames (probably because they are using unikix software). MVS customers can use option 'w2' in ctl/jclunixop51 to insert '$RUNDATA/' at the begining of all data filenames.

Full-PATH names also requires jobset52 vs jobset51. Both define subdirs for temporary files & new generations of GDG files until successful EOJ.

      export JTMP=jobtmp/$JOBID2              <-- relative-PATH in jobset51
      export JGDG=jobtmp/$JOBID2/GDG
      export JTMP=$RUNDATA/jobtmp/$JOBID2     <-- full-PATH in jobset52
      export JGDG=$RUNDATA/jobtmp/$JOBID2/GDG

options g0,g1,g2

Options g0,g1,g2 (in ctl/jclunix41) are related to the above discussion.

option g0
  • creates new generations of GDG files in the original subdirs
option g1
  • creates new generations of GDG files in temp subdir $JGDG/
    (to be moved back to original at successful EOJ)
  • assuming jobset51 used to define relative-PATH name for $JGDG/
option g2
  • creates new generations of GDG files in temp subdir $JGDG/
    (to be moved back to original at successful EOJ)
  • assuming jobset52 used to define absolute-PATH name for $JGDG/

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

4E4. Converting YOUR MVS JCL to Korn shell scripts

customizing for YOUR Top-Nodes

Before converting your JCL to Korn shell scripts, you must decide whether to store all your data-files in 1 directory (suggest mstr/...), or to use your top-nodes as subdirs within $RUNDATA.

We will illustrate 'customizing for your topnodes' using the demo files distributed in /home/uvadm/vsetest/testlibs/ctl/... If you performed the demos in Part_1, you would have setup user 'vsetest' & the demo files would now be in /home/vsetest/testlibs/ctl/... ($TESTLIBS/ctl/ & $RUNLIBS/ctl/).

For your own conversion, you would setup a new set of TESTLIBS as illustrated on page '4C3' & populated subdirs cbl0, cpy0, jcl0, proc0, etc with your own COBOL & JCL modules. Page '4C3' shows these subdirs at /p1/testlibs/..., but you can place them wherever desired (& define that path using $RUNLIBS).

topnode/subdir assignment

Topnode validation & subdir assignment is controlled by the :CTLTBL: & :TOPNODES: tables within the JCL converter control file (ctl/jclunixop41).

The supplied tables reflect the test/demos in Part_1 (using top-node/subdirs ar, gl, py). You should modify the :TOPNODES: table for your valid top-nodes.

You should code your most common top-nodes in the :TOPNODES: (allowed) table & all other (low volume) will be combined into a 'misc' directory.

You must also code your valid topnodes in the '$RUNLIBS/ctl/GDGmkdirs' script, listed on the page '4E6'.

Note
  • see more discussion & examples of top-node/subdirs at 'MVSJCL.doc#6C1'
    (not in this VSEJCL.doc).

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

4E5. customizing for YOUR Top-Nodes

customizing Top-Nodes - Procedures Required

  1. Determine the topnodes used by your JCL, using the 'statmvsjcl1' job. See the demo summary table output listed below. Here are the concise operating instructions for your JCL (assuming $RUNLIBS & 'cdl' are defined for your TESTLIBS vs the demo testlibs).

 1a. Login --> your home directory
     =====

 1b. cdl alias --> your TESTLIBS/RUNLIBS
     ===

 1c. uvcopy statvsejcl1  <-- create summary tables for programs,procs,topnodes
     ==================    - just the 'topnodes' table listed below
                             (see programs & procs tables at CNVaids.htm#4B1)

stats/jcl0_topnodes summary table

     statmvsjcl1 2008/08/08_20:03:18 Summary table of DSN Top-Nodes in jcl0
     tbl#003 pg#001     -argument-
     line#  count    %  Top-Node
         1      27  19  &&(ALLTempFiles)
         2      33  23  AR
         3      57  41  GL
         4      10   7  PY
         5       2   1  RPTS
         6       3   2  WRK
         7       1   0  WRK(IKJDEMO1)
               138*100   *TOTAL*
  1. Based on your topnode summary table, decide on any changes & consolidations desired. You might combine low volume topnodes into a 'misc/' subdir. You can also change topnode spellings if desired.

  2. Modify the :TOPNODES: table in the JCL conversion control file. See demo topnodes table listed above on page '4e1' (lines 100-125 excerpted from $TESTLIBS/ctl/jclunixop41). Replace the demo topnodes with your topnodes.

 3a. vi ctl/jclunixop41   <-- edit the JCL conversion control field
     ==================     - replace demo topnodes with your topnodes
  1. Modify the topnode/subdirs in $TESTLIBS/ctl/GDGmkdirs. 'GDGmkdirs' is a script to create topnode/subdirs in the 'jobtmp' directory, used to store new generations of GDG files until successful EOJ reached, then moved to the intended $RUNDATA/subdirs. The GDGmkdirs script is called by function 'jobset51', which is called on line 10 of all converted JCL/scripts.

 4a. vi ctl/GDGmkdirs     <-- edit supplied GDGmkdirs script
     ================       - replace demo topnode/subdirs with yours

See the GDGmkdirs script listed on the next page --->

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

4E6. customizing for YOUR Top-Nodes

ctl/GDGmkdirs - make topnode/subdirs

'GDGmkdirs' is a script to make the topnode/subdirs in the jobtmp/subdirs used to hold new generations of GDG files, until successful EOJ, when they are moved back to the intended $RUNDATA/subdirs. Here is the demo script distributed in $TESTLIBS/ctl/GDGmkdirs.

 # GDGmkdirs - make subdirs for GDG files
 #           - by Owen Townsend, UV Software, Aug 25/2008
 #
 # script in $RUNLIBS/ctl/... called by jobset51 (called by all JCL/scripts)
 # exportgen1 creates new GDG files in $RUNDATA/$JGDG/subdirs/...
 # - where: JGDG=$RUNDATA/jobtmp/$JOBID2/GDG/
 # - at normal EOJ, GDG files are moved to intended subdirs (NOT if Abterm)
 #
 # user must code names of his site's data file subdirs here
 # - matching the TOPNODEs table in $RUNLIBS/ctl/jclunixop41
 # - following subdirs are for the demo JCL/scripts
 #   (at www.uvsoftware.ca/mvsjcl.htm#Part_1)
 #
 if [[ ! -d $JTMP ]]; then
    echo "JTMP not defined or not in \$RUNDATA"; exit 81; fi
 #
 # make $JGDG/ for gdg subdirs
 # also make $GTMP/ for exportgen0/1 'ls' outputs to determine latest gen#s
 if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi
 if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi
 #
 # You MUST modify following (ar,gl,etc) to the subdirs desired at your site
 #==========================================================================
 if [[ ! -d $JGDG/ar ]]; then mkdir $JGDG/ar; fi
 if [[ ! -d $JGDG/gl ]]; then mkdir $JGDG/gl; fi
 if [[ ! -d $JGDG/py ]]; then mkdir $JGDG/py; fi
 if [[ ! -d $JGDG/tape ]]; then mkdir $JGDG/tape; fi
 if [[ ! -d $JGDG/misc ]]; then mkdir $JGDG/misc; fi
 exit 0
Note
  • for your conversion, you must modify the demo subdirs (ar,gl,etc above)
    to your list of topnode/subdirs (determined by running statmvsjcl1).
  • see statmvsjcl1 sample/demo on the previous page

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

4F1. Converting YOUR VSE JCL to Korn shell scripts

Transferring LIBS & DATA from the mainframe

I assume you will have FTP connections from the mainframe to unix/linux. Please see page '4D4' for the recommended directory design to receive the libraries onto the unix/linux system. By convention the directories receiving the mainframe modules have suffix '0', intermediate conversions have suffix 1,2,3,etc, and fully converted directories have suffix 's'. Only the '0' subdirs are shown here.

If possible create .zip files on the mainframe. You might name them cbl.zip, cpy.zip, jcl.zip, proc.zip, etc. FTP them into the appropriate subdirs. Then change into each subdir, unzip & remove the .zip file.

 /p1
 :-----testlibs          - RUNLIBS=$TESTLIBS=/p1/testlibs
 :     :------
 :     :--MF--cbl0     <-- your COBOL programs transferred from mainframe
 :     :------
 :     :--MF--cpy0     <-- for COBOL copybooks
 :     :------
 :     :--MF--jcl0     <-- your JCLs transferred from mainframe
 :     :------
 :     :--MF--proc0    <-- your PROCs transferred from mainframe
 :     :------
       '--MF--'          - 'MF' indicates subdirs receiving from 'MainFrame'
 /p4
 :-----cnvdata            - $CNVDATA=/p4/cnvdata
 :     :------
 :     :--MF--cpys       <-- COBOL copybooks
 :     :--MF--ctl        <-- control files (LISTCAT)
 :     :--MF--d0         <-- data files FTP'd from mainframe (variable length)
 :     :------d0ebc        - filenames lower case, '.clus.vseprd' dropped
 :     :------d1ebc        - converted to fixed length for conversion
 :     :------d2asc        - converted to ASCII (packed/binary preserved)
 :     :------maps         - copybooks converted to record layouts
 :     :------pfx1         - uvcopy jobs generated from copybooks
 :     :------.etc.        - see other subdirs on page '4D7'

'd0' will hold the data files to be converted.

If possible, create LISTCAT reports on the mainframe & transfer to ctl/listcat0. We will extract record-sizes, indexed keys, etc to guide us in datafile & JCL conversions. See LISTCAT processing on page '4H1'.

The 'copybooks' are used to generate the 'uvcopy jobs' that perform the datafile conversions. Copybooks might be stored directly into $CNVDATA/cpys (to assist datafile conversion), but better if you 1st convert in $TESTLIBS (as instructed on page '4G1') & then copy from $TESTLIBS/cpys to $CNVDATA/cpys.

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

4G1. Converting YOUR VSE JCL to Korn shell scripts

Converting COBOL copybooks/programs & Compiling

COBOL conversion is covered here in the JCL conversion documentation to make this a complete review of all steps required for the several 'Re-Conversions' that may be performed during the mainframe conversion period.

But for your 1st COBOL conversions, you must follow the procedures documented in VSECOBOL.htm. Initial conversions & compiles usually encounter many errors that can be resolved by modifying the search/replace tables provided for reserved word differences & customer site coding peculiarities.

Here in VSEJCL.doc we are summarizing the COBOL re-conversions, that might be performed 2 or 3 times during the conversion/test/debug period, to capture updates that have been made on the mainframe.

converting All COPYBOOKs

 cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys
       cleanup         convert         copy(cp)

 #0a. Login as appsadm ---> /home/appsadm

 #0b. cdl  --> $TESTLIBS

 #1. cnvMF41Ac all        <-- convert ALL copybooks from cpy0 to cpy1 & cpy2
     ============

 #2. cp cpy2/* cpys      <-- copy converted copybooks to cpys (used by compiler)
     ==============

 #3. cp cpy2/* $CNVDATA/cpys  <-- also copy to $CNVDATA for datafile conversion
     =======================

converting All PROGRAMs & compiling

 cbl0 -------> cbl1 -------> cbl2 --------> cbl3 ----------> cbls -------> cblx
      cleanup       convert       copy(cp)       sysin cnvt       compile

 #1. cnvMF41A all         <-- convert ALL programs from cbl0 to cbl1 & cbl2
     ===========

 #2. cp cbl3/* cbls      <-- copy converted programs to cbls (used by compiler)
     ==============

 #4. mfcblA all          <-- recompile all cobol programs, cbls --> cblx
     ==========

 #5. uvlpd1p cblx .err   <-- print 1st page of all .err reports
     =================     - to guide programmers making corrections
                           - should be very few on these reconversions

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

4G2. Converting YOUR VSE JCL to Korn shell scripts

Converting 1 COBOL copybook/program & Re-compiling

Here are some handy scripts you can use to re-convert & re-compile 1 copybook or 1 COBOL program at a time (vs prior page ALL copybooks & ALL programs). The scripts are supplied in /home/uvadm/sf/IBM/... & are listed in VSECOBOL.htm#5C1.

converting 1 COPYBOOK at a time

 cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys
       cleanup         convert         copy(cp)

 #0a. Login as appsadm or yourself

 #0b. cdl  --> $TESTLIBS

 #1. cnvMF41c cpy0/copybknm.cpy  - convert 1 copybook cpy0->cpy1->cpy2
     ============================

 #2. cp cpy2/copybknm.cpy cpys   - copy converted copybook to cpys
     =========================   - above script prompts for this

 #3. cp cpy2/copybknm.cpy $CNVDATA/cpys  - also copy to $CNVDATA
     ==================================  - for datafile conversion

converting 1 PROGRAM & Re-Compiling

 cbl0 -------> cbl1 -------> cbl2 ------> cbl3 ------> cbls ------> cblx
      cleanup       convert      acpt cnv --- prompt for copy & compile ---
                                             copy(cp)       compile

 #1. cnvMF41 cbl0/progname.cbl  - convert 1 program cbl0->cbl1->cbl2->cbl3
     =========================    (prompts to copy cbl3->cbls)

 #2. cp cbl3/progname.cbl cbls  - copy cnvrtd program to cbls
     =========================    (if you replied`'n' above)

 #3. mfcbl1 progname.cbl        - recompile 1 cobol program cbls-->cblx
     ===================

only if compile fails


 #4. uvlp12 cblx/progname.err e1  - print 1st page of .err reports
     ===========================  - to guide correction & recompile

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

4H1. Converting YOUR VSE JCL to Korn shell scripts

create Data conversion control file from LISTCAT

We assume the LISTCAT report has been transferred from the mainframe & stored at $CNVDATA/ctl/listcat0. 'catgut41' will extract filenames, avg-recsize, max-recsize, indexed key start(lth) onto 1 line per file.

Initial data conversions must be performed as instructed in VSEDATA.htm. Here in VSEJCL.doc, we are covering 'Re-Conversion', because you might reconvert all JCL,COBOL,DATA 2 or 3 times during conversion period

You will not recreate the DATA conversion control file ($CNVDATA/ctl/ctlfile4), because it required manual editing to add copybook names.

But you might want to recreate the 'JCL conversion control file' ($TESTLIBS/ctl/listcat3I), because a newer LISTCAT from the mainframe might provide more accurate information on the datafiles for the JCL converter.


 #1a. Login as appsadm ---> /home/appsadm

 #1b. cdc  --> $CNVDATA

 #2. uvcopy catgut41,fili1=ctl/listcat0,filo1=ctl/listcat1
     =====================================================
     - extract data conversion info from mainframe LISTCAT report

 #3. sort -o ctl/listcat2 ctl/listcat1
     =================================
     - sort by data file name, see sample listing on page '4I11'
     - see full listing at VSEDATA.htm#8B1.

 #4. uvlp12 ctl/listcat2     <-- list the output file
     ===================

 #5. vi ctl/listcat2         <-- edit the listcat extract
     ===============
     - drop unwanted files (not required for conversion)
     - add any missing files (not on disc when LISTCAT run)

 #6. uvlp12 ctl/listcat2     <-- re-list the listcat extract report
     ===================
     - store in 3 ring binder for frequent reference during conversion

 #7. cp ctl/listcat2 $TESTLIBS/ctl
     ============================
     - copy listcat2 from $CNVDATA to $TESTLIBS for later use in JCL conversion
     - see JCL/script conversions using listcat2 on page '4I12'
Note
  • instructions above are repeated from page 1E2 of VSEDATA.htm#1E2
  • those instructions continue to create 'ctlfile4' used for data conversion
  • we stop here because ctl/listcat2 is all we need for the JCL conversion
  • see page '4I12' where listcat2 is copied to listcat3 & loaded into
  • Indexed file ctl/listcat3I used by the JCL converter.

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

4I1. Converting YOUR VSE JCL to Korn shell scripts

Converting Your DATA files

DATA conversion is covered here in the JCL conversion documentation to make this a complete review of all steps required for the several 'Re-Conversions' that may be performed during the mainframe conversion period.

The mainframe data files might be re-transferred & reconverted 2 or 3 times during the test/debug period, & of course 1 final time on the 'go live' weekend.

For your 1st DATA file conversions, you must follow the procedures documented in VSEDATA.htm. VSEDATA.doc shows you how to generate the data conversion 'uvcopy jobs' from the COBOL copybooks. This can be completely automatic, unless you have files with multiple record types, in which case some manual coding is required.

For subsequent DATA file conversions, you can use the data conversion uvcopy jobs that were generated (& modified) during the initial conversion. You may need changes to some jobs if the mainframe copybooks change during the conversion period.

Here in VSEJCL.doc, we will briefly review how to re-convert datafiles, assuming the data conversion jobs have already been generated as documented in VSEDATA.htm#Part_4. You can use the data re-convert instructions when you re-transfer data files from the mainframe, which you might do several times during the testing period.

BUT, if you change any copybooks (from which data conversion jobs are generated) or the control file ctl/datacnv44I (which relates copybooks to datafilenames & provides file types & keys), then you must refer to VSEDATA.htm#PART_4 to re-generate the data conversion 'uvcopy jobs' in $CNVDATA/pfx3.

Important Notes

Note
  • for INITIAL datafile conversions, you MUST use VSEDATA.htm
  • generate uvcopy jobs (automatically from COBOL copybooks)
  • modify uvcopy jobs for files with multiple record-types
Note
  • for SUBSEQUENT datafile conversions, just EXECUTE the uvcopy jobs
  • already generated, modified, tested during initial conversions

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

4I2. Converting YOUR VSE JCL to Korn shell scripts

GENERATING data conversion jobs

'EXECUTE' data conversions here in VSEJCL

subdirs to GENERATE 'data conversion uvcopy jobs'

 /p4/cnvdata/  <-- Data conversion superdir ($CNVDATA)
 :-----cpys      - COBOL copybooks
 :-----ctl       - conversion control files
 :-----maps      - 'cobmaps' record layouts generated from copybooks
 :-----pfx1      - conversion jobs generated from COBOL copybooks by 'uvdata41'
 :-----pfx2      - conversion jobs with actual datafile names & indexed keys
 :               - coded by utility 'uvdata52' using control file ctl/datacnv54I
 :-----pfx3      - uvcopy jobs copied from pfx2 & modified for various reasons
 :               - for Multi Record Type files (insert code to test types)
 :               - will execute the jobs from pfx3

generating data conversion jobs

 cpys ---------> maps ---------> pfx1 ---------> pfx2 ----------> pfx3/...
       cobmap1          uvdata41       uvdata52         cp & vi  (data cnvt jobs)
                                   (ctl file req'd)

The data conversion jobs are generated from the COBOL copybooks, but we also need a control file to relate the copybooks to the datafilenames, and also to supply file types, indexed keys, etc.

creating the data conversion control file

The mainframe 'LISTCAT' report is the best place to get this information. We can transfer the mainframe file & extract the information into a control file used in the conversion job generations. See procedures at VSEDATA.htm#4E1 thru page 4F6.

 mainframe         unix/linux
 LISTCAT -----> ctl/listcat0 ---------> ctl/datacat41 ----------> ctl/datacnv54I
          FTP                catdata41            (many steps omitted)

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

4I3. Converting YOUR MVS JCL to Korn shell scripts

subdirs to GENERATE 'data conversion uvcopy jobs'

 /p4/cnvdata/  <-- Data conversion superdir ($CNVDATA)
 :-----cpys      - COBOL copybooks
 :-----ctl       - conversion control files
 :-----maps      - 'cobmaps' record layouts generated from copybooks
 :-----pfx1      - conversion jobs generated from COBOL copybooks by 'uvdata41'
 :-----pfx2      - conversion jobs with actual datafile names & indexed keys
 :-----pfx3      - uvcopy jobs copied from pfx2 & modified for multi R/T files
 :               - will execute the uvcopy jobs from pfx3

subdirs for DATA files to be converted

 /p4/cnvdata/           <-- DATA files in same superdir as Generation subdirs
 :-----d0ebc                    <-- EBCDIC data files FTP'd from mainframe
 :     :---AR.DATA.FILE1          - filenames UPPER case
 :     :---GL.DATA.FILE1(0)       - GDG file suffixes (0), G1234V00, etc
 :     :---GL.DATA.FILE2.G1234V00 - GDG file suffixes (0), G1234V00, etc
 :     :---...etc...
 :-----d1ebc                    <-- EBCDIC data filenames changed to unix stds
 :     :---ar.data.file1          - filenames lower case
 :     :---gl.data.file1_000001   - GDG file suffixes changed to VU conventions
 :     :---gl.data.file2_000001   - GDG file suffixes changed to VU conventions
 :     :---...etc...
 :-----d2asc                    <-- to receive ASCII conversions
 :     :---ar.data.file1          - ASCII data files from most recent conversion
 :     :---gl.data.file1_000001   - copy from here to refresh testdata subdirs
 :     :---gl.data.file2_000001   - copy from here to refresh testdata subdirs
 :     :---...etc...

subdirs for $TESTDATA

 p1/testdata/                   <-- $TESTDATA ($RUNDATA) for testing
 :-----ar                          - topnodes/subdirs (ar,gl for illustrations)
 :     :---data.file1              - subdirs/datafiles copied here for testing
 :     :---...etc...               - refreshed whenever required from cnvdata
 :-----gl
 :     :---data.file1_000001
 :     :---data.file2_000001
 :     :---...etc...
 :     :

Then script 'copy2nodes' copies all files from $CNVDATA/d2asc to the subdirs in $TESTDATA/... making subdirs as required from the topnode of the filenames.

Note that the datafiles in $CNVDATA/d2asc topnodes 'ar' & 'gl' are converted to subdirs when copied to $TESTDATA/...

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

4I4. Converting YOUR VSE JCL to Korn shell scripts

$CNVDATA/ctl/ctlfile4

$CNVDATA/ctl/ctlfile4 is a very imporatnt file used in generating the uvcopy jobs that perform the EBCDIC to ASCII data conversions.

ctlfile4 can be generated from the mainframe LISTCAT report as documented at VSEDATA.htm#1E2, but you must manually enter the copybook names into the slots provided.

If the LISTCAT report is not available you could construct ctlfile4 with the editor. The number of datafiles that need to be converted may be a lot less than the number of files shown on the LISTCAT report.

ctlfile4 is listed here in VSEJCL.doc to help you understand the entire conversion, but you MUST use the procedures documented on pages 1E1-1F1 of VSEDATA.htm#1E1 to GENERATE the conversion jobs.

But once the data conversion jobs have been generated, tested,& debugged you can easily EXECUTE them by following the procedures here in VSEJCL.doc.

During the conversion period you may want to refresh the data from the mainframe 2 or 3 times & of course on the 'go live' weekend.

$CNVDATA/ctl/ctlfile4

 e2121653.mtaxe.piscines cpy=e212159b rca=00082 rcm=00082 rcf=00128 key=000(020)
 e2121656.itaxe.facturat cpy=e212037b rca=00078 rcm=00245 rcf=00320 key=000(036)
 e2122683.itaxe.degrevem cpy=e212047b rca=00158 rcm=00265 rcf=00320 key=000(037)
 e2122941.mtaxe.permispn cpy=e212941b rca=00045 rcm=00045 rcf=00128 key=000(022)
 e2122942.mtaxe.droitmut cpy=e212942b rca=00030 rcm=00030 rcf=00128 key=000(011)
 e2122945.mtaxe.crtconst cpy=e212909b rca=00275 rcm=00275 rcf=00320 key=000(015)
 e2122951.mtaxe.matrenov cpy=e212910b rca=00050 rcm=00050 rcf=00128 key=000(022)
 e2122956.mtaxe.crtrenov cpy=e212912b rca=00270 rcm=00270 rcf=00320 key=000(026)
 e2123001.itaxe.banqtaxe cpy=e212001b rca=00066 rcm=00383 rcf=00448 key=000(036)
 e2123002.itaxe.taxation cpy=e212007b rca=00046 rcm=00383 rcf=00448 key=000(035)
 e2123003.itaxe.transdam cpy=e212024b rca=00464 rcm=00464 rcf=00512 typ=RSR
 e2123005.mtaxe.tpcalcul cpy=e212025b rca=00081 rcm=00081 rcf=00128 key=000(029)
 e2123691.itaxe.indexenc cpy=e212156b rca=00036 rcm=00036 rcf=00128 key=000(036)
 e2123692.itaxe.encaisse cpy=e212055b rca=00300 rcm=00426 rcf=00512 key=000(022)
 e2123693.itaxe.tranksds cpy=e212056b rca=00168 rcm=00453 rcf=00512 key=000(017)
 e2124696.itaxe.renovati cpy=e212061b rca=00036 rcm=00117 rcf=00192 key=000(036)
 e2125504.mtaxe.paracomp cpy=e212138b rca=00104 rcm=00307 rcf=00384 key=000(034)
 e2125520.mtaxe.indxpara cpy=e212136b rca=00066 rcm=00272 rcf=00320 key=000(034)
 e2126863.mtaxe.matadmis cpy=e212863b rca=00050 rcm=00050 rcf=00128 key=000(022)
 e2127546.mtaxe.donmarch cpy=e212142b rca=00152 rcm=00245 rcf=00320 key=000(020)
 e2146011.mtaxe.mapaqagr cpy=e214011b rca=00160 rcm=00160 rcf=00256 key=000(036)
 tu.f01.e211801.adrpos   cpy=e212105b rca=00250 rcm=00307 rcf=00384 typ=IDXf8v
 tu.f01.e212-no.trperm   cpy=e221004b rca=00080 rcm=00080 rcf=00128 typ=RSF
 tu.f01.e212-no.eauctr   cpy=compteau rca=00606 rcm=00606 rcf=00640 typ=RSF

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

4I5. Converting YOUR VSE JCL to Korn shell scripts

Executing jobs to convert ALL data files

 MF---->d0-------->d0ebc--------->d1ebc------------>d2asc-------->$TESTDATA/mstr
 #1 FTP   #2 copy     #3 var->fix   #4 EBCDIC->ASCII    #5 fix->var
             rename

 #1a. Login as appsadm --> /home/appsadm

 #1b. cdc ---> $CNVDATA    ('cdc' is an alias in common_profile)

 #2. cp d0/* d0ebc
     =============
     - copy datafiles to alt subdir for filename changes

 #3a. renameL d0ebc
      =============
      - translate datafilenames to lower case (standard for unix/linux)

 #3b. rename-X d0ebc .clus.vseprd
      ===========================
      - remove unwanted suffixes (.clus.vseprd, .clus.vsedev, etc)
      - do not apply to unix, do not need test/production indicators
      - test/prod provided by differences in profiles for prgrmrs/oprtrs
        with no need to have different filenames (or JCL/scripts)

 #4. uvcopyxx 'pfv2/*'
     =================
     - execute all uvcopy jobs to convert all datafiles from variable to fixed
     - copies all files from d0ebc/... to d1ebc/...
     - dropping the 2 byte binary prefix on varlth records
     - padding records with x'00's to a fixed length spcfd in the ctlfile
     - inserting recsize info string: <1=recsz<2=maxsz<3=fixsz<K=dsp(lth)
       in the space between record maxsz & fixsz spcfd in control file
     - files without 2 byte prefix are identified by 'typ=RSF' in the ctlfile
       which generated an fixlth version uvcopy job (vs varlth default)

 #5. uvcopyxx 'pfx3/*'
     =================
     - execute ALL uvcopy jobs in pfx3/... to convert all data files
     - copies all data files from d1ebc/... to d2asc/...
     - translating char fields from EBCDIC to ASCII
     - preserving any packed/binary fields (same as on mainframe)

 #6. uvcopyxx 'pfy3/*'
     =================
     - execute All uvcopy jobs in pfy3/... to restore original record sizes
       (original record sizes were saved at the end of extended records)
     - copies all data files from d2asc/... to d3asc/...

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

4I6. Converting YOUR VSE JCL to Korn shell scripts

Copying converted Data files to test directories

After data file conversion & before we can begin testing, we need to copy the converted data files from $CNVDATA/d2asc/... to $TESTDATA/mstr/...


 #7a. rm -f $TESTDATA/mstr/*     <-- remove old test data files
      ======================

 #7b. cp $CNVDATA/d3asc/* $TESTDATA/mstr
      ==================================
      - copy all converted files to $RUNDATA for testing

You might repeat above 7a & 7b several times during testing to 'refresh' the test data files back to an initial known state.

Note
  • you must perform initial DATA conversions as documented in 'VSEDATA.doc'
  • this is a brief summary here in VSEJCL.doc for reconversions
  • you might retransfer/reconvert datafiles 2 or 3 times during conversion

Old method of copying data files to $TESTDATA/mstr

Before the 'pfy3/*' uvcopy jobs were developed sizes, we used uxcp & uxsort scripts to to restore original record sizes. You should be able to use such scripts for special situations you may encounter.

Please see VSEDATA.htm#Part_4 for examples of uxcp/uxsort scripts to perform various data reformatting jobs:

  1. Changing fixed record sizes.

  2. Converting fixed size to variable length (IDXFORMAT8).

  3. Loading indexed files from sequential files.

  4. Sorting datafiles before loading indexed files, even if files were in sequence on the mainframe, because the ASCII collating sequence could cause out-of-sequences if the key field contains both char & numeric (since numerics are now lower than alphas in ASCII).

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

4I7. Converting Mainframe DATA to unix/linux/windows

Executing 1 job to convert 1 data file

As already stressed on page '4I1' you must already have generated the datafile conversion jobs using the procedures documented in VSEDATA.htm.

You may need to convert 1 data file if some files were missed during the initial conversion or you need to transfer & convert the current datafile from the mainframe.

 MF---->d0-------->d0ebc--------->d1ebc------------>d2asc-------->$TESTDATA/mstr
 #1 FTP   #2 copy     #3 var->fix   #4 EBCDIC->ASCII    #5 fix->var
             rename

 #1a. Login as appsadm or as yourself

 #1b. cdc ---> $CNVDATA      ('cdc' is an alias in common_profile)

 #2. cp d0/datafilename d0ebc
     ========================
     - copy the datafile to alt subdir for filename changes

 #3a. renameL d0ebc
      =============
      - translate datafilenames to lower case (standard for unix/linux)
      - renameL can be used for 1 file or all files in directory

 #3b. rename-X d0ebc .clus.vseprd
      ===========================
      - remove unwanted suffixes (.clus.vseprd, .clus.vsedev, etc)
      - rename-X can be used for 1 file or all files in directory

 #4. uvcopy pfv2/datafilename
     ========================
     - execute 1 uvcopy jobs to convert 1 datafile from variable to fixed
     - copies the file from d0ebc/... to d1ebc/...
     - dropping the 2 byte binary prefix on varlth records
     - padding records with x'00's to a fixed length spcfd in the ctlfile
     - inserting recsize info string: <1=recsz<2=maxsz<3=fixsz<K=dsp(lth)

 #5. uvcopy pfx3/datafilename
     ========================
     - execute 1 uvcopy job to convert 1 datafile
     - copies the datafile from d1ebc/... to d2asc/...
     - translating char fields from EBCDIC to ASCII
     - preserving any packed/binary fields (same as on mainframe)

 #6. uvcopy pfy3/datafilename
     ========================
     - execute 1 uvcopy job to restore original record sizes
     - as we copy from d2asc/... to d3asc/...

 #7. cp d3asc/datafilename $TESTDATA/mstr
     ====================================
     - copy datafile over to $TESTDATA subdirs for testing

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

4I8. Converting Mainframe DATA to unix/linux/windows

Old method of copying data files to $TESTDATA/mstr

Before the 'pfy3/*' uvcopy jobs were developed sizes, we used uxcp & uxsort scripts to to restore original record sizes. You should be able to use such scripts for special situations you may encounter.

Please see VSEDATA.htm#Part_4 for examples of uxcp/uxsort scripts to perform various data reformatting jobs:

  1. Changing fixed record sizes.

  2. Converting fixed size to variable length (IDXFORMAT8).

  3. Loading indexed files from sequential files.

  4. Sorting datafiles before loading indexed files, even if files were in sequence on the mainframe, because the ASCII collating sequence could cause out-of-sequences if the key field contains both char & numeric (since numerics are now lower than alphas in ASCII).

    scripts to reformat/sort/copy 1 file to test dir

The following examples are listed later in VSEDATA.htm#Part_4. You can use them as templates to help you create uxcp/uxsort scripts for loading other data files.


 #1. sfload/copyRSF_tu.f01.e212-no.trperm
     ====================================
     - copy sequential data (originally tape)

 #2. sfload/sortIDXf1_e2121653.mtaxe.piscines
     ========================================
     - copy/sort/load Fixed length Indexed file

 #3. sfload/sortIDX8_e2123002.itaxe.taxation
     =======================================
     - copy/sort/load Variable length Indexed file

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

4I9. Converting YOUR VSE JCL to Korn shell scripts

copying converted data files to $TESTDATA

Most mainframe conversion sites choose to use the topnode as a sub-directory on the unix/linux target systems. UV software provides the 'copy2nodes' script to facilitate this.


 #24. rm -rf $TESTDATA/*   <-- remove all subdirs from testdata dir
      ==================

 #25. vsedatadirs    <-- recreate the basic subdirs required in testdata
      ===========      - jobtmp, joblog, rpts, sysout, tmp, wrk

 #26. copy2nodes d2asc $TESTDATA
      ==========================
      - copy all converted datafiles, creating subdirs from topnodes
        (subdir created when new topnode 1st encountered)
Note
  • above DATA conversions originate from VSEDATA.htm#4G2 thru 4G6.
  • only the 'Re-Execution' steps are shown here in VSEJCL.doc
  • you MUST refer to VSEDATA.htm#Part_4 to 'Re-Generate' pfx3 jobs
  • if any copybooks or control file changes have been made

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

4I10. JCL/script conversion assisted by Datafile conversion

create JCL conversion DATA-INFO file from LISTCAT

We have already shown on page '4H1' how the mainframe LISTCAT is used to create the 'DATA conversion control file' ($CNVDATA/ctl/ctlfile4).

Here we will illustrate how to use the LISTCAT info to also create a 'JCL conversion control file' ($TESTLIBS/ctl/listcat3I). The JCL converter will still run without ctl/listcat3I, but the conversion will be improved if it is available.

Page '4H1' showed how record-sizes & indexed file key locations are extracted from the mainframe LISTCAT report into a control file (ctl/listcat2), which has 1 line per datafile with file info coded as keywords (rca=... rcm=... key=...).

For the initial conversion, you must use the step by step method documented on page '4K1'. For subsequent JCL conversions, you can use the 'jcl2ksh41A' script to perform all steps of JCL conversion with 1 command (see page '4N2'). But the ctl/listcat3I file should be prepared & loaded before you run jcl2ksh41A.

Note that step#3 in jcl2ksh41A is utility job 'jcldata41', which extracts all DLBLs/TLBLs from all JCL. These are sorted & duplicates dropped resulting in 1 line per unique datafilename found in all JCL. The output is written to $TESTLIBS/ctl/datafiles41.

The JCL converter uses the 2 Indexed files above to get file characteristics. 'listcat3I' has priority over 'datafiles43I'. The 'M' in 'typLM...' assigns these files to mstr/..., else to wrk/..., but TLBL files to tape/...

You can customize your conversion by modifying ctl/listcat3 & reloading the indexed file version ctl/listcat3I (using the 'loadcat3I' uvcopy job supplied).

You cannot customize datafiles41 since it is generated as part of the JCL conversion process, but you can create ctl/datafiles42 which is sorted with datafiles41 before loading ctl/datafiles43I used by the JCL converter.

To help you understand the process, the next page will show you a few lines of the control files before & after the jcldata42 updates.

If you are not already familiar with the subdirs in $CNVDATA & $TESTLIBS, please review them on pages '4D7' & '4D3'.

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

4I11. JCL/script conversion assisted by Datafile conversion

ctl/listcat3I - file info #1 for JCL converter

listcat3I is created by transferring the mainframe LISTCAT report, processing (as shown on page '4H1' & '4I12'),& loading into an indexed file.

 e2121653.mtaxe.piscines        rca=00082 rcm=00082 key=000(020) typLMC=IDXf1
 e2121656.itaxe.facturat        rca=00083 rcm=00239 key=000(036) typLMC=IDXf8v
 e2121853.mtaxe.b8409d35        rca=00024 rcm=00024 key=000(011) typLW_=IDXf1
 e2122683.itaxe.degrevem        rca=00158 rcm=00265 key=000(037) typLMC=IDXf8v
 e2122941.mtaxe.permispn        rca=00045 rcm=00045 key=000(022) typLMC=IDXf1
 e2122942.mtaxe.droitmut        rca=00030 rcm=00030 key=000(011) typLMC=IDXf1
 e2123001.itaxe.banqtaxe        rca=00126 rcm=00383 key=000(036) typLMC=IDXf8v
 e2123002.itaxe.taxation        rca=00046 rcm=00383 key=000(035) typLMC=IDXf8v
 e2123003.itaxe.transdam        rca=00464 rcm=00464 key=000(000) typLMC=RSR
 e2123004.itaxe.tranjour        rca=00464 rcm=00464 key=000(000) typLW_=RSF
 e2123005.mtaxe.tpcalcul        rca=00081 rcm=00081 key=000(029) typLMC=IDXf1
 e2123086.itaxe.encapost        rca=00080 rcm=00080 key=000(000) typLW_=RSF
 e2123691.itaxe.indexenc        rca=00036 rcm=00036 key=000(036) typLMC=IDXf1
 e2123692.itaxe.encaisse        rca=00146 rcm=00426 key=000(022) typLMC=IDXf8v
 e2123693.itaxe.tranksds        rca=00168 rcm=00453 key=000(017) typLMC=IDXf8v

ctl/datafiles43I - file info #2 for JCL converter

 e1133081.tfadm.b8306j02        rca=00464 rcm=00464 key=000(000) typJWV=RSF
 e2121653.mtaxe.piscines        rca=_____ rcm=_____ key=000(000) typJWV=RSF
 e2121656.itaxe.facturat        rca=00083 rcm=00239 key=000(036) typJWV=IDXf8v
 e2122680.ttaxe.b8401d30        rca=03180 rcm=03180 key=000(000) typJWV=RSF
 e2122683.itaxe.degrevem        rca=00158 rcm=00265 key=000(037) typJWV=IDXf8v
 e2122951.mtaxe.matrenov        rca=_____ rcm=_____ key=000(000) typJWV=RSF
 e2122958.ttaxe.b8409d36        rca=00236 rcm=00236 key=000(000) typJWV=RSF
 e2123001.itaxe.banqtaxe        rca=00126 rcm=00383 key=000(036) typJWV=IDXf8v
 e2123002.itaxe.taxation        rca=_____ rcm=_____ key=000(000) typJWV=RSF
 e2123003.itaxe.transdam        rca=_____ rcm=_____ key=000(000) typJWD=RSF
 e2123004.itaxe.tranjour        rca=00464 rcm=00464 key=000(000) typJWV=RSF
 e2123005.mtaxe.tpcalcul        rca=00081 rcm=00081 key=000(029) typJWV=IDXf1
 e2123010.ttaxe.sommtrie        rca=00464 rcm=00464 key=000(000) typJWV=RSF
 e2123011.ttaxe.rembours        rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v
 e2123013.ttaxe.c3001d31        rca=00360 rcm=00360 key=000(000) typJWV=RSF
 e2123013.ttaxe.rembtrie        rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v
 tu.f01.e211801.adrpos          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f01.e212-no.eauctr          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f01.e212-no.trperm          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f02.bkfaver.90-m07          rca=_____ rcm=_____ key=000(000) typJWT=RSF

The JCL converter uses the 2 Indexed files above to get file characteristics. 'listcat3I' has priority over 'datafiles43I'. The 'M' in 'typLM...' assigns these files to mstr/..., else to wrk/..., but TLBL files to tape/...

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

4I12. JCL/script conversion assisted by Datafile conversion

creating listcat3I from listcat2

Most of these procedures are automatic, but we provide you an opportunity to enhance the JCL conversion by manually updating the listcat2/3/3I control file to add datafiles that are missing from LISTCAT or to update file characteristics that you want to change for unix/linux.

You might only need to transfer & extract file info from LISTCAT once at the begining of the conversion, but you might update listcat3 & reload listcat3I several times to improve the conversion results.

We assume here that you have completed the procedures shown on page '4H1' to extract file info from LISTCAT. Those procedures may have already transferred listcat2 from $CNVDATA/ctl/... to $TESTLIBS/ctl/..., but we will repeat that step again in the instructions below.

update/load listcat3I (for JCL converter)


 #1a. Login as yourself or appsadm

 #1b. cdl ---> $TESTLIBS

 #2. cp $CNVDATA/ctl/listcat2 ctl
     ============================
     - copy LISTCAT info from data conversion superdir to JCL conversion dir

 #3. cp ctl/listcat2 ctl/listcat3
     ============================
     - copy/rename to protect future edits in listcat3
     - data convert procedures copy to listcat2, never to listcat3
     - only these JCL procedures will copy listcat2 to listcat3 & edit as reqd

 #4. vi ctl/listcat3
     ===============
     - update LISTCAT info as desired
     - add files missing when LISTCAT created on mainframe
     - modify/append keyword info on existing files as desired
Note
  • you probably would not update on the initial conversion
  • but you might update several times during conversion
  • then rerun jcl2ksh41A to get new file info into all JCL/scripts
  • updates get into jcl3/... not into jcls/... (already debugged)
  • but early in conversion most JCL/scripts still in jcl3/...
  • since we copy 1 at a time from jcl3/... to jcls/... when ready to debug

 #5. uvcopy loadcat3I,fili1=ctl/listcat3,filo1=ctl/listcat3I
     =======================================================
     - load LISTCAT info into Indexed file used by JCL converter

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

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

4J1. Converting YOUR VSE JCL to Korn shell scripts

Initial conversion of All JCL

You should perform the initial conversion of All Your JCL, using the step by step method documented in this section. Then you should test/debug 1 or 2 JCL/scripts to verify the conversions.

From the testing & debugging 1 or 2 JCL/scripts you may find improvements that can be made to the JCL converter options file (ctl/jclunixop41) & to the data information file (ctl/datactl53I). After modifying these control files you can reconvert the 1 or 2 JCLs using the 'jcl2ksh41' script (page '4N1')

After you are satisfied with the conversion & testing of 1 or 2 JCL/scripts, you can the use the 'jcl2ksh41A' script to reconvert all JCL/scripts, to realize the improvements in all JCL/scripts.

This works well because automatic conversions stop at jcl3, & we copy JCL/scripts from jcl3 to jcls, only when we are ready to test/debug each JCL/script.

                   ** directories involved in JCL conversion **
 /p1
 :-----testlibs        - RUNLIBS=$TESTLIBS=/p1/testlibs
 :     :-----
 :     :--MF--ctl    <-- control files
 :     :------         - jclunixop41 specifies options for JCL conversion
 :     :------         - listcat3I supplies file types,recsizes,indexed keys
 :     :------         - datafiles41 (filenames) extracted from all JCL
 :     :------           supplies file info for files missing from listcat3I
 :     :------           (because work files scratched, not present for LISTCAT)
 :     :------         - you can edit datafiles42 to override datafiles41 entries
 :     :------
 :     :--MF--jcl0   <-- your JCLs transferred from mainframe
 :     :------jcl1     - intermediate conversion 73-80 cleared
 :     :------jcl2     - PROCs expanded from procs
 :     :------jcl3     - JCLs converted to Korn shell scripts
 :     :------jcls     - copy here manually 1 by 1 during test/debug
 :     :-----
 :     :--MF--proc0  <-- your PROCs transferred from mainframe
 :     :------
 :     :--MF--slis   <-- SLI library may be included in JCLs
 :     :------

JCL conversion steps

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      manual copy
                                                             1 at a time

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

4J2. Converting YOUR VSE JCL to Korn shell scripts

preparation for JCL conversion

The first part of Part_4 documented several preparations required before attempting to convert your JCL. These are listed below with references back to the original documentation.

  1. You have installed the Vancouver Utilities as per '4B2' (briefly) and in complete detail in install.htm.

  2. You have setup user profiles as per '4B3' (briefly) and in complete detail at ADMjobs.htm#Part_1.

  3. I recommend you setup user 'appsadm' for initial conversions by the team leader. After initial mass conversions, the various team members will use their own logins for individual program compiling & JCL/script testing. See 'appsadm' setup at ADMjobs.htm#1D1 thru 1D7.

  4. Setup the conversion 'super-directory' as per pages '4C1' & '4C2'. The conversion superdir is defined as 'RUNLIBS' in the stub_profiles. In our example it is:

 export RUNLIBS=/p1/testlibs
 ===========================
Note
  • '/p1' is a separate file system (see ADMjobs.htm#Part_2)
  • for preliminary JCL conversion trials you could setup testlibs in a homedir
  • But for the serious conversion project I recommend separate filesystems.
  1. Setup the JCL & COBOL conversion subdirs. You can use the 'mvslibsdirs' script to setup the 30 subdirs listed on page '4C3'.

 #5a. login appsadm --> /home/appsadm

 #5b. cd $RUNLIBS  <-- change to the conversion superdir '/p1/testlibs'

 #5b. cdl          <-- same as above but easier
      ===              alias cdl='cd $RUNLIBS' is defined in the profile

 #5c. mvslibsdirs  <-- setup 30 subdirs for JCL & COBOL conversions
      ===========
  1. Copy conversion 'control files' to subdir ctl/... as per page '4D2'.

 #6a. copyvsectls  <-- script to copy control files from /home/uvadm/ctl
      ===========      to $RUNLIBS/ctl/...
  1. Modify JCL converter options 'ctl/jclunixop41' listed on page '4E1' and discussed thru page 4E6.

 #7a. vi ctl/jclunixop41  <-- modify JCL converter options
      ==================
  1. Transfer your mainframe JCLs, PROCs,& SYSIN/parms into the appropriate subdirs (jcl0, proc0, parm0) as discussed on page '4F1'.

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

4J3. Converting YOUR VSE JCL to Korn shell scripts

convert All JCL - 'script' method

For your initial conversion we recommend you use the 'step by step' method (starting on page '4K1'), because you can more easily notice any errors.

If you do try the 'do everything' script (jcl2ksh41A), be prepared to revert to the step by step method if you have problems. Or you could activate 'console logging' to capture all screen messages, or you could login from a 'putty' terminal with a large windows history.


 #1. Login as appsadm ---> /home/appsadm

 #2a. cd $TESTIBS  <-- change to the conversion superdir '/p1/testlibs'
      ===========

 #2b. cdl          <-- same as above but easier
      ===              alias cdl='cd $RUNLIBS' is defined in the profile

 #2c. cd $TESTIBS  <-- also same as above, since RUNLIBS=TESTLIBS at this point
      ===========

 #3. jcl2ksh41A all    <-- convert JCL thru all steps, as illustrated below
     =============      - reply null (take default) at all prompts
                        - or reply 'y' for prompts that demand a y/n response
                        - see jcl2ksh41A script listed on page '9A2'
 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh     copy 1 at a time
                                                          (before test/debug)
Note
  • rather than 'jcl2ksh41A' (do everything script) above
  • we recommend the 'step by step' method below (pages '1K1' - '1K5')
  • to better understand & to detect any errors sooner

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

4K1. Converting YOUR VSE JCL to Korn shell scripts

convert All JCL - 'step by step' method


 #0a. Login as yourself or appsadm

 #0b. cdl ---> $TESTLIBS

 #1. cleanup mainframe JCL, PROCs, SLIs,& PARMs (strip CR's, clear cols 73-80,
     & shorten to last nonblank).

 #1a. uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl     #<-- cleanup JCL
      ================================================
 #1b. uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.prc  #<-- cleanup PROCs
      ===================================================
 #1c. uvcopyx cleanup sli0 slis uop=q0i7g8n1,arg1=.sli     #<-- cleanup SLIs
      ================================================
 #1d. uvcopyx cleanup parm0 parms uop=q0i7g8n1             #<-- cleanup parms
      ========================================

 #2. jclpx41 jcl1 jcl2 procs slis
     ===========================
     - expand procs as we copy JCL from subdir jcl1 to subdir jcl2

JCL conversion subdirs

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh     copy 1 at a time
                                                          (before test/debug)

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

4K2. Converting YOUR VSE JCL to Korn shell scripts


 #3. uvcopy jcldata41,fild1=jcl2,filo2=ctl/datafiles41
     =================================================
     - generate data info file for JCL converter
     - extract DLBLs/TLBLs from all JCL, sort, drop dups

 #3. uvcopy jcldata41   <-- same as above (files default as shown)
     ================

ctl/datafiles43I - file info #2 for JCL converter

 e2121656.itaxe.facturat        rca=00083 rcm=00239 key=000(036) typJWV=IDXf8v
 e2122683.itaxe.degrevem        rca=00158 rcm=00265 key=000(037) typJWV=IDXf8v
 e2123001.itaxe.banqtaxe        rca=00126 rcm=00383 key=000(036) typJWV=IDXf8v
 e2123002.itaxe.taxation        rca=_____ rcm=_____ key=000(000) typJWV=RSF
 e2123003.itaxe.transdam        rca=_____ rcm=_____ key=000(000) typJWD=RSF
 e2123004.itaxe.tranjour        rca=00464 rcm=00464 key=000(000) typJWV=RSF
 e2123005.mtaxe.tpcalcul        rca=00081 rcm=00081 key=000(029) typJWV=IDXf1
 e2123013.ttaxe.c3001d31        rca=00360 rcm=00360 key=000(000) typJWV=RSF
 e2123013.ttaxe.rembtrie        rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v
 tu.f01.e211801.adrpos          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f01.e212-no.eauctr          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f01.e212-no.trperm          rca=_____ rcm=_____ key=000(000) typJWT=RSF

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

4K3. Converting YOUR VSE JCL to Korn shell scripts

modifying JCL conversions with datafiles42

Note
  • The JCL converter uses 2 Indexed files to get file characteristics.
  • ctl/listcat3I (priority) & ctl/datafiles43I (secondary)
  • You can modify ctl/listcat3 to improve conversion, assign mstr/ files etc
  • then reload using uvcopy loadcat3I as on page '4I12'
Note
  • you cannot modify datafiles41, generated as part of JCL conversion
  • but you can create ctl/datafiles42 which is sorted with datafiles41
  • before loading ctl/datafiles43I used by the JCL converter.
  • script 'sortload43I' (next step) is listed on page '3F3'

 #4.  vi ctl/datafiles42  <-- create ctl/datafiles42 to override file info
      ==================      on matching filenames in ctl/datafiles41

 #4a. >ctl/datafiles42    <-- OR --> create null file required for uvsort
      ================      - in sortload43I that sorts files together

 #5. sortload43I  <-- sort datafiles41 + datafiles42 & load datafiles43I
     ===========

 #6. jclxx41 jcl2 jcl3     <-- convert expanded JCL to Korn shell scripts
     =================
     - JCL converter called for each JCL found in jcl2 & ksh written to jcl3
     - uses ctl/datafiles43I (loaded above)
Note
  • automatic conversion stops at jcl3
  • you must manually copy each JCL/script from jcl3 to jcls (in PATH)
  • only when you are ready to test/debug each JCL/script

Alternative method to convert All JCL - via 'script'

Here is the alternative to the above 'step by step' conversion documented on the previous 4 pages. You were advised to use the 'step by step' method for your 1st conversion to better understand & detect errors sooner.

But, do use the 'jcl2ksh41A' script for your subsequent re-conversions after you have proven the conversions work OK at your site.


 #1. jcl2ksh41A all    <-- convert JCL thru all steps, as illustrated above
     =============      - reply null (take default) at all prompts
                        - or reply 'y' for prompts that demand a y/n response
                        - see jcl2ksh41A script listed on page '9A2'
 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      manual copy
Note
  • do NOT use the 'script' method for your 1st conversion
  • use the 'step by step' method (previous 4 pages)
  • to better understand & to detect any errors sooner

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

4L0. Testing & Debugging your JCL/Korn shell scripts

Preparations Required before test/debug can begin

Depending on your site, you may have some initial preparations that must be performed before you can begin testing & debugging your JCL/scripts.

OPTIONAL jobs depending on site preferences

Optional jobs are documented very briefly in Part 4 with references to details & examples in Part_5 or Part_6.


4L1. Create GDG control file (used to get no of generations for GDG files)
- see complete details & examples in Part 5
- could initially create empty Indexed file so you test non-GDG jobs
  as shown here in Part 4 on page '4L1' below.

4L2. Cross References for COBOL & JCL/scripts are a big help for test/debug.
Generate & print the cross-references now before you begin test/debug.
See XREFjobs.htm for illustrations & operating instructions

4L3. Job-Flow reports are also a big help for test/debug.
- show the datafile I/O from step to step
- generate all reports in subdir jobflow/... & print as needed
 See XREFjobs.htm#Part_5 for illustrations & operating instructions

4L4. Extract control cards from JCL to separate files
- optional jobs to extract control cards from all JCLs so you can update
  them separately form the JCL/scripts.
- control card files are date-stamped to allow updates for future dates.
- see complete details & examples begining on page '6A1'.

GDG files - see Part 5

The VSE mainframe did not have GDG files, but we have found them useful to supply tape generation handling for VSE conversions. The Vancouver Utility GDG system was enhanced in May 2007, and some features now surpass the MVS mainframe implementation.

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

4L1. Optional Preparations depending on site preferences

creating the gdgctl file

Before you can execute any JCL/scripts, you must create the GDG control file. 'ctl/gdgctl51I' is an Indexed file that is accessed by GDG functions (exportgen0, exportgen1,& gdgupab1) to supply the number of generations for each datafile & also to record a history of the last 14 accesses or errors).

Please study 'Part_5' for complete details, but if you are anxious to run some jobs (that do not contain GDG files), here is the minimum instructions with a few explanations.

Utility job 'jcldata56' will read all JCL, extract all DSN's,& sort with data reduction to 1 line per unique filename. The output file is then reformatted into the gdgctl layout & loaded into the Indexed file by 'gdgload1'.

Op. Instrns. to create gdgctl file


 #1a. login vsetest,appsadm,or yourself --> /home/vsetest,appsadm,homedir

 #1b. cdl --> $TESTLIBS (/home/vsetest, /p1/testlibs, ???)
           - see directories,profiles,$RUNLIBS,etc discussed page '1A1' +

 #2. [ jcl2ksh41A all ]      <-- we assume JCL conversion already completed
     =================        - left all converted scripts in jcl3/...

 #3. uvcopy jcldata56,fild1=jcl3,filo2=ctl/datafiles56
     =================================================

 #3a. uvcopy jcldata56     <-- same as above (files default as shown)
      ================       - sample output shown below
     gl/account.master_                       gdg=99
     gl/account.trans_                        gdg=99 opt=c

These samples are based on the test/demo JCLs shown in Part_1 (but most lines removed for this illustration).


 #4. cp ctl/datafiles56 $RUNDATA/ctl/gdgctl51
     ========================================
     - copy/rename for GDG control file
Note
  • GDG control files moved to $RUNDATA to allow multiple $RUNDATA's

 #5. cdd  (alias cdd='cd $RUNDATA') --> /home/vsetest/testdata
     ===

 #6. vi ctl/gdgctl51    <-- edit to modify no of generations as desired
     ===============      - replace any $SYMBOLS with values

 #7. uvcopy gdgload1,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I
     ======================================================
     - load Indexed file to supply file info to JCL converter

 #7a. uvcopy gdgload1   <-- same but easier (files default as shown above)
      ===============

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

4L2. Optional Preparations before testing begins

Cross References for COBOL & JCL/scripts

These cross-reference reports will be invaluable during testing & debugging.

Please see complete instructions & illustrated reports at XREFjobs.htm, but here are the reports & concise instructions to create them in subdir 'xref'.

Cross-Ref Reports Available

xcobcall1
  • list of all CALLED-PROGRAMs in each PROGRAM
xcobcall2
  • crossref all PROGRAMS calling any 1 CALLED-PROGRAM
xcobcopy1
  • list all COPYBOOKS in any 1 PROGRAM
xcobcopy2
  • crossref all PROGRAMS copying any 1 COPYBOOK
xcobfile2
  • crossref all PROGRAMS using each external-file
xcobsql1
  • list all SQL Includes in any 1 PROGRAM
xcobsql2
  • crossref all PROGRAMS using any 1 SQL Include
xjkshfile1
  • list all DATAFILES used in any 1 ksh SCRIPT
xjkshfile2
  • crossref show all ksh SCRIPTs using any 1 DATAFILE
xjkshprog1
  • list all PROGRAMs executed in any 1 ksh SCRIPT
xjkshprog2
  • crossref show all ksh SCRIPTS executing any 1 PROGRAM

Operating Instructions for Cross-Refs reports


 #1. xrefall cbls jcl3 ksh   <-- crossref COBOL & ksh scripts
     =====================

 #2.  uvlpd12D xref   <-- print all files in the directory (Duplex)
      =============
Note
  • before you print all, see if line counts are manageable
  • the xjkshfile1 & xjkshfile2 reports are sometimes very large
    & I sometimes print all except these 2

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

4L3. Optional Preparations before testing begins

Job-Flow reports

The 'JobFlow' reports are your guide to testing & debugging. They show you the programs & datafiles used in each step of each JCL/script.

I recommend you print these out before you start your testing & debugging. They serve as your guide & checklist to monitor your progress & make notes about any problems.

The JObFlow reports extract the essential info about each datafile in each step. The file info from the COBOL program is inserted onto the matching info from the JCL. The following items are shown for each file in each step:

See complete instructions & sample reports at XREFjobs.htm#Part_2.

You could run jobflow reports for all jobs but the report would be huge so we will give you the instructions to run the jobflow report for any 1 job.

You must have run 'cobfiles5A' to load an Indexed file for lookup by jobflow51 to include COBOL file information on the jobflow report.

You may regenerate the Job-Flow reports any time you make significant changes to the JCL/scripts during testing & debugging.


 #1. jobflow51 jcls/jar200.ksh   <-- generate JobFlow report for 1 job only
     =========================

 #2. uvlp12L tmp3/jar200.ksh     <-- print jobflow report for 1 JCL only
     =======================

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

4L4. Testing & Debugging your JCL/Korn shell scripts

jobparmx1 - extract control cards from JCL/scripts

'jobparmx1' will extract jobparms (control cards, dates,etc) from JCL/scripts into separate files that may be updated before JCL/scripts run.

Control files will have a date-stamp appended (current date at gen time) Run control administrators may duplicate the files & append future dates which will be selected when the current data reaches or passes file dates

Also see 'jobparms1' which will be run at 6PM (before batch shift) to copy $RUNLIBS/jobparmx1/* to $RUNDATA/jobparms1, selecting the appropriate control card from any multiple dates for any 1 jobname_step_program

Here is brief documentation for this optional job. Please see page '6A1' for complete details with examples.

initial extract All control cards


 #1. cd $RUNLIBS                  <-- change to libraries (where jcls are)

 #2a. mkdir jobparmx1 jobparmx2     <-- make jobparmx1 subdir for output
 #2b. rm -f jobparmx1/* jobparmx2/*   - or remove all files if subdirs exist

 #3. uvcopy jobparmx1,fild1=jcls,fild2=jobparmx1,fild3=jobparmx2
     ++=========================================================
     - extract control cards from all jcls to jobparmx1 or jobparmx2

extract control cards from 1 JCL/script

If you need to convert a new JCL, specify the JCL/script name via ',arg1=...' The instrns below will output directly to jobparmx1/jobparmx2.

You could use tmp1/tmp2 to ensure no overwriting files in jobparmx1/jobparmx2. 'arg1=...' may specify a prefix to extract control cards from all JCL/scripts matching the prefix specified.


 #1. cd $RUNLIBS         <-- change to libraries (where jcls area)

 #2. uvcopy jobparmx1,fild1=jcls,fild2=jobparmx1,fild3=jobparmx2,arg1=jclprefix
     ==========================================================================
     - extract control cards from 1 JCL/script direct to jobparmx1/jobparmx2
     - 'jcl2ksh41' (convert 1 JCL) uses arg1=jclname

'jcl2ksh41' script to convert 1 JCL prompts you to run the above command to extract the embedded control cards for the 1 job being converted.

This is brief documentation for this optional job. Please see page '6A1' for complete details with examples.

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

4M1. Converting YOUR VSE JCL to Korn shell scripts

Test/Debug 1 JCL/script to fine tune conversion

The previous section '4J1' - '4K3' documented the initial conversion of All JCL. Now you should test/debug 1 or 2 JCL/scripts to verify the conversions.

From the testing & debugging 1 or 2 JCL/scripts you may find improvements that can be made to the JCL converter options file (ctl/jclunixop41) & to the data information file (ctl/listcat3I). After modifying these control files you can reconvert the 1 or 2 JCLs using the 'jcl2ksh41' script (page '4N1')

After you are satisfied with the conversion & testing of 1 or 2 JCL/scripts, you can the use the 'jcl2ksh41A' script to reconvert all JCL/scripts, to realize the improvements in all JCL/scripts.

This works well because automatic conversions stop at jcl3, & we copy JCL/scripts from jcl3 to jcls, only when we are ready to test/debug each JCL/script.

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      prompt & copy

We will present the operating instructions for jcl2ksh41 & jcl2ksh41A on page '4N1' & '4N2', but 1st we will remind you of a few aids to assist you in testing & debugging. These & many more aids were 1st presented in 'Part_2'.

  1. testdatainit - clear output subdirs before test runs

  2. joblog1 - capture logs in joblog subdir of current directory
 2a. joblog1A    - capture logs And turn on COBOL Animation
                 - saves having to 'export ANIM=+A' to animate
  1. llr - script to list all files & subdirs within a subdir (Recursive)

We will illustrate using these aids as we test/debug JCL/script 28401d23.ksh


 28401d23.ksh          <-- execute JCL/script to demo debug aids
 ============

 joblog1 28401d23.ksh  <-- execute&capture log in $TESTLIBS/joblog/28401d23.log
 ====================

 joblog1A 28401d23.ksh  <-- execute&capture log in $TESTDATA/joblog/28401d23.log
 =====================    - the 'A' version also turns on COBOL Animation
                          - saves having to 'export ANIM=+A' to animate

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

4M2. Testing & Debugging Aids

testdatainit - clear output subdirs before testing

You can use the 'testdatainit' script before running your JCL/script tests, to clear out any old outputs & enable you to more easily examine the outputs of your current test runs.

You can run testdatainit anytime, if you have changed your profile to define TESTDATA as a subdir in your homedir, or if you know that no other programmers are currently testing & do not need to retain any existing outputs.

TESTDATA subdirs cleared by testdatainit

 $TESTDATA
 :     :-----ftp         ---
 :     :-----jobctl       0  <-- '0' marks subdirs cleared by testdatainit
 :     :-----joblog       0
 :     :-----jobparms1   --- SYSIN data cards, originally embedded in JCL
                             jobparmx1 utility extracts to $TESTLIBS/jobparmx1
                             dates appended to allow updates for future runs
                             jobparms1 utility copies current cards each day
                             from $TESTLIBS/jobparmx1 dropping date stamps
 :     :-----jobparms2   --- SYSIN data cards that do not need updates
 :     :-----jobtmp       0
 :     :-----mstr        --- Master datafiles
 :     :-----rpts         0
 :     :-----sysout       0
 :     :-----tape        -?- Tape files (might clear if only outputs)
 :     :-----tmp          0
 :     :-----wrk          0

 #1. cdd                    <-- change to $TESTDATA superdir

 #2. testdatainit            <-- run the testdatainit script
     ============           <-- will prompt y/n to proceed or not
     --> y                  <-- to proceed or 'n' to cancel

 #3. joblog1 28401d23.ksh   <-- run JCL/script being test/debugged
     ====================

 #4. llr rpts              <-- display report files
     ========

 #5. llr jobtmp            <-- display temp/work/inter-step files
     ==========

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

4M3. Testing & Debugging Aids

joblog1 - capture logs via 'tee'

Console logging is highly recommended (especially for production) since it captures everything that happens on the screen, including operator commands & replies to prompts. See console logging activation on page '1U1'.

But until you get console logging activates, you could use the joblog1 script (provided in /home/uvadm/sf/IBM/...).

These scripts capture the JCL/script screen displays into a file using the unix/linux 'tee' command. The log filename is created by dropping the '.ksh' extension from the jobname & then appending '.log'.


 28401d23.ksh          <-- execute JCL/script (with no logging)
 ============

 joblog1 28401d23.ksh  <-- execute & capture log in $TESTLIBS/joblog/28401d23.log
 ====================

 joblog1A 28401d23.ksh <-- execute & capture log in $TESTDATA/joblog/28401d23.log
 =====================   - the 'A' version also turns on COBOL Animation
                         - saves having to 'export ANIM=+A' to animate

llr - display all files in multilevel subdirs

The 'llr' script is convenient to examine the contents of multi-level subdirs, such as $RPTS, $JTMP, or the entire $TESTDATA.


 #4. llr rpts > tmp/llr  <-- run the 'llr' script & capture output
     ==================

 #4a. uvlp12 tmp/llr      <-- print results (or vi, more, etc)
      ==============

sample llr of rpts after running 1 job

 ./rpts:
 drwxrwxr-x    2 laval3   users        4096 Feb 13 08:43 070213
 ./rpts/070213:
 -rw-rw-r--    1 laval3   users       40033 Feb 13 08:43 28401D23_S0060_E212640C_084349.lvl
 -rw-rw-r--    1 laval3   users        2437 Feb 13 08:43 28401D23_S0060_E212640C.hex

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

4N1. Converting YOUR VSE JCL to Korn shell scripts

jcl2ksh41 - reconvert 1 JCL to script

Pages '4J1' - '4K3' documented the initial conversion of All JCL. Then you should test/debug 1 or 2 JCL/scripts to verify the conversions.

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      prompt & copy

As an example, we will convert 'JAR100', a demo JCL supplied with Vancouver Utilities in /home/uvadm/vsetest/jcl0/JAR100.jcl. You can see it listed on page '1C1' & the expected output script on page '1C2'.


 #0a. Login as appsadm ---> /home/appsadm

 #0b. cdl  --> $TESTLIBS

 #1. jcl2ksh41 jcl0/JAR100.jcl    <-- convert 1 JCL at a time
     =========================

alternate example from City of Lynn Valley


 #1a. jcl2ksh41 jcl0/28401D23.jcl   <-- convert 1 JCL at a time
      ===========================

prompt/overwrite warning

The final destination is 'jcls' where JCL/scripts must be copied to be found by the search PATH. Before overwriting any existing JCL/script, you will be prompted to answer 'y' or 'n'.

If you had made substantial modifications to the existing script, you might want to answer NO. Then you could save modified parts of existing script (in tmp subdir), copy the new script from jcl3 to jcls, then edit the new script in jcls & read in modified parts of the previous script from the saved version (or vice versa if it were easier to read new parts into the existing).

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

4N2. Converting YOUR VSE JCL to Korn shell scripts

Re-Convert All JCL using 'jcl2ksh41A' script


'4J1' - '4K3' documented the initial conversion of all JCL.

'4M1' suggested test/debug 1 or 2 JCL/scripts & modifying option/control files for optimum results.

We now suggest you reconvert all JCL/scripts, to realize the improvements in all JCL/scripts. You can do this quickly using the 'jcl2ksh41A' script (vs step by step method required on the initial conversion of All JCL).

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      prompt & copy

 #0a. Login as appsadm ---> /home/appsadm

 #0b. cdl  --> $TESTLIBS

 #1. jcl2ksh41A jcl2 jcl3
     ===================
     - convert all JCL from jcl0/... thru several steps to scripts in jcl3/...
     - jclunixop41 has options to use ctl/listcat3I &/or ctl/datafiles43I
       to supply file types, record sizes, Indexed keys, etc
     - the script prompts to ask if you wish to create ctl/datafiles42 overrides
     - see explanations on pages '4J3'
  1. The conversion team leader would now assign the various JCLs to the various team members for testing & debugging

 #3. cp jcl3/??? jcls
     ================
     - team members will copy JCL/scripts 1 at a time to jcls/... (in PATH)
       just before they are ready to test/debug each script
     - this allows us to reconvert anytime to jcl3/... to improve conversions
       after updating listcat3 & reloading listcat3I (as shown above)

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

4N3. Testing & Debugging Aids

alldiff2 - diff report for all files in 2 dirs

The 'alldiff2' script will run the unix 'diff' utility on all pairs of files in 2 subdirs. The unix 'diff' command is a marvelous thing. It shows you the differences between any 2 text files.

I recommend you use 'alldiff2' whenever you make changes to the JCL converter or the control files.

First save the existing scripts as jcl3.old, remake jcl3, rerun the converter, & then run alldiff2 to verify that the changes made are the changes you intended & nothing else has gotten screwed up.

You can use the 'newold' script to change the name & make the new subdir.


 #1a. Login as yourself or appsadm

 #1b. cdl ---> $TESTLIBS
  1. Modify the control files to enhance conversions. See ctl/jclunixop41 listed at VSEJCL.htm#3E1.

 #3. newold jcl3   <-- script to 'mv jcl3 jcl3.old' & 'mkdir jcl3'
     ===========

 #4. jclxx41 jcl2 jcl3       <-- reconvert all JCL in jcl2 to ksh in jcl3
     =================

 #5. alldiff2 jcl3.old jcl3  <-- run alldiff2 script
     ======================    - saves jcl3.dif in the tmp subdir

 #6. uvlp12 tmp/jcl3.dif     <-- print the jcl3.dif file
     ===================       - or vi, more, etc

sample jcl3.dif

Here is a sample dif file resulting from updating ctl/listcat3. We added 'topi=tape2' onto the control file line for data file 'tu.f01.e212801.adrpos'. We then ran uvcopy loadcat3I to reload the indexed file & reconverted all JCL as shown above.

 37c37
 < exportgen0 E211801 tape/tu.f01.e211801.adrpos_
 ---
 > exportgen0 E211801 tape2/tu.f01.e211801.adrpos_
 diff file# 10 - jcl3.old/... vs jcl3/24599j04.ksh
 97c97
 < exportgen1 E212990 tape/tu.f01.e211801.adrpos_
 ---
 > exportgen1 E212990 tape2/tu.f01.e211801.adrpos_
 diff file# 78 - jcl3.old/... vs jcl3/28401j04.ksh

2 different of 280 files compared jcl3.old to jcl3

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

4O1. Aids & Techniques to assist Your Testing/Debugging

setup 'testdata' in Your homedir ?

If you have multiple programmers, you might need to setup the testdata superdir in programmer homedirs to prevent update conflicts.

 /p1
 :-----testdata            <-- RUNDATA=$TESTDATA=/p1/testdata
 :     :-----joblog            - joblog1 script stores .log files here
 :     :-----jobparms1         - current datacards from $RUNLIBS/jobparmx1 at 6PM
 :     :-----jobparms2         - datacards from $RUNLIBS/jobparmx2 at 6PM
 :     :-----jobtmp            - job temporary files
 :     :-----mstr              - master files
 :     :-----pf                - user written uvcopy jobs
 :     :-----rpts              - reports
 :     :-----sf                - user written Korn shell scripts
 :     :-----sysout            - COBOL DISPLAY upon SYSLST reports
 :     :-----tape              - tape files reassigned to disc by JCL converter
 :     :-----tmp               - misc temp files & sort work files
 :     :-----wrk               - work files (inter-step)

Here is how 'userx' might setup his own testdata superdir, copy all data files, & modify his profile to use the private version of testdata.

  1. Login ---> /home/userx

 #2. mkdir testdata            <-- make private testdata superdir
     ==============

 #3. cp -r $TESTDATA testdata  <-- copy all files from shared testdata
     ========================

 #4. vi .bash_profile          <-- edit profile to modify $TESTDATA
     ================
      export TESTLIBS=$TESTLIBS
      export TESTDATA=$TESTDATA       <-- existing definitions in profile
      export CNVDATA=$CNVDATA
      export TESTLIBS=$TESTLIBS
      export TESTDATA=$HOME/testdata  <-- change ONLY TESTDATA def
      export CNVDATA=$CNVDATA

 #5a. exit              <-- logoff

 #5b. Login             <-- log back on to activate new TESTDATA definition

 #6a. echo $TESTDATA    <-- verify change effective

 #6b. cdd               <-- alias cdd should not take you to $HOME/testdata

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

4O2. Aids & Techniques to assist Your Testing/Debugging

uvhdcob display copybook names with data

uvhd
  • displays data records only (no knowledge of copybook fields)
  • uvhd is shareware & may be downloaded from www.uvsoftware.ca
  • source program is self-contained (no linkable archives req'd)
uvhdcob
  • displays copybook fieldnames, preceding data for each field
  • browse,search,update,print,write,drop,check-seq (same as uvhd)
  • intended for use in conjunction with uvhd
    (may exit to uvhd to display record without fieldnames & return)
  • does not have all the functionality of uvhd
  • displays only the 1st occurrence of occurs fields
  • might not encode proper fieldnames for multi-record-type files
  • 'cobmap1' is a uvcopy job which must be run prior to uvhdcob
    a 1 time operation to convert the COBOL copybook directory
    to a directory of 'cobmaps' (COBOL record layouts)

uvhdcob demo from /home/uvadm


 uvcopy cobmap1,fili1=tf/custmas1,filo1=tmp/custmas1
 ===================================================
 - make the cobmap required from supplied copybook

 uvhdcob dat1/custmas1 tmp/custmas1
 ==================================
 dat1/custmas1 rsz=256 totrecs=32 current=1 fsiz=8192 fptr=0
 cobmapfile=maps/custmas1 today=199911291108 datalastmod=1999112910
 rec#       1 fieldname occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 cm-num                       0   5 n  130140
 002 cm-delete                    6   9
 003 cm-name                     10  34    EVERGREEN MOTORS LTD.
 004 cm-adrs                     35  59    1815 BOWEN ROAD
 005 cm-city                     60  75    NANAIMO
 006 filler001                   76  76
 007 cm-prov                     77  78    BC
 008 filler002                   79  79
 009 cm-postal                   80  89    V9S1H1
 010 cm-phone                    90 101    604-754-5531
 011 cm-contact                 102 119
 012 cm-thisyr-sales       012  120 124pns 001234567C
 013 cm-lastyr-sales       012  180 184pns 001234567D
 014 cm-thisyr-xft              240 244pns 4320202020
 015 cm-lastyr-xft              245 249pns 2020202020
 016 filler003                  250 255
 null=next,r#=rec,s=search,u=update,p=print,i=iprint,w=write,t=tally,c=checkseq
 ,e=exit to uvhd, q=quit, ?=help --> q

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

4O3. Aids & Techniques to assist Your Testing/Debugging

uvhdcob sample for City of Lynn Valley


 #1a. Login as yourself --> your homedir

 #1b. cdd       <-- change to $TESTDATA

 #2. uvhdcob mstr/e2121653/mtaxe.piscines.dat $TESTLIBS/maps/e212159b r83
     ====================================================================

sample uvhdcob for the piscines file

 uvhdcob mstr/e2121653.mtaxe.piscines.dat lastmod=20070307:1612
 record#=1 totalrecs=263 recsize=83 filesize=21829 fileptr=0
 cobmap=/tax/cnvdata/maps/e212159b today=20070322:1249
 rec#       1 fieldname occurs  bgn end typ<------ data (hex if typ=p/b) ----->
 001 fp-role-k                    0  19    015     5  14   4
 002 fp-code-maj                 20  20pns 1C
 003 fp-dt-crea                  21  25pns 019910305C
 004 fp-dt-maj                   26  30pns 019920319C
 005 fp-mat1                     31  36pns 86532599502C
 006 fp-mat2                     37  41pns 000000000C
 007 fp-code-post                42  47    H7K3E2
 008 fp-nbr-pisc                 48  48pns 2C
 009 fp-code-pisc                49  49
 010 fp-no-semaine               50  51pns 000C
 011 fp-no-vendeur               52  53pns 000C
 012 fp-annee-fact               54  56pns 01991C
 013 filler001                   57  81
 rec#=1 of 263,null=next,r#=rec,s=search,u=update,p=print,i=iprint,w=write
 ,t=tally,c=chkseq,e=exit to uvhd,q=quit,?=help -->

script to save having to specify the map

We can use the data conversion control file (ctl/ctlfile4) & the 'uvhdc' script to save having to specify the copybook map & to enable running uvhdcob from any location & avoid having to code recsize for indexed files.


 #2a. uvhdc mstr/e2121653/mtaxe.piscines
      ==================================

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

4P1. Converting YOUR MVS JCL to Korn shell scripts

Determine solutions for any 3rd party software

The JCL converter automatically converts SORT, IDCAMS, IEBGENER, and some DITTOs, but you may need conversion solutions for 3rd party software such as EASYTRIEVE.

You can code equivalent solutions using uvcp, uvsort, & uvcopy, but you may have to write COBOL programs for complex EasyTrieves.

Easytrieve conversion to 'uvcopy'

As of March 2008, the Easytrieve conversion is documented separately in EZTRVetc.htm.

'ez2uvcopy' is a Vancouver Utility (from UV Software) to convert CA Easytrieve to the uvcopy interpretive language. 'uvcopy' is a powerful data manipulation language that was developed to replace various mainframe utilities when converting to Unix or Linux systems.

uvcopy provides functions that are non-existent in the usual Unix utilities:

uvcopy is somewhat similar to the IBM 360 assembler language, so if you have a mainframe background the code will look familiar to you. In addition to the usual basic instructions, uvcopy has many powerful instructions for scan/replace, table processing, etc.

uvcopy has the power of assembler but without the complexity of compiling since it is 'interpretive' (just edit the parameter file & rerun).

There is a lot of documentation for uvcopy, but if you have a mainframe background, I think you could get a quick start by studying the examples given in UVjobs1.htm. Then you could run the 'ezdemo2' conversion given in Part 1 of EZTRVetc.htm & refer to the uvcopy3.htm instruction manual as required.

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

4Q1. Converting YOUR VSE JCL to Korn shell scripts

Setup Backup scripts now (vs later)

Setup Your backup scripts now to protect your programmers from 'oops'. See several backup scripts suggested in ADMjobs.htm#Part_4

We recommend setting up 'crontabs' to backup cnvdata, testdata,& testlibs every night to both tape & disc (documented in ADMjobs.htm#Part_5). Those procedures provide 2 days backups on disc for immediate recoveries

The backup scripts & crontabs are stored in the 'appsadm' home directory.

appsadm - Application Administrator

We recommend you setup a login/userid 'appsadm' to serve as the applications administrator for the unix/linux site. The appsadm home directory would hold various scripts, crontabs, log files, etc used in application administration. Here are some suggested sub-directories:

 /home/appsadm
 :-----bin              - binaries for site developed/modified programs
 :-----ctl              - control files (miscellaneous)
 :-----env              - master copies of profiles etc
 :                        modified appropriately for your site
 :-----log1             - console logging files (currently active)
 :     :-----user1        - sub-directoried by user login
 :     :-----user2
 :     :     :-----070306_175400
 :     :-----.etc.
 :-----log2             - console logging files (for current month)
 :     :-----user1
 :     :-----user2
 :     :     :-----070304_153300
 :     :     :-----070305_134500
 :     :     :-----070306_175400
 :     :-----.etc.
 :-----log3             - console logging files (for last month)
 :     :-----user1
 :     :-----user2
 :     :-----.etc.
 :-----logs             - backup logs (run by cron)
 :
 :-----pf             <-- uvcopy jobs developed/modified by site admin
 :
 :-----sf             <-- shell scripts developed/modified by appsadm
 :                      - also holds the 'crontabs' used to schedule backups
 :                        & any other jobs you wish to run automatically
 :
 :-----src              - source for any programs developed/modified by appsadm
 :-----tmp

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

4R1. Converting YOUR VSE JCL to Korn shell scripts

setup console logging

This is a VITAL feature to replace the console logging systems provided by proprietary mainframe systems. Console Logging uses the Unix/Linux 'script' command inserted at the end of the profile to create a date/time stamped console log file which captures all console I/O until the operator logs off.

Console log files must be processed (to remove screen control codes) before being viewed or printed & this is accomplished automatically when the user logs off & back on. He may then use the logview script to view or print the latest (or earlier) log file.

See the sample console log created when the conversion test/demo jobs are executed on page '1U3'. See complete details about console logging in ADMjobs.htm#Part_6.

Console logging is activated by uncommenting 4 lines at the end of the supplied profile. See the stub_profile listed at ADMjobs.htm#3B1. You must also setup a subdir in /home/appsadm/log1,2,3 matching your userid.

Console logging should be mandatory for operators, but can be optional for programmers, who can use the 'joblog1' script during test/debug.


 #1. vi .bash_profile   <-- edit your profile
     ================     - uncomment following 4 lines near end
     login1 || exit 2          # exit here if 2nd login
     logfixA                   # process log1 file to log2 (to allow read/print)
     echo 'console logging requires aliases to be stored in .bashrc or .kshrc'
     exec script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)

 #2a. cd /home/appsadm    <-- change to appsadm & make subdirs matching userid
 #2b. mkdir log1/userx    <-- make subdir in log1 for current log collection
 #2c. mkdir log2/userx    <-- make subdir in log2 for current month collection
 #2d. mkdir log3/userx    <-- make subdir in log3 for last month history

 #3a. exit            <-- logoff
 #3b. Login           <-- log back in to activate console logging

 #4a. 28401d23.ksh    <-- run some of your JCL/scripts
      ============
 #4b. llr rpts        <-- list some directories, etc
      ========

 #5. logoff & back on to process console log
     (from /home/appsadm/log1/userx/... to log2/userx/...)

 #6. logview          <-- display your log files
     =======
     --> 1            <-- enter 1 to view the latest

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

4S1. Converting YOUR VSE JCL to Korn shell scripts

Parallel, Re-transfer, Setup for production,& go live

  1. Run parallels with mainframe when you have enough JCL/scripts debugged

  2. Retransfer mainframe JCL,COBOL,& DATA a few times during conversion period

  3. Setup the production machine.

  4. Go live (over a weekend usually), You will need to retransfer & reconvert all data files as documented on page '4I2' or in VSEDATA.htm. The JCL/scripts & programs will not need retransfer/reconvert on the 'go live' weekend, since you will already have them well tested.

  5. See 'Part_7' Operating Aids - Console Logging (captures all console messages) - Job Logging (captures only VITAL & ERRor messages)

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

Part_5 MVS JCL conversion - Special Sub-Systems

Part 5 GDG files - Contents


5A1. Introduction & Overview

5B1. How mainframe GDG files are converted for unix/linux
5B2.  Allowing for Abterms (don't increment GDGs until Normal EOJ)
5B3.  Sample GDG control file
5B4.  Options to process prior generations, using the control file
- vs having to modify JCL/scripts to specify desired GDG#
5B5.  exportgen0 selects next gen# using gdgctl51I Indexed control file
5B6.  gdgctl file option for expiry dates & range processing of prior generations
5B7.  Retaining a history of prior GDG# processing in the control file

5C1. Creating the gdgctl file (operating instructions)
5C3. Updating the GDG text control file & reloading the Indexed file
utility job 'gdgload1' loads ctl/gdgctl51 to ctl/gdgctl51I
5C4. Display the gdgctl Indexed file with 'uvhd' in character mode.
5C5. Display the gdgctl Indexed file with 'uvhd' in vertical hexadecimal.
5C6. Updating the gdgctl Indexed file directly with 'uvhd'.
5C7. Updating the gdgctl Indexed file directly with 'vi' (dangerous).

5D1. Sample JCL/script jgl100.ksh using GDG files
5D2.  GDG logic explained, how we prevent GDG# increments on failed runs
5D3.  Test data files supplied to illustrate GDG processing
5D4.  Op. Instrns. for jgl100.ksh to demo GDG processing - successful run
5D5.  Console log & directory listings after new generation created
- new generations (written to jobtmp) MOVED to $RUNDATA/subdirs at jobend
5D6.  Op. Instrns. for jgl100.ksh to demo GDG processing - on run FAILURE
5D7.  Console log & directory listings after run failure
- new generations (written to jobtmp) NOT moved to $RUNDATA/subdirs

5E1. Exception processing with GDG files
- example of processing a series of GDG files already stored in subdir
  without having to modify JCL/scripts or copy files
5E2.  Test files & JCL JGL220 to demo prior generation & range processing
5E3.  Converted Korn shell script jgl220.ksh to demo prior gen & range prcsng
5E4.  gdgctl51test2 control file to demo prior gen & range processing
5E5.  Op. Instrns. for jgl220.ksh to demo prior gen/range prcsng - 1st run
5E6.  Console log & directory listings after run #1 to demo range processing
5E7.  Op. Instrns. for jgl220.ksh to demo prior gen/range prcsng - 2nd run
5E8.  Console log & directory listings after run #2 to demo range processing
5E9.  jgl220.ksh run#3 demo GDG range processing - Op. Instrns & console log
5E10.   jgl220.ksh run#4 demo GDG range processing - Op. Instrns & console log
5E11.   GDG control file (ctl/gdgctl51I.dat) after 4 test runs
5E12.   Notes re generations selected for master & transaction files

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

Part 5 MVS JCL conversion - Special Sub-Systems

Part 5 GDG files - Contents (continued)


5F0. Caveats for Vancouver Utility GDG system
- some sites have situations requiring manual changes
5F1.  $SYMBOLS in data file names in the JCL/scripts
- you must replace with actual values in ctl/gdgctl51
- easy to do using vi mass change commands (see examples given)
5F2.  You must modify jclunixop51 to code your datafile topnodes/subdirs
 (vs supplied coding for the mvstest demo subdirs)
- may generate automatically from topnode list & templates (see '6A1')
 You must code your valid topnodes in the '$RUNLIBS/ctl/GDGmkdirs' script.
 used to hold new GDGs until Normal EOJ (moved back to $RUNDATA/subdir)
5F3.  You must modify any JCL/scripts that have DDNAME assignments
- if the logical filename on the exportgen0/1 function is assigned
  to an alternate logical filename via an exportfile (vs exportgen)
- an unusual situation that occurred at a VSE site
5F4.  Should be no changes required to jobs that write new GDGs & readback.
 But changes were required for a site using the option to convert all
 tape files to GDG files because it depended on an I/O indicator to
 generate exportgen0/exportgen1 (vs original mainframe coding 0/+1)
5F5.  problems converting tape files to GDG files at a VSE site.

5J0. Listings of functions used for GDG files
5J1. exportgen0 - determine current generation of a GDG file
5J2. exportgen1 - determine next generation of a GDG file
5J3. exportgenall - concatenate all generations of a GDG file
5J4. exportgenx - error message if gen# < (-3) or > (+3)
5J5. exportfile - function for non-GDG files (exports & displays filename)

5K1. jobset51 - setup job environment for scripts converted from IBM MVS JCL
- JCL converter inserts a call to this function at begin script
- changes directory to $RUNDATA, sets up subdirs, etc
5K2. jobset52 - full-PATH version of jobset51 (relative-PATH, recommended)
- differences shown via 'diff' command
5K3. jobend51 - display GDG files moved from jobtmp/subdirs
back to $RUNDATA/subdirs (so they show on console log)
5K4. jobabend51 - display GDG files NOT moved from jobtmp/subdirs
because job Terminated Abnormally

5M0. Listings of uvcopy jobs used for GDG files
5M1. makegdgctl51 - create ctl/gdgctl51 file from ctl/datactl53
5M2. gdgload1 - load ctl/gdgctl51 file to indexed file ctl/gdgctl51I
5M3. gdgunload1 - convert indexed file back to text file for editing/reload
5M4. gdgget51 - used by exportgen1 to get max generations from the
indexed control file (ctl/gdgctl51I)
5M5. gdgget52 - used by exportgen0 to determine next generation#
- checks gdgctl51I for over-ride to prior generation

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

5A1. Vancouver Utilities GDG system - Introduction & Overview

GDG Enhancements

The Vancouver Utilities provides GDG (Generation Data Group) processing similar to the mainframe facility. In May 2007, the VU GDG system was significantly enhanced and some new features go well beyond the original implementation provided on the mainframe.

Vancouver Utility GDG system - Basic Features

  1. After mainframe GDG files are converted (from EBCDIC to ASCII, preserving packed/binary fields), they are copied to the testdata/proddata directories & renamed with suffix '_000001' (1st generation using 6 digit#).

  2. When mainframe JCL is converted to Korn shell scripts, GDG files are identified with a trailing '_' underscore only.

  3. The JCL calls Korn shell 'functions' to determine the appropriate generation. 'exportgen0' defines the latest/highest generation (for reading). 'exportgen1' defines the next generation (for writing).

  4. Earlier versions of exportgen1 incremented the generation# immediately (vs delaying until the job terminated normally as on the mainframe). If a multi-step job terminated abnormally, you were advised to use the 'restart' facility (provided for every step by the VU JCL converter). But if for some reason you wanted to restart from the begining, you had to manually remove any new generations created before the abterm.

  5. The abterm problem is now solved by an enhanced version of 'exportgen1' & a new function 'jobend51' called at Normal End of Job. 'exportgen1' now assigns new generations to the 'jobtmp' directory & at Normal EOJ, function 'jobend51' will move the jobtmp files back to the $RUNDATA directories. This allows you to rerun abterm jobs from the begining , but if you do restart, you will be prompted if it is OK to move any jobtmp files back to the $RUNDATA directories.
Note
  • writing new GDGs to jobtmp controlled by option g0/g1 in ctl/jclunixop51
  • g1 (default) writes new GDGs to jobtmp/... for move back at Normal EOJ
  • g0 option writes new GDGs in original $RUNDATA/subdir
  • for g0, you could restart failed jobs at step after failure, else
    you must remove any new GDGs created up to failure before rerunning
  1. Earlier versions of exportgen1 used a hard-coded number of generations to be accumulated before erasing older generations, unless you coded the gdg=... keyword on all exportgen1's for the file, which could be problematic.

  2. The new system provides an Indexed control file which exportgen1 accesses to get the desired number of generations for each file.

  3. We provide a utility to automatically create the indexed file by extracting all GDG filenames from all JCL/scripts, sorting,& dropping duplicates. You then edit the control file to modify the default number of generations as desired & run another utility job to load the indexed file.

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

5A2. Vancouver Utilities GDG system - Introduction & Overview

Vancouver Utility GDG system - Advanced Features

The indexed control file allows us to provide some significant enhancements that go well beyond the original GDG implementation on the mainframe.

  1. You can specify a prior generation of a file to be defined by exportgen0 for the next run only, or until a specified expiry date/time is reached. This avoids having to modify the JCL/scripts. Note that you only have to modify one entry in the control file, whereas you could easily miss some of the possible multiple references in one or more JCL/scripts.

  2. You can specify range processing for a series of prior generations This is a powerful feature that 1 customer is already planning to make good use of. On the mainframe he had 30 tapes that had to be processed one at a time by a batch COBOL program & the operator simply mounted the tapes in turn.

  3. On the new unix system, all tape files are automatically converted to generation disc files, so to process the 30 tapes (now GDG disc files) separately, the customer might have to modify the JCL to hard-code the next desired generation# or he might specify via an operator keyin.

  4. With the enhanced GDG system, he edits the control file specifying the low to high range of generation#s to be processed. He can then run the batch job 30 times to process the 30 files (with no changes to JCL/scripts & no operator generation# keyins).

  5. This is possible because 'exportgen0' uses the current next generation#, which is incremented by the 'jobend51' function at normal EOJ. At the high end of the range, processing returns to normal, but an historical record is maintained in the indexed file database, making it easier to reactivate if the same cycle is repeated periodically.

  6. You can specify 'opt=c' (confirm) on control file entries to cause exportgen0 to prompt the operator to confirm the generation# selection, or to enter an alternative 6 digit generation#.

  7. The new system maintains a history of the last 30 accesses by exportgen0 and exportgen1. You can look at the control file (with uvhd) and for each of the last 30 accesses, you can see: date:time, generation# selected, lowest:highest generations on-file, jobname, step#,& program of last access.

  8. Each of the last 30 entries that define access history is identified with one of three status codes: 'G0'=exportgen0(reading current/selected gen), 'G1'=exportgen1(writing next gen), or 'AB'=ABnormal Termination (indicates file not moved from jobtmp/subdirs back to RUNDATA/subdirs).

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

5B1. MVS JCL conversion - Generation files

Generation Data Groups

Mainframe GDG files are implemented via unix/linux Korn shell functions (exportgen0, exportgen1/2/..., exportgen-1/-2/...,& exportgenall). These functions are listed later beginning on page '5J0'. Here is a sample conversion (before & after) of GDG files:

JCL conversion - GDG files (BEFORE & AFTER)

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

Note that the '(0)' suffix on an MVS DSN indicates the current generation & '(+1)' indicates the next generation. The JCL converter identifies GDG files with a trailing '_' underscore & uses function 'exportgen0' to define the current generation & function 'exportgen1' to define the next generation (for the following COBOL or utility programs).

Note that exportgen1 writes the next generation to $JTMP/... for move back to gl/... at successful end of job.

Data filename conversion

After the data files are converted from EBCDIC to ASCII (preserving any packed/binary fields), they must be renamed as they are copied from $CNVDATA/subdirs to $TESTDATA/subdirs.

The 1st generation might be assigned as generation _000001. After a few updates to the account.master file we might have:

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

Generation# does not auto wrap

The unix function exportgen1 does not automatically handle generation wrap (as did the mainframe), but note that if you had a generation file that was updated once a day it would take 2500 years to exceed 900000.

However uvcopy jobs are provided to rename files with suffixes over 900000 The uvcopy job is 'gdgreset6' for 6 digit GDG#s (versions since Dec 2005). and 'gdgreset4' for 4 digit GDG#s (versions older than Dec 2005).

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

5B2. MVS JCL conversion - GDG files

Allowing for Abterms (don't increment GDGs)

Early versions of the exportgen1 function wrote new GDG files into the same directory as the prior generations, thus creating a problem if multi-step JCL/scripts terminated abnormally & had to be rerun.

You might have been able to use the restart at any step capability, but if not you would have to manually remove any newly created generations before rerunning.

The new version of exportgen1 (exportgen1c) writes new generations of GDG files into the jobtmp/subdirs. When the job reached the normal EOJ point, the 'jobend51' function copies the new generations back to the defined $RUNDATA/subdirs.

Option g0/g1 now controls writing new GDGs to $RUNDATA/subdirs/... or jobtmp/subdirs/... See option g0/g1 in ctl/jclunixop51 listed on page '3E1'.

g1
  • (default) writes new GDGs to jobtmp/... for move back at Normal EOJ.
g0
  • option writes new GDGs in original $RUNDATA/subdir

For g0, you could restart failed jobs at step after failure, else you must remove any new GDGs created up to failure before rerunning.

Generation limits per file

Early versions of exportgen1 used a system wide number of generations for all files, or you had to specify gdg=... as an argument on all instances of exportgen1 for a particular file.

The new version of exportgen1 (exportgen1c) accesses an indexed control file to retrieve the desired number of generations for each file.

When changes are desired, you can edit the text version of the control file (ctl/gdgctl51) & reload the indexed file (ctl/gdgctl51I), which is accessed by exportgen1.

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

5B3. MVS JCL conversion - GDG files

sample GDG control file

 gl/account.acntlist_                     gdg=08
 gl/account.master_                       gdg=10
 gl/account.trans_                        gdg=20 opt=c
 py/payroll.master_                       gdg=30
 py/time.cards_                           gdg=52 next=000021
  1. The GDG control file ($RUNLIBS/ctl/gdgctl51) can be automatically created by extracting the 'exportgen1's from all JCL/scripts. See Operating Instructions later on page '5C1'.

  2. If desired, there is an option to include all files in the control file (both GDG & non-GDG).

  3. You will be prompted for the default number of generations per file.

  4. After initial creation, you can edit the control file to specify the number of generations desired for each file.

  5. You can also specify 'opt=c' for operator confirmation of selected gen# & opportunity to enter an alternative 6 digit generation#.

  6. You can specify 'next=...' to override the usual selection of the highest generation. See more about this begining on the following pages.

    loading the GDG Indexed control file

The actual GDG control file used by exportgen0,exportgen1,etc is an Indexed file for random lookup by filename, but it is much easier to prepare the contents as a text file (for easy editing).

A sample text file is provided in /home/uvadm/ctl/gdgctl51. You could use this as a guide, add your own filenames & desired generations, then load it into the Indexed GDG control file which is $RUNDATA/ctl/gdgctl51I as follows.

This assumes you have setup a user such as 'mvstest' with profiles,directories,& environmental variables (RUNLIBS & RUNDATA) as described in MVSJCL.htm#Part_1.

If setting up your own directories (vs subdirs copied from /home/uvadm/mvstest) you could use scripts mvslibsdirs & mvsdatadirs as at MVSJCL.htm#4C3 & '4C4' and use script copyvsectls to copy sample control files from /home/uvadm/ctl/ as on MVSJCL.htm#4D1.


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

 #2. cd $RUNDATA  --> /home/mvstest/testdata

 #3. uvcopy gdgload1[,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I]
     ========================================================

 #3a. uvcopy gdgload1   <-- same as above (files default as shown)
      ===============

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

5B4. MVS JCL conversion - GDG files

exportgen0 & gdgctl - Exception Processing

Normally exportgen0 defines the latest generation (file with highest 6 digit suffix). Consider the following data files & the 'exportgen0' example:

gl/account.master_000001 gl/account.master_000002 gl/account.master_000003 gl/account.master_000004 gl/account.master_000005


 exportgen0 GLMSTR gl/account.master_    <-- JCL/script coding to define the file
 ====================================        for the following COBOL program

 export GLMSTR=gl/account.master_000005  <-- effective result
 ======================================

option to process prior generations

To process prior generations, you could temporarily modify the JCL/script, explicitly coding the desired 6 digit suffix. For example we could code:


 export GLMSTR=gl/account.master_000002   <-- script modified with specific#
 ======================================
            - - - OR - - -

 exportfile GLMSTR gl/account.master_000002 <-- OR use this to display filename
 ==========================================
  1. If you hard-code the 6 digit seq#, you have to change 'exportgen0' to 'export' or 'exportfile' since exportgen0 is valid only for filenames with trailing '_'

  2. 'export' is the underlying command & 'exportfile' is a function which does issue the 'export' command, but in addition displays the filename for the console log.

    disadvantages of changing the JCL/scripts

  3. You have to remember to change them back after your reruns.

  4. Anytime you edit the JCL/scripts, there is the possibility of making mistakes.

  5. There may be multiple 'exportgen0's in multiple JCL/scripts to be modified for the reruns desired.

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

5B5. MVS JCL conversion - GDG files

exportgen0 & gdgctl rerun facility

In May 2007, a new version of exportgen0 (exportgen0c) was developed to provide a powerful rerun (prior generation access) capability.

This system uses the same control file ($RUNDATA/ctl/gdgctl51) that was 1st added to carry the desired no of generations per file (for exportgen1c).

Consider the following few lines of the gdgctl file & the following generations of the account.master file:

      gl/account.acntlist_     gdg=4
      gl/account.master_       gdg=6   <-- samples extracted from ctl/gdgctl51
      gl/account.trans_        gdg=50 opt=c
      gl/account.master_000001
      gl/account.master_000002
      gl/account.master_000003         <-- last 5 generations of account.master
      gl/account.master_000004
      gl/account.master_000005

If you wanted to rerun a JCL/script using prior generation _000002, you could modify the control file as follows:

      gl/account.acntlist_     gdg=4
      gl/account.master_       gdg=6   next=000002   <-- gen# for rerun
      gl/account.trans_        gdg=50  opt=c
  1. It is safest to edit only the ctl/gdgctl51 text file, not the indexed file (ctl/gdgctl51I.dat) used by exportgen0 (& the jobend51 function).

  2. After modifying the text file, you must load it to the indexed file using 'uvcopy gdgload1'

  3. Or you could update the Indexed file directly using 'uvhd' (as shown later on page '5C3').

  4. Or if very careful, you could edit the Indexed file directly using the 'vi' editor since we do have the text file as backup & we can recreate the text file by rerunning jcldata56.

  5. At the end of the 1st JCL/script with exportgen0 reference to account.master, the 'next=000002' is disabled by changing it to 'next=000000'

  6. You do have to remember to clear the original 'next=000002' from the text file version before you reload the indexed file for some other reason.

  7. It might be safer to 1st run the 'gdgunload1' job to convert the indexed file back to a text file for future edits & reload.

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

5B6. MVS JCL conversion - GDG files

Expiry Times

The system allows you to specify an expiry time when modifying the gdgctl file. For example:


     gl/account.master_  gdg=6  next=000002_yymmdd:HHMMSS
     ====================================================

The exception processing (defining prior generations of the file) is disabled if the expiry date has been exceeded when the next JCL/script is run with exportgen0 references to the account.master.

Progressing thru a range of prior generations

The system also allows for successive runs to process thru a range of prior generations. For example:


     gl/account.trans_ gdg=50 opt=c next=000001(000001:000012)
     =========================================================

This would allow you to load the transaction files for all 12 months, before you do any processing, then process the 12 months on successive runs. (with no changes to JCL/scripts or control file required).

After the 12th run the control file entry would be updated by the jobend51 function executed at Normal EOJ, to:


     gl/account.trans_ gdg=50 opt=c next=000000(000001:000012)
     =========================================================

IE, the next gen# is set to '000000' to indicate the processing is completed but not lose a record of the manual edits. The next reference by exportgen0 for this file would define the then highest generation# (which might still be '000012').

You could combine expiry times with progression, but it is not necessary, since the progression automatically ends the exception processing when the upper limit is reached. Expiry dates are ignored if a low < high range is specified, but the format would be:


     gl/account.trans_ gdg=50 opt=c next=000001(000001:000012)yymmdd:HHMMSS
     ======================================================================
Note
  • actually all next=... entries must be in the full format shown above
  • if you do not need progression, specify low & high same as next gen#
  • if you do not need expiry date, specify as 000000:000000

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

5B7. MVS JCL conversion - GDG files

Retaining History in gdgctl

An earlier simplified example of a 1 time access to a prior generation is shown below, followed by the actual format required, which retains some history of your prior generation overrides in the gdgctl file.


     gl/account.master_ gdg=6 next=000002  <-- gen# for next access (1 time)
     ======================================

     gl/account.master_ gdg=6 next=000000  <-- reset to this at Normal EOJ
     ======================================

     gl/account.master_ gdg=6 next=000002(000002:000002)yymmdd:HHMMSS <-- req'd
     ================================================================

     gl/account.master_ gdg=6 next=000000(000002:000002)yymmdd:HHMMSS <-- reset
     ==============================******============================

gdgctl illustrating prior gen# over-rides

 gl/account.acntlist_ gdg=08
 gl/account.master_   gdg=10 next=000002(000002:000002)000000:000000 <--note1
 gl/account.trans_    gdg=20 next=000002(000002:000002)070529:235959 <--note2
 py/payroll.master_   gdg=30 op=c                                     <--note3
 py/time.cards_       gdg=52 next=000001(000001:000012)000000:000000 <--note4
 py/time.cards.div2_  gdg=52 next=000001(000001:000012)070529:235959 <--note5
  1. 'next=000002' will be reset to 'next=000000' (disabling over-ride) at the end of the 1st JCL/script that references the file with exportgen0.

  2. Specify an 'expiry date' if you want the over-ride to persist for multiple runs until some specified date/time.

  3. Specify 'opt=c' if you want an operator prompt to confirm gen# selection or enter an alternative generation#

  4. The generation# will be incremented each time you run the JCL/script referencing the file. After the 12th run it will be set to 'next=000000(000001:000012)' disabling the over-ride, but leaving some history, in case you wanted to reactivate in future.

5a. You could also specify a non-zero expiry date/time, but not necessary since the override is automatically disabled at the high end of the range.

5b. Expiry dates are ignored for ranges (when low & high different), but you could code expiry dates with ranges for an historical record.

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

5C1. MVS JCL conversion - GDG files

creating the gdgctl file

For these discussions, we assume you have already setup userid mvstest & copied the demo files from /home/uvadm/mvstest/* to /home/mvstest/... as instructed on page MVSJCL.htm#1P1 thru 1P3. And then converted the supplied demo JCLs & COBOL programs as per 1Q1-1R3.

If you had very few GDG files you could create ctl/gdgctl51 with the editor (see the sample further below), but in case you have a lot of GDG files, we provide a utility job. 'jcldata56' will read all JCL, extract all DSN's,& sort with data reduction to 1 line per unique filename.

There are several options (as shown below at #3), but the ones you might want to change are 'g15' default generations & 'h40' the column# where you want to insert the gdg=...

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

5C2. MVS JCL conversion - GDG files

Op. Instrns. to create gdgctl file


 #1a. login mvstest,appsadm,or yourself --> /home/mvstest,appsadm,homedir

 #1b. cdl --> $TESTLIBS (/home/mvstest/testlibs, /p1/testlibs, ???)
           - see directories,profiles,$RUNLIBS,etc discussed page '1A1' +

 #2. [ jcl2ksh41A all ]      <-- we assume JCL conversion already completed
     =================        - left all converted scripts in jcl3/...

 #3. uvcopy jcldata56,fild1=jcl3,filo2=ctl/datafiles56,uop=c0f2g99h40j1
     ==================================================================
     options: c0 = no filecounts, f2 = exportgen files only, g99 = default gens
              h40 = col# to insert gdg=..., j1 = remove $JTMP/

 #3a. uvcopy jcldata56     <-- same as above (files default as shown)
      ================       - sample output shown below
     gl/account.master_                       gdg=31
     gl/account.trans_                        gdg=31 opt=c
     py/payroll.master_                       gdg=31

These samples are based on the test/demo JCLs shown in Part_1 (but several lines removed for this illustration).


 #4. cp ctl/datafiles56 $RUNDATA/ctl/gdgctl51
     ========================================
     - copy/rename for GDG control file
Note
  • GDG control files moved to $RUNDATA to allow multiple $RUNDATA's

 #5. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #6. vi ctl/gdgctl51    <-- edit to modify no of generations as desired
     ===============      - replace any $SYMBOLS with values

 #7. uvcopy gdgload1,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I
     ======================================================
     - load Indexed file to supply file info to JCL converter

 #7a. uvcopy gdgload1   <-- same but easier (files default as shown above)
      ===============
Note
  • see page '5F1' for special editing if you have $SYMBOLS
  • on your data file names extracted from your JCL/scripts by jcldata56

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

5C3. MVS JCL conversion - GDG files

updating text file with vi & reloading Indexed file


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

 #2. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #3. vi ctl/gdgctl51    <-- view the supplied file
     ===============
     gl/account.acntlist_  gdg=31
     gl/account.master_    gdg=31
     gl/account.trans_     gdg=31
     py/payroll.master_    gdg=31
     py/time.cards_        gdg=31

 #3a. update the file as shown below:
     gl/account.acntlist_  gdg=08
     gl/account.master_    gdg=10 next=000002(000002:000002)_991231:235959
     gl/account.trans_     gdg=20 opt=c next=000001(000001:000012)000000:000000
     py/payroll.master_    gdg=30
     py/time.cards_        gdg=52

 #3b. quit the editor & reload the Indexed file

 #4. uvcopy gdgload1,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I
     ======================================================
     - load Indexed file to supply file info to JCL converter

 #4a. uvcopy gdgload1    <-- same as above (files default as shown)
      ===============

 #5.  Run the supplied demo JCL/script (jgl100.ksh) & observe that it
      processes gl/account.master_000002 (NOT the latest gen# 000003

 #5a. jgl100.ksh    <-- run demo job, observe console log
      ==========      - should see input generation ..._000002

 #5b. jgl100.ksh    <-- rerun demo job, observe console log
      ==========      - should see input ..._000003 (last gen#)
                      - override was reset by jobend51 at end 1st run

updated control file supplied

An alternate version of the gdgctl file is supplied with the next=... controls as shown above. We will use it for the jgl220.ksh demos begining on page '5E1'. We will load it as follows:


 #3b. uvcopy gdgload1,fili1=ctl/gdgctl51test2
      =======================================
      - must specify alternate input file (else would default to ctl/gdgctl51)
      - no need to specify output file which defaults to ctl/gdgctl51I

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

5C4. MVS JCL conversion - GDG files

display gdgctl Indexed file with uvhd (char mode)

Rather than updating the text file version & reloading the Indexed file, you could update the Indexed file directly with 'uvhd'. This is safer than updating the indexed file directly with 'vi'.

Note that when the text file is loaded into an Indexed file, you get 2 partitions (gdgctl51I.dat & gdgctl51I.idx).


 uvhd ctl/gdgctl51I.dat r2048u   <-- execute uvhd to display gdgctl file
 =============================     - options: r2048=record-size, u=update
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
        2048 gl/account.master_                                 gdg=10
          64 next=000000(000000:000000)000000:000000
         128 000000:000000:G0_000000(000000:000000)_______  _____ _________
         192 000000:000000:G0_000000(000000:000000)_______  _____ _________
         256 000000:000000:G0_000000(000000:000000)_______  _____ _________
         320 000000:000000:G0_000000(000000:000000)_______  _____ _________
         384 000000:000000:G0_000000(000000:000000)_______  _____ _________
         448 000000:000000:G0_000000(000000:000000)_______  _____ _________
         512 000000:000000:G0_000000(000000:000000)_______  _____ _________
         576 000000:000000:G0_000000(000000:000000)_______  _____ _________
         640 000000:000000:G0_000000(000000:000000)_______  _____ _________
         704 000000:000000:G0_000000(000000:000000)_______  _____ _________
         768 000000:000000:G0_000000(000000:000000)_______  _____ _________
         832 000000:000000:G0_000000(000000:000000)_______  _____ _________
         896 000000:000000:G0_000000(000000:000000)_______  _____ _________
         960 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1024 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1088 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1152 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1216 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1280 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1344 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1408 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1472 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1536 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1600 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1664 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1728 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1792 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1856 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1920 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1984 000000:000000:G0_000000(000000:000000)_______  _____ _________..

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

5C5. MVS JCL conversion - GDG files

gdgctl file displayed by uvhd


 uvhd ctl/gdgctl51I.dat r2048u   <-- execute uvhd to display gdgctl file
 =============================     - options: r2048=record-size, u=update
  1. Please see the uvhd display on the previous page. We are showing records 2 & 3 after loading the indexed file with ctl/gdgctl51test2. Each 2048 byte record is display on 26 lines (of 64 bytes). Here are the 1st 2 lines for records 2 & 3.
        2048 gl/account.master_                                 gdg=12
          64 next=000002(000002:000002)991231:235959
                 - - - 11 lines omitted - - -
        2048 gl/account.trans_                                  gdg=18 opt=c
          64 next=000001(000001:000012)000000:000000
                 - - - 11 lines omitted - - -
  1. Only lines 2 & 3 have items that might be updated with uvhd or vi. You might want to modify the number of generations (gdg=12 or gdg=18 above). You might want to add option 'opt=c' to prompt operator to confirm gen# (as shown for the gl/account.trans file).

  2. Some users may have a reason to code the 'next=...' options shown above 'next=000002...' for gl/account.master overrides the normal selection of the highest generation until the expiry date is reached.

  3. 'next=000001(000001:000012)...' on gl/account/trans, will increment the generation# thru a range of previously stored generations from low to high. 'exportgen0' will use the next=... value & 'jobend51/gdgupok1' will increment the generation# at successful EOJ. We will demonstrate later using jgl220.ksh (see pages '5E1' thru '5E11').

  4. Note that the last 2 bytes of each record show as '..' because uvhd shows any unprintable characters as '.'. The 1st '.' is a real period inserted in the last data byte to allow possible updating with the editor. The last byte of the record & the 2nd '.' is x'0A' which is the indexed file record status byte for a good record, whereas x'00' indicates a deleted record.

  5. You can see the hex characters by adding option 'h2' to force display in 'vertical hexadecimal', which is automatic if the record contains any non-character bytes. The above was in character because the only non-char was the LineFeed x'0A' which is expected at the end of text records.

  6. On page '5C5' we will show how to use uvhd to perform the same updates as shown using vi on the text file on the previous page.

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

5C6. MVS JCL conversion - GDG files

updating gdgctl Indexed file with uvhd

On this page we will show you only the 'uvhd' commands to update the Indexed file. Please see the records displayed on page '5C3'. The records already have the updates shown below because we loaded the file from ctl/gdgctl51test2 which was already updated with 'vi' before loading the indexed file (the easier way to make extensive updates).


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

 #2. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #3. uvhd ctl/gdgctl51I.dat r2048u  <-- start uvhd with options
     =============================      r2048=recsize, u=update
      <--- see uvhd record display on prior page
         - uvhd displays the 1st record & prompts for commands
         - you can reply as shown below:

 #3a. -->    <-- null entry to advance to record #2

 #3b. --> u 64(38),'next=000002(000002:000002)000000:000000'
          ==================================================

easier alternative

Actually the gdgload1 utility inserts zero-filled inactive entries, so you only have to update the 6 digit next gen# as follows:


 #3b. --> u 69(6),'000002'
          ================

 #3c. --> q   <-- quit

Notes

  1. If you use uvhd, you must be sure not to modify the keys (1st 50 bytes)

  2. using uvhd is more awkward than an editor, but much safer. uvhd will never change the record size which would corrupt the remainder of the file, since the index partition depends upon all data record being same size. Adding or deleting bytes inadvertently is very easy to do with vi.

  3. Updating the Indexed file directly with 'vi' is dangerous, but it is fast & convenient, and we will show you how on the next page.

  4. After updating with 'vi' you should always run the 'dcheck' utility to ensure the validity of the Indexed file.

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

5C7. MVS JCL conversion - GDG files

updating gdgctl Indexed file with vi


 #1. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata

 #2. vi ctl/gdgctl51I.dat   <-- start 'vi' on the Indexed file .dat partition
     ====================
 gl/account.trans_                                  gdg=18 opt=c next=000001(0000
 01:000003)000000:000000                         000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________  000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________  000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________  000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________  000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________  000000:000000:G0_000000(000000:0
 00000)_______  _____ _________  000000:000000:G0_000000(000000:000000)_______  _
 ____ _________  000000:000000:G0_000000(000000:000000)_______  _____ _________
 000000:000000:G0_000000(000000:000000)_______  _____ _________  000000:000000:G0
 _000000(000000:000000)_______  _____ _________.

 #2a. -->vi updates ...

 #2x. -->:wq  <-- write & quit vi editor

 #3. dcheck ctl/gdgctl51I    <-- validate the Indexed file
     ====================      - to ensure you did not screw up with editor

notes re display above

To the 'vi' editor the gdgctl51I.dat records are considered very long lines, since there is only 1 Linefeed at the end of the 2048 byte records. They appear as 26 lines on the screen, since screen lines wrap at 80 bytes. If we printed the original record you would see only the 1st 90 bytes (page-width).

To simulate the screen appearance I ran a uvcopy job 'splitrec1' which inserts a Line-Feed every 80 bytes. I 1st used vi to write 1 record to tmp/gdgctl1.


 uvcopy splitrec1,fili1=tmp/gdgctl1,filo1=tmp/gdgctl2
 ====================================================

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

5C8. MVS JCL conversion - GDG files

Notes re updating gdgctl with 'vi'

  1. Shown above is the 3rd record of gdgctl51I after loading from gdgctl51test2. Each 2048 byte record requires 26 lines. The filename appears 1st, in this example 'gl/account.trans. The only items you might need to update are on the 1st 2 lines (+ 6 chars of the 3rd line). The rest is history.
 gl/account.trans_                                  gdg=18 opt=c next=000005(0000
 01:000012)000000:000000 JGL220             err4 070621:210051:G0_000003(000001:0
 00003)JGL220   S0010 cgl200err4 070621:210030:G0_000003(000001:000003)JGL220   S
  1. 'gdg=18' is the number of generations to be maintained. 'opt=c' is the option for operator confirmation of gen# selection. 'next=...' is the option to process a series of existing prior generations.

  2. Note 'next=000005(000001:000012)...'. This 'vi' snapshot was captured 4 runs after setting next=000001(000001:000012)...'

  3. If you are very careful you might be able to update with vi. Use only the 'R'eplace command of vi, not insert or delete. Note that 'gdgload1' inserts a period '.' at col 2047 to indicate the end of the record. See the end-of-record '.' on the last of the 13 x 80 column lines required to show the 2048 byte record. You know the record has not shifted if the '.' is 1 column left of the 'S' on the line above.

  4. When you rewrite the file, check that the file-size is a multiple of the record-size (256). Or use control-G in the editor to check before writing.

  5. Updating the indexed file is only justified if you always run the 'dcheck' utility to validate & if you maintain the text file version.

  6. If you do much updating with vi, you could periodically run 'gdgunload1' to convert the Indexed file back to the text file backup.

  7. If need be you can recreate the text file by running jcldata56 (see '5C1').

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

5D1. MVS JCL conversion - GDG files

GDG logic illustrated

This illustration will show you how we prevent incrementing the generation# on abnormal terminations. We will use the 'jgl100.ksh' JCL/script from pages '1E1' - '1E4'. Here we will show only lines relevant to GDG logic.

jgl100.ksh to illustrate GDG logic

 ##JGL100   JOB  (1234),'LIST GL MASTER CHART OF ACCOUNTS'
          - - - omitting lines Not Relevant to GDG logic - - -
 jobset51  # call function for JCL/script initialization             <--Note1,2,3
 #=======
            - - - omitting non relevant lines - - -
 exportgen0 ACCTMAS gl/account.master_                                   <--Note4
 exportgen1 ACTLIST $JGDG/gl/account.acntlist_                           <--Note5
 #exportgen1 GDG subdir/file, option g1 move to outdir at Normal EOJ
 logmsg2 "Executing--> cobrun $ANIM $RLX/cgl100"
 #3----------------------------------------------------------------------
 cobrun $ANIM $RLX/cgl100
 #4----------------------------------------------------------------------
 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 if ((S0010C != 0))                                                      <--Note6
    then logmsg2 "ERR: step#$JSTEP cgl100 abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
 #8======================================================================
 S9000=A                                                                 <--Note7
 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs
 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 exit 0 #jclunix51 ver:20090313 b2c0d1g1e0f1i1j0k3l20m4n3o0p0r0s0t1u1w0x0y1z0
 #9======================================================================
 S9900=A                                                                 <--Note8
 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
 exit $JCC

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

5D2. MVS JCL conversion - GDG files

Notes re jgl100.ksh above

  1. 'jobset51' sets up jobtmp/JGL100/subdirs to hold any new GDG files until normal EOJ. See jobset51 listed on page '5K1'.

  2. You must modify jobset51 to make subdirs required for your applications. Our supplied version sets up subdirs ar, gl, mstr,& tape (for our demos).

  3. jobset51 performs 'cd $RUNDATA', so all files are defined in the script relative to $RUNDATA, which is /home/mvstest/testdata/... for the test/demos documented in MVSJCL.htm#Part_1.

  4. exportgen0 defines the current generation for input. Assuming there are 3 generations in the file 000001,000002,000003, the result would be:

    export ACCTMAS=gl/account.master_000003
    =======================================
  1. exportgen1 defines the next generation for output, effectively:

    exportgen1 ACTLIST $JTMP/gl/account.acntlist_000004
    ===================================================
    #exportgen1 assign to $JTMP/subdir/file, move to subdir/file at Normal EOJ
Note
  • #comment following any exportgen1 reminds you that new GDG files are
  • 1st written to jobtmp/$JOBID/gl/... & moved back to gl/... at EOJ
  • not moved if script abends, so you can rerun abends w/o removing files
  1. Return code from the COBOL program is tested & control goes to S9900 on failure(non-zero) & S9000 on success(zero).

  2. At S9000 (Normal EOJ), function 'jobend51' will move GDG files from jobtmp/subdirs back to $RUNDATA/subdirs. In this case from jobtmp/JGL100/GDG/gl/... to $RUNDATA/gl/...

  3. At S9900 (Abnormal EOJ), jobset51 is not called, so any new GDG files are not moved back to $RUNDATA/subdirs. This means you can rerun the job without having to remove any new GDGs (so exportgen0 will get intended input).

  4. Note that for a multi-step JCL/script, you might use the restart facility to restart at the step that failed. On a restart jobset51 will prompt you & copy any new GDG files back to $RUNDATA/subdirs.
Note
  • writing new GDGs to jobtmp controlled by option g0/g1 in ctl/jclunixop51
  • g1 (default) writes new GDGs to jobtmp/... for move back at Normal EOJ
  • g0 option writes new GDGs in original $RUNDATA/subdir
  • for g0, you could restart failed jobs at step after failure, else
    you must remove any new GDGs created up to failure before rerunning

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

5D3. MVS JCL conversion - GDG files

$RUNDATA subdirs BEFORE jgl100.ksh test GDG

 /home/mvstest/testdata:
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:03 gl
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:03 joblog
 drwxrwxr-x    3 mvstest  users        4096 Jun  1 15:03 jobtmp
 /home/mvstest/testdata/gl:
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 09:36 account.acntlist_000001
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 09:36 account.acntlist_000002
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 09:36 account.acntlist_000003
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000001
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000002
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.tran1
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000001
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000002
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000004
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000005

/home/mvstest/testdata/jobtmp: total 0

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

5D4. MVS JCL conversion - GDG files

run jgl100.ksh & observe GDG results

This assumes you have setup the 'mvstest' user & copied the demo files from /home/uvadm/mvstest/* to /home/mvstest/... as instructed on pages '1P1'-'1P3'.


 #1. login mvstest --> /home/mvstest           (see dtree on page '1A1')

 #2. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #3. uvcopy gdgload1,fili1=ctl/gdgctl51
     ==================================
     - ensure gdgctl51 loaded (vs gdgctl51test2 used for increment test later)

 #4. testdatainit              <-- remove any old test output files
     ============                  (jobtmp/*, joblog/*, etc)

 #5a. rm -f gl/*               <-- remove test files & any excess generations
      ==========                   (from prior runs)

 #5b. cp glsave/* gl           <-- refresh gl/testdatafiles
      ==============             - originally only 3 generations per file

 #6. jgl100.ksh                <-- execute JCL/script to demo GDG files
     ==========                  - BETTER to use joblog1 as below

 #6a. joblog1 jgl100.ksh       <-- alternative to capture console log file
      ==================         - see listing on the next page

 #7a. vi joblog/jgl100.log     <-- view console log
      ====================

 #7b. uvlp12 joblog/jgl100.log <-- OR, print console log
      ========================

 #8a. ls -l gl                    <-- inspect contents of gl subdir
      ========                      - see before above & after below
                                      on successful & failed runs

 #8b. ls -l jobtmp/JGL100/GDG/gl  <-- inspect contents of jobtmp/...
      ==========================    - on good runs, files already moved out
                                    - on failure, new GDG files still there

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

5D5. MVS JCL conversion - GDG files

jgl100 run#1 - Terminated Normally

 090314:080747:JGL100: Begin Job=JGL100
 090314:080747:JGL100: /home/mvstest/testlibs/jcls/jgl100.ksh
 090314:080747:JGL100: Arguments:
 090314:080747:JGL100: RUNLIBS=/home/mvstest/testlibs
 090314:080747:JGL100: RUNDATA=/home/mvstest/testdata
 090314:080747:JGL100: JTMP=/home/mvstest/testdata/jobtmp/JGL100 SYOT=/home/mvstest/testdata/sysout/JGL100
 090314:080747:JGL100: RUNDATE=20090314
 090314:080747:JGL100: ******** Begin Step S0010 cgl100 (#1) ********
 090314:080747:JGL100: EOF fili01 rds=3 size=75: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010I_gl_account.master_
 090314:080747:JGL100: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:080747:JGL100: EOF filo02 wrts=1 size=51: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010G0_gl_account.master_
 090314:080747:JGL100: gen0: ACCTMAS=gl/account.master_000003insize=8720
 090314:080747:JGL100: EOF fili01 rds=3 size=81: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010O_gl_account.acntlist_
 090314:080747:JGL100: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:080747:JGL100: EOF filo02 wrts=1 size=128: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010G1_gl_account.acntlist_
 090314:080747:JGL100: gen+1: ACTLIST=/home/mvstest/testdata/jobtmp/JGL100/GDG/gl/account.acntlist_000004 gens=8
 090314:080747:JGL100: file: SYSOUT=/home/mvstest/testdata/sysout/JGL100/S0010_SYSOUT bytes=
 090314:080747:JGL100: Executing--> cobrun -F /home/mvstest/testlibs/cblx/cgl100
 090314:080747:JGL100: Job Times: Begun=08:07:47 End=08:07:47Elapsed=00:00:00
 090314:080747:JGL100: moving /home/mvstest/testdata/jobtmp/JGL100/GDG/subdir/files back to $RUNDATA/subdirs/
 `/home/mvstest/testdata/jobtmp/JGL100/GDG/gl/account.acntlist_000004' -> `gl/account.acntlist_000004'
 090314:080747:JGL100: EOF filr01 rds=5 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:080747:JGL100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

$RUNDATA subdirs AFTER jgl100.ksh run OK

 /home/mvstest/testdata:
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:03 gl
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:03 joblog
 drwxrwxr-x    3 mvstest  users        4096 Jun  1 15:03 jobtmp
 /home/mvstest/testdata/gl:
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 09:36 account.acntlist_000001
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 09:36 account.acntlist_000002
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 09:36 account.acntlist_000003
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 15:03 account.acntlist_000004
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000001
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000002
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000003
 /home/mvstest/testdata/jobtmp:
 drwxrwxr-x    6 mvstest  users        4096 Jun  1 15:03 JGL100

/home/mvstest/testdata/jobtmp/JGL100: total 0

Note
  • new generation ..._000004 was initially created in jobtmp/JGL100/GDG/gl
  • but has been moved back to $RUNDATA/gl by jobend51 at Normal EOJ

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

5D6. MVS JCL conversion - GDG files

jgl100 run#2 - demo Abnormal Termination

We will now modify jgl100.ksh to cause a run failure & rerun to illustrate that the new generations of GDG files are not stored in the $RUNDATA/subdirs if Abnormal termination occurs.


 #1. cdl --> /home/mvstest/testlibs  ('cdl' is an alias for 'cd $RUNLIBS')
     ===

 #2. mv cblx/cgl100.int tmp
     ======================
     - remove COBOL program from loadlib, to cause failure
       (saved in tmp/... for later restore)

 #3. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===
Note
  • we omit some #numbers here, so following step#s are same as on '5D4'.

 #6. jgl100.ksh                <-- execute JCL/script to demo GDG files
     ==========                  - BETTER to use joblog1 as below

 #6a. joblog1 jgl100.ksh       <-- alternative to capture console log file
      ==================           see listing on the next page -->

 #7a. vi joblog/jgl100.log     <-- view console log
      ====================

 #7b. uvlp12 joblog/jgl100.log <-- OR, print console log
      ========================

 #8a. ls -l gl                    <-- inspect contents of gl subdir
      ========                      - see before above & after below
                                      on successful & failed runs

 #8b. ls -l jobtmp/JGL100/GDG/gl  <-- inspect contents of jobtmp/...
      ==========================    - on good runs, files already moved out
                                    - on failure, new GDG files still there
                                      see listing on the next page -->

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

5D7. MVS JCL conversion - GDG files

jgl100 run#2 - Terminated Abnormally

 090314:080824:JGL100: Begin Job=JGL100
 090314:080824:JGL100: /home/mvstest/testlibs/jcls/jgl100.ksh
 090314:080824:JGL100: Arguments:
 090314:080824:JGL100: RUNLIBS=/home/mvstest/testlibs
 090314:080824:JGL100: RUNDATA=/home/mvstest/testdata
 090314:080824:JGL100: JTMP=/home/mvstest/testdata/jobtmp/JGL100 SYOT=/home/mvstest/testdata/sysout/JGL100
 090314:080824:JGL100: RUNDATE=20090314
 090314:080824:JGL100: ******** Begin Step S0010 cgl100 (#1) ********
 090314:080824:JGL100: EOF fili01 rds=3 size=75: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010I_gl_account.master_
 090314:080824:JGL100: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:080824:JGL100: EOF filo02 wrts=1 size=51: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010G0_gl_account.master_
 090314:080824:JGL100: gen0: ACCTMAS=gl/account.master_000003insize=8720
 090314:080824:JGL100: EOF fili01 rds=4 size=108: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010O_gl_account.acntlist_
 090314:080824:JGL100: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:080824:JGL100: EOF filo02 wrts=1 size=128: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010G1_gl_account.acntlist_
 090314:080824:JGL100: gen+1: ACTLIST=/home/mvstest/testdata/jobtmp/JGL100/GDG/gl/account.acntlist_000005 gens=8
 090314:080824:JGL100: file: SYSOUT=/home/mvstest/testdata/sysout/JGL100/S0010_SYSOUT bytes=
 090314:080824:JGL100: Executing--> cobrun -F /home/mvstest/testlibs/cblx/cgl100
 Load error : file '/home/mvstest/testlibs/cblx/cgl100'
 error code: 173, pc=0, call=1, seg=0
 173     Called program file not found in drive/directory
 090314:080824:JGL100: ERR: step#S0010 cgl100 abterm 255
 090314:080824:JGL100: ERR: Terminated Abnormally,JCC=255,StepsX/L=1/S0010 y/n?
 y
 090314:080826:JGL100: Job Times: Begun=08:08:24 End=08:08:26Elapsed=00:00:02
 090314:080826:JGL100: ERR: GDG files NOT moved from jobtmp/subdirs to /home/mvstest/testdata/subdirs
 090314:080826:JGL100: - can rerun OK, since GDGs not added to RUNDATA/subdirs
 090314:080826:JGL100: - OR restart at abterm step & reply y to move prompt
 090314:080826:JGL100: ERR: /home/mvstest/testdata/jobtmp/JGL100/GDG/gl/files NOT moved to $RUNDATA/gl/ listed below:
 gl/account.acntlist_000005
 090314:080826:JGL100: EOF fild01 rds=3 size=4096: /home/mvstest/testdata/jobtmp/JGL100/GDG/gl
 090314:080826:JGL100: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:080826:JGL100: - reply y/n acknowledge GDG msg, but no auto action y/n?

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

5D8. MVS JCL conversion - GDG files

$RUNDATA subdirs AFTER jgl100.ksh run FAILURE

 /home/mvstest/testdata:
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:11 gl
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:11 joblog
 drwxrwxr-x    3 mvstest  users        4096 Jun  1 15:03 jobtmp
 /home/mvstest/testdata/gl:
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 09:36 account.acntlist_000001
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 09:36 account.acntlist_000002
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 09:36 account.acntlist_000003
 -rw-rw-r--    1 mvstest  users        3394 Jun  1 15:03 account.acntlist_000004
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000001
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000002
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000003
 /home/mvstest/testdata/jobtmp:
 drwxrwxr-x    6 mvstest  users        4096 Jun  1 15:11 JGL100
 /home/mvstest/testdata/jobtmp/JGL100:
 drwxrwxr-x    2 mvstest  users        4096 Jun  1 15:11 gl
 /home/mvstest/testdata/jobtmp/JGL100/GDG/gl:
 -rw-rw-r--    1 mvstest  users           0 Jun  1 15:11 account.acntlist_000004
  1. After a failure, you can see that the new GDG file ..._000004 is in jobtmp/JGL100/GDG/gl/...

  2. Note the file size is 0, since the program failed. exportgen1 does a 'touch' to create the 0 length file, normally overwriten by the COBOL program.

  3. The new GDG jobtmp/..._000004 is not moved back to $RUNDATA/gl/... because job ends Abnormally (only moved back on a Normal EOJ).

  4. After we correct the problem, we can simply rerun the job, no need to worry about removing new GDGs for incomplete jobs.

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

5D9. MVS JCL conversion - GDG files

jgl100 run#3 - AFTER Abnormal Termination


 #1. cdl --> /home/mvstest/testlibs

 #2. mv tmp/cgl100.int cblx
     ======================
     - restore COBOL program from tmp/... back to loadlib
       (was saved in tmp/... at #2 on page '5D6')

 #6. jgl100.ksh        <-- execute JCL/script to demo GDG files
     ==========

jgl100 run#3 - after Abnormal Termination

 090314:080849:JGL100: Begin Job=JGL100
 090314:080849:JGL100: /home/mvstest/testlibs/jcls/jgl100.ksh
 090314:080849:JGL100: Arguments:
 090314:080849:JGL100: RUNLIBS=/home/mvstest/testlibs
 090314:080849:JGL100: RUNDATA=/home/mvstest/testdata
 090314:080849:JGL100: JTMP=/home/mvstest/testdata/jobtmp/JGL100 SYOT=/home/mvstest/testdata/sysout/JGL100
 090314:080849:JGL100: RUNDATE=20090314
 090314:080849:JGL100: WARN: files exist in jobtmp/GDG subdirs (from prior Abterm ERR?)
 090314:080849:JGL100: ---- files in /home/mvstest/testdata/jobtmp/JGL100/GDG/*/* listed below:
 /home/mvstest/testdata/jobtmp/JGL100/GDG/gl/account.acntlist_000005
 090314:080849:JGL100: jobtmp/GDG/subdir/files must be moved/removed before run starts
 090314:080849:JGL100: y = move back to $RUNDATA/GDG/subdirs - restart from step# ?
 090314:080849:JGL100: n = do NOT move back (will erase) - rerun from begining ?
 090314:080849:JGL100: OR - may need to kill job & investigate ?
 b n
 090314:080853:JGL100: ******** Begin Step S0010 cgl100 (#1) ********
 090314:080853:JGL100: EOF fili01 rds=3 size=75: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010I_gl_account.master_
 090314:080853:JGL100: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:080853:JGL100: EOF filo02 wrts=1 size=51: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010G0_gl_account.master_
 090314:080853:JGL100: gen0: ACCTMAS=gl/account.master_000003insize=8720
 090314:080853:JGL100: EOF fili01 rds=4 size=108: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010O_gl_account.acntlist_
 090314:080853:JGL100: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:080853:JGL100: EOF filo02 wrts=1 size=128: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010G1_gl_account.acntlist_
 090314:080853:JGL100: gen+1: ACTLIST=/home/mvstest/testdata/jobtmp/JGL100/GDG/gl/account.acntlist_000005 gens=8
 090314:080853:JGL100: file: SYSOUT=/home/mvstest/testdata/sysout/JGL100/S0010_SYSOUT bytes=
 090314:080853:JGL100: Executing--> cobrun -F /home/mvstest/testlibs/cblx/cgl100
 090314:080853:JGL100: Job Times: Begun=08:08:53 End=08:08:53Elapsed=00:00:00
 090314:080853:JGL100: moving /home/mvstest/testdata/jobtmp/JGL100/GDG/subdir/files back to $RUNDATA/subdirs/
 `/home/mvstest/testdata/jobtmp/JGL100/GDG/gl/account.acntlist_000005' -> `gl/account.acntlist_000005'
 090314:080853:JGL100: EOF filr01 rds=5 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I
 090314:080853:JGL100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

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

5D10. MVS JCL conversion - GDG files

Notes

  1. Note the 'files exist in jobtmp/GDG subdirs (from prior Abterm)' warning & the prompts to move back (for restart) or not (rerun from begining).

  2. If the job only creates new generations & does not update indexed files, it is probably easier to rerun the job from the begining, since we know that any new generations have not been moved back to RUNDATA/subdirs.

  3. But if job has updated indexed files (in RUNDATA/subdirs), then you should restart from the step# in error (after fixing the problem of course). In this case reply 'y' to move the GDGs (from prior steps) back to RUNDATA/subdirs.

  4. You might also prefer to restart at the error step if the job was very long, had very big files, created time stamped outputs, etc.

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

5D11. MVS JCL conversion - GDG files

gdgctl record - ABterm on run#2 & rerun #3 OK

After an abnormal termination, you can look (with uvhd) at the gdgctl records for any files you are concerned about. Here is control record for the gdg file created by jgl100.ksh after the 3 runs illustrated on the previous pages. (run#1 OK, run#2 ABterm, run#3 OK).


 cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
 ===

 uvhd ctl/gdgctl51I.dat r2048   <-- display control file with uvhd
 ============================
                      10        20        30        40       50 60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 gl/account.acntlist_                            gdg=08
          64 next=000000(000000:000000)000000:000000 JGL100  090314:080853
         128 090314:080853:G1_000005(000001:000004)JGL100   S0010 cgl100 +
         192 090314:080826:AB_000005(______:______)JGL100   S0010 cgl100 *
         256 090314:080824:G1_000005(000001:000004)JGL100   S0010 cgl100
         320 090314:080747:G1_000004(000001:000003)JGL100   S0010 cgl100 +
         384 000000:000000:___000000(000000:000000)_______  _____ _________
               - - - 24 lines omitted to save space - - -
        1984 000000:000000:G0_000000(000000:000000)_______  _____ _________ .
  1. Note latest history entries at the top, starting at displacement 128, so run#1 is at 320, run#2 is at 256 (& 192 AB),& run#3 at 128. You can confirm this by dates:times (latest at the top)

  2. Note 2 entries for run#2, the 1st at 256 shows incomplete status (no +), the 2nd at 192 is the ABnormal termination notice status '*'.

  3. The 'AB' ABnormal Termination history entry is created by the jobabend51 function (called at S9900 abterm step at end of JCL/scripts). 'jobabend51' creates this entry for any files it finds in jobtmp/subdirs, indicating that they have not been moved back to the RUNDATA/subdirs. They would normally have been moved back to the RUNDATA/subdirs by the 'jobend51' function which is called at the S9000 Normal End of Job step.

  4. You can see that run#3 (OK) created gen# 000005, which had been created by run#2 (ABterm), but was not moved back to RUNDATA/gl/...

  5. You will not have to worry about this, if you can simply rerun the job from the begining. No new GDGs were created since we did not reach the S9000 jobend51 function that moves files back.

  6. Alternatively, you use the 'restart' option to restart at the failing step, since you are given the option to move the files back to RUNDATA/subdirs at the begining of a restarted job. You will be prompted by the 'jobset51' function called at the begining of all JCL/scripts converted by the Vancouver Utilities JCL converter.

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

5E1. MVS JCL conversion - GDG files

prior GDG & Range processing

Here we will show you how you might use one of the extra features of the Vancouver Utility GDG system to process a series of GDG files already stored in the directory before processing begins.

We can update the gdgctl file to specify the from:to series of generations to be processed 1 a t a time when processing begins. This feature saves having to modify any JCL or copy any files between the multiple runs.

For example, suppose we have already stored 12 months of gl transactions & we now wish to process all 12 successively without having to modify any JCL or copy files.

The job that stores the 12 files would use exportgen1 & assuming that there were no existing files in the gl subdir, the result would be as follows:

sample gl/account.trans files

 /home/mvstest/testdata
 :-----gl
 :     :-----account.trans_000001
 :     :-----account.trans_000002
 :     :-----account.trans_000003
 :     :-----account.trans_000004
 :     :-----account.trans_000005
 :     :       - - - etc - - -
 :     :-----account.trans_000012

updating gdgctl to process a series of GDG files

Here is the ctl/gdgctl51 file entry before & after updating to process a series of GDG files:


 gl/account.trans opt=c gdg=18           <-- before updating
 =============================

 gl/account.trans opt=c gdg=18 next=000001(000001:000012)  <-- after edit/update
 ========================================================    - before any runs

 gl/account.trans opt=c gdg=18 next=000002(000001:000012)  <-- after 1st run
 ========================================================

 gl/account.trans opt=c gdg=18 next=000012(000001:000012)  <-- after 11th run
 ========================================================

 gl/account.trans opt=c gdg=18 next=000000(000001:000012)  <-- after 12th run
 ========================================================
  1. After the 12th run, the next gen# is set to '000000' which disables the feature, but retains a history/comment, which can easily be activated for the next requirement.

  2. Any runs after next is reset to 000000 will pick up the highest gen# in the directory as normal, which may still be the 12th month.

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

5E2. MVS JCL conversion - GDG files

Demo prior GDG & Range processing

The next few pages will illustrate how you can setup the control file to process prior generations. You can load the alternate control file, already setup to process a prior generation of the account.master file & multiple generations of the account.trans file with automatic incrementing thru a range generations.

gl/... files for GDG range demo

 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000001
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000002
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000001
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000002
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000004
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000005
               - - - only 5 trans generations supplied - - -
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000012
Note
  • we supply 5 generations of the trans_ file & will run jgl220 4 times.
  • 1st 3 will use generations 000001,2,3 due to next=... override
  • 4th run reverts to latest existing (000005) since limit reached (000003)

JGL220 JCL to demo prior GDG processing

 //JGL220   JOB  (1234),'TEST/DEMO MVS JCL CONVERSION'
 //* UPDATE GL ACCOUNT MASTER WITH GLTRANS
 //* demo exportgen0 input prior master generation (ignore newer gens)
 //* demo exportgen0 input a progression of prior trans files
 //STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
 //GLMSOLD  DD DSN=GL.ACCOUNT.MASTER(0),DISP=OLD
 //GLTRANS  DD DSN=GL.ACCOUNT.TRANS(0),DISP=OLD
 //GLMSNEW  DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE),
 //            UNIT=DISK,SPACE=(TRK,(50,50),RLSE),
 //            DCB=(MODEL.DSCB,LRECL=80,BLKSIZE=6118,RECFM=FBA)

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

5E3. MVS JCL conversion - GDG files

JGL220.jcl converted to jgl220.ksh

 #!/bin/ksh
 ##JGL220   JOB  (1234),'TEST/DEMO MVS JCL CONVERSION'
 export JOBID2=JGL220; scriptpath="$0"; args="$*"
 if [[ -z "$JOBID1" ]]; then JOBID1=JGL220; fi; export JGL220
 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 exportfile
 autoload exportgen0 exportgen1 exportgenall exportgenx
 jobset51  # call function for JCL/script initialization
 #jobset51 stores any restart step# in alias 'goto' (must be last on line)
 goto
 S0000=A
 # * UPDATE GL ACCOUNT MASTER WITH GLTRANS
 # * demo exportgen0 input prior master generation (ignore newer gens)
 # * demo exportgen0 input a progression of prior gltrans files
 #1======================= begin step#S0010 CGL200 ========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg2 "Begin Step $JSTEP cgl200 (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 ##STEP020  EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
 export PROGID=cgl200
 export PARM="$YEAREND"
 exportgen0 GLMSOLD gl/account.master_
 exportgen0 GLTRANS gl/account.trans_
 exportgen1 GLMSNEW $JGDG/gl/account.master_
 #exportgen1 assign $JGDG/subdir/file, move to outdir at Normal EOJ
 #3----------------------------------------------------------------------
 cobrun $ANIM $RLX/cgl200
 #4----------------------------------------------------------------------
 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 if ((S0010C != 0))
    then logmsg2 "ERR: step#$JSTEP cgl200 abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
 #8======================================================================
 S9000=A
 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs
 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 exit 0 #jclunix51 ver:20080902 b0c0d0g15e0f1i1j0k1l20m1n3o1p0o0r0s0t1u1w0x0y1z0
 #9======================================================================
 S9900=A
 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsExec=$XSTEP,Last=$JSTEP" RV\
  ACK
 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
 exit $JCC

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

5E4. MVS JCL conversion - GDG files

setup to demo prior GDG & Range processing

We need to load the alternate control file, provided to process a prior generation of the account.master file & multiple generations of the account.trans file with automatic incrementing thru a range generations.


 #1. login mvstest --> /home/mvstest  (see subdirs on page '1A1')

 #2. cdd  (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
     ===

 #3. vi ctl/gdgctl51test2   <-- inspect gdgctl to demo prior GDG & Range
     ====================
      # gdgctl51test2 - GDG control file
      #               - by Owen Townsend, UV Software, 2007
      # - distributed in /home/uvadm/mvstest/testlibs/ctl/gdgctl51test2
      # - see www.uvsoftware.ca/mvsjcl.htm#Part_5
      # - loaded by 'gdgload1' to test GDG files
      # - using jgl220.ksh, see MVSJCL.doc pages 5E1-5E11
      gl/account.acntlist_   gdg=06
      gl/account.master_     gdg=12 next=000002(000002:000002)991231:235959
      gl/account.trans_      gdg=18 opt=c next=000001(000001:000003)000000:000000
      py/payroll.master_     gdg=20
      py/time.cards_         gdg=30
Note
  • we supply 5 generations of the trans_ file & will run jgl220 4 times.
  • 1st 3 will use generations 000001,2,3 due to next=... override
  • 4th run reverts to latest existing (000005) since limit reached (000003)

 #4. uvcopy gdgload1,fili1=ctl/gdgctl51test2
     =======================================
     - load alternate gdgctl51test2 to demo prior select/increment GDG

 #5. testdatainit              <-- remove any old test output files
     ============                  (jobtmp/*, joblog/*, etc)

 #6a. rm -f gl/*               <-- remove test files & any excess generations
      ==========                   (from prior runs)

 #6b. cp glsave/* gl           <-- refresh gl/testdatafiles
      ==============             - only 3 generations per file

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

5E5. MVS JCL conversion - GDG files

prior GDG select/increment - Run#1


 #1. jgl220.ksh                <-- execute JCL/script to demo GDG files
     ==========                  - BETTER to use joblog1 as below

 #1a. joblog1 jgl220.ksh       <-- alternative to capture console log file
      ==================

 #2.  vi joblog/jgl220.log     <-- view console log
      ====================

 #2b. uvlp12 joblog/jgl220.log <-- OR, print console log
      ========================     see listing on the next page -->

 #3.  ls -l gl                 <-- display gl/... subdir after 1st run
      ========

 #3a. lslp gl                  <-- OR, print gl/... subdir after 1st run
      =======                      see listing on the next page -->

 #4. Please inspect the console logs & directory listings on the next page
     & observe the following:

observations after 1st run

  1. The master file selected was gl/account.master_000002, because the gdgctl file had next=000002... overriding the usual selection of the last generation in the directory which was _000005

  2. The trans file selected was gl/account.trans_000001, because the gdgctl file had next=000001(000001:000003)... & this was the 1st run.

  3. After the 1st run, the trans entry in ctl/gdgctl51I.dat would be: next=000002(000001:000003)...

  4. Note that 'opt=c' coded on the control file entry for gl/account.trans_ causes the following operator prompt to confirm 'y' or enter an alternative 6 digit generation#.
     gen0: GLTRANS=gl/account.trans_000001     <-- confirm y or alt# ?
     gen0: GLTRANS: generations=000001:000003  <-- enter y(000001) or alt# ?
     070616:155225:JGL220: gen0: GLTRANS=gl/account.trans_000001 insize=1600

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

5E6. MVS JCL conversion - GDG files

jgl220.log after 1st run

 080827:093441:JGL220: Begin Job=JGL220
 080827:093441:JGL220: /home/mvstest/testlibs/jcls/jgl220.ksh
 080827:093441:JGL220: Arguments:
 080827:093441:JGL220: RUNLIBS=/home/mvstest/testlibs
 080827:093441:JGL220: RUNDATA=/home/mvstest/testdata
 080827:093441:JGL220: JTMP=jobtmp/JGL220 SYOT=sysout/JGL220
 080827:093441:JGL220: RUNDATE=20080827
 080827:093441:JGL220: Begin Step S0010 cgl200 (#1)
 080827:093441:JGL220: gen0: GLMSOLD=gl/account.master_000002 insize=8720
 gen0: GLTRANS=gl/account.trans_000001  <-- confirm y or alt# ?
 gen0: GLTRANS: generations=000001:000005  <-- enter y(000001) or alt# ?
 080827:093557:JGL220: gen0: GLTRANS=gl/account.trans_000001 insize=1600
 080827:093558:JGL220: gen+1: GLMSNEW=jobtmp/JGL220/GDG/gl/account.master_000004 gens=12
 080827:093558:JGL220: Job Times: Begun=09:34:41 End=09:35:58 Elapsed=00:01:17
 080827:093558:JGL220: moving jobtmp/JGL220/GDG/subdir/files back to $RUNDATA/subdirs/
 `jobtmp/JGL220/GDG/gl/account.master_000004' -> `gl/account.master_000004'
 080827:093558:JGL220: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

gl directory after 1st run

 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000001
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000002
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000003
 -rw-rw-r--    1 mvstest  users        8720 Jun  2 07:31 account.master_000004
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000001
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000002
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000004
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000005

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

5E7. MVS JCL conversion - GDG files

prior GDG select/increment - Run#2


 #1. jgl220.ksh                <-- execute JCL/script to demo GDG files
     ==========                  - BETTER to use joblog1 as below

 #1a. joblog1 jgl220.ksh       <-- alternative to capture console log file
      ==================

 #2a. vi joblog/jgl220.log     <-- view console log
      ====================

 #2b. uvlp12 joblog/jgl220.log <-- OR, print console log
      ========================     see listing on the next page -->

 #3.  ls -l gl                 <-- display gl/... subdir after 2nd run
      ========

 #3a. lslp gl                  <-- OR, print gl/... subdir after 2nd run
      =======                      see listing on the next page -->

 #4. Please inspect the console logs & directory listings on the next page
     & observe the following:

observations after 2nd run

  1. The master file selected was gl/account.master_000002, because the gdgctl file had next=000002... overriding the last generation of _000005. The next=000002 was not reset because the expiration date was 991231.

  2. The trans file selected was gl/account.trans_000002, because the gdgctl file had next=000002(000001:000003)... (next= incremented at end 1st run).

  3. After the 2nd run, the trans entry in ctl/gdgctl51I.dat should be: next=000003(000001:000003)...

  4. We supply 5 generations of the trans_ file & demo 1st 4 runs. Runs 1,2,3 will use generations 000001,2,3 (overriding last existing 000005) Run#4 will revert to 000005, since upper limit of (000001:000003) exceeded.

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

5E8. MVS JCL conversion - GDG files

jgl220.log after 2nd run

 080827:094734:JGL220: Begin Job=JGL220
 080827:094734:JGL220: /home/mvstest/testlibs/jcls/jgl220.ksh
 080827:094734:JGL220: Arguments:
 080827:094734:JGL220: RUNLIBS=/home/mvstest/testlibs
 080827:094734:JGL220: RUNDATA=/home/mvstest/testdata
 080827:094734:JGL220: JTMP=jobtmp/JGL220 SYOT=sysout/JGL220
 080827:094734:JGL220: RUNDATE=20080827
 080827:094734:JGL220: Begin Step S0010 cgl200 (#1)
 080827:094734:JGL220: gen0: GLMSOLD=gl/account.master_000002 insize=8720
 gen0: GLTRANS=gl/account.trans_000002  <-- confirm y or alt# ?
 gen0: GLTRANS: generations=000001:000005  <-- enter y(000002) or alt# ?
 080827:094741:JGL220: gen0: GLTRANS=gl/account.trans_000002 insize=1600
 080827:094741:JGL220: gen+1: GLMSNEW=jobtmp/JGL220/GDG/gl/account.master_000005 gens=12
 080827:094741:JGL220: Job Times: Begun=09:47:34 End=09:47:41 Elapsed=00:00:07
 080827:094741:JGL220: moving jobtmp/JGL220/GDG/subdir/files back to $RUNDATA/subdirs/
 `jobtmp/JGL220/GDG/gl/account.master_000005' -> `gl/account.master_000005'
 080827:094741:JGL220: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

gl directory after 2nd run

 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000001
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000002
 -rw-rw-r--    1 mvstest  users        8720 May 31 17:33 account.master_000003
 -rw-rw-r--    1 mvstest  users        8720 Jun  2 07:31 account.master_000004
 -rw-rw-r--    1 mvstest  users        8720 Jun  2 07:32 account.master_000005
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000001
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000002
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000003
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000004
 -rw-rw-r--    1 mvstest  users        1600 May 31 17:33 account.trans_000005

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

5E9. MVS JCL conversion - GDG files

prior GDG select/increment - Run#3


 #1. jgl220.ksh            <-- execute JCL/script to demo GDG files
     ==========

 #1a. joblog1 jgl220.ksh   <-- alternative to capture console log file
      ==================

jgl220.log after 3rd run

 080827:094816:JGL220: Begin Job=JGL220
 080827:094816:JGL220: /home/mvstest/testlibs/jcls/jgl220.ksh
 080827:094816:JGL220: Arguments:
 080827:094816:JGL220: RUNLIBS=/home/mvstest/testlibs
 080827:094816:JGL220: RUNDATA=/home/mvstest/testdata
 080827:094816:JGL220: JTMP=jobtmp/JGL220 SYOT=sysout/JGL220
 080827:094816:JGL220: RUNDATE=20080827
 080827:094816:JGL220: Begin Step S0010 cgl200 (#1)
 080827:094816:JGL220: gen0: GLMSOLD=gl/account.master_000002 insize=8720
 gen0: GLTRANS=gl/account.trans_000003  <-- confirm y or alt# ?
 gen0: GLTRANS: generations=000001:000005  <-- enter y(000003) or alt# ?
 080827:094819:JGL220: gen0: GLTRANS=gl/account.trans_000003 insize=1600
 080827:094819:JGL220: gen+1: GLMSNEW=jobtmp/JGL220/GDG/gl/account.master_000006 gens=12
 080827:094819:JGL220: Job Times: Begun=09:48:16 End=09:48:19 Elapsed=00:00:03
 080827:094819:JGL220: moving jobtmp/JGL220/GDG/subdir/files back to $RUNDATA/subdirs/
 `jobtmp/JGL220/GDG/gl/account.master_000006' -> `gl/account.master_000006'
 080827:094819:JGL220: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

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

5E10. MVS JCL conversion - GDG files

prior GDG select/increment - Run#4


 #1. jgl220.ksh            <-- execute JCL/script to demo GDG files
     ==========

 #1a. joblog1 jgl220.ksh   <-- alternative to capture console log file
      ==================

jgl220.log after 4th run

 080827:094823:JGL220: Begin Job=JGL220
 080827:094823:JGL220: /home/mvstest/testlibs/jcls/jgl220.ksh
 080827:094823:JGL220: Arguments:
 080827:094823:JGL220: RUNLIBS=/home/mvstest/testlibs
 080827:094823:JGL220: RUNDATA=/home/mvstest/testdata
 080827:094823:JGL220: JTMP=jobtmp/JGL220 SYOT=sysout/JGL220
 080827:094823:JGL220: RUNDATE=20080827
 080827:094823:JGL220: Begin Step S0010 cgl200 (#1)
 080827:094823:JGL220: gen0: GLMSOLD=gl/account.master_000002 insize=8720
 gen0: GLTRANS=gl/account.trans_000005  <-- confirm y or alt# ?
 gen0: GLTRANS: generations=000001:000005  <-- enter y(000005) or alt# ?
 080827:094825:JGL220: gen0: GLTRANS=gl/account.trans_000005 insize=1600
 080827:094825:JGL220: gen+1: GLMSNEW=jobtmp/JGL220/GDG/gl/account.master_000007 gens=12
 080827:094825:JGL220: Job Times: Begun=09:48:23 End=09:48:25 Elapsed=00:00:02
 080827:094825:JGL220: moving jobtmp/JGL220/GDG/subdir/files back to $RUNDATA/subdirs/
 `jobtmp/JGL220/GDG/gl/account.master_000007' -> `gl/account.master_000007'
 080827:094825:JGL220: JobEnd=Normal, StepsExecuted=1, LastStep=S0010

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

5E11. MVS JCL conversion - GDG files

gdgctl file after 4 runs of jgl220.ksh


 uvhd ctl/gdgctl51I.dat r2048   <-- display control file with uvhd
 ============================
                      10        20        30        40        50        60
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
        2048 gl/account.master_                                 gdg=12
          64 next=000002(000002:000002)991231:235959 JGL220
         128 080827:094825:G1_000007(000001:000006)JGL220   S0010 cgl200
         192 080827:094823:G0_000002(000001:000006)JGL220   S0010 cgl200
         256 080827:094819:G1_000006(000001:000005)JGL220   S0010 cgl200
         320 080827:094816:G0_000002(000001:000005)JGL220   S0010 cgl200
         384 080827:094741:G1_000005(000001:000004)JGL220   S0010 cgl200
         448 080827:094734:G0_000002(000001:000004)JGL220   S0010 cgl200
         512 080827:093558:G1_000004(000001:000003)JGL220   S0010 cgl200
         576 080827:093441:G0_000002(000001:000003)JGL220   S0010 cgl200
         640 000000:000000:G0_000000(000000:000000)_______  _____ _________
         704 000000:000000:G0_000000(000000:000000)_______  _____ _________
               - - - 18 lines omitted to save space - - -
        1920 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1984 000000:000000:G0_000000(000000:000000)_______  _____ _________ .
                      10        20        30        40        50        60
 r#        3 0123456789012345678901234567890123456789012345678901234567890123
        4096 gl/account.trans_                                  gdg=18 opt=c
          64 next=000000(000001:000003)000000:000000 JGL220
         128 080827:094823:G0_000005(000001:000005)JGL220   S0010 cgl200
         192 080827:094816:G0_000003(000001:000005)JGL220   S0010 cgl200
         256 080827:094734:G0_000002(000001:000005)JGL220   S0010 cgl200
         320 080827:093441:G0_000001(000001:000005)JGL220   S0010 cgl200
         384 000000:000000:G0_000000(000000:000000)_______  _____ _________
         448 000000:000000:G0_000000(000000:000000)_______  _____ _________
         512 000000:000000:G0_000000(000000:000000)_______  _____ _________
         576 000000:000000:G0_000000(000000:000000)_______  _____ _________
         640 000000:000000:G0_000000(000000:000000)_______  _____ _________
         704 000000:000000:G0_000000(000000:000000)_______  _____ _________
               - - - 18 lines omitted to save space - - -
        1920 000000:000000:G0_000000(000000:000000)_______  _____ _________
        1984 000000:000000:G0_000000(000000:000000)_______  _____ _________ .

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

5E12. MVS JCL conversion - GDG files

Notes re gl/account.master_

  1. Note the history of the 4 runs of jgl220.ksh. The latest is inserted at the top, pushing the previous history entries down.

  2. gl/account.master_ has been processed by 1 exportgen0 & 1 exportgen1 on each of 4 runs.

  3. exportgen0 always selected gen# 000002 because of the 'next=000002...' override.

  4. exportgen1 created new generations from 000004 (at the bottom) to 000007 (at the top).

    Notes re gl/account.trans_

  5. gl/account.trans_ has been processed only by 1 exportgen0 on each of 4 runs.

  6. The 1st 3 runs selected generations 000001, 000002, 000003 due to the 'next=......(000001:000003)...' override.

  7. Run#4 reverted to 000005, since upper limit of (000001:000003) exceeded.

  8. Note that the next control card was reset to 'next=000000(000001:000003)' 'next=000000' means future runs will select highest generation found. '(000001:000003)' is retained but inactive incase you want to reactivate by resetting 'next=000000' to 'next=000001' or higher.

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

5F0. MVS JCL conversion - Generation files

GDG system - Caveats

Here are some situations that may occur at some sites, and that require manual editing to enable the Vancouver Utility GDG system to function as intended.


5F1. $SYMBOLS in data file names in the JCL/scripts
- you must replace with actual values in ctl/gdgctl51
- easy to do using vi mass change commands (see examples given)

5F2. You must modify jclunixop51 to code your datafile topnodes/subdirs
 (vs supplied coding for the mvstest demo subdirs)
- may generate automatically from topnode list & templates (see '6A1')
      You must also code your valid topnodes in the '$RUNLIBS/ctl/GDGmkdirs'
      script used to hold new GDGs until Normal EOJ (moved to $RUNDATA/subdir).

5F3. You must modify any JCL/scripts that have DDNAME assignments
- if the logical filename on the exportgen0/1 function is assigned
  to an alternate logical filename via an exportfile (vs exportgen)
- an unusual situation that occurred at a VSE site

5F4. Should be no changes required to jobs that write new GDGs & readback.
But changes were required for a site using the option to convert all
tape files to GDG files because it depended on an I/O indicator to
generate exportgen0/exportgen1 (vs original mainframe coding 0/+1)

5F5. problems converting tape files to GDG files at a VSE site.

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

5F1. special procedures for VU GDG system required at some sites

replace $SYMBOLS in gdgctl file

Any $SYMBOLS in the GDG control file ($RUNLIBS/ctl/gdgctl51) need to be replaced by the actual values.

$SYMBOLS in the filenames given to exportgen0/exportgen1 are replaced by the Korn shell, but any $SYMBOLS in filenames extracted by jcldata56 & loaded into the gdgctl file would remain as is.

We need to replace them with actual values so exportgen0/exportgen1 can match to the control file.

sample filenames extracted from JCL/scripts

 $MSTR/e2121653.mtaxe.piscines_           gdg=15
 $MSTR/e2121656.itaxe.facturat_           gdg=15
 $TAPE/ev.f01.28401a19.annexe_            gdg=15
 $TAPE/ev.f01.e211211.diftax_             gdg=15
 $TAPE2/tu.f01.e211801.adrpos_            gdg=15
 $TAPE2/tu.f01.e212-no.eauctr_            gdg=15

after replacing $SYMBOLS with values

 mstr/e2121653.mtaxe.piscines_           gdg=15
 mstr/e2121656.itaxe.facturat_           gdg=15
 tape/ev.f01.28401a19.annexe_            gdg=15
 tape/ev.f01.e211211.diftax_             gdg=15
 tape2/tu.f01.e211801.adrpos_            gdg=15
 tape2/tu.f01.e212-no.eauctr_            gdg=15

Note that the replacements are very easy to do using vi mass change commands. This editing would be in addition to the procedures shown earlier on page '5C1', so we will extend those operating instruction numbers.


 #5. vi ctl/gdgctl51    <-- edit the GDG control file
     ===============
 #5a. --> :%s/$MSTR/mstr/
 #5b. --> :%s/$TAPE2/tape2/    <-- vital to replace $TAPE2 before $TAPE
 #5b. --> :%s/$TAPE/tape/

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

5F2. special procedures for VU GDG system required at some sites

customizing for your TOP-NODEs

  1. Before you convert your JCL to Korn shell scripts, you must code your most valid top-nodes in the :TOPNODES: (allowed) table & all other (low volume) will be combined into a 'misc' directory.

  2. You must also code your valid topnodes in the '$RUNLIBS/ctl/GDGmkdirs' script.

See the operating procedures for these on pages '4E1' thru '4E5'. These points mentioned here since this is the 'caveats' (watch out for) section of Part 5.

GDGmkdirs - make subdirs for GDG files

 # GDGmkdirs - make subdirs for new versions of GDG files
 #             saved in jobtmp/subdirs/... until Normal EOJ
 #           - by Owen Townsend, UV Software, Aug 25/2008
 #
 #Apr16/2009 - this script moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/
 #           - to allow multiple $RUNDATA's to have different GDG controls
 #
 # script in $RUNDATA/ctl/... called by jobset51 (called by all JCL/scripts)
 # exportgen1 creates new GDG files in $RUNDATA/$JGDG/subdirs/...
 # - where: JGDG=$RUNDATA/jobtmp/$JOBID2/GDG/
 # - at normal EOJ, GDG files are moved to intended subdirs (NOT if Abterm)
 #
 # user must code names of his site's data file subdirs here
 # - matching the TOPNODEs table in $RUNLIBS/ctl/jclunixop51
 # - following subdirs are for the demo JCL/scripts
 #   (at www.uvsoftware.ca/mvsjcl.htm#Part_1)
 #
 #Mar14/09 - JCL converter option g1 inserts $JGDG/... on new GDGs exportgen1
 # - new option 'g0' omits $GDG/ so new GDGs in same subdir as old
 # - this GDGmkdirs script must still exist (since called by jobset51)
 #   BUT, subdirs created will not be used, since no files redirected to $JGDG/
 #
 if [[ ! -d $JTMP ]]; then
    echo "JTMP not defined or not in \$RUNDATA"; exit 81; fi
 #
 # make $JGDG/ for gdg subdirs
 # also make $GTMP/ for exportgen0/1 'ls' outputs to determine latest gen#s
 if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi
 if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi
 #
 # You MUST modify following (ar,gl,etc) to the subdirs desired at your site
 #==========================================================================
 if [[ ! -d $JGDG/ar ]]; then mkdir $JGDG/ar; fi
 if [[ ! -d $JGDG/gl ]]; then mkdir $JGDG/gl; fi
 if [[ ! -d $JGDG/py ]]; then mkdir $JGDG/py; fi
 if [[ ! -d $JGDG/tape ]]; then mkdir $JGDG/tape; fi
 if [[ ! -d $JGDG/misc ]]; then mkdir $JGDG/misc; fi
 exit 0

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

5F3. special procedures for VU GDG system required at some sites

correction for files reassigned

Here is a situation I noticed in a VSE conversion that currently requires manual correction.

VSE sites often defined most files up front & sometimes used SORT OPTION FILNM &/or TDYNASN to reassign the logical name to an alternate used for the SORT or a COBOL program.

This is a problem because the JCL converter assumes that the file is a non-GDG & uses 'exportfile' for the reassignment. This would cause 'file not found' because exportfile would assign the file as is (with trailing underscore). We need 'exportgen0/1' to select the latest or next GDG file with 6 digit sequence#.

To illustrate the problem I have extracted a few lines from a typical VSE JCL.

 #!/bin/ksh
 ##JOB 33001D10
          ---------- lines omitted -----------
   .... VSE sites often defined most files up front ....
 exportfile E212001 mstr/e2123001.itaxe.banqtaxe
 exportfile E212002 mstr/e2123002.itaxe.taxation
 exportgen0 E212990 tape/tu.f01.e212-no.soldes_
 exportgen1 E212991 $JTMP/tape/tu.f01.e212-no.soldav_
       ---------- lines omitted -----------
            ....... SORT step .......
 #  cat > $SYS011 <</*EOD
 #  SORT FIELDS=(18,6,A),FORMAT=BI,WORK=4
 #  OPTION FILNM=(E212084,E212990),SORTOUT=020,SORTIN=(014)
 # /*EOD
 exportfile SORTOUT $E212084
 exportfile SORTIN1 $E212990
 ## EXEC SORT
 #3----------------------------------------------------------------------
 uxsort "fili1=$SORTIN1,typ=RSF,rcs=354,filo1=$SORTOUT,keys=(17,6,b,a)"
 #4----------------------------------------------------------------------
Note
  • JCL converter assumes that SORTIN1 is a non-GDG file (uses exportfile)
  • you must change '$SORTIN1' to '$E212990' as shown on the uxsort below:
  • since $E212990 is the 'exportgen0' definition
  • whereas the $SORTIN1 'exportfile' definition would be undefined

 #3----------------------------------------------------------------------
 uxsort "fili1=$E212990,typ=RSF,rcs=354,filo1=$SORTOUT,keys=(17,6,b,a)"
 #4----------------------------------------------------------------------

TDYNASN is a similar situation

 ## EXEC TDYNASN
      ... TDYNASN step reassigned logical filename
 # ASSGN E212990,SYS014,INPUT
 exportfile SYS014 $E212990

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

5F4. special procedures for VU GDG system required at some sites

Write new generation & Readback in same job

There should be no manual changes required to jobs that write new generations of GDG files & read back on a later step within the same job, because the new GDG is written into $JTMP (jobtmp/subdir). 'exportgen1' determines the next generation by examining the files in the original $RUNDATA/subdir & does not get confused by the new generation in the $JTMP/subdir.

The mainframe JCL would use the (+1) suffix on the new generation creation DSN, and also on the DSN that reads the file back, because the programmer knew that the GDG generation# was not updated until successful EOJ.

This situation is illustrated by demo JCL jcl0/JGL210.jcl, and here are the relevant lines extracted from the mainframe JCL & from the converted script (jcl3/jgl210.ksh):

JCL to demo Write GDG & Readback in 1 job

 //* Demo GDG processing, write gltrans(+1) & read back as (+1)
 //STEP010  EXEC PGM=SORT
 //SORTIN   DD DSN=GL.ACCOUNT.TRAN1,DISP=OLD
 //SORTOUT  DD DSN=GL.ACCOUNT.TRANS(+1),DISP=(,CATLG,DELETE),...
 //SYSIN    DD *
 SORT FIELDS=(1,8,CH,A,69,12,CH,A)
 /*
 //STEP020  EXEC PGM=CGL200,PARM=&YEAREND
 //GLTRANS  DD DSN=GL.ACCOUNT.TRANS(+1),DISP=OLD
 //GLMSOLD  DD DSN=GL.ACCOUNT.MASTER(0),DISP=OLD
 //GLMSNEW  DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE),...

corresponding lines from converted script

 exportfile SORTIN gl/account.tran1
 exportgen1 SORTOUT $JTMP/gl/account.trans_                       #<--Note1
 #exportgen1 assign $JTMP/subdir/file, move to subdir/file at Normal EOJ
 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\
 ,keys=(0,8,c,a,68,12,c,a)"
 #4----------------------------------------------------------------------
 exportgen1 GLTRANS $JTMP/gl/account.trans_                       #<--Note2
 #exportgen1 assign $JTMP/subdir/file, move to subdir/file at Normal EOJ
 # 2+ exportgen1's for this file in this JCL/script
 exportgen0 GLMSOLD gl/account.master_
 exportgen1 GLMSNEW $JTMP/gl/account.master_
 #exportgen1 assign $JTMP/subdir/file, move to subdir/file at Normal EOJ
 #3----------------------------------------------------------------------
 cobrun $ANIM $RLX/cgl200
 #4----------------------------------------------------------------------

The 'Note1' line above writes a new generation for the sorted file. The 'Note2' line above reads the new GDG back into the COBOL program. They were both codes with the '(+1)' suffix on the DSN's, and are now both coded on the 'exportgen1' function in the Korn shell script.

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

5F5. special procedures for VU GDG system required at some sites

problem converting tape files to GDG's

We noticed a problem when converting VSE JCL's with tape files to GDG's.

The VSE JCL carried a comment indication INPUT or OUTPUT, and we added an option to the JCL converter to use the I/O indicator to generate 'exportgen1' for OUTPUT & 'exportgen0' for INPUT. We also coded the tape files in a 'tape/...' subdir.

Using the example on the previous page the write & read back file definitions might be:

exportgen1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)

 exportgen0 GLTRANS tape/account.trans_       #Note2 (readback on following step)

correction method #1 (OK)

exportgen1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)

exportgen1 GLTRANS $JTMP/tape/account.trans_ #Note2 (readback on following step)

Correction method #1 is similar to the example on the previous page, resulting for the fact that the mainframe programmer would have coded both files with suffix '(+1)'.

correction method #2 (NOK)

exportgen1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)

exportgen0 GLTRANS $JTMP/tape/account.trans_ #Note2 (readback on following step)

Correction method #2 is to leave the function as 'exportgen0' & simply add the '$JTMP/' prefix onto the file.

Note that the '$JTMP/' directory is honoured by exportgen0, but is ignored by exportgen1 when determining the latest generation within a directory. Function 'exportgen1' will 1st remove any '$JTMP/' prefix before it determines the latest generation, but 'exportgen0' will not.

Note
  • Do NOT use correction method#2. It will work, but will generate ERRORS
  • when the system tries to update the GDG history in the control file

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

5J0. MVS JCL conversion - Generation files

Listings of GDG functions


5J1. exportgen0 - determine current generation of a GDG file

5J2. exportgen1 - determine next generation of a GDG file

5J3. exportgenall - concatenate all generations of a GDG file

5J4. exportgenx - error message if gen# < (-3) or > (+3)

5J5. exportfile - function for non-GDG files (exports & displays filename)

5K1. jobset51 - job setup function called at line 10 of all JCL/scripts
- enhanced in May 2007 to support new features in GDG system
- you must add code for YOUR datafile subdirs
- vs subdirs used in supplied test/demos

5K2. jobset52 - full-PATH version of jobset51 (relative-PATH, recommended)
- differences shown via 'diff' command

5K3. jobend51 - job ending function called at normal EOJ of all JCL/scripts
- added in May 2007 to support new features in GDG system
- you must add code for YOUR datafile subdirs
(vs subdirs used in supplied test/demos)

5K4. jobabend51 - jobend function called at Abnormal Termination
- you must add code for YOUR datafile subdirs
(vs subdirs used in supplied test/demos)

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

5J1. MVS JCL conversion - GDG functions

exportgen0 determine current generation

 # exportgen0  - function to export the latest existing generation of a filename
 #             - replaces mainframe MVS JCL GDG functions
 #             - used by Vancouver Utilities JCL to Korn shell converter
 #             - these functions distributed in /home/uvadm/sfun/...
 #
 #                  ** summary of GDG functions supplied **
 #
 # exportgen0     - determine current generation (highest generation#)
 #                  or prior generations (-1),(-2),(-3)
 # exportgen1     - determine next generations (+1),(+2),(+3) not yet existing
 # exportgenx     - displays errmsg (if gen not 0,+1+2,+3,-1,-2,-3)
 # exportgenall   - concatenates all existing generations
 # exportfile     - non-GDG filenames, same as 'export', but displays filename
 #
 #                    ** uvcopy jobs used for GDG functions **
 #
 # jcldata56 - creates gdgctl51 by extracting all exportgens from all scripts
 # gdgload1  - loads edited text file ctl/gdgctl51 to indexed file gdgctl51I
 # gdgget51  - gets records from indexed file by key, called by exportgen1c
 # gdgget52  - gets records from indexed file by key, called by exportgen0c
 # gdgupok1  - updates gdgctl file next=... reset =000000 or increment range
 # gdgupab1  - updates gdgctl file history, files NOT moved to RUNDATA/subdirs
 #
 #                      ** Change History **
 #
 #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles
 #Oct18/08 - gdgget52 changed to return just gen# vs filename_gen#
 #         - exportgen0 changed to concat filename_ + gen#
 #         - remove $RUNDATA/ if present due to option e1 in jclunixop51
 #Aug28/08 - name changes getgdg51->gdgget51,getgdg52->gdgget52,
 #           gdgctlload1->gdgload1,gdgctlunload1->gdgunload1
 #           gdgctlupok1->gdgupok1,gdgctlupab1->gdgupab1
 #Aug25/08 - $JTMP changed to $GTMP for 'ls' output matching filegens
 #           GTMP=jobtmp/$JOBID2/gtmp <-- defined in jobset51
 #Aug25/08 - $JTMP changed to $JGDG in exportgen1 new GDG (N/A in exportgen0)
 #Jun16/07 - allow 'opt=c' (confirm) in control file to prompt 'y' or alt gen#
 #May28/07 - new exportgen0c to access prior versions specified by indexed file
 #May28/07 - enhance exportgen1c to get next gen# from indexed control file
 #May25/07 - new exportgen1c to avoid GDG incrementing if job abends
 #Dec02/05 - generation# increased to 6 digits
 #
 #                    ** Alternate Versions of exportgen0 **
 #
 #*exportgen0  - the *active version* called by the JCL/scripts
 #             - copy desired version from 1 of below, renaming as 'exportgen0'
 # exportgen0a - original version, required ksh 1993 to load array of filenames
 #             - more efficient, does not need to write a file & read back
 # exportgen0b - works with all versions of Korn shell (88 or 93)
 #             - uses ls to write file & reads back to determine latest version
 #*exportgen0c - *recommended version* as of July 2008 (not expected to change)
 #             - may specify next gen# or a range of gen#s by indexed file
 #             - may specify an expiry date or auto reset at end of range
 #             - uses uvcopy gdgget52 to read indexed file ctl/gdgctl51I
 #               & determine gen# allowing for prior gen# overrides
 #
 # This is the 'c' (current version July2008) of exportgen0a,b,c
 # - all versions archived to /home/uvadm/archive/sfun/...
 # - if required, could copy other versions from archive to $RUNLIBS/sfun
 # - must rename as 'exportgen0' since that is called by the JCL/scripts
 #
 #                   ** sample usage illustrated **
 #
 #   gl/account.master_000001
 #   gl/account.master_000002  <-- assume $RUNDATA contains these files:
 #   gl/account.master_000003
 #
 #command: exportgen0 CUSTMAS gl/account.master_
 #         =====================================
 #
 #result:  export CUSTMAS=gl/account.master_000003  <-- gen0=highest onfile
 #         =======================================
 #
 #                      ** sample control file **
 #
 # gl/account.master_   gdg=10
 # gl/account.trans_    gdg=20  next=000003(000003:000003)_070531:235959
 # py/payroll.master_   gdg=30  opt=c
 # py/time.cards_       gdg=52  next=000001(000001:000012)_000000:000000
 #
 #                       ** Vital Requirements **
 #
 # 1. export FPATH=$RUNLIBS/sfun   #<-- must define FPATH in common_profile
 #    ==========================      - directory holding these ksh functions
 #
 #                 ** coding for function exportgen0 **
 #
 function exportgen0  # function name here must match physical filename
 {
 if [[ -n "$1" && -n "$2" ]]; then :
 else logmsg2 "ERR: exportgen0 requires 2 args: LFD=$1, lbla=$2."
      exit 9; fi
 lfd=$1; lbla=$2       # capture args into named variables
 #
 #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles
 #         - extract subdir/filename from $RUNDATA/subdir/filename
 lbl1=${lbla##*/}      # drop large left to get filename
 lbl2=${lbla%/*}       # drop small right to get $RUNDATA/subdir
 lbl3=${lbl2##*/}      # drop large left to get subdir
 lbl4=$lbl3/$lbl1      # create subdir/filename (to match coding in gdgctl51I)
 lbld=$(echo $lbl4 | tr "/" "_")  # convert any '/' to '_' in DSNname
 #                                # for filename to hold ls of gdg filenames
 #
 # verify that filename (arg2 on call) ends with '_'
 if [[ ! "$lbla" == *_ ]]; then
    logmsg2 "ERR: exportgen0 filenames should end with '_', continue?, need fix?"
    read reply; fi
 #
 # verify $GTMP subdir present, created by jobset51
 if [[ ! -d $GTMP ]]; then
    logmsg2 "ERR: exportgen0 \$GTMP subdir not found GTMP=$GTMP"; exit 9; fi
 #
 # $GTMP subdir to hold output of 'ls' with all files matching filename_*
 # export GTMP=jobtmp/$JOBID2/gtmp <-- defined in jobset51
 # used for ls output file create/readback to determine latest generation:
 #   lslbls=$GTMP/${JSTEP}I_$lbld
 #   lslbls=$RUNDATA/jobtmp/$JOBID2/gtmp/${JSTEP}I_$lbld
 # could use GTMP=jobtmp/${JOBID2}_$(date +%y%m%d%H%M%S)/gtmp
 #   in alternative code version for time stamped jobtmp subdirs
 #
 # capture current step# (part of ls output filename)
 typeset -RZ4 step="$JSTEP"                # capture step# from calling job
 if [[ -z "$step" ]]; then step=0000; fi   # set 0000 if undefined
 #
 # capture all matching GDG filenames into a file for readback to get highest#
 # - 1st create filename for 'ls' write lslbls=jobtmp/$JOBID2/${JSTEP}I_$lbld
 # - with all filenames matching up to the trailing '_'
 lslbls=$GTMP/${step}I_$lbld       # assign filename for ls write
 ls $lbla[0-9][0-9][0-9][0-9][0-9][0-9] >$lslbls 2>/tmp/junk
 #
 # if no existing files, define ..._000001 filename, warning msg,& early return
 if [[ ! -s $lslbls ]]; then       # if NO existing files ?
    lblgena=${lbla}000001          # create filename for 1st generation
    export $lfd=$lblgena           # export LFD=lbl of next generation
    logmsg2 "ERR: gen0: No existing file, gen_000001 exported, $lfd=$lblgena "
    logmsg2 "ERR: gen0: problem input by exportgen0 ?, may continue, need fix?"
    read reply;                    # June05/03 OT warning added
    return 0; fi                   # return 0 if no files existing
 #
 # call uvcopy job gdgget52 to select control file entry for matching filename
 # - from indexed file ctl/gdgctl51I using filename as key
 # - uvcopy job will write selected entry to a file for reading by this script
 lblxG=$GTMP/${step}G0_$lbld        # create filename to be written by uvcopy
 #
 uvcopy gdgget52,fili1=$lslbls,filo2=$lblxG,arg1=$lfd,arg2=$lbl4,arg3=G0,rop=i63
 #===============================================================*****G0=current
 # arg1  = DDN (ex: GLMSTR)
 # arg2  = DSN filename key for lookup gdgctl file (ex: gl/account.master_)
 # arg3  = $gn -2,-1,0,+1,+2, etc to identify calling function exportgen0/1
 #         (getgdg52 decrements gen# by 0,-1,-2,-3 depending on $gn)
 # fili1 = $lslbls ls of all matching filenames_* to underscore (+ 6 digits)
 # filo2 = $lblxG output file for gdgctl entry (possible override, prior gen#)
 #         output file has 1 line with 4 fields as follows:
 # ===============================
 # gen#   gdg=... next=... opt=...
 # 000004 gdg=15
 # 000006 gdg=24  next=000006(000001:000012)070529:235959 opt=c
 # ============================================================
 # field1 = gen# determined by gdgget52 (Oct18/08 changed from filename_gen#)
 #          only field1 (genx) used below, others for debug audit trail
 # field2 = gdg=... no of generations maintained for this file
 # field3 = next=... in gdgctl file (not/used except for debug/audit)
 # field4 = opt=c from gdgctl file, causes prompt for confirm/change
 #Oct18/08 - gdgget52 changed to return just gen# vs filename_gen#
 #         - exportgen0 changed to concat filename_ + gen#
 #
 # read the file written by uvcopy, 1 line with 4 fields (as above)
 exec 3< $lblxG                # open the file
 read -u3 genx gens next opts  # read 1st 4 fields (4th field options)
 exec 3<&-                     # close file
 lblgenx=$lbla$genx            # concat filename_ + gen#
 #
 export $lfd=$lblgenx          # export LFD=LBL for selected filename
 #===================
 #
 # get filesize & display results for console log
 fsize="";
 if [[ $lblgenx == /* ]]; then lblx=$lblgenx; else lblx=$RUNDATA/$lblgenx; fi
 if [[ -f $lblx ]]; then fsize=$(stat -c%s $lblx); fi
 #
 logmsg1 "gen0: $lfd=$lblgenx insize=$fsize"
 #==========================================
 # return no of generations existing
 gdgsbf=$(wc -l $lslbls); gdgsb=${gdgsbf% *}; gdgs=${gdgsb##* };
 return $gdgs        # return no of generations existing
 }

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

5J2. MVS JCL conversion - GDG functions

exportgen1 determine next generation

 # exportgen1  - function to export NEXT generation of a file (not yet existing)
 #             - this version gets gdg=... values from indexed file
 #             - replaces mainframe MVS JCL GDG functions
 #             - used by Vancouver Utilities JCL to Korn shell converter
 #             - these functions distributed in /home/uvadm/sfun/...
 #
 #                ** summary of GDG functions supplied **
 #
 # exportgen0     - determine current generation (highest generation#)
 #                  or prior generations (-1),(-2),(-3)
 # exportgen1     - determine next generation (+1) not yet existing
 # exportgenx     - displays errmsg (if gen not 0,+1+2,+3,-1,-2,-3)
 # exportgenall   - concatenates all existing generations
 # exportfile     - non-GDG filenames, same as 'export', but displays filename
 #
 #                    ** uvcopy jobs used for GDG functions **
 #
 # jcldata56 - creates gdgctl51 by extracting all exportgens from all scripts
 # gdgload1  - loads edited text file ctl/gdgctl51 to indexed file gdgctl51I
 # gdgget51  - gets records from indexed file by key, called by exportgen1c
 # gdgget52  - gets records from indexed file by key, called by exportgen0c
 # gdgupok1  - updates gdgctl file next=... reset =000000 or increment range
 # gdgupab1  - updates gdgctl file history, files NOT moved to RUNDATA/subdirs
 #
 #                          ** Change History **
 #
 #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles
 #Oct18/08 - allow $RUNDATA/$JGDG/... for option e1 unikixvsam (Essentis)
 #Aug28/08 - name changes getgdg51->gdgget51,getgdg52->gdgget52,
 #           gdgctlload1->gdgload1,gdgctlunload1->gdgunload1
 #           gdgctlupok1->gdgupok1,gdgctlupab1->gdgupab1
 #Aug25/08 - $JTMP changed to $JGDG for new GDGs (JGDG=jobtmp/$JOBID2/GDG/)
 #         - $JTMP changed to $GTMP for 'ls' output matching filegens
 #           GTMP=jobtmp/$JOBID2/gtmp <-- defined in jobset51
 #May25/07 - 'exportgen1c' enhanced to get gdg=... value from Indexed file
 #May23/07 - new version 'exportgen1c' added to preserve gen# on Abterm
 #May07/06 - $DJ changed to $JTMP
 #Dec02/05 - generation# increased to 6 digits
 #
 #                 ** Alternate Versions of this Function **
 #
 #*exportgen1  - the *active version, called by the JCL/scripts
 #             - copy desired version from 1 of below, renaming as 'exportgen1'
 #             - when updating active version, also copy/rename to backup version
 #
 # exportgen1a - original version, required ksh 1993 to load array of filenames
 #             - more efficient, does not need to write a file & read back
 #             - will be obsoleted by exportgen1c that avoids gen# inc on abend
 #
 # exportgen1b - works with all versions of Korn shell (88 or 93)
 #             - uses ls to capture filenames & readback to determine latest
 #             - will be obsoleted by exportgen1c that avoids gen# inc on abend
 #
 #*exportgen1c - recommended version as of July 2008 (not expected to change)
 #             - this version avoids GDG incrementing if job abends
 #             - does not write new GDG files directly to $RUNDATA/subdirs
 #             - JCL converter changed to write exportgen1 files to $JTMP
 #               for move back to $RUNDATA/subdirs by jobend51 at Normal EOJ
 #             - must modify jobset51 & jobend51 to create required subdirs
 #
 # - exportgen1c version to get gdg=... values from indexed file
 # - gdg priority: 1st = arg3 on exportgen1, 2nd = Indexed file
 #   3rd = default hard coded in this function (15 as of May 25/07)
 # - text file ctl/gdgctl51 created by uvcopy job 'jcldata56', edited to specify
 #   gen#s by file & loaded to ctl/gdgctl51I indexed file by 'gdgload1'
 # - this function reads the indexed file using uvcopy job 'gdgget51', which
 #   returns the no of generations for the sepecified filename
 #
 # This is the 'c' (current version July2008) of exportgen1a,b,c
 # - all versions archived to /home/uvadm/archive/sfun/...
 # - if required, could copy other versions from archive to $RUNLIBS/sfun
 # - must rename as 'exportgen1' since that is called by the JCL/scripts
 #
 #                       ** Vital Requirements **
 #
 # 1. Directory holding these functions must be defined by FPATH (for Korn shell)
 #    export FPATH=$RUNLIBS/sfun       #<-- in common_profile
 #    ==========================
 #
 #                    ** command format & sample usage **
 #
 #format: exportgen1 DDname DSname [generations] [touch option]
 #        =====================================================
 #        - arg#3 is generations to maintain (see default below if absent)
 #        - arg#4 is option to touch (create new empty file)
 #
 #example: exportgen1 CUSTMAS $JGDG/gl/account.master_ [gdg=15] [touch]
 #         ============================================================
 #
 #   ap/account.master_000001
 #   ap/account.master_000002   <-- assume $RUNDATA contains these files
 #   ap/account.master_000003
 #
 #result:  export CUSTMAS=$JGDG/gl/account.master_000004
 #         =============================================
 #         [ touch $JGDG/gl/account.master_000004 ]
 #           ======================================
 #
 #                  ** coding for: function exportgen1 **
 #
 function exportgen1  # function name here must match physical filename
 {
 typeset -RZ6 gen0;             # define cur gen# 6 digits Right just, zero fill
 typeset -RZ6 gen1;             # define next gen# 6 digits Right just, zero fill
 typeset integer gensdflt=15;   # generations default 15
 typeset integer gens=$gensdflt # init gens to gensdflt
 integer filecnt=0; integer excess=0; integer lblcnt=0;  # clear counters
 #
 lfd=$1; lbla=$2;               # capture args into named variables
 #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles
 #         - extract subdir/filename from $RUNDATA/subdir/filename
 lbl1=${lbla##*/}      # drop large left to get filename
 lbl2=${lbla%/*}       # drop small right to get $RUNDATA/subdir
 lbl3=${lbl2##*/}      # drop large left to get subdir
 lbl4=$lbl3/$lbl1      # create subdir/filename (to match coding in gdgctl51I)
 lbld=$(echo $lbl4 | tr "/" "_")  # convert any '/' to '_' in DSNmame
 #                                # for filename to hold ls of gdg filenames
 #
 if [[ -n "$lfd" && -n "$lbla" ]]; then :
 else logmsg2 "ERR: exportgen1 requires 2 args: LFD=$1, lbl=$2"; exit 91; fi
 #
 # retrieve gdg=.., if specified on arg3 of command line
 if [[ "$3" == gdg=* ]]; then gens=${gdg#gdg=}; fi
 #
 # verify that filename (arg2 on call) ends with '_'
 if [[ ! "$lbla" == *_ ]]; then
    logmsg2 "ERR: gen filenames must end with '_', may continue, but need to fix"
    read reply; fi
 #
 # avoid problem when no matching files present
 # - by creating gen# filename_000000 as nullfile & removing later below
 if [[ ! -e ${lbla}000000 ]]; then touch ${lbla}000000; fi
 #
 # 1st create tmp filename for 'ls' output lslbls=jobtmp/$JOBID2/${JSTEP}O_$lbld
 # - use $GTMP for subdir, defined in function jobset51
 #   lslbls=$GTMP/${JSTEP}I_$lbld --> $RUNDATA/jobtmp/$JOBID2/${JSTEP}I_$lbld
 # - OR $RUNDATA/jobtmp/${JOBID2}_$(date +%y%m%d%H%M%S)/${JSTEP}I_$lbld
 #      if alternative code activated for time stamped jobtmp subdirs
 if [[ ! -d $GTMP ]]; then
    logmsg2 "ERR: exportgen1 ERR GTMP subdir not found GTMP=$GTMP"; exit 9; fi
 #
 typeset -RZ4 step="$JSTEP"                # capture step# from calling job
 if [[ -z "$step" ]]; then step=0000; fi   # set 0000 if undefined
 lslbls=$GTMP/${step}O_$lbld       # assign filename for ls write
 # use 'ls' to create tmp file of matching filenames
 ls $lbl4[0-9][0-9][0-9][0-9][0-9][0-9] >$lslbls 2>/tmp/junk
 #
 # read back file of filenames created by 'ls' above & use last name
 exec 3< $lslbls                 # open file of 'ls' names
 while read -u3 lblgenr          # read lines of ls filenames
       do  lblgenh=$lblgenr      # save highest generation filename
           ((filecnt+=1))        # count files for excess delete
       done                      #
 exec 3<&-                       # close file
 #
 gen0=${lblgenh##*_}             # drop filename, capture gen# of last filename
 gen1=$gen0
 ((gen1+=1))           # calc next generation
 # let gen1=$gen0+1    # Sep28/09 changed to above (this got 000000)
 #
 #Sep28/09 - display for DEBUG
 # echo "DEBUG1: lbla=$lbla gen0=$gen0 gen1=$gen1"
 # echo "- if no existing file, mvstest returns 000000, vsetest returns 000001"
 # read reply
 #
 lblgenx=${lbla}${gen1}          # create filename for next generation
 #=====================
 #
 export $lfd=$lblgenx            # export LFD=lbl of next generation
 #===================            # for COBOL or utility program
 #
 # retrieve gdg=... from indexed file using filename key & uvcopy job gdgget51
 lbldG=$GTMP/${step}G1_$lbld     # create filename for outfile
 #
 uvcopy gdgget51,fili1=$lslbls,filo2=$lbldG,arg1=$lbl4,arg2=$gen1,arg3=G1,rop=i63
 #================================================================*****G1=last+1
 gens=$?           # capture gdg=... value from return code
 #
 # verify generations min/max, if invalid set to default
 if (($gens<4)) || (($gens>249)); then gens=$gensdflt; fi
 #
 # delete files to maintain generations spcfd by arg#3 or default (see above)
 ((excess=$filecnt-$gens))    # calc number of files to delete
 # if excess, re-read file of filenames, deleting 1st few excess
 if ((excess > 0)); then
    exec 3< $lslbls              # re-open file of 'ls' names
    while read -u3 lblgenr       # read lines of ls filenames
          do  ((lblcnt+=1))      # count files for excess delete
              if ((lblcnt <= excess)); then rm -f $lblgenr; fi
          done                   #
    exec 3<&-                    # close file
 fi
 # can now remove the _000000 nullfile if created above
 if [[ ! -s ${lbla}000000 ]]; then rm -f ${lbla}000000; fi
 #
 # touch (create new empty file) if arg4 = 'touch'
 if [[ "$4" == "touch" ]]; then touch $lblgenx; fi
 #Apr20/09 - change back to only if arg4=touch (problem of optn g0)
 #
 # display result for console log
 logmsg1 "gen+1: $lfd=$lblgenx gens=$gens"
 #========================================
 # return no of generations existing
 gdgsbf=$(wc -l $lslbls); gdgsb=${gdgsbf% *}; gdgs=${gdgsb##* };
 return $gdgs        # return no of generations existing
 }

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

5J3. MVS JCL conversion - GDG functions

exportgenall concatenate all generations

 # exportgenall - function to export all of the existing generation of a filename
 #              - by Mark Wedge, Armas Solutions, Aug 2002
 #
 # All matching files with the 6 digit gen# are concatentated into 1 output file.
 # The output file will have the trailing '_' (ID for generation file)
 # but will have no 6 digit# (preventing any future inclusion as a member)
 #
 # ap/account.trans_000001
 # ap/account.trans_000002   <-- sample input 3 files
 # ap/account.trans_000003
 #
 # ap/account.trans_       <-- output 3 files combined into 1
 #
 #command: exportgenall CUSTMAS ap/account.trans_
 #         ======================================
 #result:  export CUSTMAS=ap/account.trans_
 #         ================================
 #
 # All files 'ap/account.trans_[0-9][0-9][0-9][0-9][0-9][0-9]'
 # will be concatenated in to the base name 'ap/account.trans_'
 # To remove all generations, the 'rm' comamnd will be generated as follows:
 # rm -f ${CUSTMAS}[0-9][0-9][0-9][0-9][0-9][0-9]
 # The concatenated file '_' will remain & might be a backup in case of error
 #
 function exportgenall
 {
 if [[ -n "$1" && -n "$2" ]]; then :
 else logmsg2 "ERR: exportgenall requires 2 args: LFD=$1, lbl=$2."
      exit 9; fi
 lfd=$1; lbl1=$2
 #
 #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles
 #         - extract subdir/filename from $RUNDATA/subdir/filename
 lbl2=${lbl1##*/}      # drop large left to get filename
 lbl3=${lbl1%/*}       # drop small right to get $RUNDATA/subdir
 lbl4=${lbl3##*/}      # drop large left to get subdir
 lbla=$lbl4/$lbl2      # create subdir/filename (to match coding in gdgctl51I)
 #
 #Jun05/03 - verify that filename (arg2 on call) ends with '_'
 if [[ ! "$lbla" == *_ ]]; then
    logmsg2 "ERR: gen filenames should end with '_', continue?, need fix?"
    read reply; fi
 #
 cat /dev/null > $lbla
 cat ${lbla}[0-9][0-9][0-9][0-9][0-9][0-9] > $lbla
 #================================================
 export $lfd=$lbla
 #================
 #
 # get filesize & display results for console log
 fsize="";
 if [[ $lbla == /* ]]; then lblb=$lbla; else lblb=$RUNDATA/$lbla; fi
 if [[ -f $lblb ]]; then fsize=$(stat -c%s $lblb); fi
 logmsg1 "genall: $lfd=$lbla bytes=$fsize"
 #=======================================
 #
 #Aug29/08 - call gdgget52 to add exportgenall 'GA' entry to ctlfile history
 # capture all matching GDG filenames into a file for readback to get low#/high#
 # - 1st create filename for 'ls' write lslbls=jobtmp/$JOBID2/${JSTEP}I_$lbla
 # - with all filenames matching up to the trailing '_'
 lblc=$(echo $lbla | tr "/" "_")   # convert any '/' to '_' in DSNname
 lslbls=$GTMP/${step}I_$lblc       # assign filename for ls write
 ls $lbla[0-9][0-9][0-9][0-9][0-9][0-9] >$lslbls 2>/tmp/junk
 #
 # call uvcopy job gdgget52 to select control file entry for matching filename
 # - from indexed file ctl/gdgctl51I using filename as key
 lblxG=$GTMP/${step}GA_$lblc       # create filename to be written by uvcopy
 #Oct18/08 - remove $RUNDATA/ if present due to option e1 in jclunixop51
 lblr=${lbla#$RUNDATA/}            # remove $RUNDATA/ for optn e1 jclunixop51
 #Note - output file not required for exportgenall (simply adding history)
 #
 uvcopy gdgget52,fili1=$lslbls,filo2=$lblxG,arg1=$lfd,arg2=$lblr,arg3=GA,rop=i63
 #===============================================================*****GA=All
 # arg1  = DDN (ex: GLMSTR)
 # arg2  = DSN filename key for lookup gdgctl file (ex: gl/account.master_)
 # arg3  = $gn -2,-1,0,+1,+2,etc identify calling function exportgen0/1
 # fili1 = $lslbls ls of all matching filenames_* to underscore (+ 6 digits)
 # filo2 = $lblxG output file for gdgctl entry (NOT required for exportgenall)
 #
 return 0
 }

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

5J4. MVS JCL conversion - non-GDG function

exportgenx - report err if gen# out of bounds

 # exportgenx - function to report error in JCL to script conversion
 #            - when generation on end of filename NOT as expected
 #            - see GDG doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5
 # valid exportgen_s as follows:
 #
 # exportgen0 - current generation (0) highest gen#
 # exportgen1 - next generation (+1) not yet existing
 # exportgenx - (this function) errmsg if original gen not 0,+1,+2,+3,-1,-2,-3
 # exportgenall - concatenates all existing generations
 #
 # sample JCL/script conversions:
 #
 # //DDNAME DD DSN=filename(-4) --> 'exportgenx' report err if gen# < -3
 # //DDNAME DD DSN=filename(0)  --> 'exportgen0' current/latest generation
 # //FDNAME DD DSN=filename(+1) --> 'exportgen1' next generation
 # //DDNAME DD DSN=filename(+4) --> 'exportgenx' report err if gen# > +3
 #
 # This 'exportgenx' reports an error if script run before manual correction
 # Or addition of more exportgen_ functions for -4,-5,etc or +4,+5,etc
 # (in $RUNLIBS/sfun/...)
 #
 function exportgenx
 {
 lfd=$1; lbl=$2          # capture args into named variables
 logmsg2 "ERR: exportgenx - ERR in JCL to UNIX script conversion"
 logmsg2 "- generation (-3),(-2),(-1),(0),(+1),(+2),(+3) NOT in allowed range"
 logmsg2 "- LFD=$lfd, LBL=$lbl."
 logmsg2 "- see GDG doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5"
 logmsg2 "- correct script $JOBID2 & rerun"
 logmsg2 "- enter=continue, or kill job by interrupt (del or ^C)"
 read reply               # wait for operator to enter or kill
 return 9
 }

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

5J5. MVS JCL conversion - non-GDG function

exportfile - exports & display non-GDG filename

 # exportfile - function to export DDname=DSName for Micro Focus external names
 #              DDname (logical name in program) = DSName (physical filename)
 #
 # functions must be in directory defined by FPATH (export FPATH=$RUNLIBS/sfun)
 # This is:   $RUNLIBS/sfun/exportfile to display non-GDG filenames on console
 # - also see $RUNLIBS/sfun/exportgen0 for current generation (0) highest gen#
 # - also see $RUNLIBS/sfun/exportgen1 for next generation (+1)
 #
 #function: exportfile CUSTMAS ap/customer.master
 #          =====================================
 #
 #result:   export CUSTMAS=ap/customer.master
 #          =================================
 #
 #Note - main reason for using this function (vs coding export directly)
 #       is to display the DDname & DSNname on the console log
 #
 function exportfile
 {
 #
 if [[ -n "$1" && -n "$2" ]]; then :
 else logmsg2 "ERR: exportfile requires 2 args: DDname=$1, DSName=$2."
      exit 9; fi
 #
 lfd=$1; lbl=$2              # capture args into named variables
 #
 export $lfd=$lbl            # export LFD=lbl of highest gen existing
 #===============
 #
 #Oct05/08 - init file if name ends with 'nullfile'
 if [[ $lbl == *nullfile ]]; then >$lbl; fi
 #
 # get filesize & display results for console log
 #Sep15/08 - allow for Indexed file by also testing for '.dat' suffix
 fsize="";
 if [[ $lbl == /* ]]; then lblc=$lbl; lbld=$lbl.dat;
    else lblc=$RUNDATA/$lbl; lbld=$RUNDATA/$lbl.dat; fi
 if [[ -f $lblc ]]; then fsize=$(stat -c%s $lblc);
    elif [[ -f $lbld ]]; then fsize=$(stat -c%s $lbld); fi
 #
 logmsg1 "file: $lfd=$lbl bytes=$fsize"
 #=====================================
 return 0      # return 0 if file was found
 }

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

5K1. MVS JCL conversion - GDG functions

jobset51 - alt version of jobset51 Sep2009

 # jobset51 - setup environment for UNIX scripts converted from MVS JCL
 #          - this KORN shell function stored in $RUNLIBS/sfun
 #          - see more doc at: www.uvsoftware.ca/mvsjcl.htm
 #
 function jobset51
 { # jobset51 - called at the begining of each JCL/script
 #            - inserted by JCL converter from the ctl/jclunixop51
 # jobset51 uses $RUNLIBS & $RUNDATA (exported in prgmr/oprtr profiles)
 #          to define Libraries & Data dirs for 'test' or 'prod'uction
 #
 #        - - - sample RUNLIBS/RUNDATA for programer testing - - -
 # export RUNLIBS=/home/mvstest/testlibs #<-- test/demo Libraries
 # export RUNDATA=/home/mvstest/testdata #<-- test/demo Data superdir
 #
 #        - - - sample RUNLIBS/RUNDATA for production operators - - -
 # export RUNLIBS=/p2/prodlibs           #<-- production libraries
 # export RUNDATA=/p2/proddata           #<-- production Data superdir
 #
 # - JCL/scripts are found via $RUNLIBS/jcls in the profile PATH
 # - COBOL program subdir defined here in jobset51 as '$RUNLIBS/cblx'
 #   (this allows programs to have same names as JCL/scripts)
 #
 #                      ** change history **
 #
 #Nov18/09 - jobset51/52 & g1/g2 changed back to relative/absolute
 #Sep29/09 - move code for JTMP,RPTS,SYOT together for alt jobset52
 #         - jobset51 (option g1) omits $RUNDATA for relative adrs
 #         - jobset52 (option g2) prefixes with $RUNDATA for Essentis
 #Apr16/09 - GDGmkdirs moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/
 #         - to allow multiple $RUNDATA's to have different GDG controls
 #Aug26/08 - $GTMP defined for exportgen0,1,etc for 'ls' output files
 #           of GDG matching filenames for readback determine latest gen#
 #           export GTMP=jobtmp/$JOBID2/gtmp <-- defined here in jobset51
 #Aug25/08 - simplify code GDG tmp subdirs in jobset51,jobend51,jobabend51
 #         - using script ctl/GDGmkdirs (user must define desired subdirs)
 #         - allows removing hard-coded data subdirs in jobset51,etc
 #May23/07 - add code to support exportgen1 preserve gen#s if job abends
 #         - create $JTMP/subdirs for exportgen1 new files til Normal EOJ
 #         - at Normal EOJ, move $JTMP/subdir/files to $RUNDATA/subdirs
 #         - see below where $JTMP/subdirs created (add your subdirs ?)
 #
 #                  ** begin code for function jobset51 **
 #
 cd $RUNDATA              #change to working dir for production (or test)
 cdstatus=$?              # capture status of cd $RUNDATA
 if ((cdstatus))          # ERR if cdstatus not zero (OK)
    then logmsg2 "ERR: cd \$RUNDATA ($RUNDATA) failed in jobset51"
         logmsg2 "- investigate, RUNDATA definition in profiles"
         logmsg1 "- enter to exit"; read reply; exit 91; fi
 #
 # cd $RUNDATA means all files are referenced relative to $RUNDATA
 # - allows switching between production & test files by changing $RUNDATA
 # - JCL converter has converted HLQs of DSNs to subdirs within $RUNDATA
 # - High Level Qualifiers might be applications (ar,gl,mstr,tape,etc)
 #
 export RLX=$RUNLIBS/cblx      # path for loading COBOL programs
 export RPX=$RUNLIBS/rpgx      # path for loading RPG programs
 export RLJ=$RUNLIBS/java      # path for loading JAVA programs
 export REXXLIB=$RUNLIBS/rexx  # path for loading REXX programs
 export PRMS=$RUNLIBS/parms    # control card library files (members)
 # - COBOL programs are found via $RLX/progname in JCL/scripts
 # - RPG   programs are found via $RPX/progname in JCL/scripts
 # - JAVA  programs are found via $RLX/progname in JCL/scripts
 #
 if [ -z "$ANIM" ]; then ANIM=-F; fi
 # 'ANIM=-F' inhibits non-numeric field checks (could change to +F ?)
 # - cobol programs are called via ---> cobrun $ANIM $RLX/progname <---
 #
 # make subdirs for work files, instream data files,& GDG subdirs
 #Sep29/09 - JCL converter options insert jobset51/jobset52 & $JGDG/...
 # g0 - inserts jobset51 & omits $JGDG/ so new GDGs in same subdir as old
 # g1 - inserts jobset51 & $JGDG/ on exportgen1 & JGDG=jobtmp/GDG relative
 # g2 - inserts jobset52 & $JGDG/ on exportgen1 & JGDG=$RUNDATA/jobtmp/GDG
 # w2 - inserts $RUNDATA/ on exportfile & exportgen_ functions (Essentis)
 #
 # for jobset51 - define JTMP,RPTS,SYOT relative (w/o $RUNDATA)
 # for jobset52 - define JTMP,RPTS,SYOT with $RUNDATA (Essentis Mar09)
 #
 export JTMP=jobtmp/$JOBID2
 export RPTS=rpts
 export SYOT=sysout/$JOBID2
 #NOTE - this is ***jobset51***, so above un-comntd & folwng #comntd
 # export JTMP=$RUNDATA/jobtmp/$JOBID2
 # export RPTS=$RUNDATA/rpts
 # export SYOT=$RUNDATA/sysout/$JOBID2
 #
 # define jobtmp/subdirs for new GDG files
 umask 002  # ensure perms to create dirs/files 775/664 (group share)
 export JGDG=$JTMP/GDG
 export GTMP=$JTMP/gtmp
 if [[ ! -d $JTMP ]]; then mkdir $JTMP; fi
 if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi
 if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi
 # JTMP/...     - for work files & instream data files
 # GTMP/...     - for exportgen0,1,etc 'ls' output files
 #                GDG matching filenames readback to determine latest gen#
 # JGDG/subdirs - store new GDGs for move back at Normal EOJ
 #              - see $RUNDATA/ctl/GDGmkdirs called later in jobset51
 #Mar14/09 - converter optn g1 inserts $JGDG/... on new GDGs exportgen1
 # - new option 'g0' omits $GDG/ so new GDGs in same subdir as old
 # - code in jobset51, etc did not change, no files redirected to $JGDG/
 #
 #Note - $JTMP subdir could be date/time stamped (or append process ID)
 #     - if multiple copies of same job run at same time, for example:
 # export JTMP=jobtmp/${JOBID2}$(date +%y%m%d%H%M%S) #<-- date/time stamp
 # export JTMP=jobtmp/${JOBID2}$$                    #<-- process ID
 #     - If you do this, then 'rm -rf $RUNDATA/jobtmp/*' nightly by cron
 #     - see crontab_appsadm1 & script cleantmps at ADMjobs.htm#5B1
 #
 # define subdir that might be used for printer output
 # - some sites might sub-directory by date rpts/yymmdd/...
 # export RPTS=rpts/$(date +%y%m%d)  # use this for subdirs by date
 if [[ ! -d $RPTS ]]; then mkdir $RPTS; fi
 #
 # make subdir for SYSOUT files (or any file w/o DSN=...)
 # $RUNDATA/$SYOT/step#_SYSOUT (where SYOT=sysout/JOBNAME)
 if [[ ! -d $SYOT ]]; then mkdir $SYOT; fi
 #
 # $JTMP & $SYOT are vital - ensure created successfully else exit
 if [[ -d $JTMP && -d $SYOT ]]; then :
    else logmsg2 "ERR: $JTMP &/or $SYOT failed creation (in jobset51)"
         logmsg2 "- investigate: permissions,JTMP,SYOT dirnames changed?"
         logmsg1 "- enter to exit"; read reply; exit 92; fi
 #Note - in code above we create $JTMP & $SYOT if not already existing
 #     - we also want to clean out any prior run files if they do exist
 # - BUT not on a 'RESTART', see following line of code below (near end)
 # ---> else rm -f $JTMP/*; rm -f $SYOT/*; fi  <--- see below
 #
 # define subdir for intersttep temp/work files & in IDCAMS conversions
 # ensure wrk/nullfile present & empty, for use on DD DUMMY
 >wrk/nullfile    # ensure present & empty
 # could use /dev/null, but some unix variants had problems with that
 #
 # Begin code to preserve GDGs if jobs abort
 # - see doc at www.uvsoftware.ca/mvsjcl.htm#Part_5
 #Aug25/08 - modified to make coding independent of GDG subdir names
 # - code TOPNODE table in $RUNLIBS/ctl/jclunixop51 for JCL conversion
 # - code script to make desired subdirs in $RUNDATA/ctl/GDGmkdirs
 # Ensure $JGDG/subdirs exist for exportgen1 new files til Normal EOJ
 # - at Normal EOJ, will move $JGDG/subdir/files back to $RUNDATA/subdirs
 # Call script to create $JGDG/subdir for topnodes on files in JCL/scripts
 #
 $RUNDATA/ctl/GDGmkdirs   #<-- make GDG/subdirs for datafile topnodes
 #=====================      - user must code his subdirs in GDGmkdirs
 #
 # Test for any files in $JGDG/subdirs at begin job
 # (prior run abend not moving GDG/subdir/files back to $RUNDATA/subdirs)
 # - will prompt operator to move back or not (rerun from begining)
 #
 lsgdgs=$(ls $JGDG/*/* 2>/dev/null);  # capture filenames in GDG/subdirs
 if [[ -n "$lsgdgs" ]]; then
    logmsg2 "WARN: files in jobtmp/GDG subdirs (from prior Abterm ERR?)"
    logmsg2 "---- files in $JGDG/*/* listed below:"
    echo    "$lsgdgs"
    reply=x
    until [[ "$reply" == "y" || "$reply" == "n" ]]
     do logmsg2 "jobtmp/GDG/subdir/files must move/remove before rerun"
        logmsg2 "y = move back to \$RUNDATA/GDG/subdirs, restart step# ?"
        logmsg2 "n = do NOT move back (will erase), rerun from begining ?"
        logmsg2 "OR - may need to kill job & investigate ?"
        tty -s || break  # test for login terminal, break if run by cron
        read reply
     done
    # if reply y - move files back
    if [[ "$reply" == "y" ]]; then
       logmsg2 "moving $JGDG/subdir/files back to \$RUNDATA/subdirs/"
       for psd in $JGDG/*
         { lspsd=$(ls $psd)
           if [[ "$lspsd" ]]; then
              sd=${psd##*/}
              mv -iv $psd/* $sd/
              #=================
           fi
         }
    fi
 fi
 #
 if [[ $STEP != S0000 ]]; then
    logmsg2 "WARN: **restarting** at STEP=$STEP";
 else
    # ensure $JGDG/subdirs exist to hold exportgen1 files until Normal EOJ
    # Normal EOJ will move $JGDG/subdir/files back to $RUNDATA/GDG/subdirs
    #Note - create user set of subdirs in 2 places, above for file test
    #     - and here after 'rm -fr $JTMP/*' for non-restart
    rm -fr $JTMP/*; rm -fr $SYOT/*;
    #
    $RUNDATA/ctl/GDGmkdirs   #<-- make GDG/subdirs for datafile topnodes
    #=====================      - user must code his subdirs in GDGmkdirs
 fi
 # Default RUNDATE to system date yyyymmdd, but allow cmd line override
 # --> jobname.ksh RUNDATE=20091120  <-- override system date for this job
 # See explanations at www.uvsoftware.ca/mvscobol.htm#2E1 - 2E9
 # - COBOL converter inserts unixwork1.cpy, unixproc1.cpy,& perform unixproc1
 # - unixproc1 reformats $RUNDATE into various date formats for COBOL use
 if [[ -z "$RUNDATE" ]]; then RUNDATE=$(date +%Y%m%d); fi; export RUNDATE
 export RUNDTTM=$(date +%y%m%d:%H%M%S)
 #
 # Display various information at begining of JCL/script execution
 # - for the console log, info may be useful to debug problems
 logmsg2 "Begin Job=$JOBID2"
 logmsg1 "$scriptpath"
 logmsg1 "Arguments: $args"
 logmsg1 "RUNLIBS=$RUNLIBS"
 logmsg1 "RUNDATA=$RUNDATA"
 logmsg1 "JTMP=$JTMP SYOT=$SYOT"
 logmsg1 "RUNDATE=$RUNDATE"
 uvtime W1D0 $JTMP/jobbgn
 export JSTEP=S0000 XSTEP=0
 integer JCC=0 SCC=0 LCC=0;
 #
 # Allow for RESTART at any step by step=... argument on command line:
 # --> jobname.ksh step=S0020   <-- restart at step 2
 if [[ -n "$step" ]]; then STEP="$step"; fi
 if [[ -z "$STEP" ]]; then export STEP=S0000; fi
 if [[ $STEP != S[0-9][0-9][0-9][0-9] ]]
    then logmsg2 "ERR: STEP=$STEP invalid"; exit 91; fi
 alias goto="<<${STEP}=A"
 return 0
 }
 #----------------------------- end jobset51 -----------------------------

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

5K2. MVS JCL conversion - GDG functions

jobset51/jobset52 differences

The difference is that jobset51 defines JTMP,JGDG,& SYOT with RELATIVE names, but jobset52 defines them with ABSOLUTE-PATH names. We recommend relative-PATH and the control file is provided with jobset51 coded on line 71.

The control file is ctl/jclunixop51 (for MVS) or ctl/jclunixop41 (for VSE). The JCL converters copy lines 63-73 of the control file to the begining of each converted output script.

Customers requiring full-PATH names must change 'jobset51' to 'jobset52' in the control file before executing the JCL converter.

We listed only 'jobset51' and you could use 'diff' to see the differences.


 diff -b sfun/jobset51 sfun/jobset52
 ===================================
 5,6c5,6
 < function jobset51
 < { #     'jobset51' is called at the begining of each JCL/script
 ---
 > function jobset52
 > { #     'jobset52' is called at the begining of each JCL/script
 74,80c75,81
 < export JTMP=jobtmp/$JOBID2
 < export RPTS=rpts
 < export SYOT=sysout/$JOBID2
 < #NOTE - this is ***jobset51***, so above un-commented & following #commented
 < # export JTMP=$RUNDATA/jobtmp/$JOBID2
 < # export RPTS=$RUNDATA/rpts
 < # export SYOT=$RUNDATA/sysout/$JOBID2
 ---
 > # export JTMP=jobtmp/$JOBID2
 > # export RPTS=rpts
 > # export SYOT=sysout/$JOBID2
 > #NOTE - this is ***jobset52***, so above commented & following un-commented
 > export JTMP=$RUNDATA/jobtmp/$JOBID2
 > export RPTS=$RUNDATA/rpts
 > export SYOT=$RUNDATA/sysout/$JOBID2
Note
  • this is a good example using the 'diff' utility
  • one of the most impressive unix/linux utilities

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

5K3. MVS JCL conversion - GDG functions

jobend51 - support new GDG features (May 2007+)

 # jobend51 - common function called at Normal EOJ of JCL/scripts
 #            converted from MVS JCL by Vancouver Utilities
 #          - by Owen Townsend, UV Software, May 23/2007
 #          - this KORN shell function stored in $RUNLIBS/sfun
 #          - see more doc at: www.uvsoftware.ca/mvsjcl.htm#
 # May23/07 - new system to prevent gen# increments if job abends
 #          - exportgen1 writes new GDG files into jobtmp/subdirs
 #          - this function called at Normal EOJ
 #            to move jobtmp/subdir/files to $RUNDATA/subdirs/...
 #Aug25/08 - modified to make coding independent of GDG subdir names
 # - must code TOPNODE table in $RUNLIBS/ctl/jclunixop51 for JCL conversion
 # - must code script to make desired subdirs in $RUNDATA/ctl/GDGmkdirs
 #
 #Sep29/09 - JCL converter options insert $JGDG/... on exportgen1
 # g0 - omits $JGDG/ so new GDGs in same subdir as old          (jobset52)
 # g1 - inserts $JGDG/ on exportgen1 & JGDG=jobtmp/GDG          (jobset52)
 # g2 - inserts $JGDG/ on exportgen1 & JGDG=$RUNDATA/jobtmp/GDG (jobset51)
 #    - jobend51,jobabend51 did not have to change ($JGDG defined in jobset51/52)
 #
 #                  ** coding for function jobend51 **
 #
 function jobend51
 {
 # report jobtime (July2008 moved into jobend51 to save line in all scripts)
 uvtime W1D4 $JTMP/jobend $JTMP/jobbgn $JTMP/jobtimes
 # jobtmp ($JTMP) vital - ensure present
 if [[ -d $JTMP ]]; then :
    else logmsg2 "ERR: jobtmp subdir for JCL/script missing ? \$JTMP=$JTMP"
         logmsg2 "- investigate permissions?, JTMP dirnames changed?"
         logmsg1 "- enter to exit"; read reply; exit 92; fi
 #
 # move any GDG files in jobtmp/GDG/subdirs back to $RUNDATA/subdirs
 lsgdgs=$(ls $JGDG/*/* 2>/dev/null);  # capture filenames in GDG/subdirs/...
 if [[ -n "$lsgdgs" ]]; then
    logmsg2 "moving $JGDG/subdir/files back to \$RUNDATA/subdirs/"
    for psd in $JGDG/*
      { lspsd=$(ls $psd)
        if [[ "$lspsd" ]]; then
           sd=${psd##*/}
           mv -iv $psd/* $sd/
           #=================
        fi
      }
 fi
 # call job to update the GDG control file for any prior gen# processing
 # - as indicated by exportgen0 functions within this job
 # - resets next gen# 000000 if indicated & expiry date:time past
 # - increments next gen# if processing range low to high & resets at end
 uvcopy gdgupok1
 #==============
 return 0
 }

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

5K4. MVS JCL conversion - GDG functions

jobabend51 - support new GDG features (May 2007+)

 # jobabend51 - function called at Abnormal Termination of JCL/scripts
 #            - by Owen Townsend, UV Software, June 18/2007
 #            - ksh function stored in $RUNLIBS/sfun
 #            - see doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5
 # May2007 - new system to prevent gen# increments if job abends
 #         - exportgen1c writes new GDG files into jobtmp/subdirs
 # - this function called at Abnormal Termination, to report
 #   new gens NOT moved jobtmp/subdir/files to $RUNDATA/subdirs/...
 # - also updates the gdgctl file, inserting an AB warning in history entries
 #Aug25/08 - modified to make coding independent of GDG subdir names
 # - must code TOPNODE table in $RUNLIBS/ctl/jclunixop51 for JCL conversion
 # - must code script to make desired subdirs in $RUNDATA/ctl/GDGmkdirs
 #Sep29/09 - JCL converter options insert $JGDG/... on exportgen1
 # g0 - omits $JGDG/ so new GDGs in same subdir as old          (jobset52)
 # g1 - inserts $JGDG/ on exportgen1 & JGDG=jobtmp/GDG          (jobset52)
 # g2 - inserts $JGDG/ on exportgen1 & JGDG=$RUNDATA/jobtmp/GDG (jobset51)
 #    - jobend51,jobabend51 did not have to change ($JGDG defined in jobset51/52)
 function jobabend51 {
 # report jobtime (July2008 moved into jobabend51 to save line in all scripts)
 uvtime W1D4 $JTMP/jobend $JTMP/jobbgn $JTMP/jobtimes
 # jobtmp ($JGDG) vital - ensure present
 if [[ -d $JGDG ]]; then :
    else logmsg2 "ERR: \$RUNDATA/jobtmp/GDG/ subdir missing ? "
         logmsg2 "- investigate permissions?, dirnames changed?"
         logmsg1 "- enter to exit"; read reply; exit 92; fi
 # errmsg if any GDG files in jobtmp/subdirs/ (Aug2008 moved here save code)
 lsgdgs=$(ls $JGDG/*/* 2>/dev/null);  # capture filenames in GDG/subdirs/...
 if [[ -n "$lsgdgs" ]]; then
    logmsg2 "ERR: GDG files NOT moved from jobtmp/subdirs to $RUNDATA/subdirs" RV
    logmsg2 "- can rerun OK, since GDGs not added to RUNDATA/subdirs"
    logmsg2 "- OR restart at abterm step & reply y to move prompt"
 fi
 # report any GDG files in jobtmp/subdirs NOT moved back to $RUNDATA/subdirs
 # - also call uvcopy job to update gdgctl file with err entry
 for psd in $JGDG/*
   { lspsd=$(ls $psd)
     if [[ "$lspsd" ]]; then
        sd=${psd##*/}
        logmsg2 "ERR: $JGDG/$sd/files NOT moved to \$RUNDATA/$sd/ listed below:"
        # echo  "$lspsd"  (#disable here, listed by gdgupab1)
        uvcopy gdgupab1,fild1=$psd,arg1=$sd
        #==================================
     fi
   }
 # ensure operator acknowledges GDG files not moved back
 if [[ -n "$lsgdgs" ]]; then
    logmsg2 "- reply y/n acknowledge GDG msg, but no auto action" RV ACK
 fi
 return 0
 }

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

5M0. MVS JCL conversion - Generation files

Listings of uvcopy jobs used by GDG functions

Note
  • we will list only 2 jobs here (the 2 with active links)
  • you can inspect any others in /home/uvadm/pf/IBM/...
 5M1< jcldata56     - create ctl/gdgctl51 file from all JCL/scripts
                      in directory jcls (converted to Korn shell scripts)

5M2. gdgload1 - load ctl/gdgctl51 file to indexed file ctl/gdgctl51I

5M3< gdgunload1 - convert indexed file back to text file for editing/reload


5M4. gdgget51 - used by exportgen1 to get max generations from the
indexed control file (ctl/gdgctl51I)
 5M5< gdgget52      - used by exportgen0 to determine next generation#
                    - checks gdgctl51I for over-ride to prior generation
 5M6< gdgupok1   - update gdgctl file at Normal EOJ
                    - called by jobend51 function
 5M7< gdgupab1   - update gdgctl file at Normal EOJ
                    - called by jobabend51 function

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

5M2. MVS JCL conversion - uvcopy jobs called by GDG functions

gdgload1 - load indexed file ctl/gdgctl51I

 # gdgload1 - uvcopy job from UVSI stored in: /home/uvadm/pf/IBM/
 # gdgload1 - load ctl/gdgctl51 to indexed file ctl/gdgctl51I
 #          - by Owen Townsend, UV Software, May 31/2007
 #          - see doc at www.uvsoftware.ca/mvsjcl.htm#Part5
 #
 #Apr16/09 - GDG control files moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/...
 #           to allow multiple $RUNDATA's to have different control files
 #Aug26/08 - increase recsize to 2047+1=2048 (allows 30 history entries)
 #Aug28/08 - name changes getgdg51->gdgget51,getgdg52->gdgget52,
 #           gdgctlload1->gdgload1,gdgctlunload1->gdgunload1
 #           gdgctlupok1->gdgupok1,gdgctlupab1->gdgupab1
 #
 # 1. uvcopy jcldata56,fild1=jcls,filo1=ctl/gdgctl51
 #    ==============================================
 #    - prior job to create initital gdgctl51 (text file)
 #
 # 2. cp ctl/datafiles56 ctl/gdgctl51
 #    ===============================
 #    - copy/rename
 #
 # 3. vi ctl/gdgctl51   <-- optional editing before loading Indexed file
 #    ===============     - modify no of generations (see sample below)
 #                        - possibly setup exception next=... (samples below)
 #
 #*4. uvcopy gdgload1,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I
 #    ======================================================
 #    - load Indexed file for use by exportgen1, exportgen0,& jobend51
 #
 # The gdgctl file specifies the no of generations to be maintained by the
 # exportgen1 function which writes new generations & deletes oldest generations
 #
 # The gdgctl file also provides prior generation exception processing
 # in conjunction with the exportgen0 function (see next=... examples below)
 #
 #                 ** sample input text file ctl/gdgctl51 **
 #
 # gl/account.acntlist_ gdg=08
 # gl/account.master_   gdg=10 next=000002(000002:000002)000000:000000
 # gl/account.trans_    gdg=20 opt=c next=000001(000001:000012)070531:235959
 # py/payroll.master_   gdg=30
 #
 # jcldat56 creates only filenames & gdg=... with a default no of generations
 # You would then edit the text file modifying generations as desired
 #
 # You would probably not setup any next=... at this time, but it is possible
 #     next=gen###(lowgen:higen#)yymmdd:HHMMSS
 #     next=000000(000000:000000)000000:000000
 # - will be set all zeros by gdgload1 if not coded on input
 # - see field explanations & examples at www.uvsoftware.ca/mvsjcl.htm#Part_5
 #

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

 #               ** control file record format ctl/gdgctl51I **
 #
 # 000:049 - filename example--> gl/account.master_ <--trailing underscore
 # 051:056 - gdg=..   - generations for this file (default set in jcldata56)
 # 058:062 - opt=c    - option for oprtr confirm y or enter alternate gen#
 # 064:102 - next=... any input verified & adjusted to bytes 064-103
 #           next=gen###(lowgen:higen#)yymmdd:HHMMSS
 #           next=000000(000000:000000)000000:000000
 #           zeros template/place-holder generated if not coded
 # 104:113 - jobname of last JCL/script to access this file
 #         - signal to jobend function to reset next=... as appropriate
 #           (reset next=000000 &/or increment next=... from low to high)
 # 114:126 - date/time yymmdd:HHMMSS file created by exportgen1
 #         - used by gdgupok1 to '+' flag history entry last exportgen1
 #
 # 128:191 - 1st entry of multiple action history entries
 #         - yymmdd:HHMMSS:g0_123456(123456:123456)JOBNAME  S1234 PROGRAM +
 #         - stored by exportgen0, exportgen1, jobend51?, jobend52?
 #         - action entries shifted down & latest action stored here
 # 190:190 - gdgupok1 '+' flag if moved back from jobtmp/subdir (exportgen1)
 #
 # 192:255 - update history#2 (shifted from 128-191 by jobend1)
 # 256:319 - update history#3 (shifted from 192-255)
 # 320:1983-  --- entries #4-#29 ---
 #1984:2045- update history#30
 #2046:2046- '.' period marking end of record data
 #2047:2047- x'0A' Indexed record status byte
 #         - see explanations & examples at www.uvsoftware.ca/mvsjcl.htm#Part_5
 #
 opr='load gdgctl text file to Indexed file, shifting keywords over for maxkey'
 was=c5000
 fili1=?ctl/gdgctl51,rcs=256,typ=LST
 filo1=?ctl/gdgctl51I,rcs=2047,typ=ISF,isk1=0(50)
 #
 # load zeros entries for next gen# & exportgen0 update/history entries
 #         1         2         3         4         5         6         7
 #1234567890123456789012345678901234567890123456789012345678901234567890
 lodv3=k0(100)
 next=gen###(lowgen:higen#)yymmdd:HHMMSS               <-- next gen# override
 next=000000(000000:000000)000000:000000
 next=######(######:######)######:######               <-- verify user coding
 yymmdd:HHMMSS:G1_123456(123456:123456)jobname  S1234 programid  <-- history
 000000:000000:___000000(000000:000000)_______  _____ _________
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #1234567890123456789012345678901234567890123456789012345678901234567890
 #         1         2         3         4         5         6         7

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

 @run
        opn    all                    open I/O files
        sxo    128,'0(50)'            open the sort
 #
 # begin loop to get records, reformat,& put to the sort
 # - if codes on right (gdg=..., etc) prior to col 51
 #   shift over to allow 50 bytes for the filename key
 man20  get    fili1,a0(200)          get ctlfile record
        skp>   man40
        cmc    a0(1),'#'              comment line ?
        skp=   man20                  yes - bypass, get next
        clr    b0(200),' '            clear reformat area
        mvu    b0(80),a0,' '          move filename until ending blank
        scnp   a0(80),' &'            scan to 1st nonblank folwng filename
        mvc    b50(80),ax0            ensure 50 bytes allowed for filenames
 #
 # clear cnt=... cntr=... or cntf=...
        scn    b0(150),' cnt'         cnt?=... to be cleared
        skp!   1
        clr    bx0(9),' '             clear cnt=...
 #
 # test for next=... coded on input, ifso verify & shift to byte 64
 # - else insert zeros entry at byte 64
 man30  scn    b0(80),' next='
        skp!   man36
        mvc    n0(40),bx1             isolate user's next=... entry
        clr    bx0(40),' '            clear next=... from original position
        cmcp   n0(40),k200(40)        verify users coding with table pattern
        skp!   err1
 man34  mvc    b64(40),n0             restore user entry to byte 64+
        skp    man38
 #
 # - user next=... entry not coded, insert zeros entry at byte 64
 man36  mvc    b64(40),k100           store zeros entry at byte 64+
 #
 # common point to put record to the sort
 man38  sxp    b0(128)                put to the sort
        skp    man20                  repeat loop get/put to sort
 #

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

 # end of input - now execute the sort
 man40  sxs                           execute the sort
 #
 # begin loop to get sorted records & load to Indexed file
 man50  sxg    c0(128)                get record from the sort
        skp>   man90
 #
 # create zeros entries for exportgen0,1,jobend update/history slots
 # - create zero entry only for 1st or for all by move overlapping ??
 man52  mvc    c128(64),k400          create zeros action history entrie#1
        mvc    c192(1920),c128        move overlap to create all 30 entries
        mvc    c2046(1),'>'           mark last data byte of record
        put    filo1,c0(2047)         write record to output file
        skp    man50                  repeat loop get/put sorted recs
 #
 # end of sorted records - close files & eoj
 man90  cls    all
        eoj
 #--------------------------------------------------------------------
 # Err rtns
 err1   msg    n0(40)                show users next=... entry
        msg    k0(40)                show next=... valid format
        msgw   'ERR: next=... format invalid, should fix & reload'
        mvc    b123(4),'err1'        flag record in error
        skp    man34
 #

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

5M4. MVS JCL conversion - uvcopy jobs called by GDG functions

gdgget51 for exportgen1 to get max gens from gdgctl51I

 # gdgget51 - get gdg=... for any file in $RUNDATA/ctl/gdgctl51I
 #          - called by exportgen1 function
 #          - by Owen Townsend, UV Software, May 2007
 #          - see GDG doc at www.uvsoftware.ca/mvsjcl.htm#Part_5
 #
 #Apr16/09 - GDG control files moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/...
 #           to allow multiple $RUNDATA's to have different control files
 #Oct25/08 - chg to manulock filr1 typ=ISFl4, redm5l4, updl4
 #Sep03/08 - add autolock option l2 on filr1=ctl/gdgctl51I,typ=ISFl2
 #Aug26/08 - increase recsize to 2047+1=2048 (allows 30 history entries)
 #Aug28/08 - name changes getgdg51->gdgget51,getgdg52->gdgget52,
 #           gdgctlload1->gdgload1,gdgctlunload1->gdgunload1
 #           gdgctlupok1->gdgupok1,gdgctlupab1->gdgupab1
 #
 # gdgget51 called by exportgen1 as follows:
 #
 # uvcopy gdgget51,fili1=$lslbls,filo2=$lblcG,arg1=$lblb,arg2=$gen2,arg3=$gn
 # ========================================================================
 # - use arg1=... filename as key to read Indexed file & return gdg=... value
 #
 # gdg=$?     <-- calling script can capture gdg=... from return code
 # ======
 #

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

 #                        ** gdgget5_ versions **
 #
 #*gdgget51 - this version called by exportgen1
 #          - to lookup ctl/gdgctl51I to get no of generations for the file
 # gdgget52 - version called by exportgen0
 #          - allows for prior version selection via ctl/gdgctl51
 #
 #               ** control file record format ctl/gdgctl51I **
 #
 # 000:049 - filename example--> gl/account.master_ <--trailing underscore
 # 051:056 - gdg=..   - generations for this file (default set in jcldata56)
 # 058:062 - opt=c    - option for oprtr confirm y or enter alternate gen#
 # 064:102 - next=... any input verified & adjusted to bytes 064-103
 #           next=gen###(lowgen:higen#)yymmdd:HHMMSS
 #           next=000000(000000:000000)000000:000000
 #           zeros template/place-holder generated if not coded
 # 104:113 - jobname of last JCL/script to access this file
 #         - signal to jobend function to reset next=... as appropriate
 #           (reset next=000000 &/or increment next=... from low to high)
 # 114:126 - date/time yymmdd:HHMMSS file created by exportgen1
 #         - used by gdgupok1 to '+' flag history entry last exportgen1
 #
 # 128:191 - 1st entry of multiple action history entries
 #         - yymmdd:HHMMSS:g0_123456(123456:123456)JOBNAME  S1234 PROGRAM +
 #         - stored by exportgen0, exportgen1, jobend51?, jobend52?
 #         - action entries shifted down & latest action stored here
 # 190:190 - gdgupok1 '+' flag if moved back from jobtmp/subdir (exportgen1)
 #
 # 192:255 - update history#2 (shifted from 128-191 by jobend1)
 # 256:319 - update history#3 (shifted from 192-255)
 # 320:1983-  --- entries #4-#29 ---
 #1984:2045- update history#30
 #2046:2046- '.' period marking end of record data
 #2047:2047- x'0A' Indexed record status byte
 #         - see explanations & examples at www.uvsoftware.ca/mvsjcl.htm#Part_5
 #

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

 uop=i31
 was=a2000c9000k2000
 filr1=${RUNDATA}/ctl/gdgctl51I,typ=ISFl4s2,rcs=2047,isk1=0(50)
 fili1=?lslbls,rcs=128,typ=LST
 filo2=?gdgctl1,rcs=128,typ=LSTt
 # load zeros entries for next gen# & exportgen0 update/history entries
 #         1         2         3         4         5         6         7
 #1234567890123456789012345678901234567890123456789012345678901234567890
 lodv3=k0(100)
 next=gen###(lowgen:higen#)yymmdd:HHMMSS               <-- next gen# override
 next=000000(000000:000000)000000:000000
 next=######(######:######)######:######               <-- verify user coding
 yymmdd:HHMMSS:G0_123456(123456:123456)jobname  S1234 programid  <-- history
 000000:000000:G1_000000(000000:000000)_______  _____ _________
 ######:######:                                        <-- verify history ents
 $date:$time                                           <-- values inserted above
 ${JSTEP}
 ${JOBID2}
 ${PROGID}
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #1234567890123456789012345678901234567890123456789012345678901234567890
 #         1         2         3         4         5         6         7
 # k000=next=gen#..., k100=next=000..., k200=next=###...
 # k300=yym..., k400=000..., k500=###...
 # k600=$date:$time, k700=${JSTEP}, k800=${JOBID2}, k900=${PROGID}
 #
 # uvcopy gdgget51,fili1=$lslbls,filo2=$lblcG,arg1=$lblb,arg2=$gen2,arg3=$gn
 # =========================================================================
 # - use arg1=... filename as key to read Indexed file & return gdg=... value
 @run
        opn    all                     open files
        mvn    g0(6),$arg2(6)          store gen# selected by exportgen1
        mvc    g30(2),$arg3            store G# code from exportgen1
        cmc    g30(1),'G'              spcfd on call ?
        skp=   1
        mvc    g30(2),'G1'             no - default to G1
        mvc    g50(30),$jobstamp       retrieve yymmdd:HHMMSS:JOBID
 #
 # begin loop to read ls filenames to get low & high gen#s for history entry
 # - disregard gen _000000, created to avoid problems when no existing files
 man20  get    fili1,a0(200)           get next ls filename
        skp>   man26
        mvc    a200(200),a0            save high entry before EOF
        cmn    g10(6),0                low gen# already stored ?
        skp>   man20
        scnr   a0(90),'_'              scan back to '_' ID gdg#
        mvc    g10(6),ax1              save low gen# for history
        skp    man20
 #
 # EOF - extract high gen# from saved last record before EOF
 man26  scnr   a200(90),'_'            scan back to '_' ID gdg#
        mvc    g20(6),ax201            save high gen# for history
 #

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

 # store filename key from arg1 & perform random read
 man30  mvf    c0(2047),$arg1(50)      store key from arg1 in I/O area
        redm5l4 filr1,c0(2047)         perform random read by key =
        skp>   err1
        skp<   nolock
 #
 # store $JOBID2,date/time so gdgupok1 can flag '+' entries from exportgen1
        mvc    c104(10),k800           JOBID
        mvc    c114(13),g50            date:time stamp
        put    filo2,c0(128)           write output to $JTMP/...
 # output file not used (as of June2007), return code used to return gdg=...
        scn    c0(80),' gdg='          scan record for gdg=...
        skp!   err1
 #
 # store gdg=... value for return code
 man40  mvn    $ca1,cx5(3)             store gdg for return code
 #
 # build history action entry for exportgen0 in w/s for later move to ctlrec
 man50  mvc    k400(13),k602           date:time
        mvc    k414(2),g30             arg3 G1,G2,G3
        mvc    k417(6),g0              gen# selected
        mvc    k424(6),g10             low gen#
        mvc    k431(6),g20             high gen#
        mvc    k438(9),k800            JOBID
        mvc    k447(5),k700            STEP#
        mvc    k453(9),k900            PROGID
 #
 # shift history down & insert new entry & update GDG control record
        mvc    c5000(1920),c128        save current history
        mvf    c128(64),k400(64)       store new entry
        mvc    c192(1856),c5000        restore history shifted down
        mvc    c2046(1),'>'            restore EOR ID char
        updl4  filr1,c0(2047)          update gdgctl rec for jobend51
        skp!   err2
 #
 # common point to close file, cancel job,& return gdg value or 0
 man90  cls    all                     close files
        can    ' ',$ca1                cancel with return code gdg or 0
 #
 # redm5l4 returned < already locked - prompt oprtr to retry
 nolock msg    c0(50)                  show filename locked
        msgw   'ctl/gdgctl51I record locked for filename above - enter to retry'
        skp    man30
 #
 #---------------------------------------------------------------------
 # filename not found or no gdg=... value coded in gdgctl file
 err1   msg    c0(80)                  show filename not found
        msg    'ERR: arg1 filename_ matches no filename_ in ctl/gdgctl51I'
        msgw   '- may continue, will use gdg default coded in exportgen1'
        mvn    $ca1,0                  set return code 0
        skp    man50                   go store history entry in gdgctl
 #
 err2   msg    c0(80)                  show filename update err
        msgw   'ERR: updating gdgctl51I record for jobend action'
        can    ' ',97
 #

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

Part_6 Converting 'YOUR' VSE JCL to Korn shell scripts

OPTIONAL jobs depending on site preferences

Part 6 documents optional jobs that might be desired at some sites. Part 4 (which documents the step by step conversion procedures) will refer you to Part 6 for these optional procedures.

Optional jobs are documented very briefly in Part 4 with references to details & examples here in Part 6.


6A1. jobparmx1/jobparms1 (optional) can be used to extract control cards
 from all JCLs so you can update them separately form the JCL/scripts.
 The control card files are date-stamped to allow updates for future dates.
- see details & examples begining on page '6A1'.

6B1. jclstrip1 - cleanup converted JCL/scripts
- remove non-essential code & extraneous comments
- remove mainframe steps that do not apply to unix/linux
- remove commented original JCL stmnts that may have been
  useful during conversion & testing

6C0. Changing data file-types & record-sizes AFTER conversion
- advantages changing some fixed-length files to Text files
- can use unix/linux system utilities (vi,lp,more,etc)
- convenient for data input files, parameter files, date control files, etc
- not possible for files with packed &/or binary fields.

6C1. Change selected DATA-files (append a Line-Feed after last non-blank)
- can do this with a simple 'uvcp'
6D1.  Change JCL/script references to file-types & record-sizes
- uvsorts/uvcps converted from mainframe SORT,IDCAMS,IEBGENER, etc
6E1.  Change corresponding COBOL program SELECTs to ORGANIZATION LINE SEQUENTIAL

GDG files - see Part_5

The VSE mainframe did not have GDG files, but we have found them useful to supply tape generation handling for VSE conversions. The Vancouver Utility GDG system was enhanced in May 2007, and some features now surpass the MVS mainframe implementation.

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

6A1. Testing & Debugging your JCL/Korn shell scripts

Preparations Required before test/debug can begin

Depending on your site, you may have some initial preparations that must be performed before you can begin testing & debugging your JCL/scripts.

As an example we will present the Operating Instructions required for the optional jobs 'jobparmx1' & 'jobparms1'.

jobparmx1 - extract control cards from JCL/scripts

'jobparmx1' will extract jobparms (control cards, dates,etc) from JCL/scripts into separate files that may be updated before JCL/scripts run.

Control files will have a date-stamp appended (current date at gen time) Run control administrators may duplicate the files & append future dates which will be selected when the current data reaches or passes file dates

Also see 'jobparms1' which will be run at 6PM (before batch shift) to copy $RUNLIBS/jobparmx1/* to $RUNDATA/jobparms1, selecting the appropriate control card from any multiple dates for any 1 jobname_step_program

jobparm directories

During conversion, Embedded data cards in the JCL/scripts are extracted into subdirs jobparmx1 & jobparmx2. Filenames are created from 'jobname + step# + programname'

Before each night's batch runs, files from $RUNLIBS/jobparmx1 & jobparmx2 are selected/copied over to $RUNDATA for use by the JCL/scripts.

 $RUNLIBS/jobparmx1 - control cards with 'DONNE' or 'FONCTION' in col 1+
                    - filename: jobname+step#+programname+datestamp(yymmdd)
                    - administrators may created future date-stamped files
                    - latest current file will be copied to $RUNDATA/jobparms1
                    - before each night's batch runs
 $RUNLIBS/jobparmx2 - all other control card sets
                    - without DONNE or FONCTION on any line of set
                    - will simply be copied to $RUNDATA/jobparms2
 $RUNDATA/jobparms1 - control cards with 'DONNE' or 'FONCTION' in col 1+
                    - selected from $RUNLIBS/jobparmx1 before each batch shift
                    - uvcopy job 'jobparms1' selects the latest current file
                    - & drops the date-stamp from the output file
                    - these files will be read by the JCL/scripts
 $RUNDATA/jobparms2 - all other control card sets
                    - without DONNE or FONCTION on any line of set
                    - simply copied from $RUNLIBS/jobparmx2

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

6A2. Testing & Debugging your JCL/Korn shell scripts

initial extract control cards


 #1. cd $RUNLIBS                  <-- change to libraries (where jcls are)

 #2a. mkdir jobparmx1 jobparmx2     <-- make jobparmx1 subdir for output
 #2b. rm -f jobparmx1/* jobparmx2/*   - or remove all files if subdirs exist

 #3. uvcopy jobparmx1,fild1=jcls,fild2=jobparmx1,fild3=jobparmx2
     ++=========================================================
     - extract control cards from all jcls to jobparmx1 or jobparmx2

rerun ALL - output to 'tmp1/tmp2' subdirs

If you need to rerun, but don't want to overwrite existing files in jobparmx1, you could output to 'tmp1/tmp2' subdirs & manually copy desired files to jobparmx1 & jobparmx2.


 #1. cd $RUNLIBS            <-- change to libraries (where jcls are)

 #2a. mkdir tmp1 tmp2       <-- make tmp1/tmp2 subdirs for output
 #2b. rm -f tmp1/* tmp2/*     - or remove all files if subdirs exist

 #3. uvcopy jobparmx1,fild1=jcls,fild2=tmp1,fild3=tmp2
     =================================================
     - extract ALL control cards to tmp1/tmp2 subdirs

 #4a. cp tmp1/????? jobparmx1    <-- copy desired files to jobparmx1
      =======================

 #4b. cp tmp2/????? jobparmx2    <-- copy desired files to jobparmx2
      =======================

extract control cards from 1 JCL/script

If you need to convert a new JCL, specify the JCL/script name via ',arg1=...' The instrns below will output directly to jobparmx1/jobparmx2.

You could use tmp1/tmp2 to ensure no overwriting files in jobparmx1/jobparmx2. 'arg1=...' may specify a prefix to extract control cards from all JCL/scripts matching the prefix specified.


 #1. cd $RUNLIBS         <-- change to libraries (where jcls area)

 #2. uvcopy jobparmx1,fild1=jcls,fild2=jobparmx1,fild3=jobparmx2,arg1=jclprefix
     ==========================================================================
     - extract control cards from 1 JCL/script direct to jobparmx1/jobparmx2
     - 'jcl2ksh41' (convert 1 JCL) uses arg1=jclname

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

6A3. Testing & Debugging your JCL/Korn shell scripts

sample embedded data in JCL & script

  1. // JOB 30905D04
  2. // EXEC E212108C,SIZE=512K
  3. DONNE 99999
  4. /*
  5. exportfile SYS011 jobparms/${JOBID2}_${JSTEP}_${PROGID}
  6. #< exportfile SYS011 $JTMP/${JSTEP}_${PROGID}
  7. #< cat > $SYS011 <</*EOD
  8. #< DONNE 99999
  9. #< /*EOD
  10. cobrun $ANIM $RLX/e212108c

The JCL converter generate lines 2-5 as '#<' comments. The SYS011 logical name used by COBOL program is defined by the exportfile on line 1 above, reproduced below on line 1a & followed by lines 1b & 1c showing sample values for the $SYMBOLS.


 #1a. exportfile SYS011 jobparms1/${JOBID2}_${JSTEP}_${PROGID}
      ========================================================

 #1b. exportfile SYS011 jobparms1/30905d04_S0020_e212108c
      ===================================================
      cd $RUNDATA   <-- jobset51 (function called at begin all jcls)
                      - changes directory to $RUNDATA
                      - so effective pathname might be as follows:

 #1c. exportfile SYS011 /tax/testdata/jobparms1/30905d04_S0020_e212108c
      =================================================================

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

6A4. Testing & Debugging your JCL/Korn shell scripts

control card selections by current date

jobparmx1 is a 1 time job to extract control cards into separate files in subdirs $RUNLIBS/jobparmx1 (if DONNE/FONCTION) or jobparmx2 (all others). (for reruns you might output to tmp1/tmp2 & copy to jobparmx1/jobparmx2)

 jobparmx1 will append the current date on files in jobparmx1, for example:
 - here is an example for 2 control files extracted on Dec 01/2006

control files extracted on Dec 01/06

   jobparmx1/28401a28_S0010_e212319c_061201
   jobparmx1/30905d04_S0020_e212108c_061221
 Run control administrators may duplicate control files, update,& append
 'effective dates' when the new parameters are to take effect.
 - for example, here are the 2 control cards with some future versions

control files with future dates appended

   jobparmx1/28401a28_S0010_e212319c_061201    <-- original extracted
   jobparmx1/28401a28_S0010_e212319c_061211      - future effective dates
   jobparmx1/28401a28_S0010_e212319c_061218
   jobparmx1/30905d04_S0020_e212108c_061201    <-- original extracted
   jobparmx1/30905d04_S0020_e212108c_061215      - future effective dates
   jobparmx1/30905d04_S0020_e212108c_061231
 The appropriate files will be selected
 - from $RUNLIBS/jobparmx1 to $RUNDATA/jobparms1
 - by uvcopy job 'jobparms1' which will run every day before batch shift.

 uvcopy jobparms1,fild1=$RUNLIBS/jobparmx1,fild2=$RUNDATAjobparms1
 =================================================================
 - select/copy current control cards from $RUNLIBS/jobparmx1 to $RUNDATA/jobparms1
 - and drop the date suffix so JCL/script files defs will match

 uvcopy jobparms1   <-- same but easier (subdirs default as shown above)
 ================

Here is an illustration of the selection on Dec 15/2006 for the 2 control files, each with 3 date versions

filenames selected to jobparms1 on Dec15/06

   jobparmx1/28401a28_S0010_e212319c_061211   --> jobparms1 subdir
   jobparmx1/30905d04_S0020_e212108c_061215   --> jobparms1 subdir

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

6B1. VSEJCL: Optional Preparations depending on site preferences

jclstrip1 - cleanup converted JCL/scripts

jclstrip1 will remove mainframe steps that do not apply to unix/linux. See the table of stepnames embedded in jclstrip1 (LISTLOG,PRTLOG,etc). jclstrip1 was written for VSE & jclstrip2 will be added for MVS.

jclstrip1 also removes commented original JCL stmnts that may have been useful during conversion & testing, but can be removed for ongoing production.

Op. Instrns. for jclstrip1


 #1. Login appsadm --> /home/appsadm. Or login yourself if in group apps
     and profile setup for desired libraries (TESTLIBS or PRODLIBS)

 #2. cdl --> $TESTLIBS or $PRODLIBS depending on .bash_profile

 #3. mv jcls jcls.old   <-- rename current jcls directory
     ================

 #4. mkdir jcls         <-- make new dir to receive stripped JCL/scripts
     ==========

 #5. uvcopy jclstrip1 jcls.old jcls  <-- strip all JCL/scripts
     ==============================      while copying jcls.old to jcls

sample BEFORE & AFTER


6B2. lists 2 steps DYNUTIL & IDCAMS before jclstrip1 (54 lines)

6B3. lists the 2 steps after jclstrip1 (28 lines)
  1. step 1 drops from 22 to 7 lines, since DYNUTIL is in the table of steps that do not apply to unix/linux (see listing page '6B4'). 'S0010=A' is retained since it could be the target of a goto or restart. The JSTEP & XSTEP+=1 ar retained to maintain the original step numbering.

  2. step 2 drops from 30 to 19 lines since IDCAMS is a required step. We removed 11 lines of #< comments, which showed the original IDCAMS coding for DELETE & DEFINE CLUSTER. These might be useful during conversion, but can be removed after testing is completed.

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

6B2. jclstrip1 - cleanup converted JCL/scripts

sample JCL/script BEFORE jclstrip1


 #1======================== begin step#S0010_DYNUTIL =========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 export PROGID=DYNUTIL
 export PARM="";
 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 exportfile E212528 e2125528/ttaxe.b8401d03
 exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID}
 #< cat > $SYS011 <</*EOD
 #<  DELETE 'SORTWK1 ==',POOL=POLMU5
 #< /*EOD
 ## EXEC DYNUTIL,SIZE=96K
 #3----------------------------------------------------------------------
 # DYNUTIL - convert DELETES only (but not for SORTWK_)
 #4----------------------------------------------------------------------
 :  # dummy step set cc 0 for status tests
 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 if ((SCC != 0))
    then logmsg1 "step $JSTEP DYNUTIL abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
 #1======================== begin step#S0020_IDCAMS =========================
 S0020=A
 JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0;
 logmsg1 "Begin Step $JSTEP IDCAMS (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 export PROGID=IDCAMS
 export PARM="";
 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID}
 #< cat > $SYS011 <</*EOD
 #<    DEL E2125528.TTAXE.B8401D03 PURGE     -
 #<        CATALOG(VSAM.USERCAT.CATALOG.MU5585 UCAT1)
 #<    DEF CL (NAME(E2125528.TTAXE.B8401D03) -
 #<            VOL(PRD318       )                        -
 #<            RECSZ(546 546)                            -
 #<            FILE(E212528)                             -
 #<            CISZ(6144)                                -
 #<            CYL(70 70)                                -
 #<        CATALOG(VSAM.USERCAT.CATALOG.MU5585 UCAT1)
 #< /*EOD
 ## EXEC IDCAMS,SIZE=200K
 #3----------------------------------------------------------------------
 rm -f e2125528/ttaxe.b8401d03
 uxcp "fili1=wrk/nullfile,typ=RSF,rcs=546,filo1=e2125528/ttaxe.b8401d03,typ=RSF,rcs=546"
 LCC=$?; ((SCC+=LCC));
 #4----------------------------------------------------------------------
 S0020C=$SCC; ((JCC+=SCC)); alias goto="";
 if ((SCC != 0))
    then logmsg1 "step $JSTEP IDCAMS abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto

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

6B3. jclstrip1 - cleanup converted JCL/scripts

sample JCL/script AFTER jclstrip1


 #1======================== begin step#S0010_DYNUTIL =========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
 logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 export PROGID=DYNUTIL
 export PARM="";
 exportfile E212528 e2125528/ttaxe.b8401d03
 #1======================== begin step#S0020_IDCAMS =========================
 S0020=A
 JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0;
 logmsg1 "Begin Step $JSTEP IDCAMS (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 export PROGID=IDCAMS
 export PARM="";
 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
 exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID}
 ## EXEC IDCAMS,SIZE=200K
 #3----------------------------------------------------------------------
 rm -f e2125528/ttaxe.b8401d03
 uxcp "fili1=wrk/nullfile,typ=RSF,rcs=546,filo1=e2125528/ttaxe.b8401d03,typ=RSF,rcs=546"
 LCC=$?; ((SCC+=LCC));
 #4----------------------------------------------------------------------
 S0020C=$SCC; ((JCC+=SCC)); alias goto="";
 if ((SCC != 0))
    then logmsg1 "step $JSTEP IDCAMS abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto

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

6B4. jclstrip1 - cleanup converted JCL/scripts

jclstrip1 - uvcopy job listing

 # jclstrip1 - strip non-essential code from JCL/scripts
 #           - for City of Laval, June 2008, by Owen Townsend, UV Software
 #
 # 1a. mv jcls jcls.old   <-- rename current jcls directory
 # 1b. mkdir jcls         <-- make new dir to receive stripped JCL/scripts
 #
 # 2. uvcopy jclstrip1 jcls.old jcls  <-- strip all JCL/scripts
 #    ==============================      while copying jcls.old to jcls
 #
 opr='$jobname - strip non-essential steps in JCL/scripts'
 fild1=?indir,typ=DIR,rcs=80           #input directory
 fili1=xxxxxxxx,typ=LST,rcs=256        #current input file from directory
 fild2=?outdir,typ=DIR,rcs=80          #output directory
 filo2=xxxxxxxx,typ=LSTtp775,rcs=256   #current output file
 #
 # Table of STEP names to be stripped
 lod=k0(20)
 LISTLOG
 PRTLOG
 TDYNASN
 DYNUTIL
 DYNOPEN
 BSTTWAIT
 E173001C
 VSECMD
 IPCPBTCH
 SPOB766
 ~~~~~~~~~~~~~~~~~~~~
 #

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

 @run
        opn    fild1                    open input directory
        opn    fild2                    open output directory (must exist)
        msgwya1 '- did you: mv jcls jcls.old & mkdir jcls (new/empty) ?'
        cmc    $arg1(1),'y'
        skp=   man10
        can    'cancelled - reply not "y"'
 #
 # begin outer loop to read directory for next filename
 man10  get    fild1,a0(80)             get next record (filename) in directory
        skp>   man90                    (cc set > at EOD)
        skp<   man10                    (cc set < on subdir vs file)
 #
 # create input filename by concat: indir/infile & open
        clr    f0(300),' '
        mvu    f100(80),$fild1,x'00'    move dirname until ending null
        cat    f100(80),'/'             concat the '/'
        cata8  f100(80),a0(80)          concat current filename (a8 null terms)
        mvc    $fili1,f100              store input filename before open
        opn    fili1                    open current input file
 #
 # create same filename in output subdir & open
        mvu    f200(80),$fild2,x'00'    move output dirname until null reached
        cat    f200(80),'/'             concat the '/'
        cata8  f200(80),a0(80)          concat current filename (a8 null terms)
        mvc    $filo2,f200              store output filename before open
        opn    filo2                    open current output file
 #
 # copy JCL/script to 1st step divider line
 man20  bal    getr                     get next line into area 'b'
        skp>   man80
        cmc    b0(5),'#1==='            step divider line ?
        skp=   man30
        put    filo2,b0                 copy to output file
        skp    man20
 #
 # begin each step (step divider line found)
 # #1======================== begin step#S0020_DYNUTIL ========================
 # extract step-name & match to table of steps to be stripped
 man30  mvn    $ca0,0                   clear step strip switch
        clr    d0(200),' '              clear work area
        scn    b0(80),'_'               scan to '_' preceding stepname
        mvu    d0(8),bx1,' '            isolate stepname
        lok    k0(20),k0(8),d0(8)       lookup table of steps to strip
        skp!   1
 man32  mvn    $ca0,1                   set step strip switch
        skp    man60                    go copy step divider & get next
 #

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

 # begin loop to copy until next step divider line
 # On all steps - drop the '#<' comment lines
 #              - original SYSIN lines on IDCAMS, etc
 # On steps matching table above (strip switch set)
 # - drop all lines except for:
 # S0020=A
 # JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0;
 # logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)"
 # stepctl51  # test oprtr jcpause/jcclear
 # export PROGID=DYNUTIL
 # export PARM="";
 # exportfile E212003 mstr/e2123003.itaxe.transdam    <- drop SYSOUT/SYS011
 # exportgen1 E212999 $JTMP/tape/tu.f01.e212-foncie_
 #
 man40  cmc    b0(5),'#1==='            step divider line ?
        skp=   man60                    yes - go output & get next
        cmc    b0(2),'#<'               orig SYSIN IDCAMS, etc
        skp=   man62                    yes - bypass output & get next
        cmn    $ca0,1                   stripping this step ?
        skp<   man60                    no - go output & get next
 #
 # strip switch set - drop lines (except as described above)
 man42  cmcp   b0(7),'S####=A'
        skp=   man60
        cmc    b0(6),'JSTEP='
        skp=   man60
        cmc    b0(6),'logmsg'
        skp=   man60
        cmc    b0(7),'stepctl'
        skp=   man60
        cmc    b0(7),'export '
        skp=   man60
        cmc    b0(9),'exportgen'
        skp=   man60
        cmc    b0(10),'exportfile'
        skp=   man44
        skp    man62                   drop, bypass output, get next
 #
 # exportfile (strip switch set) - drop if SYSOUT or SYS011
 man44  cmc    b10(3),' SYS'
        skp=   man62                   yes: drop, bypass output, get next
        skp    man60                   retain exportfiles except SYS...
 #
 # common point to copy current line & return to get next
 # - until end of current step
 man60  put    filo2,b0(256)            output record
 man62  bal    getr                     get next line
        skp>   man80
        cmc    b0(5),'#1==='            step divider line ?
        skp=   man30
        skp    man40
 #

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

 # EOF current file - output counts, close files,& return for next file pair
 man80  cls    fili1                    close current input file
        cls    filo2                    close current output file
        skp    man10
 #
 # end input directory - display stats, close all dirs & files, & eoj
 man90  cls    all
        eoj
 #
 #----------------------------------------------------------------------
 # getr - subrtn to get next line of JCL/script from current input file
 #      - bypasses cmts, clrs 72-80, squeezes to 1 blank between words
 getr   get    fili1,b0               get next line of current JCL/script
        skp>   getr9                  (cc > at EOF)
 #
 # copy to area c & squeeze to 1 blank between words
 # - ##commented out, not required yet ?
 ##     mvc    c0(256),b0
 ##     sqzl1c1 c0(100),' '           squeeze to 1 blank between words (c1)
 #                                    & leave 1 blank before 1st word (l1)
 # return with cc= (not EOF) or cc> (at EOF)
 getr8  ret=
 getr9  ret>

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

6C0. Optional Jobs depending on Site Preferences

6C1. changing DATA file-types & record-sizes

When converting mainframe JCL,COBOL,& DATA to run on Unix,Linux,or Windows, it is safer to make as few changes as possible until after parallel runs to prove the conversions correct.

You might then want to change some DATA files from Fixed-Length records to Text records (variable length records terminated by Linefeeds), because you can then take advantage of the Unix/Linux/Windows system utilities to view, print,& edit files on the new system.

This would be convenient for data input files, parameter files, date control files, etc. Note that this is not possible for files with packed &/or binary fields (often used in master/history files).

To change files from Fixed-Length to Text files (variable-length terminated by a LineFeed), there are 3 tasks to perform:

  1. Change the data-files (append a Line-Feed after last non-blank).

  2. Change any utilities in the JCL/scripts that refer to file-types & record-sizes. The JCL converter has converted any SORTs, IDCAMS, IEBGENERs, etc to uvsort or uvcp.

  3. Change the COBOL programs processing these files from: 'organization record sequential' to 'organization line sequential'.

    1. changing data-files from Fixed-Length to Text

For example, we might change a sales transaction file from fixed to text using uvcp as follows:


 uvcp "fili1=dat1/vendorpay2,typ=RSF,rcs=64,filo1=tmp/venpay2,typ=LSTt,rcs=80"
 =============================================================================

We increased rec-size as a saftey precaution. If somebody editing the file left extra trailing blanks, they could cause the record to be split into 2 records. For text records, we recommend a 25-50% saftey margin.

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

6C2. changing DATA/JCL/COBOL file-types & record-sizes

sample Fixed-Length to Text conversion


 #0. Login uvadm --> /home/uvadm

 #1. uvhd dat1/vendorpay1 r64h2  <-- uvhd Fixed-Length file (BEFORE conversion)
     ==========================    - option 'r64' Fixed-length 64 byte records
                                   - option 'h2'  vertical hexadecimal display
               10        20        30        40        50        60
      0123456789012345678901234567890123456789012345678901234567890123
      DELL10 P  20100131  INV00010  000195000 Dell server 2900
      4444332522333333332244533333223333333332466627677672333322222222
      45CC10000020100131009E60001000000195000045CC03526520290000000000
      HP0010 P  20100215  INV00020  000350000 HP XW9400 Workstation
      4533332522333333332244533333223333333332452553333256767767666222
      800010000020100215009E60002000000350000080087940007F2B34149FE000
      HP0010 P  20100215  INV00020  000042500 HP LCD Monitor
      4533332522333333332244533333223333333332452444246667672222222222
      800010000020100215009E600020000000425000800C340DFE94F20000000000
Note
  • fixed length 64 byte records, blank filled to 64 bytes
  • no LineFeed in last byte
  • can not use unix/linux utilities (vi,lp,more,cat,grep,etc)

 #2. uvcp "fili1=dat1/vendorpay2,typ=RSF,rcs=64,filo1=tmp/vpay2,typ=LSTt,rcs=80"
 ===============================================================================

 #3. uvhd dat1/vendorpay2 th2  <-- uvhd Text file (variable lth AFTER conversion)
     ========================    - option 't' for Text files
                                 - option 'h2' vertical hexadecimal display
               10        20        30        40        50        60
      0123456789012345678901234567890123456789012345678901234567890123
      DELL10 P  20100131  INV00010  000195000 Dell server 2900
      444433252233333333224453333322333333333246662767767233330
      45CC10000020100131009E60001000000195000045CC035265202900A
      HP0010 P  20100215  INV00020  000350000 HP XW9400 Workstation
      45333325223333333322445333332233333333324525533332567677676660
      800010000020100215009E60002000000350000080087940007F2B34149FEA
      HP0010 P  20100215  INV00020  000042500 HP LCD Monitor
      4533332522333333332244533333223333333332452444246667670
      800010000020100215009E600020000000425000800C340DFE94F2A
Note
  • variable-length text records, terminated by LineFeeds
  • LineFeed x'0A' after last non-blank
  • allows use of unix/linux utilities (vi,lp,more,cat,grep,etc)

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

6D1. mass change DATA/JCL/COBOL file-types & record-sizes

changing file-types & record-sizes in JCL/scripts

The Vancouver Utilities provide uvcopy jobs (jclmass1/2/3) to mass change file-types & record-sizes in all JCL/scripts, while copying them from 1 directory to a 2nd directory.

The only place file-types & record-sizes were coded in mainframe JCL is in utilities such as SORTs, IDCAMS, IEBGENERs, etc. The JCL converter has converted these to 'uvsort's & 'uvcp's. For example, here are relevant lines extracted from demo JCL/script 'jar200.ksh' (listed at VSEJCL.doc#1C2').

 ##JOB JAR220
 export PROGID=SORT
 exportfile SORTIN1 ar/sales.items
 exportfile SORTOUT $JTMP/%srtext
 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN1,rcs=64,typ=RSF,filo1=$SORTOUT,rcs=64,typ=RSF\
 ,keys=(30,6,c,a,0,6,c,a)"
 #4----------------------------------------------------------------------

If we wish to change the ar/sales.items file from fixed-length 64 byte records to text (variable-length records terminated by LineFeeds), the uvsort might be:


 uvsort "fili1=$SORTIN1,rcs=80,typ=LST,filo1=$SORTOUT,rcs=80,typ=LSTt\
 ===========================**=====***====================**=====****=

We have increased the record-size to 80 for saftey, in case somebody editing the sales file might leave trailing blanks that would cause record splitting if max length were left at 64. Option 't' on output file typ=LSTt will drop any trailing blanks by scanning back to last non-blank before inserting LineFeed.

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

6D2. changing file-types & record-sizes in JCL/scripts

procedures to mass-change JCL/scripts

Here is a plan to automatically change desired files from Fixed-Length to Text.

  1. Create a control file of all filenames (extracted from all JCL/scripts) with existing file-types & record-sizes, for example:

    ctl/ctlfile_jm3

 $JTMP/%sales.sortfile   rcs=00064 typ=RSF cnt=0001 job=jar200
 $JTMP/%srtext           rcs=00064 typ=RSF cnt=0001 job=jar220
 ar/sales.items          rcs=00064 typ=RSF cnt=0003 job=jar220
 gl/account.master       rcs=00080 typ=RSF cnt=0001 job=jgl350
 gl/account.master2      rcs=00080 typ=ISF cnt=0001 job=jgl360
 gl/account.tran1        rcs=00064 typ=RSF cnt=0001 job=jgl200
 gl/account.trans        rcs=00080 typ=RSF cnt=0001 job=jgl410
 gl/account.trans(+1)    rcs=00064 typ=RSF cnt=0001 job=jgl200
  1. Edit the control file, adding new filetype & new record-size, for example:
 $JTMP/%sales.sortfile   rcs=00064 typ=RSF cnt=0001 job=jar200
 $JTMP/%srtext           rcs=00064 typ=RSF cnt=0001 job=jar220
 ar/sales.items          rcs=00064 typ=RSF cnt=0003 job=jar220 nrcs=80  ntyp=LSTt
 gl/account.master       rcs=00080 typ=RSF cnt=0001 job=jgl350
 gl/account.master2      rcs=00080 typ=ISF cnt=0001 job=jgl360
 gl/account.tran1        rcs=00064 typ=RSF cnt=0001 job=jgl200 nrcs=80  ntyp=LSTt
 gl/account.trans        rcs=00080 typ=RSF cnt=0001 job=jgl410 nrcs=128 ntyp=LSTt
 gl/account.trans(+1)    rcs=00064 typ=RSF cnt=0001 job=jgl200 nrcs=80  ntyp=LSTt
  1. Run the mass change job (uvcopy jclmass3) to copy all JCL/scripts from 1 directory to a 2nd directory, changing file-types & record-sizes for desired files as per the control file (loaded into an Indexed file).
Note
  • the control file of all filenames initially created by 'uvcopy jclmass1'
  • sorted & duplicates dropped by 'uvcopy jclmass2'
  • loaded into an Indexed file by 'uvcopy loadctlI'
  • for use by 'uvcopy jclmass3'

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

6D3. changing file-types & record-sizes in JCL/scripts

mass-change procedures

Here are the step by step procedures, using the demo set of JCL/scripts provided in /home/uvadm/vsetest/... This demo assumes you have setup user 'vsetest' & copied all demo files from /home/uvadm/vsetest/* to /home/vsetest/ as documented at VSEJCL.htm#1P2. This demo also assumes you have converted the supplied mainframe JCLs supplied in subdir jcl0/... to scripts in jcls/...


 #0a. login vsetest --> /home/vsetest/
      =============
 #0b. cd testlibs --> /home/vsetest/testlibs/
      ===========

 #1. uvcopy jclmass1,fild1=jcls,filo2=ctl/ctlfile_jm1
     ================================================
     - 1st run jclmass1 to create control file of existing files/typ/rcs

 #2. uvcopy jclmass2,fili1=ctl/ctlfile_jm1,filo1=ctl/ctlfile_jm2
     ===========================================================
     - sort & data reduce to 1 line per 'filename rcs=... typ=...'

 #3. cp ctl/ctlfile_jm2 ctl/ctlfile_jm3
     ==================================
     - create copy for editing (so we can save original)

 #4. vi ctl/ctlfile_jm3       <-- edit/append new ntyp=... & nrcs=...
     ==================         - see samples below

 #5. uvcopy loadctlI,fili1=ctl/ctlfile_jm3,filo1=ctl/ctlfile_jm3I
     ============================================================
     - load control file to Indexed file for random lookup by filename

 #6. uvcopy jclmass3,fild1=jcls,fild2=jcls.new,fili3=ctl/ctlfile_jm3
     ===============================================================
     - run job to mass change uvsort/uvcp typ=.../rcs=... via ctlfile

 #7a. alldiff2 jcls jcls.new  <-- create differences report in tmp/...
      ======================
 #7b. vi tmp/jcls.new.dif     <-- verify changes
      ===================

 #8a. mv jcls jcls.old        <-- save old jcls/
      ================
 #8b. mv jcls.new jcls        <-- change name of new to active dir
      ================

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

6D4. changing file-types & record-sizes in JCL/scripts

verifying mass changes

Use the 'alldiff2' script to compare all files in jcls/... & jcls.new/... and capture the 'diff' report in tmp/jcls.new.dif. alldiff2 uses the unix/linux 'diff' is a fantastic tool that shows you the changed lines (old identified by '<' & new identified by '>' markers).


 #7a. alldiff2 jcls jcls.new  <-- create differences report in tmp/...
      ======================
 #7b. vi tmp/jcls.new.dif     <-- verify changes
      ===================
 36c36
 < uvsort "fili1=$SORTIN1,rcs=64,typ=RSF,filo1=$SORTOUT,rcs=64,typ=RSF\
 ---
 > uvsort "fili1=$SORTIN1,rcs=00080,typ=LSTt,filo1=$SORTOUT,rcs=64,typ=RSF\
 diff file# 11 - jcls/... vs jcls.new/jar200.ksh
 39c39
 < uvsort "fili1=$SORTIN1,rcs=64,typ=RSF,filo1=$SORTOUT,rcs=64,typ=RSF\
 ---
 > uvsort "fili1=$SORTIN1,rcs=00080,typ=LSTt,filo1=$SORTOUT,rcs=64,typ=RSF\
 diff file# 12 - jcls/... vs jcls.new/jar220.ksh
 37c37
 < uvsort "fili1=$SORTIN1,rcs=64,typ=RSF,filo1=$SORTOUT,rcs=64,typ=RSF\
 ---
 > uvsort "fili1=$SORTIN1,rcs=00080,typ=LSTt,filo1=$SORTOUT,rcs=00080,typ=LSTt\
 diff file# 15 - jcls/... vs jcls.new/jgl200.ksh
 38c38
 < uvcp "fili1=$SORTIN1,rcs=64,typ=RSF,filo1=$SORTOF1,rcs=64,typ=RSF,filo2=$SORTOF2\
 ---
 > uvcp "fili1=$SORTIN1,rcs=00080,typ=LSTt,filo1=$SORTOF1,rcs=64,typ=RSF,filo2=$SORTOF2\
 diff file# 24 - jcls/... vs jcls.new/splitsl1.ksh

4 different of 26 files compared jcls to jcls.new

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

6E1. mass change DATA/JCL/COBOL file-types & record-sizes

changing file-types in COBOL programs

The COBOL converter assumes fixed-length files (as on the mainframe) except for filenames that might indicate printer or card (SYSIN parameter) files. The converter matches the filenames in the SELECT stmnt to an internal table of keywords such as: printer, report, line, sysin, card, param, etc. Obviously not perfect & you may have to manually change after conversion.

We must change SELECT statements from default 'ORGANIZATION RECORD SEQUENTIAL' to 'ORGANIZATION LINE SEQUENTIAL' for all PRINTER files & all SYSIN parameter files for instream data in the JCL/scripts.

In addition, you may wish to change SELECTs to 'ORGANIZATION LINE SEQUENTIAL' for some other data files that you decide would be more convenient as Text files. Text files are more convenient on unix/linux systems, since they have the LineFeeds required by vi,lp,cat,more,etc.

change COBOL file types - plan/overview

  1. Run 'uvcopy cblmass11' to extract file info from all programs, creating a control file for coding desired changes

  2. Edit/Add '=L' on right of files you wished to change to ORG LINE Seqntl

  3. Run 'uvcopy cblmass12' to load control file into an Indexed file for following mass change job

  4. Run mass change 'uvcopy cblmass13' to copy all programs from the COBOL source directory to a 2nd directory while changing the indicated files.

    sample change SELECT - Before & After

          select saledtl assign external saledtl
                 organization RECORD sequential        <-- Before
                 access mode sequential.
          select saledtl assign external saledtl
                 organization LINE sequential          <-- After
                 access mode sequential.

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

6E2. changing file-types in COBOL programs

procedure to change COBOL files to OLS

The following procedure will copy all COBOL programs from 1 subdir to a 2nd subdir while changing file type from 'ORGANIZATION RECORD SEQUENTIAL' to 'ORGANIZATION LINE SEQUENTIAL' for desired files as indicated in a control file whose Indexed key is 'program-name + FDname' (external name in SELECT).

Before running these procedures on your COBOL programs, you can get familiar with these procedures using the sample COBOL programs provided. First see VSEJCL.htm#1P1 to setup userid /home/vsetest & copy supplied samples from /home/uvadm/vsetest.

Operating Instructions


 #0a. Login vsetest --> /home/vsetest
 #0b. cd testlibs   --> /home/vsetest/testlibs

 #1. cblmass11,fild1=cbls,filo2=ctl/ctlfile_cm11
     ===========================================
     - create ctl/ctlfile_cm11 (see sample report below)

 #2. uvsort "fili1=ctl/ctlfile_cm11,rcs=128,typ=LSTt\
             filo1=ctl/ctlfile_cm12,key1=0(22),del1=0(1):*"
     ======================================================
     - sort on program name 0(14) & FDname 14(8)
     - drop report headings '*' in 1st byte (could also do with vi below)

 #2a. sort -o ctl/ctlfile_cm11 ctl/ctlfile_cm12
      =========================================
      - Alternatively, could use Unix system sort & drop headings with vi

 #3. vi ctl/ctlfile_cm12   <-- edit/code '=L' bytes 35-36 on desired lines
     ===================     - see samples below

 #4. uvcopy cblmass12,fili1=ctl/ctlfile_cm12,filo1=ctl/ctlfile_cm12I
     ===============================================================
     - load Indexed file for cblmass13

 #5. uvcopy cblmass13,fild1=cbls,fild2=cbls.new,fili3=ctl/ctlfile_cm12I
     ==================================================================
     - run job to mass change to ORG LINE Seqntl via ctlfile

 #6a. alldiff2 cbls cbls.new  <-- saves diff file in tmp/cbls.new.dif
      ======================
 #6b. vi tmp/cbls.new.dif     <-- verify changes
      ===================

 #7a. mv cbls cbls.old        <-- save old cbls/
      ================
 #7b. mv cbls.new cbls        <-- change name of new to active dir
      ================

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

6E3. changing file-types in COBOL programs

sample ctlfile_cm11

 *cblmass11 COBOL File Info  Dir=cbls  2010/06/21_14:30:28
 *program-name FDname           OAML=L IO rcsz copybook.cpy  DDname  Wrts  Advs
 *         1         2         3         4         5         6         7
 *12345678901234567890123456789012345678901234567890123456789012345678901234567
 *=============================================================================
 car100.cbl    custmas          RS     I   256 custmas.cpy   custmas
 car100.cbl    nalist           L  L   O   120               nalist     2     2
 car200.cbl    custmas          IR     I   256 custmas.cpy   custmas
 car200.cbl    saledtl          RS     I    64 saledtl.cpy   saledtl
 car200.cbl    salelst          R  L   O   120 sdline.cpy    sys035     2     2
 car300.cbl    sysin1           R      I    80               sysin
 cgl100.cbl    acctmas          RS     I   128               acctmas
 cgl100.cbl    actlist          L  L   O   120               actlist    1     1
 cgl200.cbl    glmsnew          RS     O   128               glmsnew    1 *
 cgl200.cbl    glmsold          RS     I   128               glmsold
 cgl200.cbl    gltrans          RS     I    80               gltrans
 *Total programs=18, files=31, hits=22
Note
  • column 31 'L' indicates existing ORG is Line seqntl
  • column 34 'L' indicates PRINTER file (see count wrts/advs on right)
  • col 35-36 '=L' edit/add this code for change to OLS by uvcopy cblmass13

ctl/ctlfile_cm12 after edit/add '=L'

 car100.cbl    custmas          RS     I   256 custmas.cpy   custmas
 car100.cbl    nalist           L  L   O   120               nalist     2     2
 car200.cbl    custmas          IR     I   256 custmas.cpy   custmas
 car200.cbl    saledtl          RS  =L I    64 saledtl.cpy   saledtl
 car200.cbl    salelst          R  L=L O   120 sdline.cpy    sys035     2     2
 car300.cbl    sysin1           R   =L I    80               sysin
 cgl100.cbl    acctmas          RS     I   128               acctmas
 cgl100.cbl    actlist          L  L   O   120               actlist    1     1
 cgl200.cbl    glmsnew          RS     O   128               glmsnew    1 *
 cgl200.cbl    glmsold          RS     I   128               glmsold
 cgl200.cbl    gltrans          RS  =L I    80               gltrans

car200.cbl saledtl code '=L' by choice (tran type files OLS convenient) car200.cbl salelst code '=L' should be, since printer file (wrts/advs counts) car300.cbl sysin1 code '=L' should be, since SYSIN in cnvMF4 table cgl200.cbl gltrans code '=L' by choice (tran type files OLS convenient)

Note
  • ctl/ctlfile_cm12 shown after 1st 4 steps in Op. Procedures above
  • after selection from ctlfile_cm11 & after editing with '=L' cols 35-36
    on files desired to change to ORGANIZATION LINE SEQUENTIAL

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

6E4. changing file-types in COBOL programs

ctlfile_cm11 record layout

 000(14) - program-name
 014(16) - FDname
 031(01) - existing file organization (Record seqntl, Line seqntl, Indexed)
         - 'L' coded if ORG 'LINE' Seqntl on select
 032(01) - file access (Seqntl, Random, Dynamic)
 033(01) - file Mode 'V' Variable in FD, ' ' for Fixed
 034(01) - file type (Line Seqntl by Advancing)
         - 'L' coded if 'ADVANCING' found on write record for this file
 035(02) - '=L' coded manually to cause cblmass13 to change to OLS
 038(02) - opened (Input, Output, IO)
 040(01) - '*' if record contains size not= pic 01 size
 041(04) - recsz
 046(14) - copybook
 060(09) - DDname
 069(04) - count 'writes' for this file
 074(04) - count 'advances' for this file

Why mass change file-types ?

 Why change the COBOL program file SELECTs ?
 - from ORGANIZATION RECORD SEQUENTIAL
 - to   ORGANIZATION  LINE  SEQUENTIAL
 After conversion from mainframe to unix/linux
 - some sites may want to change some Fixed-Length files to Text-files
 - text files are more user friendly on unix/linux
 - since they have the LineFeeds required by vi,lp,cat,more,etc
Note
  • cblmass11,cblmass12,& cblmass13 supercede cblmass22 & cblmass23
  • cblmass11 creates ctlfile indicating if any write/advances for printer
  • ctlfile keyed on progname+FDname (vs progname+DDname)

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

6E5. changing file-types in COBOL programs

JCL Files report

We haved not yet automated the selection of the COBOL program files that need to be changed to 'ORGANIZATION LINE SEQUENTIAL' based on our earlier selection of the data files as on page '6D2' where we coded 'ntyp=LSTt' in the control file for files we want to change to Text (ORG Line Seqntl).

But the JCL Files report might will help you relate the data-file names to the COBOL program & DDnames. Run scripts 'cobfiles5A' & 'jobfiles5A' to generate xref/jclfil52a.


 #0a. Login vsetest --> /home/vsetest
 #0b. cdl --> /home/vsetest/testlibs

 #1. cobfiles5A cbls cpys maps
     =========================

 #2. jobflow5A jcl3
     ==============

 #3. vi xref/jclfil52a
     =================
 jclfil52    ** JCL report with COBOL info **   2010/06/20_10:12:37
 jobname.jcl #st  progname.cbl  DDname  genf  OAM   open recsz  copybook.cpy file
 ================================================================================
 jar200.ksh   0010 sort         sortin1
                                ar/sales.items
 jar200.ksh   0010 sort         sortout
                                $JTMP/%sales.sortfile
 jar200.ksh   0010 uvsort       fili1=rcs=64,typ=RSF        64
                                $SORTIN1
 jar200.ksh   0010 uvsort
                                ar/sales.items
 jar200.ksh   0010 uvsort       filo1=rcs=64,typ=RSF        64
                                $SORTOUT
 jar200.ksh   0010 uvsort
                                $JTMP/%sales.sortfile
 jar200.ksh   0010 uvsort       keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
 jar200.ksh   0020 car200.cbl   saledtl       SS_   I___    64  saledtl.cpy
                                $JTMP/%sales.sortfile
 jar200.ksh   0020 car200.cbl   custmas       IR_   I___   256  custmas.cpy
                                ar/customer.master.indexed
 jar200.ksh   0020 car200.cbl   sys035        S__   O___   120  sdline.cpy
                                $RPTS/salesrptEcar200${JSTEP}_01
Note
  • The JCL files report is best printed Landscape due to long lines
  • I have split the filenames from col 77+ to centre of 2nd lines
    (lined up under DDname)

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

Part_8 Converting MVS JCL to Korn shell scripts

JCL/script Review, Modifying, Writing new scripts


8A1. Quiz: profiles, env-vars, JCL/scripts, etc
8A2. stub_profile & common_profile
8A3. $RUNLIBS & $RUNDATA used by JCL/scripts
8A4. filenames defined 'RELATIVELY' from $RUNDATA
8A5. profile changes for Training, Conversion,& Production
8A6. profiles in appsadm/env/ vs uvadm/env/

8B1. Condition Codes (program status Return-Codes)
8B2. Sample JCL/script 'cgl100.ksh to demo return code testing & GDGs

8C1. write new GDG's in Temp subdirs until Normal EOJ
- forcing 'Abterm' to test GDG recovery

8D1. JCL converter inserts code to Restart JCL/scripts from any step

8E1. capturing joblogs for programmer testing/review
- captures console log for 1 job at a time for immediate review

8F1. capture all console I/O messages for entire login session
- primarily for production run error checking
- cleanup console logs (remove screen control characters)

8F2. Viewing your 'cleaned up' console log files
- processing console logs via nightly 'cron' jobs

8G1. capturing console logs from cron jobs by mail

Modifying converted JCL/scripts


8J1. Modifying converted JCL/scripts - Overview

8K1. Example #1 - change jar100.ksh to solicit the date from the operator
- vs coded on PARM=... for update prior to running the job

8L1. Example #2 - change jgl100.ksh to solicit account.master_ generation#
- vs default of the latest (highest generation#)

8L2. Ex#2 alternate solution using 'opt=c' option in GDG control file

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

JCL/script Review, Modifying, Writing new scripts (Contents cont)

writing new JCL/scripts


8N1. sortsales1 - simplest possible new script

8N2. sortsales2 - new script modified to Vancouver Utility standards
- to allow running from anywhere
- to allow running same script on different sets of DATA
(production, or test, or multiple test sets)

8N3. sortsales3 - testing condition return code from COBOL programs
and utilities (uvsort, uvcp, etc)

8N4. sorttrans4 - allowing for GDG files when jobs Abend or terminate normally
- new generations not stored on Abnormal termination
- using functions jobabend51 & jobend51

8N5. sorttrans4 - adding 2nd step to illustrate multi-step jobs
with common points at EOJ for Normal & Abnormal terminations
- also adding labels to allow restart at any step
- console log captured to illustrate restart at step 2

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

8A1. MVS JCL Conversion to Korn shell scripts

Quiz: profiles, env-vars, JCL/scripts, etc

Part 10 is intended to test your understanding of profiles, environmental- variables, JCL/scripts, etc - things you need to know to work effectively with the converted JCL/scripts.

 UV Software provides profiles with the Vancouver Utilties package. After
 install, they may be found in /home/uvadm/env/... The simplest is 'utilities-
 profile' for users who are NOT performing mainframe conversions.
 For mainframe conversions the profile is split into 2 parts
 - stub_profile,& common_profile.

To install, you copy either the 'utilities_profile' or the 'stub_profile' to your homedir, renaming as '.profile' or as 'bash_profile'.

  1. What determines naming to '.profile' or 'bash_profile' ?

  2. What else must you do before the new profile is activated ?

Assuming mainframe conversions, the stub_profile (renamed .profile or .bash_profile) calls the 'common_profile' via the 'source' command or '.', for example:


      . /home/uvadm/env/common_profile
      ================================
  1. Why must the stub_profile call the common_profile via '.' (or 'source') ?

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

8A2. Quiz: profiles, env-vars, JCL/scripts, etc

stub_profile,& common_profile

The profiles defines many environmental-variables. What is an environmental- variable ? Some important env-vars for mainframe conversions are TESTLIBS, TESTDATA, PRODLIBS, PRODDATA, RUNLIBS,& RUNDATA. The common_defines provided defines these as follows: (may be modified for your site depending on the file systems setup by your system administrator).

      export TESTLIBS=/p1/testlibs  <-- defs in /home/uvadm/env/common_defines
      export TESTDATA=/p1/testdata
      export PRODLIBS=/p2/prodlibs
      export PRODDATA=/p2/proddata

The 'stub_profile' defines 'RUNLIBS' & 'RUNDATA' as follows:

      export RUNLIBS=/p1/testlibs   <-- for programmers
      export RUNDATA=/p1/testdata
          - - - OR - - -
      export RUNLIBS=/p2/testlibs   <-- for operators
      export RUNDATA=/p2/testdata

The 'common_profile' uses $RUNLIBS & $RUNDATA to define other items, example:

      export PATH=$PATH:$RUNLIBS/jcls

 #04. What are some other items defined using $RUNLIBS & $RUNDATA ?
      (You could use 'vi' to /search common_profile for /RUNLIBS & /RUNDATA)
  1. What are the advantages of this 3 part profile system ?

  2. What advantages to sysadmin who maintains the common_profile ?

  3. What advantages to the programmer who maintains his stub_profile ?

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

8A3. Quiz: profiles, env-vars, JCL/scripts, etc

$RUNLIBS/$RUNDATA used by JCL/scripts

By now you probably understand that the converted JCL/scripts use $RUNDATA to address either TESTDATA or PRODDATA & $RUNLIBS to address TESTLIBS or PRODLIBS.


 #10. But why do we not see $RUNDATA/$RUNLIBS in converted JCL/scripts ?
      (For example see jar100.ksh listed at '1C2')

The COBOL program (car100.cbl) is called by JCL/script jar100.ksh as follows:


      cobrun $ANIM $RLX/car100
      ========================
  1. What are cobrun, ANIM,& RLX ?

  2. Where are ANIM & RLX defined ?

I will give you the answer - they are defined in function 'jobset51', which is called on line#10 of all converted JCL/scripts (sample jar100.ksh at '1C2').


 jobset51  # call function for JCL/script initialization <-- line 10 JCL/scripts
 =======================================================

And line 56 of jobset51 (full listing on '5K1' or extract on '1C5') is:


 export RLX=$RUNLIBS/cblx   # path for loading COBOL programs (line 56 jobset51)
 ========================
  1. How does this definition of RLX allow for programmers to execute programs from TESTLIBS & operators to execute programs from PRODLIBS ?

On our system JCL/scripts are found via $PATH, but COBOL programs are executed explicitly from $RLX/... (or RUNLIBS/cblx/...).

  1. What is the advantage of this ?

Data files are defined prior to the COBOL execution, for example:


      exportfile CUSTMAS ar/customer.master
      =====================================

'CUSTMAS' is the LOGICAL filename coded in the COBOL program to access the PHYSICAL filename (ar/customer.master.


 #15. What COBOL statement relates the logical filename to the physical filename?
      (see sample COBOL program listed at MVSCOBOL.htm#2D2)

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

8A4. Quiz: profiles, env-vars, JCL/scripts, etc

filenames defined 'RELATIVE' to $RUNDATA

Note that 'ar/customer.master' is a 'relative' filename (no leading /). This means the working directory must be above subdir ar/. Somewhere there must be a 'cd $RUNDATA', but we do not see it in the JCL/scripts (see sample jar100.ksh listed on page '1C2').

  1. Where is the 'cd $RUNDATA' ?

'exportfile' is a 'function'.

  1. What is a function ?

  2. Where is the function code stored ?

  3. How does the script know where to find it ?

We could have defined the file with the unix 'export' command as follows:


      export CUSTMAS=ar/customer.master
      =================================
  1. Why does the 'export' command use '=' between logical & physical names, but our 'exportfile' fucntion uses a ' ' space ?

  2. Why do we use the 'exportfile' function (vs the 'export' command) ?

For GDG generation files, we would use 'exportgen0' to get the current generation & 'exportgen1' to determine the name of the next generation.

For example, see jgl100.ksh listed on page '8B2' (lines 28 & 29):


      exportgen0 ACCTMAS gl/account.master_
      =====================================
      exportgen1 ACTLIST $JGDG/gl/account.acntlist_
      =============================================

As you can see our filenaming convention for GDG files is the trailing '_'. The generation# follows the '_' on the actual filenames in data directories. (see examples at '5B1')

  1. What would the actual filename be for generation #1 ?

  2. What other 'exportgen_' functions are available & what do they do ?

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

8A5. Quiz: profiles, env-vars, JCL/scripts, etc

profile changes for Training, Conversion,& Production

common_defines suggests that TESTLIBS/TESTDATA or RUNLIBS/RUNDATA might be:

        --- in common_defines ---
      export RUNLIBS=/p1/testlibs     <-- directory design suggested
      export RUNDATA=/p1/testdata
        --- in stub_profile ---
      export RUNLIBS=$HOME/testlibs   <-- for programmer training
      export RUNDATA=$HOME/testdata
Note
  • the '$HOME/...' definitions in the stub_profiles are intended ONLY for
    the initial conversion training period.
  • they would be removed before the conversion team begins the actual
    conversion testing & debugging.
  1. What are the advantages of the '$HOME' definitions for initial training ?

  2. Why must they be changed before the conversion team begins testing & debugging ?

  3. Do you see any reason why programmers might want to use '$HOME/testdata' after the actual conversion has begun or after production has begun ?

  4. Why might system administrators remove write permissions on the stub_profiles of operators ? of programmers ?

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

8A6. Quiz: profiles, env-vars, JCL/scripts, etc

profiles in appsadm/env/ vs uvadm/env/

The profiles are supplied in /home/uvadm/env/... and the stub_profile sources ('.' executes) the common_profile as follows:


      . /home/uvadm/env/common_profile
      ================================

ADMjobs.htm#1D1 - 1D7 recommends setting up user 'appsadm', & copying /home/uvadm/env/* to /home/appsadm/env/..., & change the source executions to:


      . /home/appsadm/env/common_profile
      ==================================
  1. What is the advantage of the above procedure ?

Note that we do supply an alternate version called 'stub_profile_appsadm' for you to copy from /home/uvadm/env/ to /home/appsadm/env/. See listing at ADMjobs.htm#1C8. It has the changes shown above.

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

8B1. Quiz: profiles, env-vars, JCL/scripts, etc

Condition Codes (program status Return-Codes)

On the mainframe, serious errors in program executions were detected automatically, and the job would be 'Terminated Abnormally'.

On Unix/Linux, the scripts must test the return code from the programs and take appropriate action. Our JCL converter inserts code to test the return code, and 'goto' a common 'Terminated Abnormally' errmsg at the end of the script.

sample JCL/script for COBOL with cc test

For illustratation, see JCL/script 'cgl100.ksh' listed on the next page. We have sequence numbered the lines, so we can refer to items by line# in the following questions. We have omitted some non-relevant lines.

  1. Why do we capture the return code '$?' (see line #37) in variable LCC ?

  2. Why do we also capture it in S0010C, SCC,& JCC ?

You can see from 'if ((S0010C != 0))' that if the return code is anything other than zero, we will 'goto' the 'Terminated Abnormally' end point.

  1. Did the mainframe terminate jobs for all non-zero condition codes ?

  2. How would you change the above code if 'cgl100' should be allowed to return codes < 12 ?

  3. Do you understand how the 'goto' (line #41) works ?

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

8B2. Quiz: profiles, env-vars, JCL/scripts, etc

sample JCL/script, demo return-codes, GDGs, etc

 k#01 #!/bin/ksh
 k#02 ##JGL100   JOB  'LIST GL MASTER CHART OF ACCOUNTS'
 k#03 export JOBID2=JGL100; scriptpath="$0"; args="$*"
 k#04 if [[ -z "$JOBID1" ]]; then JOBID1=JGL100; fi; export JGL100
 k#05 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#06 integer JCC=0 SCC=0 LCC=0  # init step status return codes
 k#07 autoload jobset51 jobset52 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
 k#08 autoload exportfile exportgen0 exportgen1 exportgenx exportgenall
 k#10 jobset51  # call function for JCL/script initialization
 k#11 goto
 k#12 S0000=A
 k#17 ##STEPA    EXEC PGL100,HLQ=GL,YEAREND=2003               #<-- PROC1 exp
 k#18 HLQ="GL";YEAREND="2003";
 k#20 #1======================= begin step#S0010 CGL100 ========================
 k#21 S0010=A
 k#22 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#23 logmsg2 "******** Begin Step $JSTEP cgl100 (#$XSTEP) ********"
 k#24 stepctl51  # test oprtr jcpause/jcclear
 k#25 ##STEP010  EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND
 k#26 export PROGID=cgl100
 k#27 export PARM="$YEAREND"
 k#28 exportgen0 ACCTMAS gl/account.master_
 k#29 exportgen1 ACTLIST $JGDG/gl/account.acntlist_
 k#30 #exportgen1 $JGDG/subdir/temp-file, moved to outdir at Normal EOJ
 k#31 exportfile SYSOUT $SYOT/${JSTEP}_SYSOUT
 k#33 logmsg2 "Executing--> cobrun $ANIM $RLX/cgl100"
 k#34 #3----------------------------------------------------------------------
 k#35 cobrun $ANIM $RLX/cgl100
 k#36 #4----------------------------------------------------------------------
 k#37 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 k#38 if ((S0010C != 0))
 k#39    then logmsg2 "ERR: step#$JSTEP cgl100 abterm $SCC"
 k#40    alias goto="<<S9900=A"; fi
 k#41 goto
 k#42 #8======================================================================
 k#43 S9000=A
 k#44 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs
 k#45 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 k#46 exit 0 #jclunix51 ver:20091118 b2c0d1e2f3g1i1j0k3l20m4n3o0p0r0s0t1u1w0x0y1
 k#47 #9======================================================================
 k#48 S9900=A
 k#49 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
 k#50 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
 k#51 exit $JCC

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

8C1. Quiz: profiles, env-vars, JCL/scripts, etc

new GDG's in Temp subdirs until Normal EOJ

On the mainframe, new generations were not updated until the job Terminated Normally, which meant you could just fix the problem & rerun the job, without having to remove the new generations.

Our converted JCL/scripts provide this functionality by writing new GDG's to a temporary subdir (see $JGDG/gl/account.acntlist_ above). At normal EOJ, function 'jobend51' will move the temp files to the appropriate output subdir. The code lines (in our sample job jgl100.ksh) involved in GDG file handling listed below. See more explanations at '5D1' & '5D2'.

      k#10 jobset51   # call function for JCL/script initialization
      k#29 exportgen1 ACTLIST $JGDG/gl/account.acntlist_
      k#44 jobend51   #move GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs
      k#50 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
  1. Can you explain the role each of these lines play in GDG file handling ?

    Forcing 'Abterm' to test GDG recovery

When I was debugging the GDG file handling, I forced step failures to test recoveries/reruns.

  1. Looking at the jgl100.ksh job (listed on the previous page), can you suggest 2 ways to force the job to fail (give line#s & describe changes).

  2. How could you force the job to fail without changing any code in jgl100.ksh?

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

8D1. Quiz: profiles, env-vars, JCL/scripts, etc

Restart JCL/script from any step

The JCL converter inserts code to allow the JCL/scripts to be restarted from any step. A step#/code is inserted at the begining of each step, for example here are relevant lines extracted from jar200.ksh (listed on page '1D2'.

 k#02 ##JAR200   JOB  'TEST/DEMO MVS JCL CONVERT'
 k#03 export JOBID2=JAR200; scriptpath="$0"; args="$*"
 k#04 if [[ -z "$JOBID1" ]]; then JOBID1=JAR200; fi; export JAR200
 k#05 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 k#10 jobset51  # call function for JCL/script initialization
 k#11 goto      <-- where does this goto ?
 k#12 S0000=A
 k#15 S0010=A
               - - - step 1 details - - -
 k#42 S0020=A
               - - - step 2 details - - -
 k#64 S9000=A
               - - - Normal Termination - - -
 k#69 S9900=A
               - - - Abnormal Termination - - -

Restart command


 jar200.ksh step=S0020        <-- restart jar200.ksh at step#2
 =====================

It is not readily apparent what makes restart from any step possible. The secret is found in 'jobset51'. See listing on pages '1C5' & '1C6'. The 2 most important lines are 214 & 217:


 js#214 if [[ -z "$STEP" ]]; then export STEP=S0000; fi
        ===============================================
 js#217 alias goto="<<${STEP}=A"
        ========================

Line 217 sets up alias 'goto' with the step code entered on the command line & the 'goto' is executed on line k#11 of the JCL/script (see jar200.ksh above).

  1. Why can we enter 'step=...' in lower case, when the code tests $STEP in UPPER case ?

  2. Unix/linux scripts do not have a real 'goto' command. How does our goto='<<${STEP}=A' work ?

  3. What is the significance of the '<<' ?

  4. What is the reason for the '=A' ? Why not just goto='<<$STEP' ?

  5. Why are lines 3 & 5 required for Restart to work ? (see k#03 & k#05 in JCL/script jar200.ksh above, or jgl100.ksh on '8B2')

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

8E1. Quiz: profiles, env-vars, JCL/scripts, etc

joblogs for programmer testing

The 'joblog' scripts allow programmers to run JCL/scripts and capture console messages in a file for reviewing. The script captures the logs into subdir joblog/... in your current working directory.

For example, you could run demo JCL/script jar100.ksh & capture the log into $RUNLIBS/joblog/jar100.log as follows:


 #1. login as yourself --> your homedir
 #2. cdl --> alias cdl='cd $RUNLIBS' (might be /home/userxx/testlibs/.)o

 #3. jar100.ksh   <-- run directly, shows log on screen only
     ==========

 #3a. joblog1 jar100.ksh   <-- run via joblog1 script
      ==================     - to capture log in a file
                               $RUNLIBS/joblog/jar100.log

 #4. more joblog/jar100.log  <-- display the log file
     ======================
 080827:155517:JAR100: Begin Job=JAR100
 080827:155517:JAR100: /home/mvstest/testlibs/jcls/jar100.ksh
 080827:155517:JAR100: RUNLIBS=/home/mvstest/testlibs
 080827:155517:JAR100: RUNDATA=/home/mvstest/testdata
 080827:155517:JAR100: Begin Step S0010 car100 (#1)
 080827:155517:JAR100: file: CUSTMAS=ar/customer.master bytes=8192
 080827:155517:JAR100: file: NALIST=ar/customer.nameadrs.list100 bytes=2858
 080827:155517:JAR100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
  1. How does the joblog1 script capture logs into a file, while also showing them on the screen ?

 #42a. vi $UV/sf/IBM/joblog1  <-- examine script to answer question above
       =====================

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

8F1. Quiz: profiles, env-vars, JCL/scripts, etc

Console Logging

The console logging system (documented at ADMjobs.htm#Part_6) captures all console outputs & inputs into a date/time stamped file that can be saved for a month or more.

Console logging is activated by uncommenting 7 '##' lines at the end of the stub_profile provided (see ADMjobs.htm#1C1). The 2 most important lines are:

      ## logfixA $LOGNAME
      ## exec script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)

'script' is the unix/linux utility to capture subsequent console I/O (until you logoff) into a file. For example, if your userid is 'john', the filename on Dec 4/2009 at 1:33 would be '/home/appsadm/log1/john/091204_133300'

As well as uncommenting the 7 ## lines at the end of your profile, you must also setup subdirs matching your userid in /home/appsadm/log1,log2,log3.

      mkdir /home/appsadm/log1/john  <-- current logfile being created
      mkdir /home/appsadm/log2/john  <-- cleaned up logfiles for current month
      mkdir /home/appsadm/log3/john  <-- last month's logfiles
  1. What other action is required to begin logging ? - after setting up subdirs matching your userid & uncommenting 7 ## lines

  2. How might you examine your logfiles ?

    cleaning up the log files

Console logs collected in /home/appsadm/log1/... are difficult to examine with 'vi' because they contain many 'screen control characters'. We provide script 'logfixA' to remove the screen control characters (cleanup) while copying the log files from $APPSADM/log1/$LOGNAME/... to $APPSADM/log2/$LOGNAME/... You could run the logfixA cleanup script as follows:


 #1. exit     <-- log off to write out your last script buffer
 #2. Login    <-- log back in
 #3. logfixA  <-- run script to cleanup/copy log1/... to log2/...
 #4. vi /home/appsadm/log2/john/*  <-- examine your cleaned up logs

Actually, you do NOT have to run 'logfixA' explicitly, because your profile runs it for you when you log back in (1 of the 7 ## lines at end profile). And of course logging back in then executes the 'script' command to start collecting your next log file into log1/...

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

8F2. Quiz: profiles, env-vars, JCL/scripts, etc

Viewing your console log files

You might list & view your cleaned up log files as follows (if you are John):


 #1. l /home/appsadm/log2/john/   <-- list logfiles for current month
       091201_093000    <-- log file started on Dec 1/2009 at 9:30 AM
       091202_101500    <-- log file started on Dec 2/2009 at 10:15 AM
       091203_144500    <-- log file started on Dec 3/2009 at 2:45 PM

 #2. vi /home/appsadm/log2/john/091203_144500  <-- view latest logfile

BUT, we provide a more convenient 'logview' script, which lists the logfiles & prompts you to enter a file# to view (vs having to enter the filename).


 #3. logview      <-- shows log2/... files for current user
     =======        - then prompts for # of logfile to view
       03. 091201_093000
       02. 091202_101500
       01. 091203_144500   <-- most recent file last as #01

 #3a. 1           <-- reply '1' to see the latest log file
      ===
 #3b. 1 -d        <-- print latest log file on default printer
      ====
 #3c. 1 -dlp0     <-- print latest log file on printer 'lp0'
      =======

processing logfiles by nightly cron jobs

All users should log off at the end of their shift to ensure the last buffer of their 'script command' is written out.

But, in case users forget to logout, we provide scripts & sample crontab files:

killuser2
crontab_root
  • sample crontab to schedule killuser2 (see ADMjobs.htm#5F2)
  • must be owned by root to kill other users
crontab_appsadm
  • sample crontab to schedule 'nightly1' & 'logfixN'
nightly1
  • sample script to call various nightly processing jobs/scripts
  • listed at ADMjobs.htm#5C1, runs 'logfixN'
logfixN
  • copy/cleanup all logfiles from $APPSADM/log1/*/* to log2/.../...
  • listed at ADMjobs.htm#6S4
Note
  • Each morning 'appsadm' should check the results of nightly cron jobs
  1. How would 'appsadm' check results of nightly cron jobs ?
  2. How might he print the prior day's log file for operator 'john'
  3. How might he search for any errors in yestrday's log files ?

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

8G1. Quiz: profiles, env-vars, JCL/scripts, etc

capturing logs from cron jobs by mail

The pages above reviewed procedures to capture console logs from JCL/scripts run by logged-in operators (from their command line shell prompts). See complete documentation at ADMjobs.htm#5A1 - 5H1.

BUT, the above method of cpaturing console logs does NOT work for JCL/scripts scheduled by cron (nightly batch jobs). It does not work because their is NO logged-in user to execute the 'script' command (at end of profile) to collect the console messages into a file.

However, cron jobs DO mail console msgs to the owner of the crontab file that scheduled the JCL/scripts. We setup 'appsadm' to own & issue the crontab comamnds. Each morning 'appsadm' could read his mail to see if there were any errors in last night's cron jobs.

BUT, it might be nicer if we could caapture the mail from nightly cron jobs into date/time stamped files (similar to the log files captured from logged- in operators). ADMjobs.htm#5I1 - 5K7 documents how we can do this. Here are some of the subdirs & files used in /home/appsadm/...

 /home/appsadm
 :-----cronlog1     <-- 1 line status msgs (optional)
 :     :-----090423_174201_cronscript1
 :     :-----
 :-----cronlog2     <-- console logs captured by mail from cron
 :     :-----090423_174301_cronscript1
 :     :-----
 :-----env          <-- profiles called by cronscript1
 :     :-----stub_profile_appsadm_cronlogdemo
 :     :-----common_profile
 :-----sf           <-- crontabs & scripts for demo & production models
 :     :-----cronscript1
 :     :-----cronmailsave1
 :     :-----crontab2
  1. Why can we NOT capture console logs from cron jobs using the same method (script command at end profile) as we do for logged-in operators ?

  2. How do we capture mail from cron jobs into date/time stamped files ?

See 'cronscript1' listed at ADMjobs.htm#5K3 & note it executes the profile on line 99 as follows:


 . $APPSADM/env/stub_profile_appsadm_cronlogdemo
 ===============================================
 - special version of stub_profile listed at ADMjobs.htm#5K6
  1. Why must cronscript1 '.' execute the stub_profile ? Why must the stub_profile be executed prior to executing any JCL/script (such as jgl100.ksh).

  2. Why did we need a special version of the stub_profile ? How is stub_profile_appsadm_cronlogdemo different from the normal stub_profile ?

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

8J1. Converting MVS JCL to Korn shell scripts

modifying JCL/scripts - Overview

After the initial conversion, you will probably need to & want to modify the JCL/scripts for many reasons, such as:

  1. Improve/clarify messages to operators

  2. Change embedded data (dates,rates,etc) to prompts for operator entries, or the reverse if scripts are run by cron.

  3. Change embedded data or operator prompts to separate parameter file, that can be updated with a unix editor or windows/wordpad networked using Samba.

  4. Integrate new software packages available on open systems unix/linux. This is the huge advantage that converting the JCL to Korn shell scripts has over JCL emulation offered by some vendors.

    Writing new JCL/scripts

Pages '8N1' - '8N6' are a tutorial on writing new scripts to conform to the Vancouver Utility standards established by the mainframe JCL to Korn shell script converter.

We present 5 scripts from the simplest sortsales1 (non-conforming) thru the fully conforming sorttrans5. Each script adds 1 or 2 conforming features to help you understand their importance.

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

8K1. modifying JCL/scripts - Examples

Ex#1 - prompting operator for PARM info

The 1st example will be based on JCL/script 'jar120.ksh' very similar to jar100.ksh listed on page '1C2' (used in part 1 to demo the JCL conversion to Korn shell scripts).

Problem
  • jar120.ksh passes the report date to the COBOL program car120.cbl
    via PARM="July 31, 2006". On the mainframe this was on the EXEC.
    On unix/linux this is converted to an environmental variable 'PARM'
    & the COBOL program is converted to 'ACCEPT' it's value.

 export PARM="July 31, 2009"   <-- see line #22 in jar120.ksh
 ===========================     - similar to line #22 jar100.ksh page '1C2'
Required
  • add code to jar120.ksh to solicit the report date from the operator.
  • use 'until do ... done' loop to force operator to enter something.
      rptdate=" "
      until [[ "$rptdate" > " " ]]
         do echo "enter report date (ex: January 31, 2009)"
            read rptdate
         done
      export PARM=$rptdate

edit & test

Assuming you have setup testlibs & testdata in your homedir as instructed on page '1P3' and performed the demo conversions on the following pages, then you can edit & test this modification as follows:


 #1. Login as yourself --> /home/yourhomedir
     =================

 #2. cdl (alias cdl='cd $RUNLIBS') --> /home/yourhomedir/testlibs
     ===

 #3. cp jcls/jar120.ksh sf/jar121.ksh  <-- copy/rename (do not change original)
     ================================    - to 'sf' subdir also in PATH

 #4. vi sf/jar121.ksh                  <-- edit demo JCL/script
     ================                    - change/insert code shown above

 #5. cdd (alias cdl='cd $RUNDATA') --> /home/yourhomedir/testdata
     ===

 #6. jar121.ksh   <-- execute modified script, enter report date when prompted
     ==========     - try blank to test 'until' logic

 #7. head ar/customer.nameadrs.list120 <-- display report
     =================================   - verify entered date in report headings
                                         - similar report listed on page '1T3'

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

8L1. modifying JCL/scripts - Examples

Ex#2 - solicitating desired GDG generation#

The 2nd example is based on JCL/script 'jgl100.ksh' on '8B2' which demonstrates GDG files (see jgl100.ksh listed on page '1E3'). jgl100.ksh reads the latest generation of gl/account.master_ & writes the report to the next generation of gl/account.master.list_ Here are the relevant subdirs/files for this exercise:

 /home/yourhomedir
 :-----testlibs            <-- super directory for test libs subdirs
 :     :-----cblx          <-- executable (compiled) COBOL programs
 :     :-----jcls          <-- JCLs converted to Korn shell scripts
 :     :-----sfun          <-- Korn shell common functions called by scripts
 :-----testdata            <-- super directory for test/data subdirs & files
 :     :-----gl            <-- subdir for gl/... files
 :     :     :--O--account.acntlist_000001 <-- report created by jgl100.ksh
 :     :     :--I--account.master_000001
 :     :     :--I--account.master_000002
 :     :     :--I--account.master_000003   <-- latest generation of account.master
Required
  • modify jgl100.ksh to prompt the operator for the generation desired
    (to allow listing prior month's account.master).

Here is line 29 of jgl100.ksh ('1E3') using function 'exportgen0' to determine the latest generation of the account.master_ GDG file.


 exportgen0 ACCTMAS gl/account.master_
 =====================================

One solution would replace this with the following:

 gen=000000
 until [[ "$gen" > 000000 ]]
    do echo "enter desired generation (6 digits) for gl/account.master_"
       read gen
    done
 exportfile ACCTMAS gl/account.master_$gen

notes

  1. Use function 'exportfile' when the generation# is coded (via '$gen' here), since 'exportgen0' demands GDG filenames end with '_' & it would automatically determine the latest generation.

  2. You can make the change shown above using operating instructions similar to those given for exercise #1 on the previous page. Test & Debug.

  3. The solution above has a flaw - the gen# specified by the oeperator might not exist & the job would fail.
Required
  • change the 'until' line to test for the existence of the generation#
    specified by the operator. Test & debug.
  • Hint: you can use the '-f' Korn shell test option

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

8L2. modifying JCL/scripts - Examples

Ex#2 alternate - get GDG# via 'opt=c' option

Here is an alternate solution to the previous page exercise. The GDG control file (ctl/gdgctl51) allows options to prompt for the generation# desired (null entry defaults to the highest generation).

sample ctl/gdgctl51

 # gdgctl51 - GDG control file
 #          - distributed in /home/uvadm/mvstest/testdata/ctl/gdgctl51
 # - loaded by 'gdgload1' to test GDG files (jgl100.ksh, jgl220.ksh)
 # - see MVSJCL.doc pages 5D1-5D9 & 5E1-5E11
 # - distributed with test/demo files (gl/account.master_, etc)
 # - user must code his data filenames with desired generations gdg=...
 gl/account.acntlist_   gdg=08
 gl/account.master_     gdg=10
 gl/account.trans_      gdg=18
 py/payroll.master_     gdg=20 next=000002(000002:000002)070630:235959
 py/time.cards_         gdg=30 opt=c next=000001(000001:000012)000000:000000

Above is the test/demo GDG control file supplied with Vancouver Utilities. 'opt=c' (on py/time.cards_) is the option to prompt for generation#. You could add it to gl/account.master_ & rerun as follows:


 #1. Login as yourself --> /home/yourhomedir
     =================

 #2. cdd (alias cdl='cd $RUNDATA') --> /home/yourhomedir/testdata
     ===

 #3. vi ctl/gdgctl51   <-- edit GDG control file
     ===============     - add 'opt=c' to gl/account.master_ as shown below:

      gl/account.master_     gdg=10 opt=c
      ===================================

 #4. uvcopy gdgload51  <-- reload Indexed control file ctl/gdgctl51I.dat & .idx
     ================

 #5. jgl100.ksh   <-- execute original script
     ==========     - enter 1 of the valid generation#s
                    - try null entry to test default highest gen

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

8N1. Converting MVS JCL to Korn shell scripts

Writing new JCL/scripts

As a starting point consider the following script to sort ar/sales.items by product#. We made this script by extracting the 'uvsort' lines from demo JCL/script jar200.ksh (listed on page '1D2'). See the ar/sales.items file listed on page '1T4'.

stage#1 - simplest possible new script

 #!/bin/ksh
 # sortsales1 - sort sales.items file by prod#, cust#, drop slsmn 65,85
 #         - writing new scripts tutorial stage#1 (see MVSJCL.doc#8N1)
 #         - simplest possible, must be located above I/O subdirs ar & tmp
 uvsort "fili1=ar/sales.items,typ=RSF,rcs=64,filo1=tmp/sales.items_sorted\
 ,typ=RST,rcs=64,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
 exit 0

These scripts are supplied in /home/uvadm/mvstest/testlibs/sf/... If you have followed the instructions on page '1P3' they will now be in /home/yourhomedir/testlibs/sf/... You can run the 1st one as follows:


 #1. Login as yourself --> /home/yourhomedir
     =================

 #2. cdl (alias cdl='cd $RUNLIBS') --> /home/yourhomedir/testlibs
     ===

 #3. vi sf/sortsales1   <-- inspect script (should be same as listed above)
     ================

 #4. cdd (alias cdl='cd $RUNDATA') --> /home/yourhomedir/testdata
     ===

 #5. sortsales1   <-- execute script
     ==========

 #6. uvhd ar/sales.items r64     <-- inspect Input file
     =======================       - need uvhd since no LineFeeds
                                   - see listings on page '1T4'

 #7. cat tmp/sales.items_sorted  <-- inspect output file
     ==========================    - can use cat since output typ=RST
                                   - note in sequence by product# bytes 30-35

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

8N2. Writing new JCL/scripts

sortsales2 - stage2 enhancements

 #!/bin/ksh
 # sortsales2 - sort sales.items file by prod#, cust#, drop slsmn 65,85
 #         - writing new scripts tutorial stage#2 (see MVSJCL.doc#8N2)
 #         - add jobset51 to allow run from anywhere using $RUNLIBS/$RUNDATA
 #           to allow use in PRODuction or TEST or multi testdata for prgrmrs
 #         - define files using 'exportfile' to echo filenames to console log
 export JOBID2=sortsales2     # $JOBID2 used by jobset51 for jobtmp subdir
 autoload jobset51 exportfile # declare functions used in this script
 jobset51                     # call function to setup job environment
 exportfile SORTIN ar/sales.items
 exportfile SORTOUT $JTMP/sales.items_sorted
 uvsort "fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT\
 ,typ=RST,rcs=64,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
 exit 0

notes re stage2 enhancements

  1. We added function 'jobset51' at the begining of the script. 'jobset51' (listed at '5K1') performs many job setup functions, most important are:
  1. We use function 'exportfile' to define the filenames as $SYMBOLs on the uvsort command. The exportfile function will echo the filenames into the console log.

  2. Scripts using GDG files would define filenames using exportgen0/exportgen1 which are essential to determine the current & next generation of the files (see later script 'sorttrans4').

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

8N3. Writing new JCL/scripts

sortsales3 - stage3 enhancements

 #!/bin/ksh
 # sortsales3 - sort sales.items file by prod#, cust#, drop slsmn 65,85
 #         - writing new scripts tutorial stage#3 (see MVSJCL.doc#8N3)
 #         - enhancements over sortsales2
 #         - added condition code testing & terminated Normally/Abnormally msgs
 export JOBID2=sortsales3     # $JOBID2 used by jobset51 for jobtmp subdir
 autoload jobset51 exportfile logmsg1 logmsg2 # declare functions in this script
 jobset51                     # call function to setup job environment
 exportfile SORTIN ar/sales.items
 exportfile SORTOUT $JTMP/sales.items_sorted
 uvsort "fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT\
 ,typ=RST,rcs=64,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
 LCC=$?               # capture uvsort return code status
 if ((LCC != 0))
    then logmsg2 "ERR - Terminated Abnormally code=$LCC"
         exit $LCC; fi
 logmsg1 "Terminated Normally"
 exit 0

notes re stage3 enhancements

  1. We have added code to test the return code from uvsort to see if successful and if not we generate an error message. Multi step jobs would terminate as illustrated by later job sorttrans5.

  2. Note that the script 'exit's with 0 for success or non-zero for failure. So if this job were called by another job, the calling job could determine if this job was successful or not.

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

8N4. Writing new JCL/scripts

sorttrans4 - stage4 enhancements

 #!/bin/ksh
 # sorttrans4 - sort account.trans_ file by account#
 #         - writing new scripts tutorial stage#4 (see MVSJCL.doc#8N4)
 #         - changes from stage#3 (sortsales3)
 #         - change input from ar/sales.items to gl/account.trans_ (GDG file)
 #         - change exportfile to exportgen0/exportgen1 for GDG files
 #         - add functions jobend51/jobabend51 to inhibit new GDGs on Abterms
 export JOBID2=sorttrans4     # $JOBID2 used by jobset51 for jobtmp subdir
 autoload jobset51 exportfile logmsg1 logmsg2 jobend51 jobabend51
 jobset51                     # call function to setup job environment
 exportgen0 SORTIN gl/account.trans_
 exportgen1 SORTOUT gl/account.trans_
 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RST,keys=(0,8,c,a)"
 LCC=$?               # capture uvsort return code status
 if ((LCC != 0))
    then logmsg2 "ERR - Terminated Abnormally code=$LCC"
         jobabend51   # show new GDG files NOT moved to output subdir
         exit $LCC; fi
 jobend51             # show new GDG files MOVED to output subdir (Normal EOJ)
 logmsg1 "Terminated Normally"
 exit 0

notes re stage4 enhancements

  1. This script illustrates GDG files. GDG files are defined using 'exportgen0' for the current generation & 'exportgen1' for the next generation.

  2. We declared functions 'jobend51' & 'jobabend51' on the autoload line.

  3. Note that 'exportgen1' creates new generations in $JTMP. At the end of the job, the new genertions are moved back to the intended output subdir by 'jobend51' which is executed ONLY if all steps are successful.

  4. If any steps fail, 'jobabend51' will warn the operator & list the new generations NOT moved back to the intended output subdir.

  5. This allows the operator to simply rerun the job from the begining (after correcting the problem).

  6. Alternatively he could restart the job at the point of failure and use the option (by jobset51 at begining of the rerun) to move the new generations back to the intended subdir.

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

8N5. Writing new JCL/scripts

sorttrans5 - stage5 enhancements

 #!/bin/ksh
 # sorttrans5 - sort account.trans_ file by account#
 #         - writing new scripts tutorial stage#5 (see MVSJCL.doc#8N5)
 #         - changes from stage#4 (sorttrans4)
 #         - add 2nd step to calculate transaction total $amount
 #         - add common points for Terminated Normally & Abnormally
 #         - insert step# codes S0000,S0010,S0020 to allow restart at any step
 export JOBID2=sorttrans5; args="$*"   # $JOBID2 & args used by jobset51
 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
 autoload jobset51 exportfile logmsg1 logmsg2 jobend51 jobabend51
 jobset51                     # call function to setup job environment
 goto
 S0000=A
 S0010=A
 exportgen0 SORTIN gl/account.trans_
 exportgen1 SORTOUT gl/account.trans_
 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RST,keys=(0,8,c,a)"
 #4----------------------------------------------------------------------
 LCC=$?; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 if ((SCC != 0))
    then logmsg2 "ERR - Step Abterm code=$SCC"
    alias goto="<<S9900=A"; fi
 goto
 #
 S0020=A
 exportgen0 GLTRAN gl/account.trans_
 exportfile GLSUM tmp/account.trans_sum
 #3----------------------------------------------------------------------
 uvcopy addup1,fili1=$GLTRAN,filo1=$GLSUM,uop=q0b40c10
 #4----------------------------------------------------------------------
 LCC=$?; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
 if ((SCC != 0))
    then logmsg2 "ERR - Step Abterm code=$SCC"
    alias goto="<<S9900=A"; fi
 goto
 #8======================================================================
 S9000=A
 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs
 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
 exit 0
 #9======================================================================
 S9900=A
 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
 exit $JCC

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

8N6. Writing new JCL/scripts

notes re stage5 enhancements

  1. We have added a 2nd step to illustrate a multi-step job. 'uvcopy addup1' is a Vancouver utility preprogrammed job to accumulate any field in any file. Option 'uop=b40c10' defines the field Begining byte# & Column length.

  2. For muti-step jobs we code common 'goto' points at he end of the job, for Normal & Abnormal terminations. Note the goto labels 'S9000=A' for Normal & 'S9900=A' for Abnormal.

  3. We also provide for 'RESTART' at any step by adding goto labels at each step (see S0010=A & S0020=A). To restart at step 2 the operator enters:

 sorttran5 step=S0020
 ====================

'jobset51' stores any step=... in the goto alias which defaults to S0000=A if no step=... was specified on the command line. Note 'args="$*"' and 'for arg in $args ...' were added to export command line arguments for jobset51.

console log illustrating restart

 090928:110921:sorttrans5: Begin Job=sorttrans5
 090928:110921:sorttrans5: Arguments: step=S0020
 090928:110921:sorttrans5: RUNLIBS=/home/mvstest/testlibs
 090928:110921:sorttrans5: RUNDATA=/home/mvstest/testdata
 090928:110921:sorttrans5: JTMP=/home/mvstest/testdata/jobtmp/sorttrans5
 090928:110921:sorttrans5: RUNDATE=20090928
 090928:110921:sorttrans5: WARN: **restarting** at STEP=S0020
 090928:110921:sorttrans5: gen0: GLTRAN=gl/account.trans_000005 insize=1600
 090928:110921:sorttrans5: file: GLSUM=tmp/account.trans_sum bytes=1420
 addup1 - add a column of numbers in a text file
 uop=b14c11e2 - default options
     b14      - begin column# (zero relative)
        c11   - columns wide
           e0 - edit 0 decimals
           e2 - edit 2 decimals
 090928:110921:sorttrans5: uvcopy ver=20090909 pf=/home/uvadm/pf/demo/addup1
 uvcopy DISAM ext=dat LNX L64  license=090909_00V_930630 site=UV_Software
 EOF Total  7,886.77
 090928:110921:sorttrans5: EOF fili01 rds=20 size=1600: gl/account.trans_000005
 090928:110921:sorttrans5: EOF filo01 wrts=21 size=1420: tmp/account.trans_sum
 090928:110921:sorttrans5: Job Times: Begun=11:09:21 End=11:09:21 Elapsed=00:00:00
 090928:110921:sorttrans5: EOF filr01 rds=5 upds=3 size=10240: /home/mvstest/testdata/ctl/gdgctl51I
 090928:110921:sorttrans5: JobEnd=Normal, StepsExecuted=0, LastStep=S0000

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

Part_9 VSE JCL Conversion to Korn shell scripts

Part 9 - conversion support scripts & uvcopy jobs


9A0. Conversion support 'scripts'
- most scripts are listed in detail

9B0. Conversion support 'uvcopy jobs'
- important uvcopy job names are given
- only 1 job is listed in detail
  (since uvcopy jobs are longer than scripts)

There are over 500 scripts & uvcopy jobs supplied with the Vancouver Utilities. We will name the most important scripts & uvcopy jobs here in Part 9, that are directly involved in JCL conversion.

You can inspect any of these with 'vi' or print with 'uvlp12', for example:


 vi /home/uvadm/sf/IBM/jcl2ksh41   <-- view script to convert 1 JCL to ksh
 ===============================

 uvlp12 /home/uvadm/pf/IBM/procNF  <-- print uvcopy to summarize missing PROCs
 ================================

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

9A0. VSE JCL Conversion to Korn shell scripts

conversion support scripts

Here is a list of some of the script names used for JCL conversion, followed by a detail listing of the most important scripts (those with links).


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

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

9A3. sortload43I - create JCL converter control file ctl/datafiles43I
by sorting datafiles41 & datafiles42 together
& loading an Indexed file for lookup by the JCL converter

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

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

9A6. jcpause - pause a JCL/script at the next step or a specified step

9A7. jcclear - clear the pause condition
cnvMF41
  • convert 1 COBOL program thru all stages & optionally compile
  • cleanup, conversion,& compile: cbl0 --> cbl1 --> cbl2 --> cbls
  • see COBOL conversion & compile scripts listed in VSECOBOL.htm.
cnvMF41A
  • convert All COBOL programs from cbl0 --> cbl1 --> cbl2
mfcbl1
  • compile 1 COBOL program
mfcblA
  • compile All COBOL programs

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

9A1. JCL conversion support scripts

jcl2ksh41 - convert 1 JCL thru all stages

 #!/bin/ksh
 # jcl2ksh41 - convert 1 job at a time (by OT, UVSI, Aug2004)
 #           - recommend converting all JCL's in directory (page 1Q1 VSEJCL.doc)
 #           - might use this to convert new jobs brought over from mainframe
 #           - see page 1Q9 MVSJCL.doc or www.uvsoftware.ca/mvsjcl.htm#1Q9
 # - assumes input JCL has been stored in subdir 'jcl0'
 # - assumes any PROC's present in procs (cleaned up from proc0)
 # - assumes all DLBL's present in ctl/datafiles41
 # - will convert JCL from jcl0 --> jcl1 --> jcl2 --> jcl3
 # - you will then manually copy to subdir jcls for test/debug
 #Oct2009 - option q1 in ctl/jclunixop41 applies TOPNODES replace table
 #
 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: jcl2ksh41 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
 #
 jclproc41 jcl1/$f.jcl jcl2/$f.jcl procs slis
 #===========================================
 #Nov19/07 - corrected last arg above from 'jcl1' to 'slis'
 #     - expand procs as we copy jcl from subdir jcl1 to subdir jcl2
 #     - will copy unchanged if no PROCs
 #
 jclunix41 jcl2/$f.jcl jcl3/$f.ksh
 #================================
 # - convert expanded mainframe JCL to Korn shell script
 #
 reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "OK to copy to jcls subdir (overwrite prior) y/n ?"; read reply; done
 if [[ "$reply" = "y" ]]; then
    cp jcl3/$f.ksh jcls      # copy converted JCL/script to jcls (in PATH)
    #==================
    echo "jcl3/$f.ksh copied to jcls/... (overwriting any prior version)"
 else echo "reply=$reply, jcl3/$f.ksh NOT copied to jcls/..."
 fi
 reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]]
  do echo "extract control-cards to jobparmx1 y/n ?"; read reply; done
 if [[ "$reply" = "n" ]]; then echo "reply=$reply, exiting"; exit 2; fi
 #
 uvcopy jobparmx1,fild1=jcl3,fild2=jobparmx1,fild3=jobparmx2,arg1=$f.ksh
 #======================================================================
 echo "above jobparmx1 extracted control cards from 1 job to $RUNLIBS/jobparmx1"
 echo "run jobparms1 to select all current control cards to $RUNDATA/jobparms1"
 echo "uvcopy jobparms1  <-- run manually before executing job"; read reply;
 exit 0

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

9A2. JCL conversion support scripts

jcl2ksh41A - convert all JCL from jcl0 thru jcl3

 #!/bin/ksh
 # jcl2ksh41A - convert All VSE JCL to Korn shell scripts
 #           - see page 1Q1 VSEJCL.doc or www.uvsoftware.ca/vsejcl.htm#1Q1
 # Oct2009 - option q1 in ctl/jclunixop41 applies TOPNODES replace table
 #
 if [[ -d jcl0 && -d jcl1 && -d jcl2 && -d jcl3 && -d proc0 && -d procs\
    && -d parm0 && -d parms && -d sli0 && -d slis && "$1" = "all"\
    && -f ctl/jclunixop41 && -f ctl/datafiles42 ]]; then :
 else echo "usage: jcl2ksh41A all"
      echo "       ============="
      echo "subdirs reqd: jcl0,jcl1,jcl2,jcl3,proc0,procs,sli0,slis,parm0,parms"
      echo "control files reqd: ctl/jclunixop41 & ctl/datafiles42 (may be null)"
      exit 1; fi
 #
 echo "jcl2ksh41A to perform all steps of JCL conversion to Korn shell scripts"
 echo "jcl0--------->jcl1------------->jcl2----------->jcl3---------->jcls"
 echo "     cleanup      Pro/SLIcExpand      convert         manual       "
 echo "- all steps reqd if you retransfer JCL, PROCs,or Parms"
 echo "- run 'jclxx41' to reconvert jcl2-->jcl3 after converter/option changes"
 echo "for 1st conversion - see step by step in 1Q1-1Q5 of MVSJCL.doc"
 echo "jcl2ksh41A can omit cleanup proc0-->procs & sli0-->slis"
 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
 #
 reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "OK to remove all files from procs & SLIs ? y/n"; read reply; done
 if [[ "$reply" = "y" ]]; then rm -f procs/*; rm -f slis/*; fi
 #
 echo "clear cols 73-80 of slis y/n ?"; reply=x; g=g8; read reply
 until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "clear cols 73-80 of slis y/n ?"; read reply; done
    if [[ "$reply" = "n" ]]; then g=g0; fi
    uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.prc  #<-- cleanup PROCs
    #==================================================
    uvcopyx cleanup sli0 slis uop=q0i7n1$g,arg1=.sli     #<-- cleanup SLIs
    #===============================================
    #Aug03/06 - $g is g8 to clear 73-80 or g0 to NOT clear (set at prompt above)
 fi
 echo "will now cleanup jcl0--->jcl1 & expand PROCs jcl1--->jcl2"
 reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "OK to remove all files from jcl1 & jcl2 ? y/n"; read reply; done
 if [[ "$reply" = "y" ]]; then rm -f jcl1/*; rm -f jcl2/*; fi
 #
 # 1. cleanup JCL, strip CR's, clear cols 73-80,& shorten to last nonblank
 uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl     #<-- cleanup JCL
 #===============================================
 echo "cleanup complete, enter to perform PROC expansion"; read reply
 #
 # 2. expand procs as we copy JCL from subdir jcl1 to subdir jcl2
 jclpx41 jcl1 jcl2 procs slis
 #===============================
 echo "PROC expansion complete, enter to generate data control file"; read reply
 #
 # 3. generate data control file for JCL converter
 #
 uvcopy jcldata41,fild1=jcl2,filo2=ctl/datafiles41
 #================================================
 echo "jcldata41 has extracted datafilenames from all jcl2 DLBLs/TLBLs & IDCAMS"
 echo " - 1 line for each filename with recsizes, index keys, file type on right side"
 echo " - file names & info written into ctl/datafiles41"
 #
 # 4. explain control files & allow user to stop & create ctl/datafiles42
 #
 echo "                  ** control files used by JCL converter **"
 echo "listcat3I - datafile info derived from the mainframe LISTCAT report"
 echo "          - file types, record sizes,& indexed key location(lengths)"
 echo "          - creation documented at VSEDATA.doc#1E2 & VSEJCL.doc#4J3   "
 echo " "
 echo "datafiles43I - datafile info extracted from all JCL to be converted"
 echo "             - filenames from DLBLs, TLBLs,& IDCAMS"
 echo "             - IDCAMS supplies file types, record sizes,& indexed keys "
 echo "             - creation documented at VSEJCL.doc#4K2"
 echo "                       ** listcat3I - creation **"
 echo "listcat0 - mainframe LISTCAT transferred to \$CNVDATA/ctl/listcat0"
 echo "listcat1 - LISTCAT info extracted & summarized to 1 line per datafile"
 echo "lisctat2 - sorted by filename & copied to \$TESTLIBS/ctl/listcat2"
 echo "listcat3 - copied from listcat2 & possibly edited to add missing info"
 echo "         - all listcat files presumed as Masters, may change some to Work"
 echo "listcat3I - listcat3 loaded into Indexed file for use by JCL converter"
 echo "          - primary source, JCL converter uses this info if match found"
 echo "                      ** datafiles43I - creation **"
 echo "datafiles41 - datafile info automatically extracted from all JCL"
 echo "            - from DLBLs,TLBLs,IDCAMS (file types,rec-sizes,indexed keys)"
 echo "datafiles42 - optional manual created file in same format as datafiles41"
 echo "            - to add to or modify info in datafiles41"
 echo "            - info on matching filenames here overrides datafiles41 info"
 echo "            - must create a null file if no override info required"
 echo "datafiles43I - Indexed file used by JCL converter"
 echo "             - created by sorting datafiles41 & datafiles42 together"
 echo "             - dropping datafiles41 filenames matched by datafiles42"
 echo "             - loading Indexed file keyed on datafilename"
 #
 reply=x;
 until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "enter 'y' - to continue using files described above "
       echo "enter 'n' - to stop & add info to ctl/datafiles42 "
       echo "- can create nullfile ctl/datafiles42 for 1st JCL conversion"
       read reply; done
 if [[ "$reply" != "y" ]]; then echo "job ended by request"; exit 91; fi
 #
 # 5. sort datafiles41 & datafiles42 (may be null), loads datafiles43I
 #
 sortload43I   #<-- script sorts df41+df42, loads Indexed datafiles43I
 #==========
 if (($?)); then
    echo "sortload43I failed, did you make ctl/datafiles42 (nullfile OK)"
    exit 99; fi
 echo " "
 echo "- enter to convert JCL to ksh "; read reply
 #
 # 6. convert expanded JCL to Korn shell scripts (uses ctl/datafiles42)
 #
 jclxx41 jcl2 jcl3
 #================
 #
 # 7. 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"
 echo " "
 # 8. Extract jobparms from JCL/scripts - optional
 echo "Extract jobparms from JCL/scripts - optional ?"
 echo "- see uvcopy jobparmx1 at: www.uvsoftware.ca/vsejcl.htm#4L1"
 #
 echo "uvlp12 errs/procNF.rpt     <-- print summary report of PROCs Not Found"
 echo "uvlp12 errs/includeNF.rpt  <-- print summary report INCLUDEs Not Found"
 echo "uvlp12 errs/sliNF.rpt      <-- print summary report SLIs Not Found"
 echo "uvlp12 errs/parmNF.rpt     <-- print summary report of PARMs Not Found"
 exit 0

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

9A3. JCL conversion support scripts

sortload43I

 # sortload43I - sort/load ctl/datafiles43I from datafiles41 & datafiles42
 #             - by Owen Townsend at City of Laval, March 15/2007
 #
 # ctl/datafiles41 - created by jcldata41 by extract all DLBL/TLBL/IDCAMS files
 #                 - filenames + rca=... rcm=... key=...(...) typJWV=IDXf8v
 #
 # ctl/datafiles42 - may be created by user to override datafiles41 file info
 #                 - else must create null file for sort to run
 #
 echo "sortload43I - sort/load ctl/datafiles43I from datafiles41 + datafiles42 "
 echo " - optional edit datafiles42 info to override auto extracted datafiles41 "
 echo " - must create nullfile ctl/datafiles42 if no edited ctl/datafiles42"
 reply=x;
 until [[ "$reply" == "y" || "$reply" == "n" ]]
    do echo " - sort/load ctl/datafiles43I from datafiles41 + datafiles42 OK y/n ?"
       read reply; done
 if [[ "$reply" == "n" ]]; then echo "reply=$reply, exiting"; exit 1; fi
 #
 uvsort "fili1=ctl/datafiles41,typ=LSTt,rcs=200,fili2=ctl/datafiles42\
 ,filo1=ctl/datafiles43,rcs=128,key1u2=0(30)"
 #====================================================================
 #
 # use loadcat3I to load into Indexed file shifting rca=... over to col46
 #
 uvcopy loadcat3I,fili1=ctl/datafiles43,filo1=ctl/datafiles43I
 #============================================================
 rc=$?       # capture loadcat3I status for script return code
 exit $rc
 #

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

9A4. JCL conversion support scripts

jclpx41 - expand PROCs from procs while copying jcl1 to jcl2

 #!/bin/ksh
 # jclpx41 - Korn shell script from UVSI stored in: /home/uvadm/sf/IBM/
 # jclpx41 - script to execute the jclproc41.c program
 #         - to expand PROC's & SLI's in IBM VSE JCL
 #         - see VSEJCL.doc, or www.uvsoftware.ca/vsejcl.htm
 #
 # usage:  jclpx41 indir outdir PROCdir SLIdir [options]
 #         =============================================
 #example: jclpx41 jcl1 jcl2 procs jcl1
 #         ============================
 #
 # indir   - contains the JCL's with PROCs to be expanded
 # outdir  - will receive the expanded JCL
 #         - output filenames same as input, with .jcl ensured
 # PROCdir
 # SLIdir  - may be same as indir
 #
 # jclproc41 infile outfile PROCdir SLIdir
 # =======================================
 #
 echo "script to expand PROCs in VSE JCL"
 if [[ -d "$1" && -d "$2" && -d "$3" && -d "$4" ]]; then :
    else echo "USAGE: jclpx41 indir outdir PROCdir SLIdir"
         echo "       ==================================="
    exit 1; fi
 #
 # jclproc41 appends to an error message file in errs subdir
 # - init now OR create subdir if not already present
 if [[ ! -d errs ]]; then mkdir errs; fi  # make errs subdir if not existing
 >errs/jclproc41.err  # init errmsg collection file
 x=0;y=0;
 for i in $1/*
 do
     a=${i##*/}
     typeset -l c=$a
     jclproc41 $i $2/$c $3 $4
     #=======================
     if ((!$?)); then let y=y+1; fi
     let x=x+1
 done
 echo "$x JCLs copied $1 to $2, expanding PROCs($3) & SLIs($4), $y outputs"
 echo "vi tmp/jclproc41.err  <-- see errors collected in tmp/jclproc41.err"
 #
 # echo "call uvcopy jobs to report PROCs, INCLUDEs,& SLIs NOT FOUND"
 uvcopy procNF,fili1=errs/jclproc41.err,filo1=errs/procNF.rpt
 #===========================================================
 uvcopy includeNF,fili1=errs/jclproc41.err,filo1=errs/includeNF.rpt
 #=================================================================
 uvcopy sliNF,fili1=errs/jclproc41.err,filo1=errs/sliNF.rpt
 #===========================================================
 exit 0

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

9A5. JCL conversion support scripts

jclxx41 - convert all JCL from jcl2 to jcl3

 #!/bin/ksh
 # jclxx41 - Korn shell script from UVSI stored in: /home/uvadm/sf/IBM/
 # jclxx41 - script to execute the jclunix41.c program
 #         - to convert IBM mainframe MVS JCL to UNIX scripts
 # Oct2009 - option q1 in ctl/jclunixop41 applies TOPNODES replace table
 #
 # usage:  jclxx41  indir outdir options
 #         =============================
 #
 # 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
 #         - files will be assigned the same names
 #           as they had in the input directory
 # options - options for the jclunix program
 #           (see elsewhere in documentation)
 #
 # jclunix41 appends to an error message file --> errs/jclunix41.err
 # - init or create errs subdir if not already present
 #
 if [[ ! -d errs ]]; then mkdir errs; fi  # make errs subdir if not existing
 >errs/jclunix41.err                      # init errmsg collection file
 #
 echo "script to convert mainframe JCLs to UNIX scripts"
 if [ -d "$1" -a -d "$2" ]; then :
    else echo "usage: jclxx41 indir outdir [options]"
         echo "       =============================="
    exit 1; fi
 reply=x;
 until [[ "$reply" = "y" || "$reply" = "n" ]]
    do echo "OK to remove all files from JCL convert outdir $2 y/n ?";
       read reply; done
 if [[ "$reply" = "y" ]]; then rm -f $2/*; fi
 #
 x=0; y=0;
 for i in $1/*
 do  a=${i##*/}
     typeset -l c=$a
     jclunix41 $i $2/$c $3
     #====================
     if (($?)); then let yy=yy+1; fi
     let x=x+1
 done
 echo "$x JCLs converted from $1 to Korn shell scripts in $2 ($y errors)"
 echo "vi tmp/jclunix41.err  <-- see errors collected in tmp/jclunix41.err"
 #
 # echo "call 'parmNF' to report any control card library members not found"
 # uvcopy parmNF,fili1=errs/jclunix41.err,filo1=errs/parmNF
 #=======================================================
 exit 0

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

9A6. JCL conversion support scripts

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 'stepctl51' 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.ksh       <-- pause specified job at begin next step
 #    ===================
 #
 # 2. jcpause jobname.ksh S0050 <-- pause job at step S0050 (step 5, inc by 10)
 #    =========================   - also be used by programmers debugging ?
 #
 # 3. jcclear jobname.ksh       <-- 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 .ksh)
 # - jcpause writes 1 line in the control file with jobname.ksh & step#
 # - step# is the step# specified by oprtr as arg#2 on jcpause 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.ksh 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.ksh 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 .ksh 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

9A7. JCL conversion support scripts

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 'stepctl51' 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.ksh       <-- pause specified job at begin next step
 #    ===================
 #
 # 2. jcpause jobname.ksh S0050 <-- pause job at step S0050 (step 5, inc by 10)
 #    =========================   - also be used by programmers debugging ?
 #
 # 3. jcclear jobname.ksh       <-- 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 .ksh)
 # - jcpause writes 1 line in the control file with jobname.ksh & step#
 # - step# is the step# specified by oprtr as arg#2 on jcpause 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.ksh 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 .ksh 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

9B0. VSE JCL Conversion to Korn shell scripts

conversion support - uvcopy jobs

Here is a list of some of the uvcopy job names used for JCL conversion, followed by a detail listing of just one (uvcopy jobs are usually longer than scripts).

You can of course inspect any of them in /home/uvadm/pf/IBM/...


9B1. 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
  • see listing 2 pages ahead
uvcopy cleanup
  • cleanup library files transferred from the mainframe
  • options to clear cols 73-80 in JCLs, cols 1-6 in COBOLs, etc
uvcopy jcldata41
  • extract all DLBL datafilenames from all JCL
  • creates ctl/datafiles41 which is sorted with datafiles42
    & loaded into ctl/datafiles43I for the JCL converter
uvcopy cnvMF4
  • 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
Note
  • most of the above uvcopy jobs are too long to list here
  • one of the shorter jobs is listed here to demo as a sample
    to demonstrate the power of uvcopy

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

9B1. JCL conversion support - uvcopy jobs

procNF - summarize 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 'jclpx41'
 # - jclpx41 is the script that performs PROC expansion
 #   by calling the 'jclproc41' C program for all files in the directory
 # - jclproc41 collects errmsgs into errs/jclproc41.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 jclpx41) as follows:
 #
 # uvcopy procNF,fili1=errs/jclproc41.err,filo1=errs/procNF.rpt
 # ==============================================================
 #
 #                         ** sample report **
 #
 # 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/jclproc41.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 until 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

Part_10 VSEJCL.doc - Converting VSE JCL to Unix/Linux scripts

Part 10 - Pilot Project - Contents


10A1. Pilot Project Introduction & Considerations

10B1. Setup Userid & Profiles for pilot project
10B2. listing of stub_profile to replace .bash_profile or .profile
10B3. Modify RUNLIBS/RUNDATA/CNVDATA to define pilot project directories

10C1. Setup Directories for pilot project
10C2. cnvdata - superdir to convert EBCDIC to ASCII
testdata - superdir for data files accessed by JCL/scripts
10C3. testlibs - superdir for JCL/COBOL libraries for conversion & execution
10C4. control files & functions for conversion & execution
10C5. JCL converter options file ctl/jclunixop41
10C6. JCL converter control file - CTLTBL & TOPNODE table

10D1. Select JCLs desired for Pilot Project
use JCL cross-refs to determine data-files, program,& copybooks required
10D2. Determine DATA-FILES required from JCL/Files crossref
select (copy/FTP) the data-files for the pilot project
copy/FTP mainframe LISTCAT report to supply info to data file converter
10D3. Determine COBOL PROGRAMS required from JCL/Programs crossref
10D4. Determine COPYBOOKs required from program/copybook cross-ref

10E1. Converting All COBOL copybooks using script 'cnvMF41Ac'
10E2. Converting All COBOL programs using script 'cnvMF41A'
10E3. Compiling All COBOL programs using script 'mfcblA'

10F1. Create Data Conversion Control File from LISTCAT
10F2. Editing ctl/ctlfile4 with copybook names

10G1. Pre-Requisites for Geneating jobs to convert DATA files
10G2. Generating All jobs to convert Data Files
10G3. Generating 1 job at a time (script gencnv42)

10H1. Illustrated example of data conversion job generation
10H2. skeleton uvcopy job generated from copybook
10H3. completed uvcopy job with Record Type tests added manually

10I1. Pre-requisites for Executing DATA conversion jobs
10I2. Executing jobs to convert DATA files
10I3. Copying converted DATA files to test directories

10J1. Create JCL Data File Info from LISTCAT
10J2. ctl/listcat3I - info file #1 for JCL converter
ctl/datafiles43I - info file #2 for JCL converter
10J3. Creating Indexed info file (listcat3I) for JCL converter

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

Part 10 - Pilot Project Contents (continued)


10K1. Directories required for JCL conversion
10K2. Convert All JCL using script 'jcl2ksh41A' (multi-step script)

10L1. xrefall - generate All COBOL & JCL cross-references after covndersion
10L2.  cobfiles5A - create COBOL files report & load Indexed files for jobflow
10L3.  jobfiles5A - generate jobflow reports from JCL/scripts & COBOL file info
- tracks data file usage for each step of JCL/scripts
- big help if you are unfamiliar with the applications

10M1. Execute pilot project JCL/scripts
10M2. Investigate outputs (reports, new files, SYSOUT errors ?)
10M3. Rerun in $TESTDATA & capture logs in subdir joblog/...
 10N1. Converting ASCII files back to EBCDIC (for All files in directoy)
      - uvcopy job 'uvdata55'

10N3. Comparing all re-converted files to original EBCDIC files
- to verify conversions, or to return files to the mainframe
  (if all applications can not be migrated at same time)

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

10A1. Converting VSE JCL to Unix/Linux scripts

Pilot Project prior to high volume conversions

Before attempting to convert/test/debug high volumes of JCL, COBOL,& DATA, we recommend you perform a 'Pilot Project' with a few JCLs and the required COBOL programs/copybooks & datafiles.

After selecting a few JCLs, you can determine the required COBOL programs, copybooks,& data files by running the appropriate cross-references (documented at CNVaids.htm#Part_3)

xvseprog2
  • lists all COBOL programs used in the selected JCLs
xcobcopy2
  • lists all COBOL copybooks used in the selected COBOL programs
xvsefile2
  • lists all DATA files used in the selected JCLs

notes

  1. We will setup user 'pilot1' and create directories in /home/pilot1 to hold the JCLs, COBOL programs, COBOL copybooks,& DATA files, selected for the pilot project.

  2. We assume that ALL the JCLs, COBOL programs, copybooks,& DATA files have already been transferred to the Unix system, and have been stored in the directories shown on pages '4C3' - '4C8' of the full scale data conversion guide in Part 4. For the pilot project, we will select small samples & copy to the subdirs shown at '10C2' & '10C3' of this Part 10.

  3. The JCLs, COBOL programs,& copybooks have been FTP'd from the mainframe in text mode. In text mode, FTP automatically converts to ASCII, which is OK because there should be no packed or binary data in JCL & COBOL libraries.

  4. The DATA files must be FTP'd in binary mode and will still be in EBCDIC, because text/ascii mode would destroy any packed/binary fields. Data files without packed/binary could be FTP'd in text/ascii mode, but it is better to transfer them all in binary since we do not know which are all character vs packed/binary & the conversion routines handle both.

  5. The mainframe LISTCAT report has been transferred (ascii mode) to /p1/cnvdata/ctl/listcat0. The LISTCAT report should have been run when all permanent master files are on disc & without any temporary work files.

  6. We will omit some considerations you might need for the actual conversion.

  7. For the pilot project we will select JCLs that use only fixed record length data files (vs variable length records). This simplifies the DATA conversion. See variable length record conversions documented at VSEDATA.htm#1D1 - 1G2.

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

10B1. Pilot Project prior to high volume conversions

setup new USERID for Pilot Project

We recommend you setup a separate userid & create the required conversion directories in its home directory. For this presentation we will use 'pilot1', similar to 'vsetest' in 'Part_1' to demo JCL conversion with supplied testfiles.


 #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 pilot1  <-- setup 'pilot1' for bash
     ======================================

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

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

 #5. cp -p /home/uvadm/env/stub_profile /home/pilot1/.bash_profile
     =============================================================
     - copy supplied 'stub' profile to pilot1 homedir & rename for bash
     - see listing on the next page

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

 #6. vi /home/uvadm/common_profile        <-- modify common_profile
     =============================
      export COBDIR=/opt/microfocus/cobol <-- change COBDIR for your site
      export UVLPDEST="-dlp0"             <-- change 'lp0' to your laser printer

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

Please see ADMjobs.htm#Part_1 for complete details on setting up profiles for the Vancouver utilities & mainframe conversions.

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

10B2. Pilot Project prior to high volume conversions

profiles for Vancouver Utility conversions

 # stub_profile - to be copied to user homedirs and renamed as
 #              '.profile' for Korn shell or '.bash_profile' for bash (Linux)
 #              - stub_profile calls 'common_profile'
 #              - by Owen Townsend, March 4/2010
 #
 # stub_profile - for users of Vancouver Utilities
 # - defines $RUNLIBS & $RUNDATA for common_profile, which uses them
 #   to define PATHs to libraries & data (test or production)
 # common_profile & stub_profile - distributed in $UV/env/...
 # - do not modify profiles in $UV because new versions of uvadm would overwrite
 # - copy to $APPSADM/env/... (/home/appsadm/env/...) & modify for your site
 # - then programmers can copy stub_profile to end of their .profile
 #   cat $APPSADM/env/stub_profile >>.profile
 #
 # Define RUNLIBS/RUNDATA & call common_profile to setup search PATHs, etc
 export RUNLIBS=$HOME/testlibs
 export RUNDATA=$HOME/testdata
 export CNVDATA=$HOME/cnvdata
 . /home/uvadm/env/common_profile     #<-- distributed calling from 'uvadm'
 # . /home/appsadm/env/common_profile #<-- should copy to & call from 'appsadm'
 #===============================
 #
 # insert user preferences here (aliases, TERM, UVLPDEST, etc)
 # - may override defaults in common_profile
 #
 export RUNLIBSDATA=T1  # inhibit RUNLIBS/RUNDATA redefs in .ini files
 # .ini files called at begin JCL/scripts to redefine libs/data for each script
 # - for sites that need different LIBS/DATA for different systems
 # - might be used for JCL/scripts run under schedulers (cron,control-M,etc)
 # - RUNLIBSDATA=T1 allows programmers to test JCL/scripts using definitions
 #   in common_profile (inhibits redefines in .ini file at begin JCL/scritps)
 #
 #                   ** Console Logging - optional **
 # - uncomment 7 '##' lines below to activate console logging
 # - must setup subdirs matching $LOGNAME in $APPSADM/log1/...,log2/...,log3/...
 # - subdirs log1,log2,log3 hold logfiles for: current file, month, lastmonth
 # - see details at www.uvsoftware.ca/admjobs.htm#Part_6
 # - console logging for production operators to capture entire logon session
 # - programmers can use the 'joblog1' script to capture log for 1 job at a time
  ## login1 || exit 2          # exit here if 2nd login
  ## logfixA $LOGNAME          # process log1 file to log2 (to allow read/print)
  ## echo "console logging requires aliases to be stored in .bashrc or .kshrc"
  ## echo "--> . aliases <-- 'dot' execute aliases NOW, if not in .bashrc/.kshrc"
  ## echo "--> logview   <-- execute logview script to see prior console logs"
  ## echo "script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)"
  ## exec script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)
 # - 'exec script' must be the last non-comment line in the profile
 # - 'script' disables 'aliases', put in '.bashrc' or '.kshrc' to be effective
 # - you should also setup .kshrc to preserve your aliases & umode if logging
 #   cp $APPSADM/env/kshrc .kshrc  # copy to your homedir restoring correct name

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

10B3. Pilot Project prior to high volume conversions

profiles for Vancouver Utility conversions

This design allows you to have multiple sets of libraries & data for testing and/or production without having to change any JCL/scripts. Key to this are the definitions of environmental variables 'RUNLIBS' & 'RUNDATA' which are defined at end of your profile prior to calling 'common_profile'.

for the test/demos in this section

This section suggests setting up user 'pilot1' to run a pilot project. Programmers could modify their RUNLIBS/RUNDATA/CNVDATA defs as follows if they wanted to work on a common set of JCL/COBOL/DATA.

      export RUNLIBS=/home/pilot1/testlibs
      export RUNDATA=/home/pilot1/testdata
      export CNVDATA=/home/pilot1/cnvdata
      . /home/appsadm/env/common_profile

to test in your homedir

But if the pilot project is not too big, then it might be better if each (for initial training) programmer could work on his own set of libraries & data in his homedir (to avoid conflicts with other programmers).

      export RUNLIBS=$HOME/testlibs
      export RUNDATA=$HOME/testdata
      export CNVDATA=$HOME/cnvdata
      . /home/appsadm/env/common_profile

for actual conversion

When ready to begin the real conversion, the team members will change their defs to point to the actual libraries & data to be converted. For example:

      export RUNLIBS=/p1/testlibs
      export RUNDATA=/p1/testdata
      export CNVDATA=/p1/cnvdata
      . /home/appsadm/env/common_profile

Note that the profiles define convenient aliases cdl, cdd,& cdc to quickly change to testlibs, testdata, or cnvdata from anywhere, with just 3 keystrokes.


 #1. cdl  alias cdl='cd $RUNLIBS' --> /home/pilot1/testlibs
     ===

 #2. cdd  alias cdl='cd $RUNDATA' --> /home/pilot1/testdata
     ===

 #3. cdc  alias cdl='cd $CNVDATA' --> /home/pilot1/cnvdata
     ===

See listings of the profiles starting at ADMjobs.htm#1C1, followed by more detailed explanations.

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

10C1. Pilot Project prior to high volume conversions

setup DIRECTORIES for Pilot Project

Various Directory setups are discussed on pages '4C1' - '4D2' of Part 4. We will setup the directories within the 'pilot1' home directory (like '4C1'). For high volume conversions, you might use pages '4C2' thru '4C9', where the conversion directories are setup in separate file systems from the homedirs.

We provide scripts to setup the various directories required. Assuming you have setup user 'pilot1' (as on page '1P2'), proceed as follows:


 #1. login as 'pilot1' --> /home/pilot1

 #2. testdatadirs     <-- setup the conversion superdirs
     ============       - testlibs, testdata, cnvdata (see below)
 /home
 :----pilot1
 :    :----testlibs     <-- $TESTLIBS/$RUNLIBS for pilot project
 :    :    :----          - see subdirs created by script 'vselibsdirs'
 :    :    :----
 :    :----testdata     <-- $TESTDATA/$RUNDATA for pilot project
 :    :    :----          - see subdirs created by script 'vsedatadirs'
 :    :    :----
 :    :----cnvdata      <-- $CNVDATA for pilot project
 :    :    :----          - see subdirs created by script 'cnvdatadirs'
 :    :    :----

 #3a. cd testlibs      <-- change into /home/pilot1/testlibs/
      ===========
 #3b. vselibsdirs      <-- setup various subdirs for JCL & COBOL conversions
      ===========
 #3c. cd ..            <-- change back up to home dir
      =====

 #4a. cd testdata      <-- change into /home/pilot1/testdata/
      ===========
 #4b. vsedatadirs      <-- setup various subdirs for test data files
      ===========
 #4c. cd ..            <-- change back up to home dir
      =====

 #5a. cd cnvdata       <-- change into /home/pilot1/cnvdata
      ===========
 #5b. cnvdatadirs      <-- setup various subdirs to convert data files
      ===========
 #5c. cd ..            <-- change back up to home dir
      =====
Note
  • from now on we will use the aliases cdl/cdd/cdc to change to the 3
    superdirs (testlibs, testdata, cnvdata), from anywhere on the system
    with just 3 keystrokes.

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

10C2. Pilot Project prior to high volume conversions

Here are the 3 conversion superdirs (cnvdata, testlibs, testdata) used in the pilot project to convert the DATA, JCL/COBOL, and hold the DATA accessed when the JCL/scripts are executed.

'cnvdata' to convert EBCDIC to ASCII

 /home/pilot1
 :-----cnvdata          <-- DATA conversion superdir
 :     :--MF--cpys      <-- COBOL copybooks
 :     :--MF--ctl       <-- control files (LISTCAT from the mainframe)
 :     :--MF--d0ebc     <-- data files FTP'd from mainframe (variable length)
 :     :------d1ebc       - filenames lower case, '.clus.vseprd' dropped
 :     :------d2asc       - converted to ASCII (packed/binary preserved)
 :     :------maps        - copybooks converted to record layouts
 :     :------pf          - misc uvcopy jobs
 :     :------pfx1        - uvcopy skeleton jobs generated from 'maps'
 :     :------pfx2        - uvcopy jobs completed, datafilenames (vs cpybknms)
 :     :------pfx3        - uvcopy jobs copied here for modify/execute
 :     :------sf          - misc scripts
 :     :------tmp         - misc files here (keep working dir clean, rm daily)
       '--MF--' indicates subdirs receiving files from the mainframe

 cnvdatadirs     <-- script to create subdirs shown above
 ===========

'testdata' data files accessed by JCL/scripts

 /home/pilot1
 :-----testdata             <-- RUNDATA=$TESTDATA=/p1/testdata
 :     :-----ftp
 :     :-----jobctl            - optional, could use to pause jobs at spcfd steps
 :     :-----joblog            - joblog1 script stores .log files here
 :     :-----jobtmp            - job temporary files
 :     :-----mstr            <-- master files
 :     :-----pf                - user written uvcopy jobs
 :     :-----rpts            <-- reports
 :     :-----sf                - user written Korn shell scripts
 :     :-----sysout            - COBOL DISPLAY upon SYSLST reports
 :     :-----tape            <-- tape files reassigned to disc by JCL converter
 :     :-----tmp               - misc temp files & sort work files
 :     :-----wrk             <-- work files (inter-step)
Note
  • indicators '<--' identify primary 'data files' used by JCL/scripts

 vsedatadirs       <-- script to create above subdirs
 ===========

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

10C3. Pilot Project prior to high volume conversions

'testlibs' JCL/COBOL libraries for conversion & execution

 /home/pilot1
 :-----testlibs        <-- RUNLIBS=$TESTLIBS=/p1/testlibs
 :     :--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)
 :     :--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 (jclunixop41, listcat3I)
 :     :--MF--jcl0       - your JCLs transferred from mainframe
 :     :------jcl1       - intermediate conversion 73-80 cleared
 :     :------jcl2       - PROCs expanded from procs
 :     :------jcl3       - JCLs converted to Korn shell scripts
 :     :------jcls       - copy here manually 1 by 1 during test/debug
 :     :------maps       - 'cobmaps' record layouts generated from copybooks
 :     :------pf         - uvcopy jobs to replace utilities (easytrieve,etc)
 :     :--MF--proc0      - your PROCs transferred from mainframe
 :     :------procs      - will be merged with jcl1, output to jcl2
 :     :------sf         - for misc scripts you may wish to write
 :     :--UV--sfun       - korn shell functions (jobset51,logmsg,etc)
 :     :------tmp        - tmp subdir used by various conversions
 :     :------xref       - cross-references, see CNVaids.htm#Part_3
       '--MF--' - marks subdirs transferred from your MainFrame for conversion
       '--UV--' - marks control files & functions supplied by UV Software
                - copied from /home/uvadm/... by script 'copyvsectls'

 vselibsdirs  <-- script to create above subdirs
 ===========

 copyvsectls  <-- script to copy control files from /home/uvadm/ctl & sfun
 ===========

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

10C4. Pilot Project prior to high volume conversions

control files & functions for conversion & execution

Some control files & functions are required for JCL,COBOL,& DATA conversion, COBOL compiling,& JCL script execution. See more details on '4D1' & '4D2' of Part 4.

Script 'copyvsectls' is provided to copy the required files from /home/uvadm/... to the appropriate subdirs in your conversion superdirs.


 #0a. Login pilot1 --> /home/pilot1
      ===========
 #0b. cdl --> alias 'cd $RUNLIBS' --> /home/pilot1/testlibs
      ===

 #1. copyvsectls   <-- execute script to copy required control files & functions
     ===========     - script listed below
 # copyvsectls - copy Vancouver Utility control files & functions
 #               required to convert mainframe JCL & COBOL
 cp $UV/ctl/cnvcob4.tbl   ctl  # search/replace table for COBOL cnvrtr
 cp $UV/ctl/cobdirectives ctl  # COBOL DIRECTIVES for compiler
 cp $UV/ctl/extfh.cfg     ctl  # COBOL file handler configuration
 cp $UV/ctl/jclunixop41   ctl  # options file for JCL converter
 cp $UV/ctl/gdgctl51      ctl  # GDG control text file
 cp $UV/ctl/gdgctl51I*    ctl  # GDG control Indexed file (.dat & .idx)
 cp $UV/ctl/GDGmkdirs     ctl  # script to make subdirs for new GDG files
 cp $UV/ctl/gdgctl51*     $TESTDATA/ctl # GDG control files moved to $RUNDATA
 cp $UV/ctl/GDGmkdirs     $TESTDATA/ctl # make subdirs for new GDG files
 cp $UV/sfun/*            sfun # copy all ksh functions used in JCL/scripts
 exit 0

copy/FTP LISTCAT from mainframe

You will need the LISTCAT report from the mainframe to supply data file info (recsize, file type, indexed keys, etc) for data file conversion. If it has not already been FTP'd to Unix, do now, OK to use FTP text to translate to ASCII. Store as ctl/listcat0, will be input to 'catgut41' on page '10F1'.

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

10C5. Pilot Project prior to high volume conversions

JCL converter options file

To get desired results, you may need to modify the options & control tables in the JCL converter options file 'ctl/jclunixop41'.

We will not worry about this for the 'Pilot Project', but you should know the possibilities & you can see more details on pages '4E1' - '4E6' of Part 4.

Here are the options coded on line 1 & explained on lines 2 - 32.

 jclunixop41:d0e1g1i3j1l1p0q0r0s0t12u1y0 #<-- option dflts for VUdoc test/demos
 #           d1             - debug, generate 'echo's for 'cobrun's
 #             e1           - generate 'exportfile' function (vs export)
 #                          - to display filenames for console log
 #               g0         - create new GDG's in $RUNDATA/subdir/gdgfile_
 #               g1         - new GDGs $JGDG relative move to subdir/ at EOJ
 #               g2         - new GDGs $JGDG absolute $RUNDATA/jobtmp/...
 #                 i1       - lookup ctl/listcat3I for file info (rcsz,keys,etc)
 #                 i2       - lookup ctl/datafiles43I for file info (rcsz,keys)
 #                   j1     - insert jobset51 for RUNDATE=ccyymmdd (obsolete ?)
 #                   j2     - jobset52 RUNDATE=mm/dd/ccyy old, jobset52 now $JGDG
 #                   j4     - might need new optn j4 for RUNDATE=mm/dd/ccyy ?
 #                     l1   - generate logmsg1, show script msgs on screen only
 #                     l2   - generate logmsg2, appends to joblog/jobname.log
 #                     l4   - generate logmsg4 for Bgn/End Job (vs logmsg1/2)
 #                       p1 - on COBOL steps, generate printer files as follows:
 #                          - exportfile SYS010 $JTMP/$JOBID2_step_$PROGID
 #                          - exportfile SYS010L $RPTS/$JOBID2_step_$PROGID_$date
 #                          - uvcopy cnvrpt1,fili1=$SYS010,filo1=$SYS010L
 #                       q1 - apply TOPNODES table replace/verify 1st Qualifier
 #                    r0    - gen cobrun for unix/linux .ints (allow animation)
 #                    r1    - gen runw for .ints NetExpress/Windows/UWIN/CYGWIN
 #                    r2    - assume executables $DX/program either unix/windows
 #                    r16   - execute RPG programs, $RPX/program
 #                  s1      - #< comment out SYSIN instream data (for LAVAL)
 #                          - instream data extracted separate files jobparms/..
 #                          - export SYS011 defines jobparms/.. file vs $JTMP/..
 #              t12         - TLBL options for exportgen0/1,tape/,date/time
 #                          (t1=date,t2=time,t4=subdir tape/,t8=exportgen0/1)
 #            u1            - convert IEBGENER to uvcp (vs cp default)
 #            u2            - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 files
 #          y1              - customization for CUCBC (printer class changes)

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

10C6. Pilot Project prior to high volume conversions

JCL converter control file - CTLTBL & TOPNODE table

We will not change the JCL converter control file for the 'Pilot Project', but we want you to be aware of the more important elements that you may want to modify for your high volume conversions. Here are lines 80-116 of ctl/jclunixop41:

 #----------------------- control table --------------------------------
 # controls filename conversion depending on 1 or 2+ nodes ('.'s)
 # TOPDIRDFL1 - used if only 1 node & not typJM in ctl/datafiles43
 #            - 'wrk' since 1 node files usually 'SORTOUT's
 #            - temp files, input to following steps, not needed after job ends
 # TOPDIRDFL2 - used if only 1 node & typJM on ctl/datafiles43 matching filename
 #            - 'M' of typJM stored if ',CAT=' found on DLBL by jcldata41
 # TOPDIRINS1 - if specified & no typJM, insert above top-node (retain all '.'s)
 #            - used for all files with 2+ nodes (TOPDIRDFL1/2 used if only 1)
 #            - if TOPDIRINS1/2 unspecified, topnode becomes a directory
 # TOPDIRINS2 - if specified & typJM, insert above top-node (retain all '.'s)
 #            - OVERRIDDEN if datafiles43I has topr=... or topi=...
 :CTLTBL:
 TOPDIRDFL1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRDFL2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINS1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 TOPDIRINS2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 #
 #------------------------ TOPNODES table ------------------------------
 # table of TOPNODES allowed & replacements (optional)
 # 01-30 - topnodes allowed
 # 31-60 - topnode replacements (if col 31 not '~')
 # - if 01-30 of last entry 'ALLOTHER', any others replaced by 31-60
 # - use statmvsjcl1 to create summary table of topnodes used in all JCL
 # - see www.uvsoftware.ca/mvsjcl.htm#6A2
 # - code in lower case since applied at output time(script) vs input(JCL)
 :TOPNODES:
 ar~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 gl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 rpts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 work~~~~~~~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 # - you must also code valid top-nodes in $RUNLIBS/ctl/GDGmkdirs
 # - called by jobset51 to setup subdirs for new generations of GDG files
 # - see listing at MVSJCL.htm#4E6
Note
  • TOPNODES activated by option 'q1' 1st line jclunixop41 (see prior page)
  • this example uses 'q0' (disabled)
  • the CTLTBL (above TOPNODES) puts all permanent files in subdir mstr/...
    and all temporary files in subdir wrk/...
  • 'M' or 'W' coded in control files for JCL converter (see page '4I11')

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

10D1. Pilot Project prior to high volume conversions

select JCLs desired for Pilot Project

We will select 2 JCLs for our pilot project. We had already transferred all the JCL, COBOL,& DATA files from the mainframe to the unix system & stored in file systems /p1 & /p4 as suggested on pages '4C3' - '4C8' of Part 4. So we can just select (copy) the desired files to our pilot project subdirs.


 #0a. Login pilot1 --> /home/pilot1
      ===========
 #0b. cdl --> alias 'cd $RUNLIBS' --> /home/pilot1/testlibs
      ===

 #1a. cp /p1/testlibs/jcl0/28401a03.jcl jcl0
      ======================================

 #1b. cp /p1/testlibs/jcl0/28401a04.jcl jcl0
      ======================================

determine data-files, program,& copybooks required

We can run cross-references on the selected JCLs to determine the programs, copybooks,& data-files required. You can see all cross-references provided at CNVaids.htm#Part_3. We will use the following:

xvsefile2
  • lists the data-files in the JCLs
xvseprog2
  • lists the programs executed by the JCLs
xcobcopy2
  • lists the COBOL copybooks used in the COBOL programs

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

10D2. Pilot Project prior to high volume conversions

determine data-files from JCL/Files xref


 #2. xvsefile2 jcl0   <-- cross-ref JCL to get data-files required
     ==============
 xvsefile2 ** crossref show all JOBnames using each DLBL/TLBL datafile **
 Keyword=DLBL:TLBL  Exclude=% Include=~~ Skip=  page#  1
 Directory=/home3/laval4/testlibs/tmp1 Options=q1a16b16c4e0d0j0l0s2w1a40b16c3j2w2
 =======================================================2010/01/19_05:43:10
 E2123002.ITAXE.TAXATION                  28401a04.jcl
 E2123003.ITAXE.TRANSDAM_2                28401a03.jcl    28401a04.jcl
 E2125504.MTAXE.PARACOMP_3                28401a03.jcl_2  28401a04.jcl
 TU.F01.E212656.FACTUR                    28401a04.jcl_2

select the data-files for the pilot project


 #3. cdc --> alias 'cd $CNVDATA' --> /home/pilot1/cnvdata
     ===

 #4a. cp /p4/cnvdata/d0ebc/E2123002.ITAXE.TAXATION  d0ebc/
 #4b. cp /p4/cnvdata/d0ebc/E2123003.ITAXE.TRANSDAM  d0ebc/
 #4c. cp /p4/cnvdata/d0ebc/E2125504.MTAXE.PARACOMP  d0ebc/
 #4d. cp /p4/cnvdata/d0ebc/TU.F01.E212656.FACTUR    d0ebc/

The above assumes the data files have already been FTP'd to Unix & stored in /p4/cnvdata/d0ebc. If not, you could FTP direct from the mainframe to /home/pilot1/cnvdata/d0ebc. Make sure you FTP with BINARY option.

Note
  • here is an EASIER alternative to above manual commands
  • use script 'xref2cpA' to generate the 'cp' commands automatically
    from the JCL/data-files cross-reference report.

 #5a. xref2cpA xref/xvsefile2 \$MFDATA d0ebc
      ======================================
      - reads xref/xvsefile2 report & writes sf/xvsefile2cp
      - we specify a $SYMBOL for datafile source directory, since we might
        not know it yet & it might be very long

 #5b. vi sf/xvsefile2cp  <-- examine generated script
      =================    - modify if necessary
      # xvsefile2cp - script generated by xref2copy1 uvcopy job or xref2cpA script
      #        - to generate script to select items for pilot projects
      #        - City of Laval 2010/02/01_18:43:15
      cp $MFDATA/e2123002.itaxe.taxation                d0ebc
      cp $MFDATA/e2123003.itaxe.transdam                d0ebc
      cp $MFDATA/e2125504.mtaxe.paracomp                d0ebc
      cp $MFDATA/tu.f01.e212656.factur                  d0ebc

 #5c. export MFDATA=/u/aaa/bbb/ccc
      ============================

 #5d. ksh sf/xvsefile2cp     <-- execute generated script
      ==================

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

10D3. Pilot Project prior to high volume conversions

determine COBOL PROGRAMS from JCL/Program xref


 #6. cdl --> alias 'cd $RUNLIBS' --> /home/pilot1/testlibs
     ===

 #7. xvseprog2 jcl0   <-- cross-ref JCL to get PROGRAMS executed
     ==============
  xvseprog2 ** crossref all VSE JOBnames for each EXEC/PGM name **
  Keyword=PGM:EXEC  Exclude=~~ Include=~~ Skip=  page#  1
  Directory=/home3/laval4/testlibs/tmp1 Options=q1a16b16c4s2w1a16b16c4j2w1
  =======================================================2010/01/19_05:23:46
  E173001C.cbl_2   28401a03.jcl    28401a04.jcl
  E212109C.cbl     28401a04.jcl
  E212152C.cbl     28401a03.jcl
  E212543C.cbl     28401a03.jcl
 *IDCAMS_17        28401a03.jcl_5  28401a04.jcl_12
 *PROC_4           28401a03.jcl_2  28401a04.jcl_2
 *SORT_6           28401a03.jcl_2  28401a04.jcl_4

select the COBOL programs for the pilot project


 #8a. cp /p1/testlibs/cbl0/E173001C.cbl  cbl0
 #8b. cp /p1/testlibs/cbl0/E212109C.cbl  cbl0
 #8c. cp /p1/testlibs/cbl0/E212152C.cbl  cbl0
 #8d. cp /p1/testlibs/cbl0/E212543C.cbl  cbl0
Note
  • here is an EASIER alternative to above manual commands
  • use script 'xref2cpA' to generate the 'cp' commands automatically.

 #9a. xref2cpA xref/xvseprog2 \$MFCBL cbl0
      =====================================
      - reads xref/xvseprog2 report & writes sf/xvseprog2cp

 #9b. vi sf/xvseprog2cp  <-- examine generated script
      =================    - modify if necessary
      # xvseprog2cp - script generated by xref2copy1 uvcopy job or xref2cpA script
      #        - to generate script to select items for pilot projects
      #        - City of Laval 2010/02/01_18:44:03
      cp $MFCBL/e173001c.cbl        cbl0
      cp $MFCBL/e212109c.cbl        cbl0
      cp $MFCBL/e212152c.cbl        cbl0
      cp $MFCBL/e212543c.cbl        cbl0

 #9c. export MFCBL=/u/uvadm/vsetest/lroman/jose/0.8.6.1-Cobol
      =======================================================

 #9d. ksh sf/xvseprog2cp     <-- execute generated script
      ==================

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

10D4. Pilot Project prior to high volume conversions

determine COPYBOOKs from Program/Copybook xref


 #9a. cleanupcbl cbl0 cbl1  <-- must run cleanupcbl before xcobcopy2
      ====================

 #9b. xcobcopy2 cbl1   <-- cross-ref COBOL programs to get COPYBOOKS used
      ==============
  xcobcopy2 ** crossref all PROGRAMS using each COPYBOOK **
  Keyword=copy:include  Exclude=unix Include=.cpy Skip=  page#  1
  Directory=/home3/laval4/testlibs/tmp1 Options=q1a16b16c4e0s2w1a16b16c4e3l1
  =======================================================2010/01/19_07:55:00
  cgetdatb.cpy     e212109c.cbl    e212152c.cbl    e212543c.cbl    e212648c.cbl
  _____________5   e212649c.cbl
  e212007b.cpy_2   e212648c.cbl    e212649c.cbl
  e212024b.cpy     e212648c.cbl
  e212037b.cpy_3   e212109c.cbl    e212648c.cbl    e212649c.cbl
  jul2000b.cpy     e212109c.cbl    e212152c.cbl    e212543c.cbl    e212648c.cbl
  _____________5   e212649c.cbl

select the COBOL COPYBOOKS for the pilot project


 #10a. cp /p1/testlibs/cpy0/cgetdatb.cpy  cpy0
 #10b. cp /p1/testlibs/cpy0/e212007b.cpy  cpy0
 #10c. cp /p1/testlibs/cpy0/e212024b.cpy  cpy0
 #10d. cp /p1/testlibs/cpy0/e212037b.cpy  cpy0
 #10e. cp /p1/testlibs/cpy0/jul2000b.cpy  cpy0

EASIER alternative to above manual commands


 #11a. xref2cpA xref/xcobcopy2 \$MFCBL cpy0  <-- generate script
       ====================================
      - reads xref/xcobcopy2 report & writes sf/xcobcopy2cp

 #11b. vi sf/xcobcopy2cp  <-- examine generated script
       =================    - modify if necessary
      # xcobcopy2cp - script generated by xref2copy1 uvcopy job or xref2cpA script
      #        - to generate script to select items for pilot projects
      #        - City of Laval 2010/02/01_19:03:05
      cp $MFCBL/cgetdatb.cpy        cpy0
      cp $MFCBL/e212007b.cpy        cpy0
      cp $MFCBL/e212024b.cpy        cpy0
      cp $MFCBL/e212037b.cpy        cpy0
      cp $MFCBL/jul2000b.cpy        cpy0

 #11c. export MFCBL=/u/uvadm/vsetest/lroman/jose/0.8.6.1-Cobol
       =======================================================

 #11d. ksh sf/xcobcopy2cp     <-- execute generated script
       ==================

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

10D5. Pilot Project prior to high volume conversions

determine called programs from Program/called xref


 #12. xcobcall2 cbl1   <-- cross-ref COBOL programs to get CALLed programs
      ==============
  e212036b         e212649c.cbl
  e212037b_3       e212109c.cbl    e212648c.cbl    e212649c.cbl
  e212038b_2       e212109c.cbl    e212648c.cbl
  e212912b         e212648c.cbl

select the COBOL COPYBOOKS for the pilot project


 #13a. cp /p1/testlibs/cpy0/e212036b  cpy0
 #13b. cp /p1/testlibs/cpy0/e212037b  cpy0
 #13c. cp /p1/testlibs/cpy0/e212038b  cpy0
 #13d. cp /p1/testlibs/cpy0/e212912b  cpy0

EASIER alternative to above manual commands


 #14a. xref2cpA xref/xcobcall2 \$MFCBL cbl0   <-- generate script
       ====================================
      - reads xref/xcobcall2 report & writes sf/xcobcall2cp

 #14b. vi sf/xcobcall2cp       <-- examine generated script
       =================         - modify if necessary
      # xcobcall2cp - script generated by xref2copy1 uvcopy job or xref2cpA script
      #        - to generate script to select items for pilot projects
      #        - City of Laval 2010/02/01_19:03:05
      cp $MFCBL/e212036b            cbl0
      cp $MFCBL/e212037b            cbl0
      cp $MFCBL/e212038b            cbl0
      cp $MFCBL/e212912b            cbl0

 #14c. ksh sf/xcobcall2cp     <-- execute generated script
       ==================

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

eject

10E2. Pilot Project prior to high volume conversions

converting All PROGRAMs with 'cnvMF41A'

 cbl0 -------> cbl1 -------> cbl2 --------> cbl3 ----------> cbls -------> cblx
      cleanup       convert       copy(cp)       sysin cnvt       compile

 #1. cnvMF41A all         <-- convert ALL programs from cbl0 to cbl1 & cbl2
     ===========           - see 'cnvMF41A' script listed at VSECOBOL.htm#5C3

prompts & replies for 'cnvMF41Ac'

'cnvMF41A' has many option prompts. For initial conversion I suggest you take all defaults exceept 2:


 #1a. Do you want to generate Index of files to be ORGANIZATION LINE SEQUENTIAL ?
      --> n  <-- reply No initially, may rerun later with YES (after study)

 #1b. Do you want to convert 'accept from instream' to 'read's from SYSIN ?
      --> n  <-- reply No initially, may rerun later with YES (after study)

convert 1 copybook at a time


 cnvMF41 cbl0/programname
 ========================
Note
  • do not specify extension, the script will take the last matching name
  • allows for sites that code a version date after the '.'

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

10E3. Pilot Project prior to high volume conversions

compiling All PROGRAMs with 'mfcblA'


 #2a. cp cbl2/* cbls      <-- copy converted programs to cbls (used by compiler)
      ==============

 #2b. cp cbl3/* cbls      <-- use this if you replied 'y' to #1b above
      ==============

 #3. mfcblA all          <-- recompile ALL cobol programs, cbls --> cblx
     ==========            - see 'mfcblA' script listed at at VSECOBOL.htm#5E2

 #4. uvlpd1p cblx .err   <-- print 1st page of all .err reports
     =================     - to guide programmers making corrections
                           - should be very few on these reconversions

notes re COBOL compiles

For our pilot project, we got all clean compiles here, because we had already spent considerable time enhancing the compiles for the high volume libraries.

Our 1st mass compile had a 30% error rate, but we reduced this to 7% by modifying search/replace tables for reserved word differences (mainframe compiler vs Micro Focus compiler). We also modified the converter itself to automatically correct for a lot of missing periods that the mainframe allowed (but not Micro Focus).

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

10F1. Pilot Project prior to high volume conversions

create Data Conversion Control File from LISTCAT

Note
  • these instructions for a 'Pilot Project' prior to high volume conversions
  • omitting some considerations you might need for the actual conversion
  • for fixed record length data files only (vs variable length records)
  • assumes you have setup user 'pilot' with required VU profile
    and conversion superdirs: testlibs, testdata,& cnvdata.
Note
  • you must have completed the pre-requisites on page '10C1' - '10C6'
  • see subdirs required on page '10C2'
  • mainframe data FTP'd (binary) to $CNVDATA/d1ebc
  • mainframe COBOL copybooks FTP'd (text/ASCII) to $CNVDATA/cpys
  • mainframe LISTCAT (text/ASCII) to $CNVDATA/ctl

create Data conversion control file

 listcat0--------->listcat1-------->listcat2---------->ctlfile3-------->ctlfile4
          catgut41           sort            ctlfile41          cp/edit

 #0a. Login as pilot1 --> /home/pilot1

 #0b. cdc ---> $CNVDATA    ('cdc' is an alias in common_profile)

 #1. Create data conversion control file from mainframe LISTCAT report
     - LISTCAT report must have been stored in $CNVDATA/ctl/listcat0
     - see sample listing on page VSEDATA.htm#8A1
     - will extract filenames, avg-recsize, max-recsize, indexed key start(lth)

 #2.  uvcopy catgut41,fili1=ctl/listcat0,filo1=ctl/listcat1
      =====================================================
      - extract data conversion info from mainframe LISTCAT report

 #2a. uvcopy catgut41   <-- same as above (files default as shown above)
      ===============

 #3. sort -o ctl/listcat2 ctl/listcat1
     =================================
     - sort by data file name
     - see sample listing on page VSEDATA.htm#8B1 of the full scale data
       conversion guide.

 #4. uvlp12 ctl/listcat2     <-- list the output file
     ===================       - a few records are shown below
 e2121653.mtaxe.piscines   rca=00082 rcm=00082 key=000(020) typLM_=IDXf1  cntr=00033321
 e2121656.itaxe.facturat   rca=00083 rcm=00245 key=000(036) typLM_=IDXf8v cntr=15946788
 e2123004.itaxe.tranjour   rca=00464 rcm=00464 key=000(000) typLM_=RSF    cntr=00003905

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

10F2. Converting Mainframe DATA to unix/linux/windows

create data conversion control file from LISTCAT


 #5. uvcopy ctlfile41,fili1=ctl/listcat2,filo1=ctl/ctlfile3
      =====================================================
      - convert listcat report into data conversion control file format
      - inserts cpy=________, rcf=fixsz, drops cnt=...
      - see sample listing below.

 #5a. uvcopy ctlfile41    <-- same as above (files default as shown)
      ================

Editing ctlfile with copybook names

ctlfile3 was created above with 'cpy=________' slots into which, you must edit the copybooknames corresponding to the datafilenames.

Before we edit the control file, we will copy/rename as ctlfile4, to protect our edited version, in case ctlfile41 is rerun (would overwrite ctlfile3).

If this is the 1st creation, you can simply copy ctl/ctlfile3 to ctl/ctlfile4, and then edit ctlfile4.

Note
  • Do NOT copy ctlfile3 to ctlfile4 if you are re-generating from LISTCAT
  • you would not want to lose your editing of copybook names on 1st gen
  • see alternative to recover copybook names at VSEDATA.htm#1E4.

 #6. cp ctl/ctlfile3 ctl/ctlfile4
     ============================
     - copy/rename control file before editing
     - protects edited file from overwrite if ctlfile41 rerun

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

10F3. Converting Mainframe DATA to unix/linux/windows

Editing control file with copybook names


 #7. vi ctl/ctlfile4      <-- edit data conversion control file
     ===============
     - insert copybook names into the slot provided by cpy=________
     - add any missing files (not on disc when LISTCAT run)
     - could drop unwanted files not required for pilot project
       but not necessary (might use same file for later full conversion)
     - store in 3 ring binder for frequent reference during conversion

ctlfile4 sample after copybook names

 e2121653.mtaxe.piscines cpy=e212159b rca=00082 rcm=00082 rcf=00128 key=000(020)
 e2121656.itaxe.facturat cpy=e212037b rca=00083 rcm=00245 rcf=00320 key=000(036)
 e2123004.itaxe.tranjour cpy=e212142b rca=00464 rcm=00464 rcf=00512 key=000(000)
 tu.f01.e212-no.trperm   cpy=e221004b rca=00080 rcm=00080 rcf=00128 key=000(000)
Note
  • the last line (tu.f01...) was added manually, because it was tape
  • only VSAM files are captured on LISTCAT reports

 #8. uvlp12 ctl/ctlfile4  <-- list the edited data conversion control file
     ===================    - file in 3 ring binder for reference

 #9. uvcopy loadctlI,fili1=ctl/ctlfile4,filo1=ctl/ctlfile4I
     ======================================================
     - load control file to an Indexed file for various future jobs
     - such as 'uvhdc2' to display datafiles with COBOL fieldnames

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

10G1. Pilot Project prior to high volume conversions

Pre-Requisites for Generating jobs to convert DATA files

Note
  • these instructions for a 'Pilot Project' prior to high volume conversions
  • omitting some considerations you might need for the actual conversion
  • for fixed record length data files only (vs variable length records)
  • assumes you have setup user 'pilot1' with required VU profile
    and conversion superdirs: testlibs, testdata,& cnvdata.
Note
  • you must have completed pre-requisites on pages '10C1' thru '10C4'
  • created library subdirs: cpys,maps,ctl,pfx1,pfx2,pfx3
  • created data subdirs: d0ebc, d1ebc, d2asc
    (see directories illustrated on page '10C2')
  • transfered DATA files, rename as desired (see page '10D2')
  • created/edited data control file ctl/ctlfile4 (pages '10F1' & '10F2')

Directories Required to Generate jobs to convert Data Files

We generated in pfx1, add data filenames in pfx2, copy to pfx3 for execution

 Main----->cpys------->maps-------->pfx1-------->pfx2------->pfx3--------->
 frame FTP     cobmap1     uvdata42     uvdata46     copy/edit    execute

Pilot Project restrictions

  1. No variable length record files. We simplify the pilot project by using only fixed length record files. See VSEDATA.htm#1F0 for variable length conversions.

  2. No multiple record types with packed or signed numeric fields. Manual changes are required for these files. Note that it is OK to have files with multiple record types if they have no packed or signed fields because the entire record is simply translated to ASCII for all types. See VSEDATA.htm#2D1 for multi Record Type conversions with packed/signed.

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

10G2. Converting Mainframe DATA to unix/linux/windows

Generating jobs to convert ALL datafiles EBCDIC to ASCII

 mainframe----->cpys------->maps-------->pfx1-------->pfx2------->pfx3--------->
           FTP      cobmap1     uvdata42     uvdata46     copy/edit    execute
                                                                       from pfx3
 #0a. Login as pilot1 --> /home/pilot1
 #0b. cdc ---> $CNVDATA    ('cdc' is an alias in profile)

 #1. cp $RUNLIBS/cpys/* cpys/     <-- copy copybooks from $RUNLIBS to $CNVDATA
     ========================

 #2. uvcopyx cobmap1 cpys maps uop=q0i7p0
     ====================================
     - convert all copybooks to record layouts (cobmaps)

 #3. rmzf maps    <-- remove any zero files
     =========      - caused by procedure copybooks vs data copybooks

 #4. uvcopyx uvdata42 maps pfx1 uop=q0i7
     ===================================
     - generate skeleton uvcopy jobs from cobmaps
     - skeleton jobs have the same filenames as copybooks
     - skeleton jobs use copybooknames for datafilenames on fili1=... & filo1=...

 #5. uvcopy uvdata46,fili1=ctl/ctlfile4,fild2=pfx1,fild3=pfx2,uop=q0i7
     =================================================================
     - complete the uvcopy jobs with actual datafilenames & indexed file keys
     - 1 uvcopy job for each line in control-file using specified copybook/map
     - completed jobs named same as datafilenames (vs copybooknames used in pfx1)
     - completed jobs change fili1=... & filo1=... to datafilenames

 #5a. uvcopy uvdata46   <-- same as above (files default as shown)
      ===============

 #6. cp pfx2/* pfx3  <-- do ONLY on initial generation or if no packed/signed
     ==============    - to avoid overwriting jobs edited with multi R/T code
Note
  • uvcopy jobs must be copied from pfx2 to pfx3 before executing
  • may need modifications for multi record type files
  • our sample data files had Multi R/T files, but they had no packed/binary
    so we did not have to modify/insert any R/T test code.
  • see VSEDATA.htm#2D1 for multi Record Type files with packed/signed.

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

10G3. Converting Mainframe DATA to unix/linux/windows

Generating job to convert 1 datafile at a time

The procedures above generate all jobs to convert all data files. You can use script 'gencnv42' to generate 1 job to convert 1 data file. You need this when you need to add a datafile after the initial generation of all jobs you thought were needed.

 mainframe----->cpys------->maps-------->pfx1-------->pfx2------->pfx3--------->
           FTP      cobmap1     uvdata42     uvdata46     copy/edit    execute
                                                                       from pfx3
 #0a. Login as pilot1 --> /home/pilot1

 #0b. cdc ---> $CNVDATA    ('cdc' is an alias in profile)

 #1. gencnv42 datafile copybook    <-- script arguments
     ==========================

 #1a. gencnv42 e2122183.itaxe.degrevm e212047b  <-- example
      ========================================
Note
  • do not specify the sub-directories for this script
  • may or may not be extension on copybook name

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

10H1. Converting Mainframe DATA to unix/linux/windows

illustrated example of data conversion

Here is an example given in more detail at VSEDATA.htm#2E2. The instructions here generate 1 job at a time vs prior instructions which generated conversion jobs for all copybooks in the directory.


 #3. uvcopy cobmap1,fili1=cpys/e221004b,filo1=maps/e221004b
     ======================================================
     - convert the specified copybook to a record layout (cobmap)
 cobmap1  start-end bytes for cobol record fields    200702170943  pg# 0001
 cpys/e221004b                  mt-travaux-perman  RCSZ=00080  bgn  end  lth typ
 * fichier travaux permanents
  01  mt-travaux-permanents.
      05 mt-cd-dos            pic 9.                          0000 0000  001 n  1
      05 mt-exq.
              10 mt-exv       pic 99.                         0001 0002  002 n  2
              10 mt-anq       pic x.                          0003 0003  001
 *
 * r/t 1 - identified by '1' in 1st byte (mt-cd-dos)
      05 mt-rec-1.
          10 mt-cd-imp.
              15 mt-regl      pic x(6).                       0004 0009  006
              15 mt-serv      pic xx.                         0010 0011  002
          10 mt-division      pic 9.                          0012 0012  001 n  1
          10 mt-terme         pic 9999.                       0013 0016  004 n  4
          10 mt-perio         pic 99.                         0017 0018  002 n  2
          10 mt-mes-cont      pic 9(10)v999  comp-3.          0019 0025  007pn 13
          10 mt-taux          pic 9(4)v9(5)  comp-3.          0026 0030  005pn  9
          10 filler001        pic x(8).                       0031 0038  008
          10 mt-cd-anc        pic 9.                          0039 0039  001 n  1
          10 filler002        pic x(40).                      0040 0079  040
 *
 * r/t 2 - identified by '2' in 1st byte (mt-cd-dos)
      05 mt-rec-2 redefines mt-rec-1.
          10 mt-cd-imp-2.
               15 mt-regl-2   pic x(6).                       0004 0009  006
               15 mt-serv-2   pic xx.                         0010 0011  002
          10 mt-mod-2         pic x.                          0012 0012  001
          10 mt-rol-2.
               15 mt-ex2  pic 99.                             0013 0014  002 n  2
               15 filler003  pic x.                           0015 0015  001
               15 mt-qt2  pic x.                              0016 0016  001
               15 filler004  pic x(13).                       0017 0029  013
          10 mt-matricu-2     pic x(17).                      0030 0046  017
          10 mt-mesur-2       pic 9(8)v999 comp-3.            0047 0052  006pn 11
          10 filler005        pic x(27).                      0053 0079  027
 ***************** end of e221004b.cpy **********************
 *RCSZ=00080
Note
  • the packed fields are in different locations in R/T '1' & R/T '2'
  • see the 'mvc' instructions generated in the uvcopy job on the next page

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

10H2. Generating jobs to convert Multi-Record-Type files

Generate job to convert EBCDIC to ASCII & preserve packed


 #4. uvcopy uvdata42,fili1=maps/e221004b,filo1=pfx1/e221004b
     =======================================================
     - generate uvcopy job to convert 1 data file from EBCDIC to ASCII
     - generates a skeleton uvcopy job from the record layout (cobmap)

sample skeleton job to convert EBCDIC to ASCII

 # e221004b - uvcopy EBCDIC to ASCII, preserve packed, fix signs
 opr='e221004b - uvcopy job generated from copybook: E221004B '
 was=a33000b33000
 fili1=?d1ebc/e221004b,rcs=00080,typ=RSF
 filo1=?d2asc/e221004b,rcs=00080,typ=RSF
 @run
        opn    all
 loop   get    fili1,a0
        skp>   eof
        mvc    b0(00080),a0       move rec to outarea before field prcsng
        tra    b0(00080)          translate entire outarea to ASCII
 #      ---                <-- insert R/T tests here for redefined records
 typ___ mvc    b19(12),a19             pn  mt-mes-cont:mt-taux
        skp    put1
 #      ---
 typ___ mvc    b47(6),a47              pn  mt-mesur-2
 put1   put    filo1,b0
        skp    loop
 eof    cls    all
        eoj

Notes re translation & packed field preservation

  1. The entire record is translated to ASCII by the 'tra' instrn on line 11

  2. The packed fields are preserved (same for Micro Focus as on the mainframe) by 'mvc'ing them from input to output to undo the prior translation.

  3. Note the 'mvc's reflect the different locations of the packed fields in the 2 different record types:
    typ___ mvc    b19(12),a19        <-- preserves packed fields for R/T '1'
    typ___ mvc    b47(6),a47         <-- preserves packed fields for R/T '2'
  1. Note that adjacent packed fields are combined to minimize the number of packed fields required. You can see from the copybook map on page '2E3' that R/T '1' had 2 packed fields at 19(7) & 26(5). Note that these are combined into 1 mvc instruction of 12 bytes.
    typ___ mvc    b19(12),a19        <-- preserves 2 adjacent packed fields
    typ___ mvc    b19(7),a19         <-- same as above (without combining)
           mvc    b26(5),a19

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

10H3 Generating jobs to convert Multi-Record-Type files

complete skeleton job with datafilenames (vs copybookname)


 #5. uvcopy uvdata46,fili1=ctl/ctlfile4,fild2=pfx1,fild3=pfx2,arg1=tu.f01.e212-no.trperm
     ======================================================================
     - complete the uvcopy job with actual datafilenames & indexed file keys
     - jobs generated for control file lines matching arg1 datafilename/prefix
     - jobs in pfx2 named for datafiles in control file (vs copybooks in pfx1)

 #6. cp pfx2/tu.f01.e212-no.trperm pfx3 <-- copy uvcopy job to execution dir
     ==================================   - uvcopy jobnames same as datafilenames

 #7. vi pfx3/tu.f01.e212-no.trperm      <-- edit job as required
     =============================
     - changes required if file contains multiple record types
     - test record types & skip to instructions generated for redefined records
     - may need to read instructions for record types not redefined
     - read from pfx1a (instructions only extracted from generated jobs)

completed job to convert EBCDIC to ASCII & preserve packed

 # tu.f01.e212-no.trperm - uvcopy EBCDIC to ASCII, preserve packed, fix signs
 opr='tu.f01.e212-no.trperm - uvcopy job generated from copybook: E221004B '
 #ctlfile: tu.f01.e212-no.trperm cpy=e221004b rca=00080 rcm=00080 rcf=00128 typ=RSF
 was=a33000b33000
 fili1=?d1ebc/tu.f01.e212-no.trperm,rcs=00128,typ=RSF
 filo1=?d2asc/tu.f01.e212-no.trperm,rcs=00128,typ=RSF
 @run
        opn    all
 loop   get    fili1,a0
        skp>   eof
        mvc    b0(00128),a0       move rec to outarea before field prcsng
        tra    b0(00128)          translate entire outarea to ASCII
 #      ---                <-- insert R/T tests here for redefined records
 #Feb06/07 - R/T tests added by Owen Townsend                          <--*--
        cmc    b0(1),'1'                                               <--*--
        skp=   typ1                                                    <--*--
        cmc    b0(1),'2'                                               <--*--
        skp=   typ2                                                    <--*--
        msg    b0(80)                                                  <--*--
        msgw   'R/T col1 not 1/2 - enter to trnslt only'               <--*--
        skp    put1                                                    <--*--
 #
 typ1   mvc    b19(12),a19             pn  mt-mes-cont:mt-taux
        skp    put1
 #      ---
 typ2   mvc    b47(6),a47              pn  mt-mesur-2                  <--*--
 #
 put1   put    filo1,b0
        skp    loop
 eof    cls    all
        eoj
Note
  • We identified the manually edited R/T testing instructions with <--*--
    on the right hand side.

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

10I1. Converting Mainframe DATA to unix/linux/windows

Pre-Requisites for Executing DATA conversion jobs

  1. transfer mainframe datafiles to $CNVDATA/d0ebc

  2. transfer copybooks to $CNVDATA/cpys

  3. generate mainframe LISTCAT reports & transfer to $CNVDATA/ctl/listcat0

  4. rename datafiles to lower case, drop unwanted suffixes (CLUS.VSEPRD, etc)

  5. create the control file to guide generation of jobs to convert data

  6. generate uvcopy jobs to convert the datafiles

  7. uvcopy jobs to convert files are auto-generated in subdir pfx2/... and copied to subdir pfx3/... before any modifications & execution

  8. make any manual changes required for files with multiple record types (none for this Pilot Project)

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

10I2. Converting Mainframe DATA to unix/linux/windows

Executing jobs to convert ALL data files

 MF----->$CNVDATA/d0ebc-------->d1ebc-------------->d2asc------>$TESTDATA/mstr
 #1 FTP              #2 copy       #3 EBCDIC->ASCII    #4 copy
                        rename     uvdata42/uvdata46
                     if required         pfx3/...

 #0a. Login as pilot1 --> /home/pilot1

 #0b. cdc ---> $CNVDATA    ('cdc' is an alias in common_profile)

 #1. cp d0ebc/* d1ebc
     ================
     - copy datafiles to alt subdir for filename changes

 #2a. renameL d1ebc
      =============
      - translate datafilenames to lower case (standard for unix/linux)
      - usually already translated to lower case earlier in conversion

 #2b. rename-X d0ebc .clus.vseprd
      ===========================
      - remove unwanted suffixes (.clus.vseprd, .clus.vsedev, etc)
      - do not apply to unix, do not need test/production indicators
      - test/prod provided by differences in profiles for prgrmrs/oprtrs
        with no need to have different filenames (or JCL/scripts)

 #2c. rename-X d0ebc .dat   <-- NOT recommended, ONLY if necessary
      ===================
      - old versions of Micro Focus COBOL may not respect IDXNAMETYPE=2
        option in extfh.cfg (see listing at VSECOBOL.htm#5D2)

 #3. uvcopyxx 'pfx3/*'
     =================
     - execute ALL uvcopy jobs in pfx3/... to convert all data files
     - copies all data files from d1ebc/... to d2asc/...
     - translating char fields from EBCDIC to ASCII
     - preserving any packed/binary fields (same as on mainframe)

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

10I3. Converting Mainframe DATA to unix/linux/windows

Copying converted Data files to test directories

After data file conversion & before we can begin testing, we need to copy the converted data files from $CNVDATA/d2asc/... to $TESTDATA/mstr/...

This procedure can be repeated any time that testing has destroyed the integrity of the set of co-ordinated data files.


 #6a. rm -f $TESTDATA/mstr/*
      ======================
      - remove old files & any extra files generated thru testing

 #6b. cp -f d2asc/* $TESTDATA/mstr
      ============================
      - copy all converted files for the next round of testing

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

10J1. JCL/script conversion assisted by Datafile conversion

create JCL Data-Info control file from LISTCAT

We have already shown on page '10F1' - '10F2' how the mainframe LISTCAT is used to create the 'DATA conversion control file' ($CNVDATA/ctl/ctlfile4).

Here we will illustrate how to use the LISTCAT info to also create a 'JCL conversion control file' ($TESTLIBS/ctl/listcat3I). The JCL converter will still run without ctl/listcat3I, but the conversion will be improved if it is available.

Pages '10F1' - '10F2' showed how record-sizes & indexed file key locations are extracted from the mainframe LISTCAT report into a control file (ctl/listcat2), which has 1 line per datafile with file info coded as keywords (rca=... rcm=... key=...).

You can use the 'jcl2ksh41A' script to perform all steps of JCL conversion with 1 command (see page '4N2' & script listing on page '9A2'). Note that step#3 in jcl2ksh41A is utility job 'jcldata41', which extracts all DLBLs/TLBLs from all JCL. These are sorted & duplicates dropped resulting in 1 line per unique datafilename found in all JCL. The output is written to $TESTLIBS/ctl/datafiles41.

The JCL converter uses the 2 Indexed files above to get file characteristics. 'listcat3I' has priority over 'datafiles43I'. The 'M' in 'typLM...' assigns these files to mstr/..., else to wrk/..., but TLBL files to tape/...

You can customize your conversion by modifying ctl/listcat3 & reloading the indexed file version ctl/listcat3I (using the 'loadcat3I' uvcopy job supplied).

You cannot customize datafiles41 since it is generated as part of the JCL conversion process, but you can create ctl/datafiles42 which is sorted with datafiles41 before loading ctl/datafiles43I used by the JCL converter.

To help you understand the process, the next page will show you a few lines of the 2 control files.

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

10J2. JCL/script conversion assisted by Datafile conversion

ctl/listcat3I - file info #1 for JCL converter

listcat3I is created by transferring the mainframe LISTCAT report, processing (as shown on page '4H1' & '4I12'),& loading into an indexed file.

 e2121653.mtaxe.piscines        rca=00082 rcm=00082 key=000(020) typLMC=IDXf1
 e2121656.itaxe.facturat        rca=00083 rcm=00239 key=000(036) typLMC=IDXf8v
 e2121853.mtaxe.b8409d35        rca=00024 rcm=00024 key=000(011) typLW_=IDXf1
 e2122683.itaxe.degrevem        rca=00158 rcm=00265 key=000(037) typLMC=IDXf8v
 e2122941.mtaxe.permispn        rca=00045 rcm=00045 key=000(022) typLMC=IDXf1
 e2122942.mtaxe.droitmut        rca=00030 rcm=00030 key=000(011) typLMC=IDXf1
 e2123001.itaxe.banqtaxe        rca=00126 rcm=00383 key=000(036) typLMC=IDXf8v
 e2123002.itaxe.taxation        rca=00046 rcm=00383 key=000(035) typLMC=IDXf8v
 e2123003.itaxe.transdam        rca=00464 rcm=00464 key=000(000) typLMC=RSR
 e2123004.itaxe.tranjour        rca=00464 rcm=00464 key=000(000) typLW_=RSF
 e2123005.mtaxe.tpcalcul        rca=00081 rcm=00081 key=000(029) typLMC=IDXf1
 e2123086.itaxe.encapost        rca=00080 rcm=00080 key=000(000) typLW_=RSF
 e2123691.itaxe.indexenc        rca=00036 rcm=00036 key=000(036) typLMC=IDXf1
 e2123692.itaxe.encaisse        rca=00146 rcm=00426 key=000(022) typLMC=IDXf8v
 e2123693.itaxe.tranksds        rca=00168 rcm=00453 key=000(017) typLMC=IDXf8v

ctl/datafiles43I - file info #2 for JCL converter

 e1133081.tfadm.b8306j02        rca=00464 rcm=00464 key=000(000) typJWV=RSF
 e2121653.mtaxe.piscines        rca=_____ rcm=_____ key=000(000) typJWV=RSF
 e2121656.itaxe.facturat        rca=00083 rcm=00239 key=000(036) typJWV=IDXf8v
 e2122680.ttaxe.b8401d30        rca=03180 rcm=03180 key=000(000) typJWV=RSF
 e2122683.itaxe.degrevem        rca=00158 rcm=00265 key=000(037) typJWV=IDXf8v
 e2122951.mtaxe.matrenov        rca=_____ rcm=_____ key=000(000) typJWV=RSF
 e2122958.ttaxe.b8409d36        rca=00236 rcm=00236 key=000(000) typJWV=RSF
 e2123001.itaxe.banqtaxe        rca=00126 rcm=00383 key=000(036) typJWV=IDXf8v
 e2123002.itaxe.taxation        rca=_____ rcm=_____ key=000(000) typJWV=RSF
 e2123003.itaxe.transdam        rca=_____ rcm=_____ key=000(000) typJWD=RSF
 e2123004.itaxe.tranjour        rca=00464 rcm=00464 key=000(000) typJWV=RSF
 e2123005.mtaxe.tpcalcul        rca=00081 rcm=00081 key=000(029) typJWV=IDXf1
 e2123010.ttaxe.sommtrie        rca=00464 rcm=00464 key=000(000) typJWV=RSF
 e2123011.ttaxe.rembours        rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v
 e2123013.ttaxe.c3001d31        rca=00360 rcm=00360 key=000(000) typJWV=RSF
 e2123013.ttaxe.rembtrie        rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v
 tu.f01.e211801.adrpos          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f01.e212-no.eauctr          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f01.e212-no.trperm          rca=_____ rcm=_____ key=000(000) typJWT=RSF
 tu.f02.bkfaver.90-m07          rca=_____ rcm=_____ key=000(000) typJWT=RSF

The JCL converter uses the 2 Indexed files above to get file characteristics. 'listcat3I' has priority over 'datafiles43I'. The 'M' in 'typLM...' assigns these files to mstr/..., else to wrk/..., but TLBL files to tape/...

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

10J3. JCL/script conversion assisted by Datafile conversion

creating listcat3I (data-file-info) for JCL converter

Most of these procedures are automatic, but we provide you an opportunity to enhance the JCL conversion by manually updating the listcat2/3/3I control file to add datafiles that are missing from LISTCAT or to update file characteristics that you want to change for unix/linux.

You might only need to transfer & extract file info from LISTCAT once at the begining of the conversion, but you might update listcat3 & reload listcat3I several times to improve the conversion results.

We assume here that you have completed the procedures shown on page '10F1' to extract file info from LISTCAT. Those procedures may have already transferred listcat2 from $CNVDATA/ctl/... to $TESTLIBS/ctl/..., but we will repeat that step again in the instructions below.

update/load listcat3I (for JCL converter)


 #1a. Login as yourself or pilot1

 #1b. cdl ---> $TESTLIBS

 #2. cp $CNVDATA/ctl/listcat2 ctl
     ============================
     - copy LISTCAT info from data conversion superdir to JCL conversion dir

 #3. cp ctl/listcat2 ctl/listcat3
     ============================
     - copy/rename to protect future edits in listcat3
     - data convert procedures copy to listcat2, never to listcat3
     - only these JCL procedures will copy listcat2 to listcat3 & edit as reqd

 #4. vi ctl/listcat3
     ===============
     - update LISTCAT info as desired
     - add files missing when LISTCAT created on mainframe
     - modify/append keyword info on existing files as desired
Note
  • you probably would not update on the initial conversion
  • but you might update several times during conversion
  • then rerun jcl2ksh41A to get new file info into all JCL/scripts
  • updates get into jcl3/... not into jcls/... (already debugged)
  • but early in conversion most JCL/scripts still in jcl3/...
  • since we copy 1 at a time from jcl3/... to jcls/... when ready to debug

 #5. uvcopy loadcat3I,fili1=ctl/listcat3,filo1=ctl/listcat3I
     =======================================================
     - load LISTCAT info into Indexed file used by JCL converter

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

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

10K1. Converting YOUR VSE JCL to Korn shell scripts

                   ** directories involved in JCL conversion **
 /p1
 :-----testlibs        - RUNLIBS=$TESTLIBS=/p1/testlibs
 :     :-----
 :     :--MF--ctl    <-- control files
 :     :------         - jclunixop41 specifies options for JCL conversion
 :     :------         - listcat3I supplies file types,recsizes,indexed keys
 :     :------         - datafiles41 (filenames) extracted from all JCL
 :     :------           supplies file info for files missing from listcat3I
 :     :------           (because work files scratched, not present for LISTCAT)
 :     :------         - you can edit datafiles42 to override datafiles41 entries
 :     :------
 :     :--MF--jcl0   <-- your JCLs transferred from mainframe
 :     :------jcl1     - intermediate conversion 73-80 cleared
 :     :------jcl2     - PROCs expanded from procs
 :     :------jcl3     - JCLs converted to Korn shell scripts
 :     :------jcls     - copy here manually 1 by 1 during test/debug
 :     :-----
 :     :--MF--proc0  <-- your PROCs transferred from mainframe
 :     :------
 :     :--MF--slis   <-- SLI library may be included in JCLs
 :     :------

JCL conversion steps

 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh      manual copy
                                                             1 at a time

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

10K2. Converting YOUR VSE JCL to Korn shell scripts

convert All JCL using 'jcl2ksh41A' script

For your initial conversion we recommend you use the 'step by step' method (starting on page '4K1'), because you can more easily notice any errors.

But for our pilot project we used the 'do everything' script 'jcl2ksh41A' because we had already run it on all JCL in the high volume directories, and were confident using it for our pilot project.


 #1. Login as pilot1 ---> /home/pilot1

 #2a. cd $TESTLIBS  <-- change to the conversion superdir '/p1/testlibs'
      ============

 #2b. cdl           <-- same as above but easier
      ===              alias cdl='cd $RUNLIBS' is defined in the profile

 #3. jcl2ksh41A all  <-- convert JCL thru all steps, as illustrated below
     =============    - reply null (take default) at all prompts
                      - or reply 'y' for prompts that demand a y/n response
                      - see jcl2ksh41A script listed on page '9A2'
 jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
      cleanup       PROC/SLI expand      convert to ksh     copy 1 at a time
                                                          (before test/debug)

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

10L1. Pilot Project prior to high volume conversions

JCL/script & COBOL Cross-References

Cross-references are essential both for conversion and ongoing maintenance at any site running applications based on COBOL & JCL (now Korn shell scripts). Vancouver Utilities provides the following cross-references, which can all be quickly regenerated with 1 command (xrefall) any time the JCL/scripts & COBOL programs are substantially modified.


 xrefall cbls jcl3 ksh    <-- generate All COBOL & JCL cross-references
 =====================
      xcobcall1  - list of all CALLED-PROGRAMs in each PROGRAM
      xcobcall2  - crossref all PROGRAMS calling any 1 CALLED-PROGRAM
      xcobcopy1  - list all COPYBOOKS in any 1 PROGRAM
      xcobcopy2  - crossref all PROGRAMS copying any 1 COPYBOOK
      xkshfile1 - list all DATAFILES used in any 1 ksh SCRIPT
      xkshfile2 - crossref show all ksh SCRIPTs using any 1 DATAFILE
      xkshprog1 - list all PROGRAMs executed in any 1 ksh SCRIPT
      xkshprog2 - crossref show all ksh SCRIPTS executing any 1 PROGRAM

sample cross-ref - programs using each copybook

 xcobcopy2 ** crossref all PROGRAMS using each COPYBOOK **
 Keyword=copy:include  Exclude=unix Include=.cpy  page#  1
 Directory=/home/mvstest/testlibs/cbls Options=q1a16b16c4e0d0j0l0s2w1a16b16c4e3l1q0i7
 =======================================================2008/04/05_11:46:21
  custmas.cpy      car100.cbl      car120.cbl      car130.cbl      car140.cbl
  ____________6    car150.cbl      car200.cbl
 *paymas.cpy       cpy100.cbl
  saledtl.cpy_2    car150.cbl      car200.cbl
  sdline.cpy       car200.cbl
  stline.cpy       car200.cbl
Note
  • the '*' above indicates missing copybooks

See all cross references at www.uvsoftware.ca/cnvaids.htm#Part_3

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

10L2. Pilot Project prior to high volume conversions

COBOL Files Report

For each file used in each program, this report shows:

  1. external name from the 'select' stmnt (to match DDname in JCL)
  2. Organization & Access Method
  3. Open mode - Input, Output, Extend, Input-Output
  4. Record-size
  5. Copybook name (if any)
  6. internal name from the 'select' stmnt

See sample report on the next page --->

All programmers should have a copy of this report before they begin testing & debugging. It supplies instant answers to questions about file inputs & outputs, access methods, record sizes, copybooks, etc.

cobfiles5A - COBOL files report & load Indexes for jobflow


 #1. cobfiles5A cbls    <-- generate xref/cobfil51a & load xref/cobfil51I
     ===============

 #2. uvlp12 xref/cobfiles.rpt   <-- list the COBOL files report
     ========================       see sample report on the next page -->

The jobflow reports (see further below) require Indexed files loaded by cobfiles5A to merge COBOL file info with the JCL/script info. 'cobfiles5A' is a handy script to both generate the cobfiles report & load the Indexed file that will be required by jobflow51 & jobflow5A. See the 'cobfiles5A' script listed at XREFjobs.htm#3X1

sample COBOL files report

 cobfil51  ** COBOL Files Report ** Dir=cbls  2009/08/30_17:47:40
 progname.cbl DDname       OAM   open recsz  copybook.cpy  FDname / Key    lines
 ============================================se=in=up=de=========================
 car100.cbl   custmas      SS    I      256  custmas.cpy   custmas
 car100.cbl   nalist       L     O      120                nalist
                                                                              52
 car120.cbl   custmas      SS    I      256  custmas.cpy   custmas
 car120.cbl   nalist       L     O       90                nalist
                                                                              71
 car200.cbl   saledtl      SS    I       64  saledtl.cpy   saledtl
 car200.cbl   custmas      IR    I      256  custmas.cpy   custmas
 car200.cbl          key->                                    cm-cust
 car200.cbl   salelst      L     O      120  sdline.cpy    salelst
                                                                              65
 cgl200.cbl   glmsold      SS    I       80                glmsold
 cgl200.cbl   glmsnew      SS    O       80                glmsnew
 cgl200.cbl   gltrans      SS    I       80                gltrans
                                                                              61
 Total programs = 14, total files = 25

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

10L3. COBOL files & JCL JobFlow reports

Job-Flow reports

The 'JobFlow' reports are your guide to testing & debugging. They show you the programs & datafiles used in each step of each JCL/script. I recommend you print these out before you start your testing & debugging.

The JObFlow reports extract the essential info about each datafile in each step. The file info from the COBOL program is inserted onto the matching info from the JCL. The following items are shown for each file in each step.

  1. JCL Job Step# & Program name
  2. JCL DDname (matching COBOL external name)
  3. COBOL Organization & Access Methods
  4. COBOL Open mode - Input, Output, Extend, Input-Output
  5. COBOL Record-size
  6. COBOL Copybook name (if any)
  7. JCL DSNname (physical filename)

    JobFlow sample report

 jclfil53  ** JobFlow Report I/O files info **  20100329 page#0001
 stp# progname.cbl DDname  genf  OAM   open recsz  copybook.cpy  data-file-name
 ==============================================================================
 jar200.ksh
 0010 sort.cbl     sortin                                        ar/sales.items
                   sortout                                       $JTMP/__tempsls
 0010 uvsort       fili1=typ=RSF,rcs=64,       64                $SORTIN
                                                                 ar/sales.items
                   filo1=typ=RSF,rcs=64,       64                $SORTOUT
                                                                 $JTMP/__tempsls
                   keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
 0020 car200.cbl   sysout                                        $SYOT/${JOBID2}_${JSTEP}_${PROGID}
                   saledtl       SS_   I___    64  saledtl.cpy   $JTMP/%sales.sortfile
                   custmas       IR_   I___   256  custmas.cpy   ar/customer.master.indexed
                   sys035        S__   O___   120  sdline.cpy    $RPTS/salesrpt_E_car200_${JSTEP}_01
                   sysin                                         $JTMP/${JSTEP}_${PROGID}

JCL/script 'jar200.ksh' is a 2 step job with a SORT & a COBOL program with 4 data files. See jar200.ksh listed at MVSJCL.htm#1D2.

The JobFlow reports are listed by 'uvlp12L' which allow for 120 characters wide on 8 1/2 x 11 Landscape. We have removed the JCL/script name from the left & scrunched up to fit this documentation.

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

10L4. COBOL files & JCL JobFlow reports

Op. Instrns to generate JobFlow Reports

Script 'jobflow5A' generates ALL jobflow reports. You must have run 'cobfiles5A' to load an Indexed file for lookup by jobflow5A to include COBOL file information on the jobflow report. You would not print ALL job flow reports because of high volume & subject to change as you test/debug.

I recommend you use 'jobflow51' to generate & print the jobflow report for any 1 JCL/script. Regen & reprint any time you make significant changes to during testing & debugging.

Note
  • You must run 'cobfiles5A' (page '5C1') before jobflow5A or jobflow51
  • cobfiles5A generates indexed files of COBOL info used by jobflow5A/51

jobflow5A - generate All jobflow reports


 #1. cobfiles5A cbls cpys maps <-- generate xref/cobfil51a & load xref/cobfil51I
     =========================   - run now if not already run on page '5C1'

 #2. jobflow5A jcl3            <-- generate All JobFlow Reports
     ==============              - recommend alternative jobflow51 (1 at a time)

 #3. uvlpd12L jobflow          <-- would print ALL reports in subdir jobflow/...
     ================            - Do *NOT* print ALL JobFlow reports

You probably do NOT want to print all jobflow reports, since the reports would be very long & many could go out of date before you use them. It is better to print the individual jobflow report just before you intend to start test/debug for each JCL/script.

You can re-generate the report for any 1 JCL/script using script 'jobflow51' (regenerate when ever you substantially modify the JCL/script).

jobflow51 - generate jobflow report for 1 JCL/script


 #1. jobflow51 jcls/jar200.ksh   <-- generate JobFlow report for 1 job only
     =========================

 #2. uvlp12L jobflow/jar200.io   <-- print jobflow report for 1 JCL only
     =========================       (120 chars wide 8 1/2 x 11 Landscape)

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

10M1. Pilot Project prior to high volume conversions

Execute pilot project JCL/scripts

Our pilot project converted only 2 JCLs jcl0/28401A03.jcl & jcl0/28401A04.jcl, which have now been converted to Korn shell scripts in jcl3/28401a03.ksh & jcl3/28401a04.ksh. Script jcl2ksh41A converts all JCLs in jcl0/... thru jcl1/..., jcl2/... to jcl3/...

JCL/scripts must be copied from jcl3/... to jcls/... for execution because only jcl3 is in the profile PATH. We recommend you copy the scripts from jcl3 to jcls ONE at a time, just before you are ready to test/debug. But for our pilot project, we will simply copy them.


 #0a. Login pilot1 --> /home/pilot1
      ===========
 #0b. cdl --> alias 'cd $RUNLIBS' --> /home/pilot1/testlibs
      ===

 #1. cp jcl3/* jcls   <-- copy converted scripts to jcls (execution subdir)
     ==============

 #2a. 28401a03.ksh    <-- execute pilot project job #1
      ============

 #2b. 28401a04.ksh    <-- execute pilot project job #2
      ============

rerun & capture log


 #3a. joblog1 28401a03.ksh    <-- rerun, capturing console displays
      ====================        into joblog/28401a03.log

 #3b. vi joblog/28401a03.ksh  <-- investigate log`
      ======================

The joblog1 script are intended for programmers to capture 1 log at a time while testing/debugging. Production operators should turn on 'console logging' by uncommenting the 7 '##' lines at the end of their profile (originally from 'stub_profile').

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

10M2. Pilot Project prior to high volume conversions

rerun in $TESTDATA & capture joblogs

Note
  • it is usually better to run jobs in testdata/, so you can more easily
    check your output reports & data files.
  • run with 'joblog1' to capture the log in subdir joblog/...

 #1. cdd --> alias 'cd $RUNDATA' --> /home/pilot1/testdata
     ===

 #2. testdatainit             <-- remove temporary files from prior runs
     ============                 (jobtmp/*, wrk/*, sysout/*, rpts/*, tmp/*)

 #2a. joblog1 28401a03.ksh    <-- execute job #1 & capture log in joblog/...
      ====================

 #2b. joblog1 28401a04.ksh    <-- execute job #2 & capture log in joblog/...
      ====================

 #3a. vi joblog/28401a03.log  <-- inspect joblog from job #1
      ======================

 #3b. vi joblog/28401a03.log  <-- inspect joblog from job #2
      ======================

investigate outputs


 #4. l mstr      <-- list permanent files in mstr/ see if any new files created
     ======

 #5. l wrk       <-- list temporary files in wrk/  see if any new files created
     =====

 #6. llr rpts    <-- list files in rpts/ to see if any reports created
     ========      - use 'llr' to list all files in all subdirs
                   - since each day's reports will be in a separate subdir
                     (subdir named as yymmdd)

 #7. llr sysout  <-- list SYSOUTs for all jobs
     ==========    - sysout/ sub-directoried by jobname

 #8. llr jobtmp  <-- list all files in all subdirs within jobtmp/...
  `  ==========    - temporary files (SYSINs, %.files, GDGs, etc)
                   - only used for debugging

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

10M3. Pilot Project prior to high volume conversions

print reports


 #9. uvlp13LS rpts/yymmdd/xxx  <-- print a report on laser Landscape Simplex
     ========================    - script fits 132 cols x 66 lines on 8 1/2 x 11
                                 - or use 'uvlp13LD' for Landscape Duplex

 #10a. uvlpd12 sysout/28401A03  <-- print ALL sysouts from 28401a03.ksh
       =======================    - print all files found in directory
                                  - at 12 cpi Portrait (SYSOUTs usually 80 cols)
                                 - jobname directory may have multiple reports
                                   (could be 1 from each COBOL program)

 #10b. listall sysout/28401A03  <-- print ALL sysouts from 28401a03.ksh
       =======================    - prints all files on 1 report
                                  - does not start a new page for each file
                                    (since SYSOUTs often small)

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

10N1. Pilot Project prior to high volume conversions

converting EBCDIC back to ASCII

We will now show you how to generate & execute jobs to convert the ASCII files back to EBCDIC (& then compare the reconverted files to the original mainframe files).

You might do this to verify your conversions &/or you might need the ASCII to EBCDIC conversions to return some files to the maifnrame if you can not switch all applications over to unix/linux at the same time.

We could generate the ASCII to EBCDIC jobs using 'uvdata31' the opposite of 'uvdata51' that we used to generate EBCDIC to ASCII, but it is much better to use 'uvdata55' to convert our already generated EBCDIC-->ASCII jobs to ASCII-->EBCDIC jobs.

Besides saving steps, the big advantage is that this method saves having to duplicate any manual coding required for files with multiple Record Types. With the addition of uvdata55, pfx4,& uvcmp1all, our flow charts will then be:

Generate jobs: EBCDIC-->ASCII & ASCII-->EBCDIC

 cpys -------> maps --------> pfx1 --------> pfx2 ---------> pfx3 -------> pfx4
      cobmap1       uvdata51       uvdata52       copy/edit       uvdata55

Execute jobs: EBCDIC-->ASCII, ASCII-->EBCDIC,& compare

 Main -----> d1ebc ----------> d2asc ----------> d3ebc --------> rptcmp
 frame FTP   uvcopyxx 'pfx3/*'  uvcopyxx 'pfx4/*'    uvcmp1all   mismatch rpts

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

10N2. converting EBCDIC data-files back to ASCII

generate ASCII-->EBCDIC jobs - for ALL data-files


 #0a. Login as pilot1 --> /home/pilot1
      ===============
 #0b. cdc  alias cdc='cd $CNVDATA' --> /home/pilot1/cnvdata
      ===

 #1. mkdir pfx4       <-- make subdir for ASCII-->EBCDIC jobs
     ==========           (if not already existing)

 #2. uvcopyx uvdata55 pfx3 pfx4 uop=q0i7   <-- generate ALL jobs
     ===================================

Execute ALL jobs to convert ALL data-files


 #3. uvcopyxx 'pfx4/*'                     <-- execute ALL jobs
     =================

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

10N3. converting EBCDIC data-files back to ASCII

Compare ALL re-converted files to original EBCDIC files

You might want to compare all re-converted files to original EBCDIC files to verify conversions, or to return files to the mainframe, if all applications can not be migrated at the same time.


 #0a. Login as pilot1 --> /home/pilot1
      ===============
 #0b. cdc  alias cdc='cd $CNVDATA' --> /home/pilot1/cnvdata
      ===

 #1. mkdir rptcmp           <-- make subdir for mismatch reprots
     ============

 #2. uvcmp1all d1ebc d3ebc  <-- compare all original files to reconverted files
     =====================

 #3a. vi rptcmp/*          <-- inspect all mismatch reports
      ===========

 #3b. uvlpd12 rptcmp       <-- print all mismatch reports
      ==============

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

Permuted Index of Keywords from ** Headings **

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

4I4 $cnvdata: $CNVDATA/ctl/ctlfile4
4I4 $cnvdata: $CNVDATA/ctl/ctlfile4
5D3 $rundata: $RUNDATA subdirs BEFORE jgl100.ksh test GDG
5D5 $rundata: $RUNDATA subdirs AFTER jgl100.ksh run OK
5D8 $rundata: $RUNDATA subdirs AFTER jgl100.ksh run FAILURE
8A3 $rundata: $RUNLIBS/$RUNDATA used by JCL/scripts
8A4 $rundata: filenames defined 'RELATIVE' to $RUNDATA
8A3 $runlibs: $RUNLIBS/$RUNDATA used by JCL/scripts
5F1 $symbols: after replacing $SYMBOLS with values
5F1 $symbols: replace $SYMBOLS in gdgctl file
10M2 $testdata: rerun in $TESTDATA & capture joblogs
4I3 $testdata: subdirs for $TESTDATA
4I6 $testdata: Old method of copying data files to $TESTDATA/mstr
4I8 $testdata: Old method of copying data files to $TESTDATA/mstr
4I9 $testdata: copying converted data files to $TESTDATA
4D1 $testlibs: Copying VU control files & functions to Your $TESTLIBS
4D1 $testlibs: Copying VU ctl/... & sfun/... to Your $TESTLIBS

4D1 ..: Copying VU ctl/... & sfun/... to Your $TESTLIBS
4D1 ...: Copying VU ctl/... & sfun/... to Your $TESTLIBS
5E2 ...: gl/... files for GDG range demo

5D6 Abnormal: jgl100 run#2 - demo Abnormal Termination
5D9 Abnormal: jgl100 run#3 - AFTER Abnormal Termination
5D9 Abnormal: jgl100 run#3 - after Abnormal Termination
1C13 Abnormally: EOJ Terminated Normally/Abnormally
5D7 Abnormally: jgl100 run#2 - Terminated Abnormally
5D11 Abterm: gdgctl record - ABterm on run#2 & rerun #3 OK
8C1 Abterm: Forcing 'Abterm' to test GDG recovery
5B2 Abterms: Allowing for Abterms (don't increment GDGs)
10C2 Accessed: 'testdata' data files accessed by JCL/scripts
1T7 Account.acntlist_000gl/account.acntlist_000000
1T6 Account.master_: gl/account.master_ GDG file
5E12 Account.master_: Notes re gl/account.master_
5E1 Account.trans: sample gl/account.trans files
5E12 Account.trans_: Notes re gl/account.trans_
1U2 Activate: Activate Console Logging & Re-run demos
10B3 Actual: for actual conversion
6E3 Add: ctl/ctlfile_cm12 after edit/add '=L'
4Q1 Administrator: appsadm - Application Administrator
5A2 Advanced: Vancouver Utility GDG system - Advanced Features
4C9 Aliases: in profiles for quick change
4N3 Alldiff2: - diff report for all files in 2 dirs
5B2 Allowing: Allowing for Abterms (don't increment GDGs)
5K1 Alt: jobset51 - alt version of jobset51 Sep2009
6A4 Appended: control files with future dates appended
4Q1 Application: appsadm - Application Administrator
3B3 Appsadm: setting up profiles in /home/appsadm/env
4B2 Appsadm: setup 'profiles' for uvadm,appsadm,& your team
4Q1 Appsadm: - Application Administrator
8A6 Appsadm: profiles in appsadm/env/ vs uvadm/env/
1C3 Args: scriptpath & args
1C4 Arguments: JCL/script arguments
10C2 Ascii: 'cnvdata' to convert EBCDIC to ASCII
10G2 Ascii: Generating jobs to convert ALL datafiles EBCDIC to ASCII
10H2 Ascii: Generate job to convert EBCDIC to ASCII & preserve packed
10H2 Ascii: completed job to convert EBCDIC to ASCII & preserve packed
10H2 Ascii: sample skeleton job to convert EBCDIC to ASCII
10N1 Ascii: converting EBCDIC back to ASCII
10N1 Ascii-->ebcdic: Execute jobs EBCDIC-->ASCII, ASCII-->EBCDIC,& compare
10N1 Ascii-->ebcdic: Generate jobs EBCDIC-->ASCII & ASCII-->EBCDIC
10N2 Ascii-->ebcdic: generate ASCII-->EBCDIC jobs - for ALL data-files
1D1 Assgn: test/demo Conversion #3 - JAR120 ASSGN & LST
3E5 Assignment: Directory Assignment Rules
4E4 Assignment: topnode/subdir assignment
1S2 Attempting: BEFORE attempting to Test/Debug YOUR JCL/scripts
4L2 Available: Cross-Ref Reports Available

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

4C7 Backup: Backup/Restore Directories
4Q1 Backup: Setup Backup scripts now (vs later)
5A1 Basic: Vancouver Utility GDG system - Basic Features
4I3 Be: subdirs for DATA files to be converted
4L0 Begin: Preparations Required before test/debug can begin
6A1 Begin: Preparations Required before test/debug can begin
1C7 Better: example#2 - better way to prompt & verify a variable
1C7 Better: example#3 - even better way to prompt & verify a variable
1S2 Binders: Three Ring Binders with Index Tabs
5J4 Bounds: exportgenx - report err if gen# out of bounds

10D5 Called: determine called programs from Program/called xref
10D5 Called: determine called programs from Program/called xref
4L0 Can: Preparations Required before test/debug can begin
6A1 Can: Preparations Required before test/debug can begin
10M1 Capture: rerun & capture log
10M2 Capture: rerun in $TESTDATA & capture joblogs
1U4 Capture: joblog1 - capture logs via 'tee'
4M3 Capture: joblog1 - capture logs via 'tee'
8G1 Capturing: logs from cron jobs by mail
1T3 Car100: jar100/car100 - sample output report
6A4 Card: control card selections by current date
1Q2 Cards: cleanup mainframe JCL, PROCs,& Control Cards
4L4 Cards: extract control cards from 1 JCL/script
4L4 Cards: initial extract All control cards
4L4 Cards: jobparmx1 - extract control cards from JCL/scripts
6A1 Cards: jobparmx1 - extract control cards from JCL/scripts
6A2 Cards: extract control cards from 1 JCL/script
6A2 Cards: initial extract control cards
5F0 Caveats: GDG system - Caveats
5B4 Changing: disadvantages of changing the JCL/scripts
6C0 Changing: 6C1. changing DATA file-types & record-sizes
6C1 Changing: 1. changing data-files from Fixed-Length to Text
6D1 Changing: file-types & record-sizes in JCL/scripts
6E1 Changing: file-types in COBOL programs
5C4 Char: display gdgctl Indexed file with uvhd (char mode)
1T2 Check: Check I/O for jar100.ksh
1T4 Check: Check I/O for jcls/jar200.ksh
1T1 Checking: Checking Test/Demo Results
4C10 City: City of Lynn Valley Alternative Design
4N1 City: alternate example from City of Lynn Valley
4O3 City: uvhdcob sample for City of Lynn Valley
8F1 Cleaning: up the log files
1Q2 Cleanup: mainframe JCL, PROCs,& Control Cards
1R3 Cleanup: step#1 - cleanup code
6B1 Cleanup: jclstrip1 - cleanup converted JCL/scripts
4M2 Clear: testdatainit - clear output subdirs before testing
9A7 Clear: jcclear - clear the pause control file
4M2 Cleared: TESTDATA subdirs cleared by testdatainit
1F4 Cluster: jgl360.jcl IDCAMS DEFINE CLUSTER - Create VSAM
1F5 Cluster: jgl360.ksh IDCAMS DEFINE CLUSTER converted to uvcp
1C7 Cmd: example#1 - prompt for date if not entered on cmd line
10C2 Cnvdata: 'cnvdata' to convert EBCDIC to ASCII
10E2 Cnvmf41a: converting All PROGRAMs with 'cnvMF41A'
10E2 Cnvmf41ac: prompts & replies for 'cnvMF41Ac'
10L2 Cobfiles5a: cobfiles5A - COBOL files report & load Indexes for jobflow
10C3 Cobol: 'testlibs' JCL/COBOL libraries for conversion & execution
10D3 Cobol: determine COBOL PROGRAMS from JCL/Program xref
10D3 Cobol: select the COBOL programs for the pilot project
10D4 Cobol: select the COBOL COPYBOOKS for the pilot project
10D5 Cobol: select the COBOL COPYBOOKS for the pilot project
10E3 Cobol: notes re COBOL compiles
10L1 Cobol: JCL/script & COBOL Cross-References
10L2 Cobol: COBOL Files Report
10L2 Cobol: cobfiles5A - COBOL files report & load Indexes for jobflow
10L2 Cobol: sample COBOL files report
1B1 Cobol: test/demo JCL PROCs,& COBOL
1C11 Cobol: COBOL EXECs converted to 'cobrun's
1C8 Cobol: sample conversion of 1 step COBOL JCL
1R1 Cobol: Converting Mainframe COBOL to Unix/Linux
1R1 Cobol: converting All Copybooks & COBOL programs
1R1 Cobol: scripts to perform all COBOL conversion steps
1R2 Cobol: Converting Mainframe COBOL CopyBooks to Unix/Linux
1R2 Cobol: step by step procedures for COBOL conversion
1R3 Cobol: Convert ALL COBOL programs - Overview
1R5 Cobol: COBOL Compile Error reports
1R6 Cobol: Note re MicroFocus COBOL
4G1 Cobol: Converting COBOL copybooks/programs & Compiling
4G2 Cobol: Converting 1 COBOL copybook/program & Re-compiling
4L2 Cobol: Cross References for COBOL & JCL/scripts
6E1 Cobol: change COBOL file types - plan/overview
6E1 Cobol: changing file-types in COBOL programs
6E2 Cobol: procedure to change COBOL files to OLS
8B1 Cobol: sample JCL/script for COBOL with cc test
1C11 Cobrun: COBOL EXECs converted to 'cobrun's
1U1 Collection: Console Log Collection subdirs
8D1 Command: Restart command
10D4 Commands: EASIER alternative to above manual commands
10D5 Commands: EASIER alternative to above manual commands
4B3 Common_defines:
8A2 Common_profile: stub_profile,& common_profile
10N1 Compare: Execute jobs EBCDIC-->ASCII, ASCII-->EBCDIC,& compare
10N3 Compare: Compare ALL re-converted files to original EBCDIC files
0A7 Compile: Compile 'C' programs if not Linux
1R4 Compile: copy & compile
1R5 Compile: COBOL Compile Error reports
1R6 Compile: Compile Error Summaries
1R6 Compile: printing compile failure reports
4G2 Compile: only if compile fails
10E3 Compiles: notes re COBOL compiles
10E3 Compiling: All PROGRAMs with 'mfcblA'
4G1 Compiling: Converting COBOL copybooks/programs & Compiling
4G1 Compiling: converting All PROGRAMs & compiling
10H2 Completed: job to convert EBCDIC to ASCII & preserve packed
5J3 Concatenate: exportgenall concatenate all generations
1C12 Condition: testing program Return Condition
8B1 Condition: Condition Codes (program status Return-Codes)
3E7 Configuration: extfh.cfg - File Handler Configuration
1S3 Console: Execute demo scripts & observe Console Displays
1U1 Console: Console Log Collection subdirs
1U1 Console: UV Console Logging Features
1U2 Console: Activate Console Logging & Re-run demos
1U3 Console: Console Log from demo JCL/scripts
4R1 Console: setup console logging
8F1 Console: Console Logging
8F2 Console: Viewing your console log files
8N6 Console: log illustrating restart
10C4 Control: files & functions for conversion & execution
10C6 Control: JCL converter control file - CTLTBL & TOPNODE table
10F1 Control: create Data Conversion Control File from LISTCAT
10F1 Control: create Data conversion control file
10F2 Control: create data conversion control file from LISTCAT
10F3 Control: Editing control file with copybook names
10J1 Control: create JCL Data-Info control file from LISTCAT
1D3 Control: stream data redirected to a file
1Q2 Control: cleanup mainframe JCL, PROCs,& Control Cards
1Q3 Control: Creating the DataFile Info control file
1Q3 Control: Creating the datafile info control file
3E1 Control: ctl/jclunixop41 JCL Conversion control file
3E2 Control: Customizing the JCL Conversion control file
4D1 Control: Copying VU control files & functions to Your $TESTLIBS
4D2 Control: script to copy supplied control files & functions
4E2 Control: jclunixop41 - topnode/subdir control
4H1 Control: create Data conversion control file from LISTCAT
4I2 Control: creating the data conversion control file
4L4 Control: extract control cards from 1 JCL/script
4L4 Control: initial extract All control cards
4L4 Control: jobparmx1 - extract control cards from JCL/scripts
5B3 Control: loading the GDG Indexed control file
5B3 Control: sample GDG control file
5C3 Control: updated control file supplied
6A1 Control: jobparmx1 - extract control cards from JCL/scripts
6A2 Control: extract control cards from 1 JCL/script
6A2 Control: initial extract control cards
6A4 Control: card selections by current date
6A4 Control: files extracted on Dec 01/06
6A4 Control: files with future dates appended
9A7 Control: jcclear - clear the pause control file
10C4 Conversio: control files & functions for conversion & execution
10C5 Converter: JCL converter options file
10C6 Converter: JCL converter control file - CTLTBL & TOPNODE table
10J2 Converter: ctl/datafiles43I - file info #2 for JCL converter
10J2 Converter: ctl/listcat3I - file info #1 for JCL converter
10J3 Converter: creating listcat3I (data-file-info) for JCL converter
10J3 Converter: update/load listcat3I (for JCL converter)
3E3 Converter: ctl/datafiles43I - file info #2 for JCL converter
3E3 Converter: ctl/listcat3I - file info #1 for JCL converter
4E1 Converter: Modifying JCL converter options
4I11 Converter: ctl/datafiles43I - file info #2 for JCL converter
4I11 Converter: ctl/listcat3I - file info #1 for JCL converter
4I12 Converter: update/load listcat3I (for JCL converter)
4K2 Converter: ctl/datafiles43I - file info #2 for JCL converter
10C4 Copy: copy/FTP LISTCAT from mainframe
1P3 Copy: demo files to your vsetest home dir
1R4 Copy: & compile
4D2 Copy: script to copy supplied control files & functions
4I8 Copy: scripts to reformat/sort/copy 1 file to test dir
10D4 Copybook: determine COPYBOOKs from Program/Copybook xref
10E2 Copybook: convert 1 copybook at a time
10F2 Copybook: Editing ctlfile with copybook names
10F3 Copybook: Editing control file with copybook names
10F3 Copybook: ctlfile4 sample after copybook names
10L1 Copybook: sample cross-ref - programs using each copybook
4G2 Copybook: Converting 1 COBOL copybook/program & Re-compiling
4G2 Copybook: converting 1 COPYBOOK at a time
4O2 Copybook: uvhdcob display copybook names with data
10H2 Copybookname: complete skeleton job with datafilenames (vs copybookname)
10D1 Copybooks: determine data-files, program,& copybooks required
10D4 Copybooks: determine COPYBOOKs from Program/Copybook xref
10D4 Copybooks: select the COBOL COPYBOOKS for the pilot project
10D5 Copybooks: select the COBOL COPYBOOKS for the pilot project
1R1 Copybooks: converting All Copybooks & COBOL programs
1R2 Copybooks: Converting Mainframe COBOL CopyBooks to Unix/Linux
4G1 Copybooks: Converting COBOL copybooks/programs & Compiling
4G1 Copybooks: converting All COPYBOOKs
10I3 Copying: Copying converted Data files to test directories
4D1 Copying: Copying VU control files & functions to Your $TESTLIBS
4D1 Copying: Copying VU ctl/... & sfun/... to Your $TESTLIBS
4I6 Copying: Copying converted Data files to test directories
4I6 Copying: Old method of copying data files to $TESTDATA/mstr
4I8 Copying: Old method of copying data files to $TESTDATA/mstr
4I9 Copying: converted data files to $TESTDATA
9A4 Copying: jclpx41 - expand PROCs from procs while copying jcl1 to jcl2
5F3 Correction: for files reassigned
5F5 Correction: method #1 (OK)
5F5 Correction: method #2 (NOK)
5F4 Corresponding: lines from converted script
8F2 Cron: processing logfiles by nightly cron jobs
8G1 Cron: capturing logs from cron jobs by mail
4L2 Cross: Cross References for COBOL & JCL/scripts
10L1 Cross-ref: sample cross-ref - programs using each copybook
4L2 Cross-ref: Cross-Ref Reports Available
10L1 Cross-references: JCL/script & COBOL Cross-References
4L2 Cross-refs: Operating Instructions for Cross-Refs reports
10J2 Ctl: ctl/datafiles43I - file info #2 for JCL converter
10J2 Ctl: ctl/listcat3I - file info #1 for JCL converter
3E1 Ctl: ctl/jclunixop41 JCL Conversion control file
3E3 Ctl: ctl/datafiles43I - file info #2 for JCL converter
3E3 Ctl: ctl/listcat3I - file info #1 for JCL converter
3E4 Ctl: ctl/datafiles41 - Notes
3E5 Ctl: samples from ctl/datafiles41
4D1 Ctl: Copying VU ctl/... & sfun/... to Your $TESTLIBS
4E6 Ctl: ctl/GDGmkdirs - make topnode/subdirs
4I11 Ctl: ctl/datafiles43I - file info #2 for JCL converter
4I11 Ctl: ctl/listcat3I - file info #1 for JCL converter
4I4 Ctl: $CNVDATA/ctl/ctlfile4
4I4 Ctl: $CNVDATA/ctl/ctlfile4
4K2 Ctl: ctl/datafiles43I - file info #2 for JCL converter
5M2 Ctl: gdgload1 - load indexed file ctl/gdgctl51I
6D2 Ctl: ctl/ctlfile_jm3
6E3 Ctl: ctl/ctlfile_cm12 after edit/add '=L'
8L2 Ctl: sample ctl/gdgctl51
10F2 Ctlfile: Editing ctlfile with copybook names
10F3 Ctlfile4: sample after copybook names
4I4 Ctlfile4: $CNVDATA/ctl/ctlfile4
4I4 Ctlfile4: $CNVDATA/ctl/ctlfile4
6E3 Ctlfile_cm11: sample ctlfile_cm11
6E4 Ctlfile_cm11: record layout
6E3 Ctlfile_cm12: ctl/ctlfile_cm12 after edit/add '=L'
6D2 Ctlfile_jm3: ctl/ctlfile_jm3
10C6 Ctltbl: JCL converter control file - CTLTBL & TOPNODE table
5J1 Current: exportgen0 determine current generation
6A4 Current: control card selections by current date
3B3 Customizing: the profile for Unix/Linux conversions
3C6 Customizing: Customizing Korn shell functions
3E2 Customizing: Customizing the JCL Conversion control file
4E4 Customizing: for YOUR Top-Nodes
4E5 Customizing: Top-Nodes - Procedures Required
5F2 Customizing: for your TOP-NODEs
0A8 Cygwin: SFU/UWIN/CYGWIN differences to Unix/Linux

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

10C2 Data: 'testdata' data files accessed by JCL/scripts
10F1 Data: create Data Conversion Control File from LISTCAT
10F1 Data: create Data conversion control file
10F2 Data: create data conversion control file from LISTCAT
10G1 Data: Directories Required to Generate jobs to convert Data Files
10G1 Data: Pre-Requisites for Generating jobs to convert DATA files
10H1 Data: illustrated example of data conversion
10I1 Data: Pre-Requisites for Executing DATA conversion jobs
10I2 Data: Executing jobs to convert ALL data files
10I3 Data: Copying converted Data files to test directories
1B2 Data: test/demo DATA files
1D3 Data: control stream data redirected to a file
4C4 Data: DATA Directories for Your Testing
4C5 Data: DATA Directories for Your Testing
4C6 Data: DATA Directories for Your Production
4C8 Data: Data Conversion Directories
4E3 Data: full-PATH or relative-PATH data filenames
4F1 Data: Transferring LIBS & DATA from the mainframe
4H1 Data: create Data conversion control file from LISTCAT
4I1 Data: Converting Your DATA files
4I2 Data: 'EXECUTE' data conversions here in VSEJCL
4I2 Data: GENERATING data conversion jobs
4I2 Data: creating the data conversion control file
4I2 Data: generating data conversion jobs
4I2 Data: subdirs to GENERATE 'data conversion uvcopy jobs'
4I3 Data: subdirs for DATA files to be converted
4I3 Data: subdirs to GENERATE 'data conversion uvcopy jobs'
4I5 Data: Executing jobs to convert ALL data files
4I6 Data: Copying converted Data files to test directories
4I6 Data: Old method of copying data files to $TESTDATA/mstr
4I7 Data: Executing 1 job to convert 1 data file
4I8 Data: Old method of copying data files to $TESTDATA/mstr
4I9 Data: copying converted data files to $TESTDATA
4O2 Data: uvhdcob display copybook names with data
5B1 Data: Data filename conversion
5B1 Data: Generation Data Groups
6A3 Data: sample embedded data in JCL & script
6C0 Data: 6C1. changing DATA file-types & record-sizes
10J3 Data-file-info: creating listcat3I (data-file-info) for JCL converter
10D1 Data-files: determine data-files, program,& copybooks required
10D2 Data-files: determine data-files from JCL/Files xref
10D2 Data-files: select the data-files for the pilot project
10N2 Data-files: Execute ALL jobs to convert ALL data-files
10N2 Data-files: generate ASCII-->EBCDIC jobs - for ALL data-files
6C1 Data-files: 1. changing data-files from Fixed-Length to Text
10J1 Data-info: create JCL Data-Info control file from LISTCAT
4I10 Data-info: create JCL conversion DATA-INFO file from LISTCAT
10G3 Datafil: Generating job to convert 1 datafile at a time
1Q3 Datafile: Creating the DataFile Info control file
1Q3 Datafile: Creating the datafile info control file
10H2 Datafilenames: complete skeleton job with datafilenames (vs copybookname)
10G2 Datafiles: Generating jobs to convert ALL datafiles EBCDIC to ASCII
3E4 Datafiles41: ctl/datafiles41 - Notes
3E5 Datafiles41: samples from ctl/datafiles41
4K3 Datafiles42: modifying JCL conversions with datafiles42
10J2 Datafiles43i: ctl/datafiles43I - file info #2 for JCL converter
3E3 Datafiles43i: ctl/datafiles43I - file info #2 for JCL converter
4I11 Datafiles43i: ctl/datafiles43I - file info #2 for JCL converter
4K2 Datafiles43i: ctl/datafiles43I - file info #2 for JCL converter
1C7 Date: example#1 - prompt for date if not entered on cmd line
1F3 Date: alternative to date/time stamp tape files
6A4 Date: control card selections by current date
1C7 Dates: jobset51 & operator prompts for dates, etc
6A4 Dates: control files with future dates appended
1S2 Debug: BEFORE attempting to Test/Debug YOUR JCL/scripts
4L0 Debug: Preparations Required before test/debug can begin
4M1 Debug: Test/Debug 1 JCL/script to fine tune conversion
6A1 Debug: Preparations Required before test/debug can begin
6A4 Dec: control files extracted on Dec 01/06
6A4 Dec15: filenames selected to jobparms1 on Dec15/06
1F4 Define: jgl360.jcl IDCAMS DEFINE CLUSTER - Create VSAM
1F5 Define: jgl360.ksh IDCAMS DEFINE CLUSTER converted to uvcp
8A4 Defined: filenames defined 'RELATIVE' to $RUNDATA
4C9 Defs: RUNLIBS/RUNDATA defs in 'stub_profiles'
0A7 Demo: Test/Demo files provided
1A1 Demo: Directory-Design for UV test/demo JCL Conversion
1A2 Demo: Notes re JCL/PROC test/demo subdirs provided
1B1 Demo: test/demo JCL PROCs,& COBOL
1B2 Demo: test/demo DATA files
1D1 Demo: test/demo Conversion #3 - JAR120 ASSGN & LST
1E1 Demo: test/demo Conversion #3 - JAR200 (SORT+COBOL)
1F1 Demo: test/demo #4 jgl350.jcl IDCAMS REPRO
1P1 Demo: Preparations for JCL test/demo conversions
1P1 Demo: alternative - setup demo files in your homedir
1P3 Demo: copy demo files to your vsetest home dir
1P4 Demo: alternative - setup demo files in your homedir
1S1 Demo: Executing the test/demo JCL/scripts
1S1 Demo: Operating Instructions to Execute the Test/Demo JCL/scripts
1S3 Demo: Execute demo scripts & observe Console Displays
1T1 Demo: Checking Test/Demo Results
1U3 Demo: Console Log from demo JCL/scripts
4C1 Demo: Directories for test/demo conversions in Part_1
4O2 Demo: uvhdcob demo from /home/uvadm
5D6 Demo: jgl100 run#2 - demo Abnormal Termination
5E2 Demo: Demo prior GDG & Range processing
5E2 Demo: JGL220 JCL to demo prior GDG processing
5E2 Demo: gl/... files for GDG range demo
5E4 Demo: setup to demo prior GDG & Range processing
5F4 Demo: JCL to demo Write GDG & Readback in 1 job
8B2 Demo: sample JCL/script, demo return-codes, GDGs, etc
0A7 Demos: Running Conversion Test/Demos
10B3 Demos: for the test/demos in this section
1P3 Demos: converting your own JCL ? (vs test/demos)
1P3 Demos: scripts for your own conversions (vs test/demos)
1U2 Demos: Activate Console Logging & Re-run demos
4L0 Depending: OPTIONAL jobs depending on site preferences
4C10 Design: Alternative file system design
4C10 Design: City of Lynn Valley Alternative Design
4C2 Designs: Alternative File System Designs
10D1 Desired: select JCLs desired for Pilot Project
8L1 Desired: Ex#2 - solicitating desired GDG generation#
3E5 Determination: TOPDIR Determination & Modification
4N3 Diff: alldiff2 - diff report for all files in 2 dirs
0A8 Differences: SFU/UWIN/CYGWIN differences to Unix/Linux
5K2 Differences: jobset51/jobset52 differences
4A1 Digging: before digging in to Part 4
1P3 Dir: copy demo files to your vsetest home dir
4I8 Dir: scripts to reformat/sort/copy 1 file to test dir
10C1 Directories: setup DIRECTORIES for Pilot Project
10G1 Directories: Directories Required to Generate jobs to convert Data Files
10I3 Directories: Copying converted Data files to test directories
4C1 Directories: Directories for test/demo conversions in Part_1
4C2 Directories: Directories for YOUR Conversion,Testing,& Production
4C4 Directories: DATA Directories for Your Testing
4C5 Directories: DATA Directories for Your Testing
4C6 Directories: DATA Directories for Your Production
4C7 Directories: Backup/Restore Directories
4C8 Directories: Data Conversion Directories
4I6 Directories: Copying converted Data files to test directories
6A1 Directories: jobparm directories
1Q5 Directory: Operating Instructions - Convert ALL JCLS in directory
3E5 Directory: Directory Assignment Rules
5E6 Directory: gl directory after 1st run
5E8 Directory: gl directory after 2nd run
1A1 Directory-design: Directory-Design for UV test/demo JCL Conversion
4N3 Dirs: alldiff2 - diff report for all files in 2 dirs
5B4 Disadvantages: of changing the JCL/scripts
4M3 Display: llr - display all files in multilevel subdirs
4O2 Display: uvhdcob display copybook names with data
5C4 Display: gdgctl Indexed file with uvhd (char mode)
5C7 Display: notes re display above
5J5 Display: exportfile - exports & display non-GDG filename
5C5 Displayed: gdgctl file displayed by uvhd
1S3 Displays: Execute demo scripts & observe Console Displays
1C9 Dlbl: 'DLBL' converted to 'exportfile'
5B1 Does: Generation# does not auto wrap
5B2 Don: Allowing for Abterms (don't increment GDGs)
0A8 Download: Download/Install Korn shell (1993)

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

10D4 Easier: EASIER alternative to above manual commands
10D5 Easier: EASIER alternative to above manual commands
5C6 Easier: alternative
4P1 Easytrieve: Easytrieve conversion to 'uvcopy'
10C2 Ebcdi: 'cnvdata' to convert EBCDIC to ASCII
10G2 Ebcdi: Generating jobs to convert ALL datafiles EBCDIC to ASCII
10H2 Ebcdi: Generate job to convert EBCDIC to ASCII & preserve packed
10H2 Ebcdi: completed job to convert EBCDIC to ASCII & preserve packed
10H2 Ebcdi: sample skeleton job to convert EBCDIC to ASCII
10N1 Ebcdic: converting EBCDIC back to ASCII
10N3 Ebcdic: Compare ALL re-converted files to original EBCDIC files
10N1 Ebcdic-->ascii: Execute jobs EBCDIC-->ASCII, ASCII-->EBCDIC,& compare
10N1 Ebcdic-->ascii: Generate jobs EBCDIC-->ASCII & ASCII-->EBCDIC
6E3 Edit: ctl/ctlfile_cm12 after edit/add '=L'
8K1 Edit: & test
10F2 Editing: Editing ctlfile with copybook names
10F3 Editing: Editing control file with copybook names
6A3 Embedded: sample embedded data in JCL & script
5A1 Enhancements: GDG Enhancements
8N2 Enhancements: notes re stage2 enhancements
8N2 Enhancements: sortsales2 - stage2 enhancements
8N3 Enhancements: notes re stage3 enhancements
8N3 Enhancements: sortsales3 - stage3 enhancements
8N4 Enhancements: notes re stage4 enhancements
8N4 Enhancements: sorttrans4 - stage4 enhancements
8N5 Enhancements: sorttrans5 - stage5 enhancements
8N6 Enhancements: notes re stage5 enhancements
1C7 Entere: example#1 - prompt for date if not entered on cmd line
3B1 Env: 'profiles' provided in /home/uvadm/env
3B3 Env: setting up profiles in /home/appsadm/env
8A6 Env: profiles in appsadm/env/ vs uvadm/env/
8A6 Env: profiles in appsadm/env/ vs uvadm/env/
8A1 Env-vars: Quiz profiles, env-vars, JCL/scripts, etc
1C13 Eoj: EOJ Terminated Normally/Abnormally
8C1 Eoj: new GDG's in Temp subdirs until Normal EOJ
5J4 Err: exportgenx - report err if gen# out of bounds
1R5 Error: COBOL Compile Error reports
1R6 Error: Compile Error Summaries
1C7 Even: example#3 - even better way to prompt & verify a variable
10H1 Example: illustrated example of data conversion
1C7 Example: example#1 - prompt for date if not entered on cmd line
1C7 Example: example#2 - better way to prompt & verify a variable
1C7 Example: example#3 - even better way to prompt & verify a variable
4N1 Example: alternate example from City of Lynn Valley
5B4 Exception: exportgen0 & gdgctl - Exception Processing
1C11 Execs: COBOL EXECs converted to 'cobrun's
10M1 Execute: Execute pilot project JCL/scripts
10N1 Execute: Execute jobs EBCDIC-->ASCII, ASCII-->EBCDIC,& compare
10N2 Execute: Execute ALL jobs to convert ALL data-files
1S1 Execute: Operating Instructions to Execute the Test/Demo JCL/scripts
1S3 Execute: Execute demo scripts & observe Console Displays
4I2 Execute: 'EXECUTE' data conversions here in VSEJCL
10I1 Executing: Pre-Requisites for Executing DATA conversion jobs
10I2 Executing: Executing jobs to convert ALL data files
1S1 Executing: Executing the test/demo JCL/scripts
4I5 Executing: Executing jobs to convert ALL data files
4I7 Executing: Executing 1 job to convert 1 data file
10C3 Execution: 'testlibs' JCL/COBOL libraries for conversion & execution
10C4 Execution: control files & functions for conversion & execution
1T1 Execution: subdirs & I/O files used in execution
1Q3 Expand: PROCs & SLIs in all JCL
9A4 Expand: jclpx41 - expand PROCs from procs while copying jcl1 to jcl2
5B6 Expiry: Expiry Times
1C4 Explained: jobset51 function - explained
1C6 Explained: jobset51 function - explained
1C9 Exportfile: 'DLBL' converted to 'exportfile'
5J5 Exportfile: - exports & display non-GDG filename
3D0 Exportgen: summary of exportgen functions
3D0 Exportgen0: GDG functions exportgen0,exportgen1,etc
5B4 Exportgen0: & gdgctl - Exception Processing
5B5 Exportgen0: & gdgctl rerun facility
5J1 Exportgen0: determine current generation
3D0 Exportgen1: GDG functions exportgen0,exportgen1,etc
5J2 Exportgen1: determine next generation
5M4 Exportgen1: gdgget51 for exportgen1 to get max gens from gdgctl51I
5J3 Exportgenall: concatenate all generations
5J4 Exportgenx: - report err if gen# out of bounds
5J5 Exports: exportfile - exports & display non-GDG filename
3E7 Extfh.cfg: - File Handler Configuration
1C4 Extract: jobset51 'extract' listing
1C5 Extract: 'jobset51' function - code extract from '5K1'
4L4 Extract: control cards from 1 JCL/script
4L4 Extract: initial extract All control cards
4L4 Extract: jobparmx1 - extract control cards from JCL/scripts
6A1 Extract: jobparmx1 - extract control cards from JCL/scripts
6A2 Extract: control cards from 1 JCL/script
6A2 Extract: initial extract control cards
5F1 Extracted: sample filenames extracted from JCL/scripts
6A4 Extracted: control files extracted on Dec 01/06

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

5B5 Facility: exportgen0 & gdgctl rerun facility
4G2 Fails: only if compile fails
1R6 Failure: printing compile failure reports
5D8 Failure: $RUNDATA subdirs AFTER jgl100.ksh run FAILURE
1U1 Features: UV Console Logging Features
5A1 Features: Vancouver Utility GDG system - Basic Features
5A2 Features: Vancouver Utility GDG system - Advanced Features
5K3 Features: jobend51 - support new GDG features (May 2007+)
5K4 Features: jobabend51 - support new GDG features (May 2007+)
10H2 Field: Notes re translation & packed field preservation
4I8 Fil: scripts to reformat/sort/copy 1 file to test dir
6C0 File-types: 6C1. changing DATA file-types & record-sizes
6D1 File-types: changing file-types & record-sizes in JCL/scripts
6E1 File-types: changing file-types in COBOL programs
6E4 File-types: Why mass change file-types ?
5B1 Filename: Data filename conversion
5J5 Filename: exportfile - exports & display non-GDG filename
4E3 Filenames: full-PATH or relative-PATH data filenames
5F1 Filenames: sample filenames extracted from JCL/scripts
6A4 Filenames: selected to jobparms1 on Dec15/06
8A4 Filenames: defined 'RELATIVE' to $RUNDATA
4M1 Fine: Test/Debug 1 JCL/script to fine tune conversion
6C1 Fixed-length: 1. changing data-files from Fixed-Length to Text
6C2 Fixed-length: sample Fixed-Length to Text conversion
8C1 Forcing: Forcing 'Abterm' to test GDG recovery
9B1 Found: procNF - summarize PROCs Not Found in JCL conversion
10C4 Ftp: copy/FTP LISTCAT from mainframe
4E3 Full-path: full-PATH or relative-PATH data filenames
1C4 Function: jobset51 function - explained
1C5 Function: 'jobset51' function - code extract from '5K1'
1C6 Function: jobset51 function - explained
4D1 Function: Copying VU control files & functions to Your $TESTLIBS
10C4 Functions: control files & functions for conversion & execution
3C0 Functions: - used by JCL/scripts
3C6 Functions: Customizing Korn shell functions
3D0 Functions: GDG functions exportgen0,exportgen1,etc
3D0 Functions: summary of exportgen functions
4D2 Functions: script to copy supplied control files & functions
5J0 Functions: Listings of GDG functions
5M0 Functions: Listings of uvcopy jobs used by GDG functions
6A4 Future: control files with future dates appended

0A7 Gdg: GDG processing
1C10 Gdg: Tape conversion alternative - GDG files
1F3 Gdg: TAPE output files converted to GDG files
1G1 Gdg: converting TAPE files to GDG generation files
1G2 Gdg: converting TAPE files to GDG generation files
1T6 Gdg: gl/account.master_ GDG file
3D0 Gdg: GDG functions exportgen0,exportgen1,etc
4L0 Gdg: GDG files - see Part 5
5A1 Gdg: GDG Enhancements
5A1 Gdg: Vancouver Utility GDG system - Basic Features
5A2 Gdg: Vancouver Utility GDG system - Advanced Features
5B1 Gdg: JCL conversion - GDG files (BEFORE & AFTER)
5B3 Gdg: loading the GDG Indexed control file
5B3 Gdg: sample GDG control file
5D1 Gdg: GDG logic illustrated
5D1 Gdg: jgl100.ksh to illustrate GDG logic
5D3 Gdg: $RUNDATA subdirs BEFORE jgl100.ksh test GDG
5D4 Gdg: run jgl100.ksh & observe GDG results
5E1 Gdg: prior GDG & Range processing
5E1 Gdg: updating gdgctl to process a series of GDG files
5E10 Gdg: prior GDG select/increment - Run#4
5E2 Gdg: Demo prior GDG & Range processing
5E2 Gdg: JGL220 JCL to demo prior GDG processing
5E2 Gdg: gl/... files for GDG range demo
5E4 Gdg: setup to demo prior GDG & Range processing
5E5 Gdg: prior GDG select/increment - Run#1
5E7 Gdg: prior GDG select/increment - Run#2
5E9 Gdg: prior GDG select/increment - Run#3
5F0 Gdg: GDG system - Caveats
5F2 Gdg: GDGmkdirs - make subdirs for GDG files
5F4 Gdg: JCL to demo Write GDG & Readback in 1 job
5F5 Gdg: problem converting tape files to GDG's
5J0 Gdg: Listings of GDG functions
5K3 Gdg: jobend51 - support new GDG features (May 2007+)
5K4 Gdg: jobabend51 - support new GDG features (May 2007+)
5M0 Gdg: Listings of uvcopy jobs used by GDG functions
8C1 Gdg: Forcing 'Abterm' to test GDG recovery
8C1 Gdg: new GDG's in Temp subdirs until Normal EOJ
8L1 Gdg: Ex#2 - solicitating desired GDG generation#
8L2 Gdg: Ex#2 alternate - get GDG# via 'opt=c' option
4L1 Gdgctl: Op. Instrns. to create gdgctl file
4L1 Gdgctl: creating the gdgctl file
5B4 Gdgctl: exportgen0 & gdgctl - Exception Processing
5B5 Gdgctl: exportgen0 & gdgctl rerun facility
5B7 Gdgctl: Retaining History in gdgctl
5B7 Gdgctl: illustrating prior gen# over-rides
5C1 Gdgctl: creating the gdgctl file
5C2 Gdgctl: Op. Instrns. to create gdgctl file
5C4 Gdgctl: display gdgctl Indexed file with uvhd (char mode)
5C5 Gdgctl: file displayed by uvhd
5C6 Gdgctl: updating gdgctl Indexed file with uvhd
5C7 Gdgctl: updating gdgctl Indexed file with vi
5C8 Gdgctl: Notes re updating gdgctl with 'vi'
5D11 Gdgctl: record - ABterm on run#2 & rerun #3 OK
5E1 Gdgctl: updating gdgctl to process a series of GDG files
5E11 Gdgctl: file after 4 runs of jgl220.ksh
5F1 Gdgctl: replace $SYMBOLS in gdgctl file
8L2 Gdgctl51: sample ctl/gdgctl51
5M2 Gdgctl51i: gdgload1 - load indexed file ctl/gdgctl51I
5M4 Gdgctl51i: gdgget51 for exportgen1 to get max gens from gdgctl51I
5M4 Gdgget51: for exportgen1 to get max gens from gdgctl51I
5M2 Gdgload1: - load indexed file ctl/gdgctl51I
4E6 Gdgmkdirs: ctl/GDGmkdirs - make topnode/subdirs
5F2 Gdgmkdirs: GDGmkdirs - make subdirs for GDG files
5B2 Gdgs: Allowing for Abterms (don't increment GDGs)
8B2 Gdgs: sample JCL/script, demo return-codes, GDGs, etc
5B7 Gen: gdgctl illustrating prior gen# over-rides
5J4 Gen: exportgenx - report err if gen# out of bounds
10G1 Generate: Directories Required to Generate jobs to convert Data Files
10H2 Generate: Generate job to convert EBCDIC to ASCII & preserve packed
10L4 Generate: Op. Instrns to generate JobFlow Reports
10L4 Generate: jobflow51 - generate jobflow report for 1 JCL/script
10L4 Generate: jobflow5A - generate All jobflow reports
10N1 Generate: Generate jobs EBCDIC-->ASCII & ASCII-->EBCDIC
10N2 Generate: ASCII-->EBCDIC jobs - for ALL data-files
4I2 Generate: subdirs to GENERATE 'data conversion uvcopy jobs'