| Part_0 | - Introduction & Summary of Major Benefits |
| Part_1 | - Demo conversion using supplied Test files (JCL, COBOL,& DATA files) |
| - do these first & ensure your results match those listed | |
| - helps you to understand these tools & ensure they work at your site | |
| - use Part 4 to convert your own JCL (vs these supplied test/demo files) | |
| - scripts to reconvert JCL - 1 at a time or all in directory | |
| - scripts to reconvert COBOL copybooks & programs - 1 or all in dir |
| Part_2 | - Testing & Debugging Aids |
| - Cross-References, Jobflow reports, job logging, etc | |
| - many other scripts & utilities valuable during conversions | |
| - several of these can be run using supplied test files | |
| - get familiar with these, so you will know when they can save you time | |
| - Micro Focus COBOL Error codes listed for your convenience |
| Part_3 | - Conversion Support Files - profiles, functions, control files |
| - supplied versions are tuned for the Test/Demo conversions | |
| - you may want to modify for Your conversions |
| Part_4 | - intended to present a plan for you to follow in converting 'YOUR' JCL |
| (vs the test/demo conversions illustrated in Part_1) | |
| - Part 4 is a good roadmap for planning & executing the entire conversion | |
| - use the step by step method for your '1st' conversion of all JCL | |
| (for re-conversions, script jcl2ksh51A converts All JCL with 1 command) | |
| - Part 4 also documents scripts to convert All COBOL & DATA, but you | |
| should use the step by step methods for the '1st' conversions | |
| as documented in MVSCOBOL.htm & MVSDATA.htm. |
| Part_5 | - converting mainframe GDG files for Unix/linux |
| - some features surpass mainframe implementation | |
| - new generations written to jobtmp, copied to $RUNDATA on Normal EOJ | |
| so Abterms do not create some new generations making reruns difficult | |
| but if you can restart at the step, you will be prompted to copy back | |
| - Indexed control file provides for number of generations per file | |
| - may update control file to process prior gens 1 time or by expiry date | |
| - may update control file to increment thru a range of prior generations | |
| - option to prompt operator to confirm gen# or enter an alternate gen# |
| Part_6 | - documents optional jobs that might be required or desired at some sites |
| - assigning mainframe files to sub-dirs on unix/linux systems. | |
| - use top-node of DSNs as a sub-dir, or store all files in mstr/... | |
| - see TOPNODES table in JCL conversion control file (jclunixop51). | |
| - extra control files for sites without VSAM LISTCAT reports | |
| - inputting datafile recsizes,keys,etc from Excel spreadsheets | |
| - extract control cards (for dates, etc) from JCL to separate files | |
| (easier to update, without danger of modifying JCL unintentionally) | |
| - jobparmx1/jobparms1 files date-stamped allow updates for future dates | |
| - jclstrip1, utility job to cleanup converted JCL/scripts | |
| - remove non-essential code & extraneous comments | |
| - Manual changes for DDNAMEs required in scripts converted from JCL | |
| if DDNAME is a forward reference (multi-part files with INSTREAM data) |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| Part_7 | - Operating Aids |
| - Console Logging captures all console messages, | |
| intended to assist operators & applications administrators | |
| - Job Debug Logs capture the log for 1 job execution, | |
| intended to help programmers debug JCL/scripts | |
| - Job Message Logs captures only VITAL & ERRor messages, | |
| intended to assist operators & applications administrators | |
| - Illustrated demos of Console, Job Debug,& Job Message Logging | |
| (run jgl200.ksh 4 times, forcing GDG errors on run#2) |
| Part_8 | - JCL/script Review, Modifying, Writing new scripts |
| - Quiz to test your understanding of profiles, environmental-variables | |
| console logging, capturing logs from jobs scheduled by cron | |
| - modifying converted JCL/scripts (examples & exercises) | |
| - writing new scripts to Vancouver Utility standards |
| Part_9 | - scripts & uvcopy jobs used in MVS JCL conversion |
| Note |
|
| MVSJCL2.htm | - separate document for special conversions |
| & extended capabilities |
MVSJCL2.htm#Part_26 - Special conversions for SORT/SYNCSORT, FTP, etc
- Manual Changes Required for SORT/SyncSort
- uvsort has all the powerful capabilities of SyncSort, but some
of the more complex conversions may require manual correction.
- Alternate solutions for SORTs with too many OMIT/INCLUDEs
- Merging SyncSort converted parameters into VU JCL/scripts
- FTP conversion examples
MVSJCL2.htm#Part_27 - Scanning for Problems & Mass-Change Fix-ups
- grep, sed, uvcopy scan1d, scan2d, rep1d, rep2d, etc
MVSJCL2.htm#Part_28 - Special Considerations, Problems & Solutions
- CONDition tests
- Run a JCL/script when an input file is detected (ftrigger51)
- detect FTP'd files & move/rename to a 2nd subdir to prevent overwrite
- Convert mainframe JCL containing Cybermatics ESP scheduler coding
- Process scripts converted from mainframe JCL containing BMC Control-M
to allow testing on unix before unix version of control-M installed.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is a brief review of the documentation relevant to mainframe conversions & accessible on the UV Software web site (www.uvsoftware.ca).
| MVSJCL.htm | - MVS JCL Conversion to Korn shell scripts <--- This Document |
MvsJclPerl.htm - MVS JCL Conversion to Perl scripts <--- Alternate
| VSEJCL.htm | - VSE JCL Conversion |
| MVSCOBOL.htm | - VSE COBOL Conversion |
| VSECOBOL.htm | - MVS COBOL Conversion |
| MVSDATA.htm | - Convert MVS EBCDIC Data to ASCII, preserving packed fields |
| - high volume (all files in directory) |
| VSEDATA.htm | - Convert VSE EBCDIC Data to ASCII, preserving packed fields |
| - high volume (all files in directory) |
| DATAcnv1.htm | - Basic DATA conversion (1 file at a time) |
Owen Townsend, UV Software, 4667 Hoskins Rd., North Vancouver BC, V7K2R3
Tel: 604-980-5434 Fax: 604-980-5404
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
MVSJCL.doc is the detailed step by step instructions for converting IBM MVS JCL to Unix/Linux, using the Vancouver Utilities from UV Software Inc.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
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.
uvlpLS13 - prints Landscape Simplex at 13 cpi to fit 132 cols on 11" wide
- prints at 8.1 lpi to fit 60 lines in 8 1/2 deep
uvlpLD13 - prints Landscape Duplex
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
GDG files in MVS JCL are recognized by the suffixes (0), (+1), (-1).In the ksh scripts, the (0),(+1),(-1) is indicated by functions exportgen0/1 and a filename will be suffixed with an '_' underscore. The converted data files will be suffixed by '_######' (underscore & 6 digit gen#). Please see Part_5 for further discussion.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
UV Software has the complete solution to batch conversions of JCL, COBOL,& DATA. The Vancouver Utility package supplies several additional items essential to the successful conversion & ongoing operation on Unix/Linux systems:
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Test/Demo JCL, PROCs, COBOL programs,& DATA files are provided, for you to run the conversion procedures & verify you results match the results listed in this documentation.
The Test/Demo conversion sessions will give you a clear understanding of these conversion procedures & make it easier for you to get started on your own conversions. If you are reading this on the web site (www.uvsoftware.ca), the test/demo documentation will make it easier for you to understand these conversion concepts.
If you have not yet purchased the Vancouver Utilities conversion package, UV Software invites you to send samples of your JCL for conversion & return by email attachments. Please be sure to include all referenced PROCs and any library members containing SORT keys, etc.
You can run the test/demos without the extensive planning & file system setup recommended for your own conversions. After installing the Vancouver Utilities, the test/demo subdirs & files will be found in directory 'mvstest' (/home/uvadm/mvstest if installed as recommended).
We recommend you do not run the test/demos in /home/uvadm/mvstest, since any updated installation of Vancouver Utilities would wipe this out. So we advise you to setup a new user 'mvstest' (/home/mvstest), and setup the profile for mvstest as described in install.htm or ADMjobs.htm. Then copy the test/demo subdirs & files from /home/uvadm/mvstest/* to /home/mvstest/...
You could copy the 'mvstest' directory to a subdir within your home directory, if you modify your profile as described in install.htm or ADMjobs.htm. If you don't want to do that yet, setup user 'mvstest' for initial testing. When you decide to proceed with your own conversions, you can then modify your profile & the profiles of all programmers & operators involved.
The Vancouver Utilities are distributed with the 'C' utility programs already compiled (into /home/uvadm/bin) using Red Hat 9.0. If you are running Linux, you should not have to recompile. If you are running Unix, please see install.htm for the compile instructions for the various flavors of Unix. If you are running on Windows with SFU (Services For Unix), please see WindowsSFU.htm for compile instructions.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The converted scripts are designed for the Korn Shell (ksh) and I recommend the 1993 version, which can be downloaded from http://www.kornshell.com.
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.
COBOL compile scripts are different since the MicroFocus COBOL compiler is different (Server Express for Unix/Linux vs Net Express for Windows). The script to compile 1 program at a time is 'mfcbl1' for unix/linux, and 'mfnxcbl1' for SFU/UWIN/CYGWIN (see listings at MVSCOBOL.htm#5E0). To compile all programs in a directory the scripts are 'mfcblA' & 'mfnxcblA'.
JCL/scripts use functions (exportgen0 & exportgen1) to simulate mainframe generation files. Until June 2004, these complex functions required the 1993 version of the Korn shell & would not work under 'bash' (default shell for CYGWIN) or under 'pdksh' (public domain ksh), which is supplied with CYGWIN and UWIN (and aliased as 'ksh'). In June 2004, the exportgen functions were modified & tested for SFU (probably also OK for CYGWIN).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Before you attempt to convert your own JCL, we recommend you perform the demo conversions illustrated in Part 1, using the supplied test JCLs & data files.
Part_1 will help you understand these tools & ensure they work at your site, but be sure to use Part_4 to convert your own JCL vs the test/demos in Part 1.
| 1A1. | Directory Design for test/demo JCL Conversion & Execution |
| 1B1. | Overview of test/demo JCL PROCs,& COBOL programs |
| 1C1. | JAR100 - simple 1 step JCL to execute a COBOL program |
| 1D1. | JAR200 - typical 2 step JCL (SORT + COBOL report). |
| 1E1. | JGL100 - demo conversion of PROCs & GDG files (1 step COBOL) |
| 1F1. | JGL200 - 2 step JCL (SORT+COBOL) using PROCs & GDG files |
| 1G1. | JGL300 - demo IEBGENER/IDCAMS & CONDition codes |
| 1G3. | JGL320 - demo IF/THEN/ENDIF |
| 1G5. | JGL360 - IDCAMS DEFINE CLUSTER converted to uvcp to init an Indexed file |
| 1H1. | JGL500 - demo IEFBR14 conversion |
| - to DELETE files (regular & GDG) |
| 1I1. | IKJEFT01 - demo conversion of TSO batch utility required to RUN mainframe |
| COBOL programs that accessed DB2 tables |
| 1J1. | FTPPUT1 - converting mainframe FTP to unix/linux ftp |
| - demo JCL you can execute after conversion to ksh script |
| 1K1. | MAILSMTP - convert mainframe IEBGENER sending mail via SYSOUT=(B,SMTP) |
| 1K2. | MAILDEMO - converting mainframe 'MAILTOLN' to unix/linux mail or mutt |
| - demo JCL you can execute after conversion to ksh script |
| 1L1. | ISRSUPC1 - converting SUPERC to unix/linux 'cmp' & VU 'uvcmp' |
| - demo JCL you can execute after conversion to ksh script |
| 1P1. | Preparations to convert test/demo JCL to Korn shell scripts |
| - setup user 'mvstest' & copy supplied test/demo files from 'uvadm/mvstest' |
| 1P4. | Alternative setup demo files in your homedir (vs setup new user mvstest). |
| If you prefer or if multiple programmers at your site to perform demos, | |
| you can setup 'testlibs' & 'testdata' subdirs in your own homedir | |
| & copy the supplied demo files to them. |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| 1Q1. | Operating Instructions to Convert the Test/Demo JCLs to scripts |
| - 10 pages of detailed instructions |
| 1R1. | Operating Instructions to Convert the Test/Demo COBOL programs |
| - required to execute the test/demo JCL/scripts |
| 1S1. | Operating Instructions to Execute the Test/Demo JCL/scripts |
| 1T1. | Checking Test/Demo Output Results |
| 1U1. | Re-run Test/Demo JCL/scripts with Console Logging |
| 1V1. | scripts to reconvert JCL - 1 at a time or All in directory |
| - jcl2ksh51 & jcl2ksh51A | |
| 1V2. | scripts to reconvert COBOL - 1 at a time or All in directory |
| - cnvMF51c & cnvMF51Ac for copybooks, cnvMF51 & cnvMF51A for programs |
| 1X1. | Quick conversion for your JCL (vs test/demo JCL) |
| - I recommend you take the time to perform the test/demos in Part 1 | |
| - Then follow procedures in Part_4 for your own JCL conversions | |
| - But if desired, here is a method of getting some quick results |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/home/mvstest <-- setup user 'mvstest' & copy subdirs from uvadm/mvstest
:-----testlibs
: :------Csub - C subroutines for COBOL programs
: :--MF--cbl0 - COBOL programs ('*' means files present)
: :------cbl1 - cleaned up, cols 1-6 & 73-80 cleared, etc
: :------cbl2 - cnvMF5 converts mainframe COBOL to MicroFocus COBOL
: :------cbl3 - sysin1 converts instream ACCEPTs to READs from a file
: :------cbl4 - sysout1 converts DISPLAY on SYSOUT to WRITE to a file
: :---ux-cbls - copy here (standard source library) before compiling
: :------cblst - cobol source listings from compiles
: :------cblx - compiled COBOL programs (.int's)
: :--MF--parm0 - control cards & includes (SORT FIELDS, etc)
: :------parms - control cards with 73-80 cleared
: :--MF--cpy0 - for COBOL copybooks
: :------cpy1 - cleaned up, cols 1-6 & 73-80 cleared, etc
: :------cpy2 - cnvMF5 converts mainframe COBOL to MicroFocus COBOL
: :---ux-cpys - copy here (standard copybook library)
: :--UV--ctl - conversion control files (jclunixop5,datactl53I,etc)
: :------errs - JCL converter writes ERROR reports here
: :--MF--jcl0 - test/demo JCLs supplied
: :------jcl1 - intermediate conversion 73-80 cleared
: :------jcl2 - PROCs expanded from procs
: :------jcl3 - JCLs converted to Korn shell scripts
: :---ux-jcls - copy here manually 1 by 1 during test/debug
: :------maps - 'cobmaps' record layouts generated from copybooks
: :------pf - uvcopy jobs to replace utilities (easytrieve,etc)
: :--MF--proc0 - test/demo PROCs supplied
: :------procs - will be merged with jcl1, output to jcl2
: :------sf - for misc scripts you may wish to write
: :------tmp - tmp subdir used by various conversions
: :------xref - cross-references (see XREFjobs.htm)
:-----testdata - test/demo data files supplied : :--MF--ap - Accounts Payable : :--MF--ar - Accounts Receivable : :--MF--gl - General Ledger : :--UV--ctl - GDG control file : :------jobtmp - temporary files for SYSIN instream data : : :----030926 - jobtmp subdir created in jobset51 (script line 10) : :------sysout - SYSOUT printer files : :------tmp - tmp subdir for uvsort & misc use : :------wrk - interstep temporary work files
--MF-- marks subdirs containing MainFrame files for conversion
(COBOL programs, copybooks, parms, PROCs,& data)
--UV-- marks control files supplied by UV Software
---ux- marks the most important outputs of the conversion
most other subdirs can go away after the conversion is complete
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The sub directories illustrated on the previous page are included on the Vancouver Utility distribution media and after installation will be contained within /home/uvadm/mvstest (1 of about 20 directories in the package).
You will later be instructed to setup a test/demo userid/login 'mvstest' and copy the subdirs from /home/uvadm/mvstest to /home/mvstest. Please do not run tests within /home/uvadm because new distributions of Vancouver Utilities would destroy your test results.
The following pages will list several test/demo JCLs & PROCs provided and their converted equivalents (Korn shell scripts). Studying these examples will give you a good understanding of the JCL conversion process.
If you have just installed the package, you can run the conversion procedures (starting on page '1P1') and verify that you get the same results listed here. If you have not yet purchased the package, you are invited to send samples of your JCL & PROCs to UV Software for conversion & return.
Note that the directory design listed here is for test/demo convenience only. The recommended directory design for your own testing & production is illustrated later begining on page '4C2'. The big difference is that you should assign your data directories to a separate file system from the libraries.
See the detailed operating instructions on page '1P1' ahead. These instructions review everything required (loading Vancouver Utilities, setting up users, etc).
Please see Part_4 when you think you are ready to start converting your own JCL, COBOL,& DATA files. But be first run these test/demos in Part 1 (with supplied demo files) before you attempt to perform your own conversions.
See page '1X1' if you need to do a quick preliminary conversion of a few of your JCLs before you invest the time & effort that should be expended when you launch your mainframe conversion project.
Page '1X2' shows you how to use script 'mvslibsdirs' to create the (empty) sub-dirs (shown on the previous page). You could create a directory within your homedir (call it testlibs) to contain the subdirs required for conversion.
Page '1X2' also shows you script 'jcl2ksh51A' to perform all steps of JCL conversion, BUT we recommend you first use the step by step method (starting on page '1P1') to better understand the process.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The Library & Data directories used by the converted JCL/scripts is determined by environmental variables 'RUNLIBS' & 'RUNDATA' defined in user profiles. See recommended profiles for these test/demos listed at ADMjobs.htm#1C1.
$RUNLIBS is used in the PATH to define where the JCL/scripts are to be found.
$RUNDATA is used in the jobset51 function called at the beginning of each script to perform a change directory to the data files super directory.
All data files are addressed relative to RUNDATA, which allows us to easily switch between test data & production data simply by changing the value of RUNDATA. This is done most reliably by providing different profiles to the programmers & the production personnel.
The stub_profile is copied/renamed as .profile for ksh & .bash_profile for bash. The stub_profile listed ADMjobs.htm#1C1 defines RUNLIBS & RUNDATA as follows:
export RUNLIBS=$HOME/testlibs #============================ export RUNDATA=$HOME/testdata #============================
If you setup separate user 'mvstest' for these tests, the expansions would be:
export RUNLIBS=/home/mvstest/testlibs #==================================== export RUNDATA=/home/mvstest/testdata #====================================
Alternatively, you could create a 'mvstest' subdir within your current HOME dir, in which case you would modify the exports as follows:
export RUNLIBS=/home/userxx/testlibs #=================================== export RUNDATA=/home/userxx/testdata #===================================
Note that setting up RUNLIBS & RUNDATA in a HOME dir is a convenience to get you started testing quickly. You would NOT do this for serious testing & definitely not for production.
See the recommendations for your serious testing & production described later on pages '4C2' thru '4C10'
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will illustrate the original mainframe JCL & the converted Korn shell script equivalents for several test/demo JCLs. Then we present the Operating Instructions to Convert, Execute,& Check the results.
We will illustrate the conversion (before & after) of the following JCLs:
| JAR100 |
|
| JAR200 |
|
| JGL100 |
|
| JGL200 |
|
| JGL300 |
|
| JGL320 |
|
JAR100 & JAR200 are as simple as possible - no PROCs, no &SYMBOLS, no Generation (GDG) files, no instream data,& no control card members.
JGL100 & JGL200 are more typical of MVS JCL - including PROCs, &SYMBOLS, Generation (GDG) files, instream data,& control card members.
Our test/demo mainframe JCLs, PROCs, COBOL programs,& control card members are supplied in the 'mvstest' sub-directories illustrated on page '1A1'.
By convention, we have given these UPPER case names to reinforce their mainframe origins. The cleanup, PROC expansion,& conversion procedures will convert the UPPER case names to lower case names & append a .extension ('.jcl' for JCL, '.proc' for PROCs, '.ksh' for converted scripts,& '.cbl' for COBOL programs).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The test/demo JCLs reference the following data files:
The JCL conversion will assume the 1st node (High Level Qualifier or HLQ) is to be a sub-directory containing data files (named from the remaining nodes). Filenames with only 1 node will be assigned to $DW or 'wrk'. See TOPDIRDEFAULT in the conversion control file listed later on page '3E1'.
We have supplied the test data files in /home/uvadm/mvstest/testdata. Later on page '1P1', you will be instructed to setup userid 'mvstest' & copy the testdata files to the following structure.
/home/mvstest/ :-----testdata/ : :-----ar/ : : :--customer.master : : :--sales.items : :-----gl/ : : :--account.master : : :--account.trans : :-----py/ : : :--payroll.master : : :--time.cards
Our test/demo data files have already been converted from EBCDIC to ASCII, preserving packed fields & correcting zoned signed fields to MicroFocus COBOL standards. You can see the details of the data conversions in DATAcnv1.htm & MVSDATA.htm.
By our conventions, all converted filenames are in lower case. This eliminates a lot of confusion on Unix/Linux systems where filenames are case sensetive.
We will later (after converting JCL & compiling COBOL programs) be using these test data files to execute our converted JCLs & COBOL programs.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Note that we will present the detailed operating instructions later on starting on page '1Q1'. First we will illustrate some sample JCL/script before/after to ensure you understand the desired conversions.
First we will present the simplest possible JCL conversion (no PROC's, no GDG files, no control card members).
The 1st procedure is to remove any obsolete sequence numbers from the right side of JCLs & PROCs, change filenames to lower case,& append extension to identify the files (.jcl).
//JAR100 JOB 'TEST MVS2UNIX CONVERSION',DATE=20080323 00000010 //* CUSTOMER NAME & ADDRESS LIST (WITH DATE & RPT HDNGS) 00000020 //STEP010 EXEC PGM=CAR100,PARM=2008 00000030 //CUSTMAS DD DSN=AR.CUSTOMER.MASTER,DISP=SHR 00000040 //NALIST DD DSN=AR.CUSTOMER.NAMEADRS.LIST100,DISP=(,CATLG,DELETE), 00000050 // UNIT=DISK,SPACE=(TRK,(25,25),RLSE), 00000060 // DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA) 00000070 //SYSOUT DD SYSOUT=* 00000080
j#001 //JAR100 JOB 'TEST MVS2UNIX CONVERSION',DATE=20080323 j#002 //* CUSTOMER NAME & ADDRESS LIST (WITH DATE & RPT HDNGS) j#003 //STEP010 EXEC PGM=CAR100,PARM=2008 j#004 //CUSTMAS DD DSN=AR.CUSTOMER.MASTER,DISP=SHR j#005 //NALIST DD DSN=AR.CUSTOMER.NAMEADRS.LIST100,DISP=(,CATLG,DELETE), j#006 // UNIT=DISK,SPACE=(TRK,(25,25),RLSE), j#007 // DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA) j#008 //SYSOUT DD SYSOUT=*
The 'cleanup' job removes any sequence#s from the right side. We have re-inserted a sequence# on the left side only to facilitate references. We will prefix JCL sequence#s with 'j#' and the Korn shell script sequence#s with 'k#'.
Any 'PROC's are expanded & any 'INCLUDE's are included by the 'jclproc51' utility as it copies from subdir 'jcl1' to subdir 'jcl2'. Our first sample JCL has no 'PROC's or 'INCLUDE's so it will be copied unchanged.
The next step is the actual JCL conversion to Korn shell script. Please see the results listed on the next page --->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#001 #!/bin/ksh
k#002 ##JAR100 JOB 'TEST MVS2UNIX CONVERSION',DATE=20080323
k#003 export JOBID2=JAR100 jobid2=jar100; scriptpath="$0"; args="$*"
k#004 if [[ -z "$JOBID1" ]]; then export JOBID1=$JOBID2; fi
k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
k#006 integer JCC=0 SCC=0 LCC=0 # init step status return codes
k#007 autoload jobset51 jobset52 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
k#008 autoload exportfile exportgen0 exportgen1 exportgenall exportgenx
k#009 . $APPSADM/env/stub.ini #<-- for control-M (see notes in env/stub.ini)
k#010 jobset51 # call function for JCL/script initialization
k#011 goto
k#012 S0000=A
k#013 # * CUSTOMER NAME & ADDRESS LIST (WITH DATE & RPT HDNGS)
k#014 #1======================= begin step#S0010 CAR100 ========================
k#015 S0010=A
k#016 stepctl51; #calc StepTimes & check jobstop/goto end
k#017 goto
k#018 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#019 logmsg2 "******** Begin Step $JSTEP car100 (#$XSTEP) ********"
k#020 ##STEP010 EXEC PGM=CAR100,PARM=2008
k#021 export PROGID=car100
k#022 export PARM="2008"
k#023 exportfile CUSTMAS data/ar.customer.master
k#024 exportfile NALIST data/ar.customer.nameadrs.list100
k#025 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_SYSOUT
k#026 logmsg2 "Executing--> cobrun $ANIM $RLX/car100"
k#027 #3----------------------------------------------------------------------
k#028 cobrun $ANIM $RLX/car100
k#029 #4----------------------------------------------------------------------
k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
k#031 if ((S0010C != 0))
k#032 then logmsg2 "ERR: step#$JSTEP car100 abterm $SCC"
k#033 alias goto="<<S9900=A"; fi
k#034 goto
k#035 #8======================================================================
k#036 S9000=A
k#037 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs
k#038 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
k#039 exit 0 #ver:20120208 a1b2c0d1e2f3g1i1j0k3l40m4n3o0p0r0s0t1u1v3w0x0y1z0
k#040 #9======================================================================
k#041 S9900=A
k#042 logmsg2 "JobEnd=AbTerm, JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
k#043 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
k#044 exit $JCC
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The following block of front end code is inserted at the beginning of each Korn shell script (output from the JCL converter). This is the same for all jobs, except for the JOB name & description which is extracted from the // JOB card & inserted on lines 3 & 4 below.
k#001 #!/bin/ksh
k#002 ##JAR100 JOB 'TEST MVS2UNIX CONVERSION',DATE=20080323
k#003 export JOBID2=JAR100 jobid2=jar100; scriptpath="$0"; args="$*"
k#004 if [[ -z "$JOBID1" ]]; then export JOBID1=$JOBID2; fi
k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
k#006 integer JCC=0 SCC=0 LCC=0 # init step status return codes
k#007 autoload jobset51 jobset52 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
k#008 autoload exportfile exportgen0 exportgen1 exportgenall exportgenx
k#009 . $APPSADM/env/stub.ini #<-- for control-M (see notes in env/stub.ini)
========
k#010 jobset51 # call function for JCL/script initialization
========
k#011 goto
k#012 S0000=A
| Note |
|
k#003 export JOBID2=JAR100 jobid2=jar100; scriptpath="$0"; args="$*"
k#004 if [[ -z "$JOBID1" ]]; then export JOBID1=$JOBID2; fi
'$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' will be displayed by the 'jobset51' function which is listed on page '1C5' (see lines js#36 & js#37).
"$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
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 =============================================================================
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'.
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
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/apps/prodlibs #<-- production libraries
js#017 # export RUNDATA=/p2/apps/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
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
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
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:
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
# 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
# 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
Here is the input/output for just the COBOL EXEC step, extracted from the JCL & Korn shell script listed previously. This typical step is the basis for much discussion on the following pages.
j#03 //STEP010 EXEC PGM=CAR100,PARM=2003 j#04 //CUSTMAS DD DSN=AR.CUSTOMER.MASTER,DISP=SHR j#05 //NALIST DD DSN=AR.CUSTOMER.NAMEADRS.LIST100,DISP=(,CATLG,DELETE), j#06 // UNIT=DISK,SPACE=(TRK,(25,25),RLSE), j#07 // DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA) j#08 //SYSOUT DD SYSOUT=*
k#015 #1======================= begin step#S0010 CAR100 ========================
k#016 stepctl51; #calc StepTimes & check jobstop/goto end
k#017 goto
k#018 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#019 logmsg2 "******** Begin Step $JSTEP car100 (#$XSTEP) ********"
k#020 ##STEP010 EXEC PGM=CAR100,PARM=2008
k#021 export PROGID=car100
k#022 export PARM="2008"
k#023 exportfile CUSTMAS data/ar.customer.master
k#024 exportfile NALIST data/ar.customer.nameadrs.list100
k#025 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_SYSOUT
k#026 logmsg2 "Executing--> cobrun $ANIM $RLX/car100"
k#027 #3----------------------------------------------------------------------
k#028 cobrun $ANIM $RLX/car100
k#029 #4----------------------------------------------------------------------
k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
k#031 if ((S0010C != 0))
k#032 then logmsg2 "ERR: step#$JSTEP car100 abterm $SCC"
k#033 alias goto="<<S9900=A"; fi
k#034 goto
| Note |
|
| 1C10. | JCL file defs 'DD's converted to 'exportfile's |
| 1C11. | JCL 'EXEC's converted to 'cobrun's (for Micro Focus COBOL .int or .gnt) |
| 1C12. | testing program return code for good/bad status |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#04 //CUSTMAS DD DSN=AR.CUSTOMER.MASTER,DISP=SHR j#05 //NALIST DD DSN=AR.CUSTOMER.NAMEADRS.LIST100,DISP=(,CATLG,DELETE), j#06 // UNIT=DISK,SPACE=(TRK,(25,25),RLSE), j#07 // DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)
k#023 exportfile CUSTMAS data/ar.customer.master k#024 exportfile NALIST data/ar.customer.nameadrs.list100
'exportfile' is a function (see listing on page '3C1') that displays the filenames (for the console log), in addition to generating the korn shell 'export'. For the above examples, the 'export's would be:
The 'export's load the environmental variables for the 'Logical File Names' with the values for the 'Physical File Names'. These values are available to the COBOL programs, since the COBOL converter has inserted 'external' into the file 'select' clauses.
Note that the High Level Qualifier ('ar' in this case) becomes a subdir (within $RUNDATA) & the data files will be converted correspondingly. Any DISK SPACE EXTENT info is ignored (not applicable to unix/linux).
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#03 //STEP010 EXEC PGM=CAR100,PARM=2003
k#020 ##STEP010 EXEC PGM=CAR100,PARM=2008 ..... ............. file exports here ................ k#026 logmsg2 "Executing--> cobrun $ANIM $RLX/car100" k#027 #3---------------------------------------------------------------------- k#028 cobrun $ANIM $RLX/car100 k#029 #4----------------------------------------------------------------------
COBOL 'EXEC's converted to 'cobrun's for MicroFocus COBOL. 'cobrun' will execute/interpret the '.int' (car100.int in this example). '.int's are much smaller than executables & allows animation (debugging) without having to recompile or modify any JCL/script, for example:
--> export ANIM=+A <-- activate the Animation option --> jar100.ksh <-- run the job (will animate COBOL programs) --> export ANIM="" <-- deactivate Animation
The '.int's usually do not run significantly slower than executables. But if you had some programs doing a lot of memory table indexing, you can compile it to a .gnt (native code) or an executable
'.gnt's are faster & still quire small, but you have to recompile to .int when you need to animate.
Fully compiled executable COBOL programs are fastest, but huge (1 MB each) You would have to remove the 'cobrun $ANIM' from the script. When you need to animate you would have to restore the cobrun $ANIM & recompile to .int.
I recommend leaving all programs as '.int's. The convenience of being able to animate simply by exporting a value (& not having to change anything or recompile) far outweighs the usually insignificant difference in speed.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
After each EXEC, code is inserted to test the program return status. The mainframe did this automatically, but unix/linux scripts must test success/fail after each program execution.
j#03 //STEP010 EXEC PGM=CAR100,PARM='MARCH 10, 2005'
k#027 #3---------------------------------------------------------------------- k#028 cobrun $ANIM $RLX/car100 k#029 #4---------------------------------------------------------------------- k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto=""; k#031 if ((S0010C != 0)) k#032 then logmsg2 "ERR: step#$JSTEP car100 abterm $SCC" k#033 alias goto="<<S9900=A"; fi k#034 goto
The Korn shell stores the program status in '$?'. Our converted script saves the status from this temporary variable to a dedicated variable constructed from the current step# (S0010C in example above).
If the status is non-zero, we display the 'abterm' message and we 'goto' the Abnormal termination (tag 'S9900=A') at the end of the program.
This code is a little complex since ksh does not have a real 'goto'. We are using redirected input to 'eat up' the script itself until we reach the stop pattern ('S9900=A' in the example above).
We assigned the redirected input statement to an alias 'goto' in case we needed a $variable in the stop pattern. The goto alias is initialized to null on line k#030 (goto=""), so that if the return code is 0, then the goto on line k#034 will do nothing.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#035 #8====================================================================== k#036 S9000=A k#037 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs k#038 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP" k#039 exit 0 #jclunix51 ver:20111015 a1b0c0d3e2f3g1i1j0k3l20m4n3o0p0r0s0t1u1w0x0y1z0 k#040 #9====================================================================== k#041 S9900=A k#042 logmsg2 "JobEnd=AbTerm, JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK k#043 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs k#044 exit $JCC
If all step return codes were zero (normal), then we would reach 'Terminated Normally' & exit 0.
If any step return code was non-zero, then we would 'goto' the 'S9900=A' label (line k#041 above), display 'Terminated Abnormally',& exit 99.
If the JCL had any COND=EVEN steps, you would move them to this point.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
COBOL programs can 'DISPLAY UPON SYSOUT' or they can 'WRITE' to a file. If they WRITE reports, the converter will treat the printer files the same as any other data file. The files would be assigned to a directory derived from the top level node in the MVS JCL data file name.
COBOL programs that 'DISPLAY UPON SYSOUT' did not need to declare a printer file, and the MVS JCL did not need to include a DSN for the printer file.
We assume that Micro Focus COBOL was used with option '-C OUTDD(SYSOUT)'. See the ctl/cobdirectives options file listed at MVSCOBOL.htm#5D1.
This option is similar to converting 'DISPLAY UPON SYSOUT' to 'WRITE's to a file which is inserted into the COBOL program (using select name 'SYSOUT').
We give special treatment to any file in the JCL without a DSN assigned. We code the directory as '$SYOT', which is assigned to the 'sysout' directory with a subdir coded as the jobname ($JOBID). Expansion examples follow:
j#08 //SYSOUT DD SYSOUT=*
k#025 exportfile SYSOUT $SYOT/${JSTEP}_SYSOUT
k#025 exportfile SYSOUT sysout/JAR100/S0010_SYSOUT <-- for testing
k#025 exportfile SYSOUT sysout/JAR100_yymmddHHMMSS/S0010_SYSOUT <-- production
'SYOT' is assigned in the 'jobset51' function inserted at the begining of each script (see listing on page '5K1'). For testing I recommend 'sysout/$JOBID', but for production you might change to 'sysout/${JOBID}_$(date +%y%m%d%H%M%S)' to allow the job to be rerun without overwriting previous SYSOUTs.
Printer files might be sent to a spooling package to allow page restarts, etc. EasySpooler is a popular Unix/Linux spooling package.
For laser printers, you could use one of the 'uvlp' scripts provided by UV Software. For example, 'uvlpLD1' will print a mainframe style report (originally on 15x11 paper) Landscape & Duplex, reducing the cpi & lpi to fit on standard 8 1/2 by 11 (leaving margins for 3 hole punched paper).
The JCL conversion might be enhanced to send the printer files to the spooling package or a uvlp script at the Terminated Normally end of script.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is a typical 2 step JCL (SORT + COBOL report).
j#001 //JAR200 JOB (1234),'TEST/DEMO MVS JCL CONVERT' j#002 //* SORT AR.SALES.ITEMS BY PRODUCT CODE FOR LISTING j#003 //STEP010 EXEC PGM=SORT,REGION=2048K j#004 //SORTIN DD DSN=AR.SALES.ITEMS,DISP=SHR j#005 //SORTOUT DD DSN=&&TEMPSLS,DISP=(NEW,PASS), j#006 // DCB=(LRECL=64,BLKSIZE=6400,RECFM=FB), j#007 // SPACE=(TRK,(50,50),RLSE),UNIT=DISK j#008 //SYSIN DD * j#009 SORT FIELDS=(31,6,CH,A,1,6,CH,A) j#010 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85')) j#011 /* j#012 //* LIST AR.SALES.ITEMS IN PRODUCT CODE SEQUENCE j#013 //STEP020 EXEC PGM=CAR200,COND=(4,LT,STEP010),PARM=2006 j#014 //SALEDTL DD DSN=&&TEMPSLS,DISP=(OLD,PASS) j#015 //CUSTMAS DD DSN=AR.CUSTOMER.MASTER.INDEXED,DISP=SHR j#016 //SALELST DD DSN=AR.SALES.LIST,DISP=(,CATLG,DELETE), j#017 // UNIT=DISK,SPACE=(TRK,(25,25),RLSE), j#018 // DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)
Please see the converted equivalent Korn shell script on the next page ---->
We have omitted the front end 12 lines & the back end 11 lines, since they are the same for all conversions & have already been illustrated for example #1 on page '1C2'.
Please see comments about the conversion of SORT to uvsort 2 pages ahead --->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#013 # * SORT AR.SALES.ITEMS BY PRODUCT CODE FOR LISTING
k#014 #1======================= begin step#S0010 SORT ========================
k#015 S0010=A
k#016 stepctl51; #calc StepTimes & check jobstop/goto end
k#017 goto
k#018 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#019 logmsg2 "******** Begin Step $JSTEP sort (#$XSTEP) ********"
k#020 ##STEP010 EXEC PGM=SORT,REGION=2048K
k#021 export PROGID=sort
k#022 export PARM=""
k#023 exportfile SORTIN1 data/ar.sales.items
k#024 exportfile SORTOUT $JTMP/__tempsls
k#025 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
k#026 cat > $SYSIN <</*
k#027 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
k#028 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
k#029 /*
k#030 logmsg2 "Executing--> uvsort \"fili1=$SORTIN1,typ=RSF,rcs=64,filo1=$SORT..."
k#031 #3----------------------------------------------------------------------
k#032 uvsort "fili1=$SORTIN1,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\
k#033 ,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
k#034 #4----------------------------------------------------------------------
k#035 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
k#036 if ((S0010C != 0)) #need to modify for COND step S0020
k#037 then logmsg2 "ERR: step#$JSTEP sort abterm $SCC"
k#038 alias goto="<<S9900=A"; fi
k#039 goto
k#040 #/=* LIST AR.SALES.ITEMS IN PRODUCT CODE SEQUENCE
k#041 #1======================= begin step#S0020 CAR200 ========================
k#042 if ((S0010C > 4)); then # COND=(4,LT,STEP010)
k#043 alias goto="<<S9000=A"; fi
k#044 goto
k#045 S0020=A
k#046 stepctl51; #calc StepTimes & check jobstop/goto end
k#047 goto
k#048 export JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#049 logmsg2 "******** Begin Step $JSTEP car200 (#$XSTEP) ********"
k#050 ##STEP020 EXEC PGM=CAR200,COND=(4,LT,STEP010),PARM=2006
k#051 export PROGID=car200
k#052 export PARM="2006"
k#053 exportfile SALEDTL $JTMP/__tempsls
k#054 exportfile CUSTMAS data/ar.customer.master.indexed
k#055 exportfile SALELST data/ar.sales.list
k#056 logmsg2 "Executing--> cobrun $ANIM $RLX/car200"
k#057 #3----------------------------------------------------------------------
k#058 cobrun $ANIM $RLX/car200
k#059 #4----------------------------------------------------------------------
k#060 LCC=$?; S0020C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0020R=1; alias goto="";
k#061 if ((S0020C != 0))
k#062 then logmsg2 "ERR: step#$JSTEP car200 abterm $SCC"
k#063 alias goto="<<S9900=A"; fi
k#064 goto
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#003 //STEP010 EXEC PGM=SORT,REGION=2048K j#004 //SORTIN DD DSN=AR.SALES.ITEMS,DISP=SHR j#005 //SORTOUT DD DSN=&&TEMPSLS,DISP=(NEW,PASS), j#006 // DCB=(LRECL=64,BLKSIZE=6400,RECFM=FB), j#007 // SPACE=(TRK,(50,50),RLSE),UNIT=DISK j#008 //SYSIN DD * j#009 SORT FIELDS=(31,6,CH,A,1,6,CH,A) j#010 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85')) j#011 /*
k#023 exportfile SORTIN1 data/ar.sales.items
k#024 exportfile SORTOUT $JTMP/__tempsls
k#025 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
k#026 cat > $SYSIN <</*
k#027 SORT FIELDS=(31,6,CH,A,1,6,CH,A)
k#028 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
k#029 /*
k#030 logmsg2 "Executing--> uvsort \"fili1=$SORTIN1,typ=RSF,rcs=64,filo1=$SORT..."
k#031 #3----------------------------------------------------------------------
k#032 uvsort "fili1=$SORTIN1,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\
k#033 ,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
k#034 #4----------------------------------------------------------------------
The original SORT control cards are seen in the converted script since all control streams are redirected into a tmp file & brought ahead of the program execution. The tmp file is not required for uvsort since the converter has already inserted the SORT FIELDS & RECORD SIZE into the uvsort command string. But listing the control stream allows you to check the SORT/uvsort conversion without referring back to the input.
The uvsort I/O files are declared by keywords 'fili1=...' & 'filo1=...'. The converter will define these using the $SYMBOLS ($SORTIN & $SORTOUT).
exportfile SORTIN data/ar.sales.items
exportfile SORTOUT $JTMP/__tempsls
====================================================================
uvsort "fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\
Note that the SORT FIELD displacements were one relative for the mainframe, but are zero relative for uvsort.
SORT FIELDS=(31,6,CH,A,1,6,CH,A)
OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85'))
================================================================
,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
This page lists the 2 components of sample JCL 'JGL100'(JCL) & 'PGL100'(PROC). The next page will list the JCL after PROC expansion and the following page will list the Korn shell script conversion result.
//JGL100 JOB (1234),'LIST GL MASTER CHART OF ACCOUNTS' 00000010 //* MVS JCL CONVERSION DEMO - PROCs & GDG files 00000020 //STEPA EXEC PGL100,HLQ=GL,YEAREND=2003 00000030
//PGL100 PROC HLQ=GL,YEAREND=2002 00000010 //* LIST G/L CHART OF ACCOUNTS FROM ACCOUNT.MASTER 00000020 //STEP010 EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND 00000030 //ACCTMAS DD DSN=&HLQ..ACCOUNT.MASTER(0),DISP=SHR 00000040 //ACTLIST DD DSN=&HLQ..ACCOUNT.ACNTLIST(+1),DISP=(,CATLG,DELETE), 00000050 // UNIT=DISK,SPACE=(TRK,(25,25),RLSE), 00000060 // DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA) 00000070 //SYSOUT DD SYSOUT=* 00000080
See the step by step conversion instructions beginning on page '1Q1'.
The 1st procedure is to remove any obsolete sequence numbers from the right side of JCLs & PROCs, change filenames to lower case,& append extensions to identify the files (.jcl or .proc).
The 2nd procedure is the 1 time expansion of PROCs and the 3rd procedure will convert the expanded JCL to Korn shell scripts.
Please relate these conversions to the directories illustrated on page '1A1'
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#01 //JGL100 JOB (1234),'LIST GL MASTER CHART OF ACCOUNTS' j#02 //* MVS JCL CONVERSION DEMO - PROCs & GDG files j#03 //* j#04 ##STEPA EXEC PGL100,HLQ=GL,YEAREND=2003 #<-- PROC1 call j#05 //PGL100 PROC HLQ=GL,YEAREND=2002 j#06 //* j#07 //STEPA EXEC PGL100,HLQ=GL,YEAREND=2003 #<-- PROC1 exp j#08 //* LIST G/L CHART OF ACCOUNTS FROM ACCOUNT.MASTER j#09 //STEP010 EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND j#10 //ACCTMAS DD DSN=GL.ACCOUNT.MASTER(0),DISP=SHR j#11 //ACTLIST DD DSN=GL.ACCOUNT.ACNTLIST(+1),DISP=(,CATLG,DELETE), j#12 // UNIT=DISK,SPACE=(TRK,(25,25),RLSE), j#13 // DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA) j#14 //SYSOUT DD SYSOUT=* j#15 ##PEND1 PGL100
jcl1/jgl100.jcl + procs/pgl100.jcl --> jcl2/jgl100.jcl
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#013 # * MVS JCL CONVERSION DEMO - PROCs & GDG files
k#014 ##STEPA EXEC PGL100,HLQ=GL,YEAREND=2003 #<-PROC1call
k#015 ##PGL100 PROC HLQ=GL,YEAREND=2002
k#016 HLQ="GL";YEAREND="2002";
k#017 ##STEPA EXEC PGL100,HLQ=GL,YEAREND=2003 #<-PROC1exp
k#018 HLQ="GL";YEAREND="2003";
k#019 # * LIST G/L CHART OF ACCOUNTS FROM ACCOUNT.MASTER
k#020 #1======================= begin step#S0010 CGL100 ========================
k#021 S0010=A
k#022 stepctl51; #calc StepTimes & check jobstop/goto end
k#023 goto
k#024 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#025 logmsg2 "******** Begin Step $JSTEP cgl100 (#$XSTEP) ********"
k#026 ##STEPA EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND
k#027 export PROGID=cgl100
k#028 export PARM="2003"
k#029 exportgen0 0 ACCTMAS data/gl.account.master_
k#030 exportgen1 +1 ACTLIST $JGDG/data/gl.account.acntlist_
k#031 #exportgen1 $JGDG/subdir/tempfiles restored to outdir at Normal EOJ
k#032 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_SYSOUT
k#033 logmsg2 "Executing--> cobrun $ANIM $RLX/cgl100"
k#034 #3----------------------------------------------------------------------
k#035 cobrun $ANIM $RLX/cgl100
k#036 #4----------------------------------------------------------------------
k#037 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
k#038 if ((S0010C != 0))
k#039 then logmsg2 "ERR: step#$JSTEP cgl100 abterm $SCC"
k#040 alias goto="<<S9900=A"; fi
k#041 goto
We have omitted the front end 11 lines & the back end 10 lines, since they are the same for all conversions & have already been illustrated for example #1 on page '1C2'.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are the data file definitions extracted from the previous JCL & the corresponding converted equivalents from the Korn shell script.
j#08 //ACCTMAS DD DSN=GL.ACCOUNT.MASTER(0),DISP=SHR j#09 //ACTLIST DD DSN=GL.ACCOUNT.ACNTLIST(+1),DISP=(,CATLG,DELETE), j#10 // UNIT=DISK,SPACE=(TRK,(25,25),RLSE), j#11 // DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)
k#029 exportgen0 0 ACCTMAS data/gl.account.master_ #<-- current generation k#030 exportgen1 +1 ACTLIST $JGDG/data/gl.account.acntlist_ #<-- next generation
One of the main objectives of this demo #3 was to illustrate the conversion of Generation (GDG) files to Korn shell functions (exportgen0 & exportgen1).
You can see exportgen0 & exportgen1 listed ahead on pages '5J1' & '5J2'. Also see Part_5 for more discussion including features that go well beyond the GDG implementation on the mainframe.
Note that the '(0)' suffix on an MVS DSN indicates the current generation & '(+1)' indicates the next generation.
data/gl.account.master_000001 <-- 1st generation of GDG file after conversion data/gl.account.master_000002 data/gl.account.master_000003
The data conversion procedures should append '_000001' to any GDG filenames.
See data conversion procedures in MVSDATA.htm. Page 4E1+ & 4G1 describes making a data conversion control file from the LISTCAT info. Page 4G5 gives the operating instructions to generate 'uvcopy jobs' from the COBOL copybooks to translate character fields from EBCDIC to ASCII while preserving any packed fields & correcting any zoned signs.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
This page lists the 3 components of sample JCL 'JGL200' (JCL, PROC,& a library member for the SORT keys). The next page will list the JCL after PROC expansion and the following page will list the Korn shell script conversion result.
//JGL200 JOB (1234),'TEST/DEMO MVS JCL CONVERSION' 00000010 //* SORT TRANSACTIONS & UPDATE GL ACCOUNT MASTER 00000020 //* - demo GDG processing, write gltrans(+1) & read back as (+1) 00000030 //STEPA EXEC PGL200,HLQ=GL,YEAREND=2003 00000040
//PGL200 PROC HLQ=GL,YEAREND=2002 00000010 //* SORT GL TRANSACTIONS BEFORE UPDATING ACCOUNT MASTER 00000020 //STEP010 EXEC PGM=SORT,REGION=2048K 00000030 //SORTIN DD DSN=&HLQ..ACCOUNT.TRAN1,DISP=OLD 00000040 //SORTOUT DD DSN=&HLQ..ACCOUNT.TRANS(+1),DISP=(,CATLG,DELETE), 00000050 // DCB=(LRECL=80,BLKSIZE=8000,RECFM=FB), 00000060 // SPACE=(TRK,(50,50),RLSE),UNIT=DISK 00000070 //SYSIN DD DSN=&HLQ..PARMS(PGL200S1) 00000080 //* UPDATE ACCOUNT.MASTER WITH TRANSACTION DETAIL 00000090 //STEP020 EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND 00000100 //GLTRANS DD DSN=&HLQ..ACCOUNT.TRANS(+1),DISP=OLD 00000110 //GLMSOLD DD DSN=&HLQ..ACCOUNT.MASTER(0),DISP=OLD 00000120 //GLMSNEW DD DSN=&HLQ..ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE), 00000130 // UNIT=DISK,SPACE=(TRK,(50,50),RLSE), 00000140 // DCB=(MODEL.DSCB,LRECL=80,BLKSIZE=6118,RECFM=FBA) 00000150
SORT FIELDS=(1,18,CH,A,69,12,CH,A)
strip seq#s: proc0 --> procs, jcl0 --> jcl1, parm0 --> parms
expand procs: jcl1 + procs + parms --> jcl2
convert JCL: jcl2 --> jcl3
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#01 //JGL200 JOB (1234),'TEST/DEMO MVS JCL CONVERSION' j#02 //* SORT TRANSACTIONS & UPDATE GL ACCOUNT MASTER j#03 //* - demo GDG processing, write gltrans(+1) & read back as (+1) j#04 //* j#05 ##STEPA EXEC PGL200,HLQ=GL,YEAREND=2003 #<-- PROC1 call j#06 //PGL200 PROC HLQ=GL,YEAREND=2002 j#07 //* j#08 //STEPA EXEC PGL200,HLQ=GL,YEAREND=2003 #<-- PROC1 exp j#09 //* SORT GL TRANSACTIONS BEFORE UPDATING ACCOUNT MASTER j#10 //STEP010 EXEC PGM=SORT,REGION=2048K j#11 //SORTIN DD DSN=GL.ACCOUNT.TRAN1,DISP=OLD j#12 //SORTOUT DD DSN=GL.ACCOUNT.TRANS(+1),DISP=(,CATLG,DELETE), j#13 // DCB=(LRECL=80,BLKSIZE=8000,RECFM=FB), j#14 // SPACE=(TRK,(50,50),RLSE),UNIT=DISK j#15 //SYSIN DD DSN=GL.PARMS(PGL200S1) j#16 /=* UPDATE ACCOUNT.MASTER WITH TRANSACTION DETAIL j#17 //*============================ step# 002 ============================ j#18 //STEP020 EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND j#19 //GLTRANS DD DSN=GL.ACCOUNT.TRANS(+1),DISP=OLD j#20 //GLMSOLD DD DSN=GL.ACCOUNT.MASTER(0),DISP=OLD j#21 //GLMSNEW DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE), j#22 // UNIT=DISK,SPACE=(TRK,(50,50),RLSE), j#23 // DCB=(MODEL.DSCB,LRECL=80,BLKSIZE=6118,RECFM=FBA) j#24 ##PEND1 PGL200
Please compare this jgl200.jcl conversion with the previous jar200.jcl. Both are 2 step jobs executing a SORT & a COBOL program. This job is intended to illustrate the following:
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#013 # * SORT TRANSACTIONS & UPDATE GL ACCOUNT MASTER k#014 # * - demo GDG processing, write gltrans(+1) & read back as (+1) k#020 # * SORT GL TRANSACTIONS BEFORE UPDATING ACCOUNT MASTER k#021 #1======================= begin step#S0010 SORT ======================== k#022 S0010=A k#023 stepctl51; #calc StepTimes & check jobstop/goto end k#024 goto k#025 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto=""; k#026 logmsg2 "******** Begin Step $JSTEP sort (#$XSTEP) ********" k#027 ##STEPA EXEC PGM=SORT,REGION=2048K k#028 export PROGID=sort k#029 export PARM="" k#030 exportfile SORTIN1 data/gl.account.tran1 k#031 exportgen1 +1 SORTOUT $JGDG/data/gl.account.trans_ k#032 #exportgen1 $JGDG/subdir/tempfiles restored to outdir at Normal EOJ k#033 exportfile SYSIN $RUNLIBS/parms/pgl200s1 k#034 #2-------------------------- parms/pgl200s1 --------------------------- k#035 # SORT FIELDS=(1,8,CH,A,69,12,CH,A) k#036 logmsg2 "Executing--> uvsort \"fili1=$SORTIN1,typ=RSF,rcs=80,filo1=$SORT..." k#037 #3---------------------------------------------------------------------- k#038 uvsort "fili1=$SORTIN1,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\ k#039 ,keys=(0,8,c,a,68,12,c,a)" k#040 #4---------------------------------------------------------------------- k#041 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto=""; k#042 if ((S0010C != 0)) #need to modify for COND step S0020 k#043 then logmsg2 "ERR: step#$JSTEP sort abterm $SCC" k#044 alias goto="<<S9900=A"; fi k#045 goto k#046 #/=* UPDATE ACCOUNT.MASTER WITH TRANSACTION DETAIL k#047 #1======================= begin step#S0020 CGL200 ======================== k#048 if ((SCC > 4)); then # COND=(4,LT,STEP010) k#049 alias goto="<<S9000=A"; fi k#050 goto k#051 S0020=A k#052 stepctl51; #calc StepTimes & check jobstop/goto end k#053 goto k#054 export JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto=""; k#055 logmsg2 "******** Begin Step $JSTEP cgl200 (#$XSTEP) ********" k#056 ##STEP020 EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND k#057 export PROGID=cgl200 k#058 export PARM="2003" k#059 exportgen1 +1 GLTRANS $JGDG/data/gl.account.trans_ k#060 #exportgen1 $JGDG/subdir/tempfiles restored to outdir at Normal EOJ k#061 exportgen0 0 GLMSOLD data/gl.account.master_ k#062 exportgen1 +1 GLMSNEW $JGDG/data/gl.account.master_ k#063 logmsg2 "Executing--> cobrun $ANIM $RLX/cgl200" k#064 #3---------------------------------------------------------------------- k#065 cobrun $ANIM $RLX/cgl200 k#066 #4---------------------------------------------------------------------- k#067 LCC=$?; S0020C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0020R=1; alias goto=""; k#068 if ((S0020C != 0)) k#069 then logmsg2 "ERR: step#$JSTEP cgl200 abterm $SCC" k#070 alias goto="<<S9900=A"; fi k#071 goto
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
jgl200.jcl illustrates a SYSIN control card library member, which contains the 'SORT FIELDS'. Note that the previous jar200.jcl included the SORT FIELDS as embedded '//SYSIN DD *' instream data, but PROCs are not allowed to contain instream data, so control card library members are used.
j#13 //SYSIN DD DSN=GL.CTLCDLIB(PGL200S1)
k#033 exportfile SYSIN $RUNLIBS/parms/pgl200s1 k#034 #2-------------------------- parms/pgl200s1 --------------------------- k#035 # SORT FIELDS=(1,8,CH,A,69,12,CH,A) k#036 logmsg2 "Executing--> uvsort \"fili1=$SORTIN1,typ=RSF,rcs=80,filo1=$SORT..." k#037 #3---------------------------------------------------------------------- k#038 uvsort "fili1=$SORTIN1,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\ k#039 ,keys=(0,8,c,a,68,12,c,a)" k#040 #4----------------------------------------------------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#01 //JGL300 JOB (1234),'TEST MVS JCL CONVERSION' j#02 //* DEMO CONVERSION OF IEBGENER (TO UVCP) & IDCAMS (TO CP) j#03 //* COPY GL.ACCOUNT.MASTER TO A TEMP/WORK FILE & BACK (GEN# +1) j#04 //* - demos CONDition code testing (also see JGL320 IF/THEN/ENDIF) j#05 //STEP010 EXEC PGM=IEBGENER j#06 //SYSUT1 DD DSN=GL.ACCOUNT.MASTER(0),DISP=SHR j#07 //SYSUT2 DD DSN=&&TEMPGLM,DISP=(NEW,PASS),DCB=(LRECL=80) j#08 /=* j#09 //*============================ step# 002 ============================ j#10 //STEP020 EXEC PGM=IDCAMS,COND=(4,LT,STEP010) j#11 //TEMPGLM DD DSN=&&TEMPGLM,DISP=(OLD,PASS) j#12 //ACNTMAS DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(NEW,CATLG),LRECL=80 j#13 //SYSIN DD * j#14 REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS) RECORDSIZE(80) j#15 /*
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#013 # * DEMO CONVERSION OF IEBGENER (TO UVCP) & IDCAMS (TO CP)
k#014 # * COPY GL.ACCOUNT.MASTER TO A TEMP/WORK FILE & BACK (GEN# +1)
k#015 # * - demos CONDition code testing (also see JGL320 IF/THEN/ENDIF)
k#016 #1======================= begin step#S0010 IEBGENER ========================
k#017 S0010=A
k#018 stepctl51; #calc StepTimes & check jobstop/goto end
k#019 goto
k#020 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#021 logmsg2 "******** Begin Step $JSTEP iebgener (#$XSTEP) ********"
k#022 ##STEP010 EXEC PGM=IEBGENER
k#023 export PROGID=iebgener
k#024 export PARM=""
k#025 exportgen0 0 SYSUT1 data/gl.account.master_
k#026 exportfile SYSUT2 $JTMP/__tempglm
k#027 logmsg2 "Executing--> uvcp \"fili1=$SYSUT1,typ=RSF,rcs=80,filo1=$SYSUT2,..."
k#028 #3----------------------------------------------------------------------
k#029 uvcp "fili1=$SYSUT1,typ=RSF,rcs=80,filo1=$SYSUT2,typ=RSF,rcs=80"
k#030 #4----------------------------------------------------------------------
k#031 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
k#032 if ((S0010C != 0)) #need to modify for COND step S0020
k#033 then logmsg2 "ERR: step#$JSTEP iebgener abterm $SCC"
k#034 alias goto="<<S9900=A"; fi
k#035 goto
k#036 #1======================= begin step#S0020 IDCAMS ========================
k#037 if ((S0010C > 4)); then # COND=(4,LT,STEP010)
k#038 alias goto="<<S9000=A"; fi
k#039 goto
k#040 S0020=A
k#041 stepctl51; #calc StepTimes & check jobstop/goto end
k#042 goto
k#043 export JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#044 logmsg2 "******** Begin Step $JSTEP idcams (#$XSTEP) ********"
k#045 ##STEP020 EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
k#046 export PROGID=idcams
k#047 export PARM=""
k#048 exportfile TEMPGLM $JTMP/__tempglm
k#049 exportgen1 +1 ACNTMAS $JGDG/data/gl.account.master_
k#050 #exportgen1 $JGDG/subdir/tempfiles restored to outdir at Normal EOJ
k#051 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
k#052 cat > $SYSIN <</*
k#053 REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS) RECORDSIZE(80)
k#054 /*
k#055 logmsg2 "Executing--> uvcp \"fili1=$TEMPGLM,typ=RSF,rcs=80,filo1=$ACNTMA..."
k#056 #3----------------------------------------------------------------------
k#057 uvcp "fili1=$TEMPGLM,typ=RSF,rcs=80,filo1=$ACNTMAS,typ=RSF,rcs=80";
k#058 LCC=$?; ((SCC+=LCC)); ((JCC+=LCC));
k#059 #4----------------------------------------------------------------------
k#060 S0020C=$SCC; ((JCC+=SCC)); S0020R=1; alias goto="";
k#061 if ((S0020C != 0))
k#062 then logmsg2 "ERR: step#$JSTEP idcams abterm $SCC"
k#063 alias goto="<<S9900=A"; fi
k#064 goto
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#01 //JGL320 JOB (1234),'TEST MVS JCL CONVERSION' j#02 //* DEMO CONVERSION OF IEBGENER (TO UVCP) & IDCAMS (TO CP) j#03 //* COPY GL.ACCOUNT.MASTER TO A TEMP/WORK FILE & BACK (GEN# +1) j#04 //* - demos IF/THEN/ENDIF (vs CONDition codes in JGL320) j#05 //* - change input filename (step1 will fail) & step2 will be skipped j#06 //STEP010 EXEC PGM=IEBGENER j#07 //SYSUT1 DD DSN=GL.ACCOUNT.MASTER(0),DISP=SHR j#08 //SYSUT2 DD DSN=&&TEMPGLM,DISP=(NEW,PASS),DCB=(LRECL=80) j#09 //* j#10 // IF (RC = 0) THEN j#11 //STEP020 EXEC PGM=IDCAMS,COND=(4,LT,STEP010) j#12 //TEMPGLM DD DSN=&&TEMPGLM,DISP=(OLD,PASS) j#13 //ACNTMAS DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(NEW,CATLG),LRECL=80 j#14 //SYSIN DD * j#15 REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS) j#16 /* j#17 // ENDIF
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#013 # * DEMO CONVERSION OF IEBGENER (TO UVCP) & IDCAMS (TO CP)
k#014 # * COPY GL.ACCOUNT.MASTER TO A TEMP/WORK FILE & BACK (GEN# +1)
k#015 # * - demos IF/THEN/ENDIF (vs CONDition codes in JGL320)
k#016 # * - change input filename (step1 will fail) & step2 will be skipped
k#017 #1======================= begin step#S0010 IEBGENER ========================
k#018 S0010=A
k#019 stepctl51; #calc StepTimes & check jobstop/goto end
k#020 goto
k#021 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#022 logmsg2 "******** Begin Step $JSTEP iebgener (#$XSTEP) ********"
k#023 ##STEP010 EXEC PGM=IEBGENER
k#024 export PROGID=iebgener
k#025 export PARM=""
k#026 exportgen0 0 SYSUT1 data/gl.account.master_
k#027 exportfile SYSUT2 $JTMP/__tempglm
k#028 logmsg2 "Executing--> uvcp \"fili1=$SYSUT1,typ=RSF,rcs=80,filo1=$SYSUT2,..."
k#029 #3----------------------------------------------------------------------
k#030 uvcp "fili1=$SYSUT1,typ=RSF,rcs=80,filo1=$SYSUT2,typ=RSF,rcs=80"
k#031 #4----------------------------------------------------------------------
k#032 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
k#033 if ((S0010C > 4)) #need to modify for COND step S0020
k#034 then logmsg2 "ERR: step#$JSTEP iebgener abterm $SCC"
k#035 alias goto="<<S9900=A"; fi
k#036 goto
k#037 if ((S0010C == 0)); then #IF (RC = 0) THEN #J001(1)
k#038 #1======================= begin step#S0020 IDCAMS ========================
k#039 if ((S0010C > 4)); then # COND=(4,LT,STEP010)
k#040 alias goto="<<S9000=A"; fi
k#041 goto
k#042 S0020=A
k#043 stepctl51; #calc StepTimes & check jobstop/goto end
k#044 goto
k#045 export JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#046 logmsg2 "******** Begin Step $JSTEP idcams (#$XSTEP) ********"
k#047 ##STEP020 EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
k#048 export PROGID=idcams
k#049 export PARM=""
k#050 exportfile TEMPGLM $JTMP/__tempglm
k#051 exportgen1 +1 ACNTMAS $JGDG/data/gl.account.master_
k#052 #exportgen1 $JGDG/subdir/tempfiles restored to outdir at Normal EOJ
k#053 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
k#054 cat > $SYSIN <</*
k#055 REPRO INFILE(TEMPGLM) OUTFILE(ACNTMAS) RECORDSIZE(80)
k#056 /*
k#057 logmsg2 "Executing--> uvcp \"fili1=$TEMPGLM,typ=RSF,rcs=80,filo1=$ACNTMA..."
k#058 #3----------------------------------------------------------------------
k#059 uvcp "fili1=$TEMPGLM,typ=RSF,rcs=80,filo1=$ACNTMAS,typ=RSF,rcs=80";
k#060 LCC=$?; ((SCC+=LCC)); ((JCC+=LCC));
k#061 #4----------------------------------------------------------------------
k#062 S0020C=$SCC; ((JCC+=SCC)); S0020R=1; alias goto="";
k#063 if ((S0020C != 0))
k#064 then logmsg2 "ERR: step#$JSTEP idcams abterm $SCC"
k#065 alias goto="<<S9900=A"; fi
k#066 goto
k#067 fi #ENDIF #J001(1) #IF (RC = 0) THEN #J001(1)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#01 //JGL360 JOB 'TEST MVS JCL IDCAMS DEFINE CLUSTER CONVERSION' j#02 //* CREATE VSAM INDEXED FILE (INIT EMPTY FILE FOR RANDOM UPDATES) j#03 //STEP010 EXEC PGM=IDCAMS j#04 //SYSPRINT DD SYSOUT=* j#05 //SYSIN DD * j#06 DELETE (GL.ACCOUNT.MASTER2) PURGE CLUSTER CATALOG (USERCAT5) j#07 DEFINE CLUSTER (NAME (GL.ACCOUNT.MASTER2) - j#08 RECORDSIZE(80) - j#09 KEYS(6 0) ) j#10 /* j#11 //
See the 'uvcp' equivalent of IDCAMS listed on the next page --->
Most of the IDCAMS functions are not required for MicroFocus COBOL on Unix/Linux/Windows systems. For example 'DEFINE CLUSTER' was required by the mainframe to create a VSAM file, but MicroFocus COBOL can create VSAM files simply by 'OPEN OUTPUT'.
However the IDCAMS DEFINE CLUSTER is converted to 'uvcp' which will create an empty file, in case the IDCAMS step is followed by a COBOL program that expects to ADD/UPDATE records to an empty existing file. The uvcp will create the file with any indexed keys specified.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The front end 11 lines & the back end 10 lines are omitted since they are the same for all jobs (except for jobname & any JCL comments).
k#013 # * CREATE VSAM INDEXED FILE (INIT EMPTY FILE FOR RANDOM UPDATES)
k#014 #1======================= begin step#S0010 IDCAMS ========================
k#015 S0010=A
k#016 stepctl51; #calc StepTimes & check jobstop/goto end
k#017 goto
k#018 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#019 logmsg2 "******** Begin Step $JSTEP idcams (#$XSTEP) ********"
k#020 ##STEP010 EXEC PGM=IDCAMS
k#021 export PROGID=idcams
k#022 export PARM=""
k#023 exportfile SYSPRINT $SYOT/${JOBID2}_${JSTEP}_SYSPRINT
k#024 exportfile SYSIN $JTMP/${JSTEP}_${PROGID}_SYSIN
k#025 cat > $SYSIN <</*
k#026 DELETE (GL.ACCOUNT.MASTER2) PURGE CLUSTER CATALOG (USERCAT5)
k#027 DEFINE CLUSTER (NAME (GL.ACCOUNT.MASTER2) -
k#028 RECORDSIZE(80) -
k#029 KEYS(6 0) )
k#030 /*
k#031 logmsg2 "Executing--> #rm -f data/gl.account.master2.dat"
k#032 #3----------------------------------------------------------------------
k#033 #rm -f data/gl.account.master2.dat
k#034 #rm -f data/gl.account.master2.idx
k#035 uvcp "fili1=ctl/nullfile,typ=RSF,rcs=80,filo1=data/gl.account.master2,typ=ISF\
k#036 ,rcs=80,isk1=0(6)"
k#037 LCC=$?; ((SCC+=LCC)); ((JCC+=LCC));
k#038 #4----------------------------------------------------------------------
k#039 S0010C=$SCC; ((JCC+=SCC)); S0010R=1; alias goto="";
k#040 if ((S0010C != 0))
k#041 then logmsg2 "ERR: step#$JSTEP idcams abterm $SCC"
k#042 alias goto="<<S9900=A"; fi
k#043 goto
Most of the IDCAMS functions are not required for MicroFocus COBOL on Unix/Linux/Windows systems. For example 'DEFINE CLUSTER' was required by the mainframe to create a VSAM file, but MicroFocus COBOL can create VSAM files simply by 'OPEN OUTPUT'.
However the IDCAMS DEFINE CLUSTER is converted to 'uvcp' which will create an empty file, in case the IDCAMS step is followed by a COBOL program that expects to ADD/UPDATE records to an empty existing file. The uvcp will create the file with any indexed keys specified.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
IEFBR14 steps were often used to DELETE files. Here is a demo job to illustrate deleting files - both regular & GDG (all members of a generation file set).
j#01 //JGL500 JOB 'test DELETE files - regular & GDG (all members)' j#02 //STEP010 EXEC PGM=IEFBR14 j#03 //ACTEXPT DD DSN=GL.ACCOUNT.EXPORT,DISP=(OLD,DELETE) j#04 //ACTLIST DD DSN=GL.ACCOUNT.ACNTLIST,DISP=(OLD,DELETE)
k#013 #1======================= begin step#S0010 IEFBR14 ========================
k#014 S0010=A
k#015 stepctl51; #calc StepTimes & check jobstop/goto end
k#016 goto
k#017 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#018 logmsg2 "******** Begin Step $JSTEP iefbr14 (#$XSTEP) ********"
k#019 ##STEP010 EXEC PGM=IEFBR14
k#020 export PROGID=iefbr14
k#021 export PARM=""
k#022 exportfile ACTEXPT data/gl.account.export
k#023 exportgenall ACTLIST data/gl.account.acntlist_
k#024 logmsg2 "Executing--> #rm -f $ACTEXPT"
k#025 #3----------------------------------------------------------------------
k#026 #rm -f $ACTEXPT
k#027 #rm -f ${ACTLIST}[0-9][0-9][0-9][0-9][0-9][0-9]
k#028 #4----------------------------------------------------------------------
k#029 : # dummy step set cc 0 for status tests
k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
k#031 if ((S0010C != 0))
k#032 then logmsg2 "ERR: step#$JSTEP iefbr14 abterm $SCC"
k#033 alias goto="<<S9900=A"; fi
k#034 goto
j#03 //ACTEXPT DD DSN=GL.ACCOUNT.EXPORT,DISP=(OLD,DELETE)
k#022 exportfile ACTEXPT data/gl.account.export k#026 rm -f $ACTEXPT
j#04 //ACTLIST DD DSN=GL.ACCOUNT.ACNTLIST,DISP=(OLD,DELETE)
k#023 exportgenall ACTLIST data/gl.account.acntlist_
k#027 rm -f ${ACTLIST}[0-9][0-9][0-9][0-9][0-9][0-9]
The Regular file delete is straitforward, but the GDG file delete deserves some explanation. How does the converter know that 'GL.ACCOUNT.ACNTLIST' is a GDG file ? - since it does not have the usual identifying suffix (0) (1).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Before the 1st JCL conversion, job 'jcldata51' reads thru all JCLs, extracting all file definitions, sorting,& dropping duplicates. An output file is written to 'ctl/datactl53I' which is read by the JCL converter as an Indexed file or stored in a memory table. The JCL converter can then lookup this file to determine which files are GDG & get record sizes, keys, etc if not in JCL.
Here are a few lines from the control file. You can see the entire test/demo file listed later on page '3F1'.
| Note |
|
#01 &&TEMPGLM cntf=0016 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL1 #02 AR.CUSTOMER.MASTER cntf=0010 rca=00000 rcm=00000 typ=RSF src=J___________ job=jar100 prg=CAR100 #03 AR.CUSTOMER.NAMEADRS.LIST100 cntf=0002 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jar109 prg=CAR100 #04 GL.ACCOUNT.ACNTLIST(+1) cntf=0001 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100 #05 GL.ACCOUNT.MASTER cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14 #06 GL.ACCOUNT.MASTER(+1) cntf=0014 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL2 #07 GL.ACCOUNT.MASTER(0) cntf=0020 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl100 prg=CGL100 #08 GL.ACCOUNT.MASTER2 cntf=0002 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6) #09 GL.ACCOUNT.TRANS(+1) cntf=0005 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl211 prg=SORT #10 PY.PARMS(PPY200S1) cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy200 prg=SORT #11 PY.TIME.&DAY..&MONTH..&YEAR cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy910 prg=IEFBR14 #12 PYTEST.PAYROLL.MASTER cntf=0006 rca=00200 rcm=00200 typ=ISF src=Jk__________ job=jpy400 prg=IDCAMS key=(0,8)
#01 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL1 #02 rca=00000 rcm=00000 typ=RSF src=J___________ job=jar100 prg=CAR100 #03 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jar109 prg=CAR100 #04 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100 #05 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14 #06 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL2 #07 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl100 prg=CGL100 #08 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6) #09 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl211 prg=SORT #10 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy200 prg=SORT #11 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy910 prg=IEFBR14 #12 rca=00200 rcm=00200 typ=ISF src=Jk__________ job=jpy400 prg=IDCAMS key=(0,8)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Prior to May 2007, all GDG files defaulted to a system wide value for the number of generations maintained - unless you modified by coding 'gdg=..' in this control file for datafiles you wanted different from the default.
As of May 2007, an indexed file (ctl/gdgctl51I) now holds the 'gdg=..' info. This file is looked up by exportgen1 to get the gdg=.. value. This is a big improvement since you can make changes in 1 place to affect all references to each datafile.
See much more about the enhanced GDG system in 'Part_5' of this MVSJCL.doc.
Also note that ctl/datactl53I is used to determine references to an entire set of GDG files when there is no (0) or (+1) suffix on the reference, but the control file knows it is a GDG file from other references in the JCL. In this case the converter generates the 'exportgenall' function which concatenates all members of the file.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The mainframe required IKJEFT01 to execute COBOL programs that access DB2 tables. Microfocus COBOL on Unix/Linux/Windows(SFU) does not require this, so the converter retrieves the COBOL program name from the SYSTSIN control cards, and formats the cobrun command to execute the COBOL program directly.
//IKJEFT01 JOB (MXP,WXS91),'sample job to demo IKJEFT01 conversion' //STEP0010 EXEC PGM=IKJEFT01,DYNAMNBR=20 //SYSTSIN DD DSN=MXPLIB(IKJDEMO1),DISP=SHR //*note - for demo simplicity all files commented out except SYSTSIN //*SYSTSPRT DD SYSOUT=&SYSOUT1 //*SYSOUT,SYSPRINT,SYSABOUT,SYSDBOUT,SYSUDUMP,PRT(all similar SYSTSPRT) //*SXH DD DSN=MXP.PSXH.KSVSAM.MAST,DISP=SHR
DSN SYSTEM(DB2P)
RUN PROGRAM(IKJPROG1) PLAN(IKJPROG1) LIB('MEPP.WXS91.LOADLIB')
END
k#013 #1======================= begin step#S0010 IKJEFT01 ========================
k#014 S0010=A
k#015 stepctl51; #calc StepTimes & check jobstop/goto end
k#016 goto
k#017 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#018 logmsg2 "******** Begin Step $JSTEP ikjeft01 (#$XSTEP) ********"
k#019 ##STEP0010 EXEC PGM=IKJEFT01,DYNAMNBR=20
k#020 export PROGID=car100
k#021 export PARM=""
k#022 exportfile SYSTSIN $RUNLIBS/parms/ikjdemo1
k#023 #2-------------------------- parms/ikjdemo1 ---------------------------
k#024 # DSN SYSTEM(DB2P)
k#025 # RUN PROGRAM(CAR100) PLAN(IKJPROG1) LIB('MEPP.WXS91.LOADLIB')
k#026 # PARMS('parmsdata added on IKJEFT01 demo Aug28/07')
k#027 # END
k#028 export PARM="parmsdata added on IKJEFT01 demo Aug28/07"
k#029 logmsg2 "Executing--> cobrun $ANIM $RLX/car100"
k#030 #3----------------------------------------------------------------------
k#031 cobrun $ANIM $RLX/car100
k#032 #4----------------------------------------------------------------------
k#033 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
k#034 if ((S0010C != 0))
k#035 then logmsg2 "ERR: step#$JSTEP ikjeft01 abterm $SCC"
k#036 alias goto="<<S9900=A"; fi
k#037 goto
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
After converting the test/demo JCL, you can run the converted script. The demo JCL specifies TCP/IP adrs as '127.0.0.1' which is the unix/linux host. The demo assumes you have setup test users mvstest/vsetest and FTP's from 'mvstest' & logs in the 'vsetest' on the same machine.
//FTPPUT1 JOB 'test FTP conversion' //FTPSTEP1 EXEC PGM=FTP,PARM='127.0.0.1' //INPUT DD * vsetest vsetest00 put GL.ACCOUNT.TRANS(0) <-- Note - GDG files are handled quit /*
k#013 #1======================= begin step#S0010 FTP ========================
k#014 S0010=A
k#015 stepctl51; #calc StepTimes & check jobstop/goto end
k#016 goto
k#017 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#018 logmsg2 "******** Begin Step $JSTEP ftp (#$XSTEP) ********"
k#019 ##FTPSTEP1 EXEC PGM=FTP,PARM='127.0.0.1'
k#020 export PROGID=ftp
k#021 export PARM="127.0.0.1"
k#022 exportfile INPUT1 $JTMP/${JSTEP}_${PROGID}_INPUT1
k#023 cat > $INPUT1 <</*
k#024 mvstest mvstest00
k#025 cd testdata
k#026 binary
k#027 put GL.ACCOUNT.TRANS(0)
k#028 quit
k#029 /*
k#030 exportgen0 0 FTPPUT01 data/gl.account.trans_
k#031 exportfile FTPTMP2 $JTMP/${JSTEP}_${PROGID}_FTPTMP2
k#032 cat > $FTPTMP2 <</*FTP2
k#033 open 127.0.0.1
k#034 user mvstest mvstest00
k#035 cd testdata
k#036 binary
k#037 put $FTPPUT01
k#038 quit
k#039 /*FTP2
k#040 logmsg2 "Executing--> ftp -i -n -u -v <$FTPTMP2"
k#041 #3----------------------------------------------------------------------
k#042 ftp -i -n -u -v <$FTPTMP2
k#043 #4----------------------------------------------------------------------
k#044 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
k#045 if ((S0010C != 0))
k#046 then logmsg2 "ERR: step#$JSTEP ftp abterm $SCC"
k#047 alias goto="<<S9900=A"; fi
k#048 goto
ftpdemo1.ksh <-- execute FTP demo (after conversion) ============ - see console log on the next page
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
090314:135607:FTPPUT1: Begin Job=FTPPUT1 090314:135607:FTPPUT1: /home/mvstest/testlibs/jcls/ftpput1.ksh 090314:135607:FTPPUT1: Arguments: 090314:135607:FTPPUT1: RUNLIBS=/home/mvstest/testlibs 090314:135607:FTPPUT1: RUNDATA=/home/mvstest/testdata 090314:135607:FTPPUT1: JTMP=/home/mvstest/testdata/jobtmp/FTPPUT1 SYOT=/home/mvstest/testdata/sysout/FTPPUT1 090314:135607:FTPPUT1: RUNDATE=20090314 090314:135607:FTPPUT1: ******** Begin Step S0010 ftp (#1) ******** 090314:135607:FTPPUT1: file: INPUT1=/home/mvstest/testdata/jobtmp/FTPPUT1/S0010_ftp_INPUT1 bytes=66 090314:135607:FTPPUT1: EOF fili01 rds=5 size=120: /home/mvstest/testdata/jobtmp/FTPPUT1/gtmp/0010I_gl_account.trans_ 090314:135607:FTPPUT1: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I 090314:135607:FTPPUT1: EOF filo02 wrts=1 size=51: /home/mvstest/testdata/jobtmp/FTPPUT1/gtmp/0010G0_gl_account.trans_ 090314:135607:FTPPUT1: gen0: FTPPUT01=data/gl.account.trans_000005 insize=1600 090314:135607:FTPPUT1: file: FTPTMP2=/home/mvstest/testdata/jobtmp/FTPPUT1/S0010_ftp_FTPTMP2 bytes= 090314:135607:FTPPUT1: Executing--> ftp -i -n -u -v </home/mvstest/testdata/jobtmp/FTPPUT1/S0010_ftp_FTPTMP2 Connected to 127.0.0.1. 220 (vsFTPd 2.0.5) 331 Please specify the password. 230 Login successful. 250 Directory successfully changed. 200 Switching to Binary mode. local: data/gl.account.trans_000005 remote: data/gl.account.trans_000005 550 Permission denied. Passive mode refused. Turning off passive mode. 200 PORT command successful. Consider using PASV. 150 Ok to send data. 226 File receive OK. 1600 bytes sent in 4.5e-05 seconds (3.5e+04 Kbytes/s) 221 Goodbye. 090314:135607:FTPPUT1: Job Times: Begun=13:56:07 End=13:56:07 Elapsed=00:00:00 090314:135607:FTPPUT1: EOF filr01 rds=5 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I 090314:135607:FTPPUT1: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#001 //MAILSMTP JOB 'test/demo SMTP MAIL convert to sendmail' j#003 //STEP010 EXEC PGM=IEBGENER j#004 //SYSUT2 DD SYSOUT=(B,SMTP) j#005 //SYSUT1 DD * j#006 TO: appsadm j#007 FROM: mvstest j#008 SUBJECT: testing SMTP/sendmail to other unix logins j#009 j#010 Hello: appsadm, sending this mail from batch job MAILSMTP (a test) j#011 Note: the blank line between SUBJECT: & message is mandatory j#012 Similar mail might be used to alert you of problems in batch jobs ? j#013 This mail from 1 unix login to another unix login j#014 Not sure if we can send to an internet email address yet ? j#015 (may need to install more software ?) j#016 /*
k#013 #1======================= begin step#S0010 IEBGENER ========================
k#014 S0010=A
k#015 stepctl51; #calc StepTimes & check jobstop/goto end
k#016 goto
k#017 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#018 logmsg2 "******** Begin Step $JSTEP iebgener (#$XSTEP) ********"
k#019 ##STEP010 EXEC PGM=IEBGENER
k#020 export PROGID=iebgener
k#021 export PARM=""
k#022 exportfile SYSUT2 $SYOT/${JOBID2}_${JSTEP}_SYSUT2
k#023 exportfile SYSUT1 $JTMP/${JSTEP}_${PROGID}_SYSUT1
k#024 cat > $SYSUT1 <</*
k#025 TO: appsadm
k#026 FROM: mvstest
k#027 SUBJECT: testing SMTP/sendmail to other unix logins
k#028
k#029 Hello: appsadm, sending this mail from batch job MAILSMTP (a test)
k#030 Note: the blank line between SUBJECT: & message is mandatory
k#031 Similar mail might be used to alert you of problems in batch jobs ?
k#032 This mail from 1 unix login to another unix login
k#033 Not sure if we can send to an internet email address yet ?
k#034 (may need to install more software ?)
k#035 /*
k#036 logmsg2 "Executing--> sendmail -t <$SYSUT1"
k#037 #3----------------------------------------------------------------------
k#038 sendmail -t <$SYSUT1
k#039 #4----------------------------------------------------------------------
mailsmtp.ksh <-- execute (as mvstest) Login appsadm <-- Login as appsadm (mail addressee) mail <-- read mail (sent from mvstest)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are listings of mainframe MAILTOLN & the converted 'mutt' JCL/script, that you can run after conversion.
//MAILDEMO JOB 'test/demo MAIL conversion to linux mutt' //* demo conversion of mainframe 'MAILTOLN' to linux 'mutt' //STEP010 EXEC PGM=MAILTOLN //PARMFILE DD * TO: uvadm SUBJECT: current generation of GL.ACCOUNT.TRANS file attached //MAIL DD DISP=SHR,DSN=GL.ACCOUNT.TRANS(0)
#1======================= begin step#S0010 MAILTOLN ========================
S0010=A
JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
logmsg1 "Begin Step $JSTEP mailtoln (#$XSTEP)"
stepctl51; #calc StepTimes & check jobstop/goto end
goto
##STEP010 EXEC PGM=MAILTOLN
export PROGID=mailtoln
export PARM=""
PARMFILE=$JTMP/${JSTEP}_${PROGID}_PARMFILE
cat > $PARMFILE <</*
TO: uvadm
SUBJECT: current generation of GL.ACCOUNT.TRANS file attached
/*
exportfile PARMFILE $PARMFILE
exportgen0 +1 MAIL data/gl.account.trans_ #<--NOTE: GDG file attachment
#3----------------------------------------------------------------------
mutt -s "current generation of GL.ACCOUNT.TRANS file attached"\
-a $MAIL uvadm <$PARMFILE
#4----------------------------------------------------------------------
maildemo.ksh <-- execute test/demo JCL/script (after conversion) ============
This demo JCL/script assumes you will be logged in as 'mvstest' & will mail to user 'uvadm'. Note the attachment is '$MAIL' which is a GDG file defined by 'exportgen0'. It is addressed in subdir 'gl/' since all JCL/scripts call function 'jobset51' (on line 10 not shown here) which changes directory to $RUNDATA. RUNDATA will be /home/mvstest/testdata/ if logged in as mvstest using the profile listed at ADMjobs.htm#1C1.
See the resulting 'mbox' for 'uvadm' listed on the next page.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
From mvstest@uvsoft3.uvsoft.ca Mon Jul 30 13:11:42 2007 Return-Path: <mvstest@uvsoft3.uvsoft.ca> Received: from uvsoft3.uvsoft.ca (uvsoft3.uvsoft.ca [127.0.0.1]) by uvsoft3.uvsoft.ca (8.12.10/8.12.10) with ESMTP id l6UKBgdd009858 for <uvadm@uvsoft3.uvsoft.ca>; Mon, 30 Jul 2007 13:11:42 -0700 Received: (from mvstest@localhost) by uvsoft3.uvsoft.ca (8.12.10/8.12.10/Submit) id l6UKBf1U009856 for uvadm@localhost.localdomain; Mon, 30 Jul 2007 13:11:41 -0700 Date: Mon, 30 Jul 2007 13:11:41 -0700 From: MVSTEST <mvstest@uvsoft3.uvsoft.ca> To: UVADM <uvadm@uvsoft3.uvsoft.ca> Subject: current generation of GL.ACCOUNT.TRANS file attached Message-ID: <20070730201141.GA9851@localhost.localdomain> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="Kj7319i9nmIyA2yE" Content-Disposition: inline User-Agent: Mutt/1.4.1i Status: RO
--Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline
TO: uvadm SUBJECT: current generation of GL.ACCOUNT.TRANS file attached
--Kj7319i9nmIyA2yE Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="account.trans_000005"
00011100T Bank Fee 000000100} 1234BJ 040428 00011100T EMJ Sony Tape Drive 000012314J 1234BC000871040428 00011100T Telephone 000000559Q 1234BC000882040428 00011100T FEDEX 000000109J 1234BC000870040428 00011100T VISA payment 000040000} 1234BC000884040428 00011100T Staples office supplies 000001227N 1234BC000874040428 00011100T Datex office rent 000003210} 1234BC000885040428 00011200T VISA payment 0000400000 1234BC000884040428 00011200T Dollar rent a car 000014177O 1234VS 040428 00033700T EMJ Sony Tape Drive 0000008056 1234BC000871040428 00033700T Telephone 0000000344 1234BC000882040428 00033700T FEDEX 0000001091 1234BC000870040428 00033700T Staples office supplies 0000000754 1234BC000874040428 00033700T Datex office rent 0000002100 1234BC000885040428 00061500T EMJ Sony Tape Drive 0000115085 1234BC000871040428 00062200T Staples office supplies 0000011521 1234BC000874040428 00063300T Dollar rent a car 0000141776 1234VS 040428 00074100T Bank Fee 0000001000 1234BJ 040428 00075100T Datex office rent 0000030000 1234BC000885040428 00075300T Telephone 0000005254 1234BC000882040428
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The 'ISRSUPC' (SUPERC) file comparison utility is converted to unix/linux 'cmp' and to the Vancouver Utility 'uvcmp1' utilties.
'cmp' is used to set the condition code for any following 'IF', often the only purpose of the ISRSUPC step. 'uvcmp' creates a report in SYSOUT in case you do need the file comparison report (see sample report on the next page).
Here are listings of the JCL (ISRSUPC.jcl) & converted script (isrsupc1.ksh) provided to demo SUPERC conversion (relevant lines only).
//ISRSUPC1 JOB 'test ISRSUPC (file compare) July 2007' //STEP010 EXEC PGM=ISRSUPC,PARM=(CHNGL,LINECMP,'','') //NEWDD DD DSN=GL.ACCOUNT.TRANS(0),DISP=SHR <-- GDG current generation //OLDDD DD DSN=GL.ACCOUNT.TRANS(-1),DISP=SHR <-- GDG previous generation //OUTDD DD SYSOUT=(A) //SYSIN DD * CMPCOLM 1:80 DPLINE 'HDR1',1 /* // IF STEP010.RC=0 THEN // ...................
exportgen0 0 NEWDD data/gl.account.trans_ #<-- GDG current generation
exportgen0 -1 OLDDD data/gl.account.trans_ #<-- GDG previous generation
exportfile OUTDD $SYOT/${JSTEP}_OUTDD_A
#3----------------------------------------------------------------------
uvcopy uvcmp1,fili1=$OLDDD,fili2=$NEWDD,filo3=$OUTDD,rop=r0,uop=q0s5r80
#NB - ISRSUPC conversion sets condition (via cmp below) for following IF
# - uvcopy uvcmp1 above creates SYSOUT/OUTDD report
# - need to modify record size 'r80' in uop=q0s5r80 above
# - any CMPCOLM & DPLINE ignored as of July 2007
cmp $OLDDD $NEWDD
#4----------------------------------------------------------------------
LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
if ((S0010C == 0)); then # IF STEP010.RC=0 THEN #J001(1)
..................................................
You might not need to modify the converted JCL/script, if the only purpose was to set the condition code for al following 'IF' statement.
If you want the 'uvcmp' report, you will need to correct the record size option from the default 'r80' (at the end of the 'uvcopy uvcmp1' line above),
'CMPCOLM' & 'DPLINE' are not yet supported as of July 2007.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
After converting the test/demo JCLs, you can run the 'isrsupc1.ksh' demo script as follows & you should get the report listed below:
isrsupc1.ksh <-- execute the ISRSUPC test/demo provided ============ - output report (in SYSOUT) shown below:
uvcmp1 - compare 2 files "*" diffs (uops=q1e0p30r256s5t500000v2x0q0s5r80) recsize reccount file-size typ filename sysout/ISRSUPC1/S0010_OUTDD_A 1: 80 20 1,600 RSF data/gl.account.trans_000004 2: 80 20 1,600 RSF data/gl.account.trans_000005 2007/07/30_08:29:54 1 2 3 4 5 6 f#rec#byte# 0123456789012345678901234567890123456789012345678901234567890123 ============================================================================
1 3 0 00011100T Telephone XX 000000559Q 1234BC0008820
3333333352566676666255222222222222222222333333333523333443333333
000111004045C508FE5088000000000000000000000000559101234230008820
**
64 40499 ^
3333322222222220
404990000000000A
**
2 3 00011100T Telephone 000000559Q 1234BC0008820
3333333352566676666222222222222222222222333333333523333443333333
000111004045C508FE5000000000000000000000000000559101234230008820
**
64 40428 ^
3333322222222220
404280000000000A
**
2007/07/30_08:29:54 1 2 3 4 5 6 f#rec#byte# 0123456789012345678901234567890123456789012345678901234567890123 ============================================================================
1 18 0 00074100T Bank Fee XX 0000001099 1234BJ 0
3333333352466624662552222222222222222222333333333323333442222223
000741004021EB065508800000000000000000000000001099012342A0000000
** **
64 40428 ^
3333322222222220
404280000000000A
2 18 00074100T Bank Fee 0000001000 1234BJ 0
3333333352466624662222222222222222222222333333333323333442222223
000741004021EB065500000000000000000000000000001000012342A0000000
** **
64 40428 ^
3333322222222220
404280000000000A
======================= EOF or stop count reached ========================== Total=000020,read=000020,mismatches=000002,stop=000005,term=500000
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are the preparations required for you to run the conversions for the supplied test/demo JCLs, some of which have been listed previously beginning on page '1C1'. The operating Instructions for your own JCL conversions will be presented later in Part_4. We recommend you perform the following before proceeding.
#1. Install the Vancouver Utilities as documented in install.htm.
#2. Download & installed the Korn shell from http://www.kornshell.com
if not supplied with your system or if it is the old 1988 version (vs 1993).
We recommend 'bash' for interactive use, but 'ksh' is better for batch
scripts. The JCLs are converted for the Korn shell (1st line #!/bin/ksh).
#3. Setup 'appsadm' & modify profiles as documented in Part 1 of ADMjobs.htm.
You must have installed the Vancouver Utilities, you must have the Korn shell, and we highly recommend setting up 'appsadm' & modifying the profiles, as instructed in ADMjobs.htm.
If desired you could delay setting up 'appsadm' & performing the actions in ADMjobs.htm, until you complete the test/demos here in Part 1 (of MVSJCL.doc), and are ready to begin your own conversions in Part_4.
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
The following instructions presume the 'bash' profile. If you do not have bash, please see the alternatives for 'ksh' in Part 1 of ADMjobs.htm.
#1. login as 'root'
#2. groupadd apps <-- setup group 'apps', if not already setup
============= (when uvadm was setup in install.htm)
#3. useradd -m -g apps -s /bin/bash mvstest <-- setup 'mvstest' for bash
=======================================
#3a. useradd -m -g apps -s /bin/ksh mvstest <-- alternative for 'ksh'
======================================
#4. passwd mvstest <-- set password for mvstest
==============
#5. cp -p /home/uvadm/env/stub_profile /home/mvstest/.bash_profile
==============================================================
- copy supplied 'stub' profile to mvstest homedir & rename for bash
#5a. cp -p /home/uvadm/env/stub_profile /home/mvstest/.profile
=========================================================
- alternative if you are using 'ksh' (vs bash)
| Note |
|
#6. vi /home/uvadm/common_profile <-- modify common_profile
=============================
export COBDIR=/opt/microfocus/cobol <-- change COBDIR for your site
===================================
export UVLPDEST="-dlp0" <-- change 'lp0' to your laser printer
=======================
export UVLPDEST="-dLPT1" <-- for Windows SFU
=======================
#7. Logout of Root & login as 'mvstest', on the next page --->
You should realize that the above are the minimum setups for mvstest & not the most efficient method if you later proceed to setup your own additional programmers & operators. Setting up 'appsadm' & modifying the profiles as described in Part 1 of ADMjobs.htm is more efficient because you would avoid duplication.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1. login: mvstest --> /home/mvstest
================================
#2. cp -r /home/uvadm/mvstest/* /home/mvstest
=========================================
- copy supplied test/demo files from uvadm to mvstest home dir
/home/mvstest should now contain the subdirs & files listed on page '1A1'.
The more relevant subdirs for the JCL conversions are:
ctl, parm0, parms, proc0, procs, jcl0, jcl1, jcl2,& jcl3.
| Note |
|
If you later want to create these subdirs for your own use (without demo files) you can use the the following scripts. You might set them up in your home dir or you might create another user (mvstest2, etc).
#1. Login as yourself or vsetest2, etc --> homedir
#2. vsetestdirs <-- create conversion superdirs (testlibs, testdata, cnvdata)
===========
#3a. cdl --> alias 'cd $RUNLIBS' --> $HOME/testlibs/
#3b. vselibsdirs <-- create empty set of testlibs (cbl0,cbl1,etc)
===========
#3c. vsetestlibsinit <-- clear testlibs subdirs for retesting
=============== - cbl1,cbl2,cbls, jcl1,jcl2,jcl3,jcls, etc
- not the '0' subdirs or ctl/...
#4a. cdd --> alias 'cd $RUNDATA' --> $HOME/testdata/
#4b. vsedatadirs <-- create empty set of testdata subdirs (ar,gl,jobtmp,etc)
===========
#4c. testdatainit <-- clear testdata subdirs for retesting
============ - jobtmp, joblog, tmp, wrk, rpts, etc
- not the master data in ar, gl, mstr, tape, etc
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
We strongly recommend you 1st work thru these test/demos before trying to convert your own JCL & then to study Part_4 carefully before attempting to convert your own JCL.
BUT see page '1X1', if you need to do a quick preliminary conversion of a few of your JCLs before you invest the time & effort that should be expended when you launch your mainframe conversion project.
Page '1X2' shows you how to use the scripts above & also 'jcl2ksh51A' to perform all steps of JCL conversion.
BUT again, we strongly recommend you first use the step by step method (here in Part 1) to better understand the process.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The previous pages setup userid 'mvstest' & copied the test/demo files to the mvstest homedir, in preparation for the JCL demo conversions documented on the following pages.
If you prefer or if there are multiple programmers at your site who wish to perform these demos, you can setup the 'testlibs' & 'testdata' subdirs in your own homedir & copy the supplied demo files to them.
If you do not already have a login, see ADMjobs.htm#Part_1 to setup your account & copy the supplied 'stub_profile' to your homedir.
The following assumes you already have a login, but it has not yet been updated with the 'stub_profile' required to perform the JCL conversions.
#1. Login as youself --> your homedir
================
#2. vi .bash_profile <-- edit your .bash_profile for Linux bash shell
================ - OR .profile for Unix Korn shell
#2a. G <-- Go to the end of your existing profile
===
#2b. :r /home/uvadm/env/stub_profile
===============================
- read supplied stub_profile onto the end of your existing profile
#3. logout & log back in <-- to activate the new profile
====================
#4. mkdir testlibs testdata <-- make subdirs within your homedir
======================= to receive the supplied demo files
#5. cp -r /home/uvadm/mvstest/testlibs/* testlibs
=============================================
- copy supplied demo libraries to testlibs/... in your homedir
(JCL,COBOL,etc)
#6. cp -r /home/uvadm/mvstest/testdata/* testdata
=============================================
- copy supplied demo data-files to testdata/... in your homedir
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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.
'jcl2ksh51A' will perform all steps of the JCL conversion - the same as the 'step by step' procedures documented on pages 1Q2 thru 1Q5. The script is easier than the step by step method, but you might not gain as much understanding.
You should use the 'step by step' method the 1st time you convert your own JCL (as documented in Part_4), because you will be able to detect & fix problems that may occur in your JCL conversions (vs the proven test/demos here in Part 1).
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
cleanup PROC/SLI expand convert to ksh manual copy
proc0 -------> procs parm0 -------> parms
cleanup cleanup
#1. jcl2ksh51A all <-- convert JCL thru all steps, as illustrated above
============= - reply null (take default) at all prompts
- or reply 'y' for prompts that demand a y/n response
#2. cp jcl3/* jcls <-- copy JCL/scripts to jcls (in PATH)
============== - ONLY for the test/demos here in Part 1
- since they have already been tested & debugged
| Note |
|
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The next few pages document the 'step by step' procedures for JCL conversion (vs the jcl2ksh51A 'script' documented on the previous page).
It is much easier to use the jcl2ksh51A script than the step by step procedures, but you might not get as much understanding from it.
You should use the 'step by step' method the 1st time you convert your own JCL (as documented in Part_4), because you will be able to detect & fix problems that may occur in your JCL conversions (vs the proven test/demos here in Part 1).
The 1st 3 procedures will cleanup the demo mainframe code, clearing cols 73-80, translating filenames to lower case,& assigning filename extensions (.jcl or .proc or nothing).
#1a. uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl <-- cleanup mainframe JCL
================================================
- strip any CR's, clear cols 73-80,& shorten back to last nonblank
- ensure output filenames are translated to lower case
- assign filename extension '.jcl'
#1b. uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.proc <-- cleanup PROCs
===================================================
- strip any CR's, clear cols 73-80,& shorten back to last nonblank
- ensure output filenames are translated to lower case
- assign filename extension '.proc'
#1c. uvcopyx cleanup parm0 parms uop=q0i7g8n5 <-- control cards & includes
========================================
- strip any CR's, clear cols 73-80,& shorten back to last nonblank
- ensure output filenames are translated to lower case
- includes combined with parms (include0/include1 subdirs dropped May2006)
| Note |
|
#2. jclpx51 jcl1 jcl2 procs parms
=============================
- copy all jcl from jcl1 to jcl2, expanding PROCs & including INCLUDEs
- 'jclpx1' is a script that calls the 'jclproc51' utility for each file
found in the directory
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#3. jcldata5A all <-- generate datafile info control file for JCL converter
=============
- extracts datafilenames from all JCL, sorts, & drops duplicates
- collects file info (record sizes, file types, key locations/lengths, etc)
- encoding on keywords (rca=... typ=... key=...) on right side of filename
- combines with other file info (LISTCAT, Excel spreadsheets, etc)
- loads Indexed file 'datactl53I' for look up by JCL converter
'jcldata5A' reads all JCL & gathers datafile info for use by the JCL converter. Record sizes, indexed keys, etc are collected onto 1 entry per unique datafilename. See sample ctl/datactl53 listed on page '3F5'.
The Datafile Info control file is vital to conversions of your JCL, but we can delay these considerations until Part_4 where we discuss conversions of 'YOUR' JCL versus the test/demo JCL conversions illustrated here in Part 1.
For the JCL converter test/demos here in Part 1, you can just run 'jcldata5A' to create 'datactl53I' used by the JCL converter. In Part 4, we will explain how you would create datactl53I for your own JCL conversions from up to six sources.
Note that we have supplied some sample data in most of these files that you can see in /home/uvadm/mvstest/ctl/... or /home/mvstest/testlibs/ctl (if you followed test/demo setup instructions begining on page '1P1'.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Before you run the actual JCL/script conversion (step #5 on the next page), you may need to modify the options in the control file ctl/jclunixop51. See the sample JCL options control file listed on page '3E1'.
You will not have to modify for these test/demos (here in Part 1), but you may need to modify options for your own JCL conversions (documented in Part 4).
If you are using Windows SFU, Cygwin, or Uwin, you must change option 'r' in the control file (ctl/jclunixop5), before you run the JCL converter. See the control file listed on page '3E1' further ahead.
You must change option 'r0' to 'r1' on line 1 of ctl/jclunixop5. The control file is supplied with option 'r0' to generate 'cobrun' for MicroFocus COBOL Server Express on Unix/Linux systems. 'r1' will cause the converter to generate 'cobw' which is the equivalent for MicroFocus COBOL Net Express on Windows.
#4. vi ctl/jclunixop51 <-- edit change only for Windows SFU/Cygwin/Uwin
==================
jclunixop5:d0g10j1n0p0r0u1x0y0 #<-- option defaults for JCL converter ======================r1====== <-- change r0 to r1
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#5. jclxx51 jcl2 jcl3 <-- convert all JCL in jcl2 to scripts in jcl3
=================
'jclxx51' is a script that executes the 'jclunix51' conversion program for each file found in input subdir & copy results to output subdir.
jclxx51 requires control files: ctl/jclunixop5, ctl/datactl53I, parms/... The control files may need changes. See discussion on the next page.
| Note |
|
#6. vi jcl3/* <-- investigate your results
=========
Your results should match those listed previously. For example the original JCL for the first demo job (jar100.jcl) is listed on page '1C1', and the expected results (jar100.ksh) are listed on page '1C2'.
Before you can execute the sample jobs, you must convert & compile the COBOL programs as shown begining on page '1R1'. Then see the script executions starting on page '1S1'.
#7. cp jcl3/* jcls - copy all converted JCL/scripts to subdir jcls
============== (since jcls is in the PATH, but not jcl3)
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is the console display you should get when you run the jclxx51 script.
jclxx51 jcl2 jcl3 <-- convert all JCL in jcl2 to Korn shell scripts in jcl3 =================
script to convert mainframe JCLs to UNIX scripts jclunix51 jcl2/jar100.jcl jclunix51 jcl3/jar100.ksh 8 in, 55 out, 0 errs jclunix51 jcl2/jar200.jcl jclunix51 jcl3/jar200.ksh 16 in, 79 out, 0 errs jclunix51 jcl2/jgl100.jcl jclunix51 jcl3/jgl100.ksh 12 in, 64 out, 0 errs jclunix51 jcl2/jgl200.jcl jclunix51 jcl3/jgl200.ksh 20 in, 87 out, 0 errs jclunix51 jcl2/jgl300.jcl jclunix51 jcl3/jgl300.ksh 14 in, 79 out, 0 errs jclunix51 jcl2/jgl320.jcl jclunix51 jcl3/jgl320.ksh 17 in, 83 out, 0 errs jclunix51 jcl2/jpy200.jcl ERR: SYSIN parms/member not found: parms/ppy200s1 ERR@ in#13 out#43 file: jpy200.jcl jclunix51 jcl3/jpy200.ksh 20 in, 88 out, 1 errs jclunix51 jcl2/splitsl1.jcl jclunix51 jcl3/splitsl1.ksh 21 in, 68 out, 0 errs 9 IBM MVS JCLs converted from jcl2 to UNIX KORN shell scripts in jcl3
ERR: SYSIN parms/member not found: parms/ppy200s1 ERR@ in#13 out#43 file: jpy200.jcl
This is a common error (missing control card library members for SORT FIELDS, etc). In this case we intentionally caused the error by mismatching the name of the control card member in the parms subdir vs the name coded in the JCL.
ls -l parms <-- display control card members ============
-rw-rw-r-- 1 poha users 46 May 11 16:40 pap100s1 -rw-rw-r-- 1 poha users 34 May 11 16:40 pgl200s1 -rw-rw-r-- 1 mvstest users 34 May 13 12:49 ppy200s2
vi jcl2/jpy200.jcl <-- inspect JCL for SYSIN control card member name ==================
//JPY200 JOB - - - many lines omitted - - - //SYSIN DD DSN=PY.CTLCDLIB(PPY200S1)
Note the mismatched names; the JCL calls 'PPY200S1', but the closest member in the library is 'ppy200s2'. If you wish, change the member name to 'ppy200s1' & rerun the 'jclxx51' script. The error should go away.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The previous page illustrated the console display created by 'jclxx51'. The JCL converter also creates an error log file in the 'tmp' subdir containing just the error messages & omitting all successful conversions.
vi tmp/jclunix51.err <-- inspect JCL conversion Error Log ====================
ERR: SYSIN parms/member not found: parms/ppy200s1 ERR@ in#13 out#43 file: jpy200.jcl Errs=1, In=20, Out=88, File=jcl3/jpy200.ksh
uvlp12 tmp/jclunix51.err <-- print the JCL conversion Error Log ========================
We recommend you print the JCL conversion Error Log to serve as your guide in correcting the JCL conversion problems. Please see later discussions of how best to correct/test/debug your JCL in Part 4 (pages '4M1' to '4M4').
In the early stages of conversion, you should not make any manual corrections, but rather find & correct any common problems that will be eliminated by reconverting. Missing control card library members is such a problem.
Part 4 also shows you how to setup search/replace table entries in the JCL conversion control file (ctl/jclunixop5) to improve re conversions.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Normally you would use the script method on the previous pages to convert all JCL's in the directory. Converting 1 job at a time might be used to re-convert new jobs brought over from the mainframe. As an example, here are the conversion instructions for demo job 'jgl200'.
#0. login: mvstest --> /home/mvstest
relevant subdirs --> proc0, procs, jcl0, jcl1, jcl2, jcl3, jcls.
#1a. uvcopy cleanup,fili1=jcl0/JGL200.jcl,filo1=jcl1/jgl200.jcl,uop=g8n1
===================================================================
- cleanup mainframe JCL
- strip CR's, clear cols 73-80,& shorten back to last nonblank
- output filenames are lower case & have extension '.jcl' added.
#1b. uvcopy cleanup,fili1=proc0/PGL200,filo1=procs/pgl200.proc,uop=g8n1
==================================================================
- cleanup PROCs
- strip CR's, clear cols 73-80,& shorten back to last nonblank
#1c. uvcopy cleanup,fili1=parm0/PGL200S1,filo1=parms/pgl200s1,uop=g8n1
=================================================================
- cleanup Control Card library modules (SORT FIELDS, etc)
- strip CR's, clear cols 73-80,& shorten to last nonblank
| Note |
|
#2. jclproc51 jcl1/jgl200.jcl jcl2/jgl200.jcl procs parms
=====================================================
- expand PROCs & INCLUDEs as we copy jcl from subdir jcl1 to subdir jcl2
#3. Note that you must run the 'convert all files in directory' procedures
first, before you can convert 1 JCL at a time, because the converter
needs the data info control file (to get recsizes, keys, ID GDG files, etc)
See the procedures to generate 'ctl/datactl53I' on page '1Q3'.
Those procedures process the entire directory (not just 1 jcl).
#4. jclunix51 jcl2/jgl200.jcl jcl3/jgl200.ksh <-- convert 1 JCL (jgl200)
=========================================
- using jgl200 as an example of converting 1 jcl at a time:
#5. cp jcl3/jgl200.ksh jcls <-- copy converted script to test/production lib
======================= before any changes, testing, debugging
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
JCL conversion scripts are listed in Part_9:
| 9A1. | jcl2ksh51 - convert 1 MVS JCL thru all stages |
| - cleanup, PROC/INCLUDE expansion, JCL conversion, copy to jcls | |
| - jcl0 ---> jcl1 ---> jcl2 ---> jcl3 ---> jcls |
| 9A2. | jcl2ksh51A - convert all JCL from jcl0 thru jcl3 |
Note that it is much more efficient to convert all JCL's in the directory as documented previously on pages '1Q1' thru '1Q6', or with the 'jcl2ksh51A' script. Script 'jcl2ksh51' would be most useful for JCL's subsequently transferred due to changes on the mainframe.
This assumes that all PROCs & control card library members are already present in procs & parms.
jcl2ksh51A includes the following scripts which might be used separately in some circumstances. If you modify the JCL options control file, you would only need to rerun 'jclxx51' to reconvert jcl2/* to jcl3 (vs jcl2ksh51A).
| 9A3. | jcldata5A - create ctl/datactl53I control file to supply recsizes, |
| key loc/lth, ID GDGs, etc |
| 9A4. | jclpx51 - expand PROCs & INCLUDEs while copying JCL from jcl1 to jcl2 |
| 9A5. | jclxx51 - convert all JCLs from jcl2 --> jcl3 |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We have just converted our demo JCL to Korn shell scripts, and we would now like to execute the scripts and show you the results (console displays).
But, we must also have converted & compiled the demo COBOL programs called by the JCL. COBOL conversion & compile is documented in MVSCOBOL.htm, but in case you have skipped directly to this JCL conversion (MVSJCL.doc), we will briefly repeat the COBOL conversion & compile instructions here. You must of course have MicroFocus COBOL installed to compile & execute the COBOL programs, but if you do not, you can still do everything except the 'mfcblA' compiles (#5 on page '1R3'). You can even execute the 'jar200.ksh' demo job. The 1st step will work since it is a SORT.
'cnvMF51Ac' will perform all steps of the copybook conversion & 'cnvMF51A' will perform all steps of the COBOL program conversion - the same as the 'step by step' procedures documented on pages 1R2 thru 1R5. The script is easier than the step by step method, but you might not gain as much understanding.
You should use the 'step by step' method the 1st time you convert your own COBOL (as documented in Part_4), because you will be able to detect & fix problems that may occur in your COBOL conversions (vs the proven test/demos here in Part 1).
cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys
cleanup convert copy(cp)
cbl0-------->cbl1-------->cbl2------->cbl3------->cbl4------->cbls-------->cblx
cleanup convert sysin1 sysout1 copy compile
|--------optional-------|
#1. cnvMF51Ac all <-- convert copybooks thru all steps, as illustrated above
============ - reply null (take defaults) or reply 'y' if y/n demanded
#2. cnvMF51A all <-- convert COBOL programs thru all steps, as illustrated above
=========== - reply null (take defaults) or reply 'y' if y/n demanded
- 1 exception, reply 'n' when asked to run 'cobfil55'
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
First we will convert the CopyBooks, then the COBOL Programs (on the next page). Our test/demo mainframe copybooks are stored in subdir 'cpy0'. We recommend the following procedure:
cpy0--------->cpy1---------->cpy2------->cpys
cleanup convert copy
#1. Cleanup copybooks from mainframe (may have extraneous CR's from FTP)
- remove CR's, clear cols 1-6 & 73-80, translate to lower (not in quotes)
- shorten text back to last non-blank, ensure output filenames in lowercase
- cpy0 filenames UPPER case indicates mainframe,
but all subsequent subdirs must have filenames in lowercase
#1. uvcopyx cleanup cpy0 cpy1 uop=q0i7c5e15g8j1k1l1n1s8t1,arg1=.cpy
===============================================================
| Note |
|
#2. uvcopy cnvMF5,fild1=cpy1,fild2=cpy2,fili3=ctl/cnvcob5.tbl,uop=q0i7m2
====================================================================
- convert COBOL CopyBooks for Unix/Linux MicroFocus compiler
#3. cp cpy2/* cpys - copy converted copybooks to standard library
==============
| Note |
|
cp cpy1/* cpys <-- alternative to steps #2a, #2b,& #3
==============
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
These instructions will convert & compile ALL programs in the directory. Three demo programs (CAP100, CAR100,& CGL100) are supplied in subdir cbl0. The conversions & compile progress thru several subdirs as follows:
cbl0-------->cbl1-------->cbl2------->cbl3------->cbl4------->cbls-------->cblx
cleanup convert sysin1 sysout1 copy compile
|--------optional-------|
#1. Cleanup copybooks from mainframe (may have extraneous CR's from FTP)
- remove CR's, clear cols 1-6 & 73-80, translate to lower (not in quotes)
- shorten text back to last non-blank, ensure output filenames in lowercase
- cpy0 filenames UPPER case indicates mainframe,
but all subsequent subdirs must have filenames in lowercase
#1. uvcopyx cleanup cbl0 cbl1 uop=q0i7c5e15g8j1k1l1n1s8t1,arg1=.cbl
===============================================================
#2. uvcopy cnvMF5,fild1=cbl1,fild2=cbl2,fili3=ctl/cnvcob5.tbl,uop=q0i7m1
====================================================================
- convert COBOL programs for Unix/Linux Micro Focus compiler
- for demo programs, only important change is to add 'external'
onto the file assignments.
#3. uvcopyx sysin1 cbl2 cbl3 uop=q0i7 <-- optional, see NOTE below
=================================
- convert ACCEPT's from control streams to READ's from a file
#4. uvcopyx sysout1 cbl3 cbl4 uop=q0i7 <-- optional, see NOTE below
==================================
- convert DISPLAY's upon SYSOUT to WRITE's to a file
You will NOT need to do #3 & #4 above if you have MicroFocus COBOL which has options INDD & OUTDD to cause 'ACCEPTs from SYSIN' & 'DISPLAYs upon SYSOUT' to use external files defined by exports for SYSIN & SYSOUT. Please see the options file ctl/cobdirectives & a test/demo program & JCL in MVSCOBOL.htm begining on page 2G1.
For customers that do not have MicroFocus COBOL, the Vancouver Utilities includes uvcopy utility jobs 'sysin1' & 'sysout1' which will insert file definitions into the COBOL source programs.
sysin1 will convert 'accepts from sysin' to 'reads' from a real file with external name SYSIN. sysout1 will convert 'displays upon sysout' to 'writes' to a real file with external name SYSOUT.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#5. cp cbl2/* cbls - copy converted programs to standard source library
============== expected by the compile script (mfcblA)
#5a. cp cbl3/* cbls - copy from cbl3/* for optional conversion
============== accept/SYSIN to read from file
#5b. cp cbl4/* cbls - copy from cbl4/* for optional conversion
============== display on SYSOUT to write to a file
#6. mfcblA all - compile all programs for unix/linux
========== (input source from cbls & output .int/.idy to cblx)
mfcblA started 050320:1514
#compile #1 - car100.cbl start compile of: car120.cbl
#compile #2 - car120.cbl start compile of: car130.cbl
- - - etc, 8 clean compiles & 1 Intentional Failure - - -
#compile #9 - cpy100.cbl
* copy "paymas.cpy".
* 8-S***************************** ( 0)**
** Unknown COPY file paymas.cpy specified
* 256-S*********** ( 1)**
** Preceding record has zero length
18 fd nalist record contains 120 characters.
* 205-S** ( 1)**
** RECORD missing or has zero size
#compile #9 - cpy100.cbl - *FAILED*
*** 1 compiles failed, of 9 attempts of 9 total ***
programs compiled from cbls to cblx
compile options file=/home/mvstest/ctl/cobdirectives
mfcblA started 050320:1514, ended 050320:1514
#7. uvlpd1p cblx .err <-- print 1st page of compile failure reports
=================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
You must of course have MicroFocus COBOL installed to compile & execute the COBOL programs, but if you do not, you can still do everything except the 'mfcblA' compiles above. You can even execute the 'jar200.ksh' demo job. The 1st step will work since it is a SORT, before bombing out on step 2.
For the 'mfcblA' COBOL compiles to work, you will probably have to modify the COBDIR definition in the common_profile, depending on where COBOL is installed at your site. The supplied profile (listed at ADMjobs.htm#1C2) defines COBDIR as follows:
export COBDIR=/opt/microfocus/cobol <-- COBDIR install default ===================================
#6a. mfnxcblA all - compile all programs to .int/.idy for SFU/UWIN/CYGWIN
============= (input source from cbls & output .int/.idy to cblx)
#6b. mfnxcblB all - compile all programs to executables for SFU/UWIN/CYGWIN
============= (input source from cbls & output .exe's to cblx)
COBOL compile scripts are different since the MicroFocus COBOL compiler is different (Server Express for Unix/Linux vs Net Express for Windows). The script to compile 1 program at a time is 'mfcbl1' for unix/linux, and 'mfnxcbl1' for SFU/UWIN/CYGWIN (or 'mfnxcbl2' to compile to executables). See listings at MVSCOBOL.htm#5E0.
mfnxcblA started 040609:1549 MicroFocus Net Express V4 Version 4.0.38 Copyright (C) 1984-2003 MicroFocus International Ltd. * Checking complete with no errors - starting code generation * Generating car100 * Data: 2000 Code: 1424 Literals: 484 #compile #1 - car100.cbl
- - - etc, 8 clean compiles & 1 Intentional Failure - - -
9 programs compiled from cbls to cblx 1 compiles failed, of 9 attempts mfnxcblA started 040609:1549, ended 040609:1549
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Now we are ready to execute the demo JCL/scripts. Note that RUNLIBS & RUNDATA (vital environmental variables in the profile) control which libraries are searched & which data directories will be accessed. The following illustrates only the subdirs that are actually required for the demo JCL/script execution and omits the various conversion subdirs illustrated previously.
export RUNLIBS=/home/mvstest/testlibs
/home/mvstest :-----testlibs <-- $RUNLIBS : :-----cblx - compiled COBOL programs (.int's) : :-----jcls - copy here manually 1 by 1 during test/debug
export RUNDATA=/home/mvstest/testdata
/home/mvstest :-----testdata <-- $RUNDATA : :-----ap - Accounts Payable : :-----ar - Accounts Receivable : :-----gl - General Ledger : :-----ctl - GDG control file : :-----jobctl - for jobstop stop at begin each step for debug : :-----jobtmp - temp files for SYSIN instream data : :-----jobmsgs - job progress msgs (step begin, end Normal/AbTerm) : :-----sysout - SYSOUT printer files : :-----tmp - tmp subdir for uvsort : :-----wrk - interstep temporary work files
The pages ahead will present the commands to execute the following JCL/scripts:
| jar100.ksh |
|
| jar200.ksh |
|
| jgl100.ksh |
|
| jgl200.ksh |
|
| jgl300.ksh |
|
| jgl320.ksh |
|
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
Before you begin to test/debug, I strongly recommend that you study XREFjobs.htm & run the test/demo Inventory Listings, Cross-References, COBOL File Info reports,& JCL Job-Flow reports.
This would be vital if you were about to start testing & debugging your own JCL & COBOL programs. For these demos it would not matter whether you studied & ran them BEFORE or AFTER you execute the supplied JCL & COBOL programs. But, please be sure to run these reports for your own JCL & COBOL programs BEFORE you begin your own testing & debugging.
Here is a summary of the types of reports documented in XREFjobs.htm.
#1. Inventory lists & counts of all filenames in all directories of relevance.
==========================================================================
#2. Contents listings of JCLs, scripts, control-cards,& copybook maps.
==================================================================
#3. Cross-References of COBOL programs & JCL/scripts.
=================================================
- copybooks vs programs, datafiles vs Jobnames, Programs vs Jobnames
#4. COBOL File Information reports (1 line per datafile)
====================================================
- externalname, Org & Access, Open mode, record-size, copybook, internalname
#5. JobFlow reports - combine file info from the JCL with the COBOL info above
==========================================================================
- step#, programname, DDname, COBOL info(above), DSNname
These will be explained in more detail in XREFjobs.htm with Operating Instructions to generate them using the test/demo files supplied. You will also need to have an organized way of housing them for easy access when required.
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
jar100.ksh <-- execute test/demo JCL/script 'jar100' ========== 080827:155517:JAR100: Begin Job=JAR100 080827:155517:JAR100: /home/mvstest/testlibs/jcls/jar100.ksh 080827:155517:JAR100: Arguments: 080827:155517:JAR100: RUNLIBS=/home/mvstest/testlibs 080827:155517:JAR100: RUNDATA=/home/mvstest/testdata 080827:155517:JAR100: JTMP=jobtmp/JAR100 SYOT=sysout/JAR100 080827:155517:JAR100: RUNDATE=20080827 080827:155517:JAR100: Begin Step S0010 car100 (#1) 080827:155517:JAR100: file: CUSTMAS=data/ar.customer.master bytes=8192 080827:155517:JAR100: file: NALIST=data/ar.customer.nameadrs.list100 bytes=2858 080827:155517:JAR100: file: SYSOUT=sysout/JAR100/S0010_SYSOUT bytes=0 080827:155517:JAR100: Job Times: Begun=15:55:17 End=15:55:17 Elapsed=00:00:00 080827:155517:JAR100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
jar200.ksh <-- execute JCL/script 'jar200' ========== 080827:155553:JAR200: Begin Job=JAR200 080827:155553:JAR200: /home/mvstest/testlibs/jcls/jar200.ksh 080827:155553:JAR200: Arguments: 080827:155553:JAR200: RUNLIBS=/home/mvstest/testlibs 080827:155553:JAR200: RUNDATA=/home/mvstest/testdata 080827:155553:JAR200: JTMP=jobtmp/JAR200 SYOT=sysout/JAR200 080827:155553:JAR200: RUNDATE=20080827 080827:155553:JAR200: Begin Step S0010 sort (#1) 080827:155553:JAR200: file: SORTIN=data/ar.sales.items bytes=1280 080827:155553:JAR200: file: SORTOUT=jobtmp/JAR200/__tempsls bytes=0 080827:155553:JAR200: file: SYSIN=jobtmp/JAR200/S0010_sort_SYSIN bytes=92 080827:155553:JAR200: uvsort fili1=data/ar.sales.items,filo1=jobtmp/JAR200/__tempsls 080827:155553:JAR200: EOF fili01 20 rds, 1280 size; data/ar.sales.items 080827:155553:JAR200: sort phase complete, used 64 megabytes, sort output begin 080827:155553:JAR200: EOF filo01 16 wrts, 1024 size; jobtmp/JAR200/__tempsls 080827:155553:JAR200: Begin Step S0020 car200 (#2) 080827:155553:JAR200: file: SALEDTL=jobtmp/JAR200/__tempsls bytes=1024 080827:155553:JAR200: file: CUSTMAS=data/ar.customer.master.indexed bytes=0 080827:155553:JAR200: file: SALELST=data/ar.sales.list bytes=1521 080827:155553:JAR200: Job Times: Begun=15:55:53 End=15:55:53 Elapsed=00:00:00 080827:155553:JAR200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
jgl100.ksh <-- execute JCL/script 'jgl100' ========== 080827:155743:JGL100: Begin Job=JGL100 080827:155743:JGL100: /home/mvstest/testlibs/jcls/jgl100.ksh 080827:155743:JGL100: Arguments: 080827:155743:JGL100: RUNLIBS=/home/mvstest/testlibs 080827:155743:JGL100: RUNDATA=/home/mvstest/testdata 080827:155743:JGL100: JTMP=jobtmp/JGL100 SYOT=sysout/JGL100 080827:155743:JGL100: RUNDATE=20080827 080827:155743:JGL100: Begin Step S0010 cgl100 (#1) 080827:155743:JGL100: gen0: ACCTMAS=data/gl.account.master_000003 insize=8720 080827:155743:JGL100: gen+1: ACTLIST=jobtmp/JGL100/GDG/data/gl.account.acntlist_000004 gens=8 080827:155743:JGL100: file: SYSOUT=sysout/JGL100/S0010_SYSOUT bytes=0 080827:155743:JGL100: Job Times: Begun=15:57:43 End=15:57:43 Elapsed=00:00:00 080827:155743:JGL100: moving jobtmp/JGL100/GDG/subdir/files back to $RUNDATA/subdirs/ `jobtmp/JGL100/GDG/data/gl.account.acntlist_000004' -> `data/gl.account.acntlist_000004' 080827:155743:JGL100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
jgl200.ksh <-- execute JCL/script 'jgl200' ========== 080827:155906:JGL200: Begin Job=JGL200 080827:155906:JGL200: /home/mvstest/testlibs/jcls/jgl200.ksh 080827:155906:JGL200: Arguments: 080827:155906:JGL200: RUNLIBS=/home/mvstest/testlibs 080827:155906:JGL200: RUNDATA=/home/mvstest/testdata 080827:155906:JGL200: JTMP=jobtmp/JGL200 SYOT=sysout/JGL200 080827:155906:JGL200: RUNDATE=20080827 080827:155906:JGL200: Begin Step S0010 sort (#1) 080827:155906:JGL200: file: SORTIN=data/gl.account.tran1 bytes=1600 080827:155906:JGL200: gen+1: SORTOUT=jobtmp/JGL200/GDG/data/gl.account.trans_000006 gens=18 080827:155906:JGL200: file: SYSIN=data/gl.parms/pgl200s1 bytes=0 080827:155906:JGL200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 bytes=34 080827:155906:JGL200: uvsort fili1=data/gl.account.tran1,filo1=jobtmp/JGL200/GDG/data/gl.account.trans_000006 080827:155906:JGL200: EOF fili01 20 rds, 1600 size; data/gl.account.tran1 080827:155906:JGL200: sort phase complete, used 64 megabytes, sort output begin 080827:155906:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/JGL200/GDG/data/gl.account.trans_000006 080827:155906:JGL200: Begin Step S0020 cgl200 (#2) 080827:155906:JGL200: gen+1: GLTRANS=jobtmp/JGL200/GDG/data/gl.account.trans_000006 gens=18 080827:155906:JGL200: gen0: GLMSOLD=data/gl.account.master_000003 insize=8720 080827:155906:JGL200: gen+1: GLMSNEW=jobtmp/JGL200/GDG/data/gl.account.master_000004 gens=10 080827:155906:JGL200: Job Times: Begun=15:59:06 End=15:59:06 Elapsed=00:00:00 080827:155906:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/ `jobtmp/JGL200/GDG/data/gl.account.master_000004' -> `data/gl.account.master_000004' `jobtmp/JGL200/GDG/data/gl.account.trans_000006' -> `data/gl.account.trans_000006' 080827:155906:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
jgl320.ksh <-- execute JCL/script 'jgl320' ========== 080827:155938:JGL320: Begin Job=JGL320 080827:155938:JGL320: /home/mvstest/testlibs/jcls/jgl320.ksh 080827:155938:JGL320: Arguments: 080827:155938:JGL320: RUNLIBS=/home/mvstest/testlibs 080827:155938:JGL320: RUNDATA=/home/mvstest/testdata 080827:155938:JGL320: JTMP=jobtmp/JGL320 SYOT=sysout/JGL320 080827:155938:JGL320: RUNDATE=20080827 080827:155938:JGL320: Begin Step S0010 iebgener (#1) 080827:155938:JGL320: gen0: SYSUT1=data/gl.account.master_000005 insize=8720 080827:155938:JGL320: file: SYSUT2=jobtmp/JGL320/__tempglm bytes=0 080827:155938:JGL320: uvcp fili1=data/gl.account.master_000005,filo1=jobtmp/JGL320/__tempglm 080827:155938:JGL320: EOF fili01 109 rds, 8720 size; data/gl.account.master_000005 080827:155938:JGL320: EOF filo01 109 wrts, 8720 size; jobtmp/JGL320/__tempglm 080827:155938:JGL320: Begin Step S0020 idcams (#2) 080827:155938:JGL320: file: TEMPGLM=jobtmp/JGL320/__tempglm bytes=8720 080827:155938:JGL320: gen+1: ACNTMAS=jobtmp/JGL320/GDG/data/gl.account.master_000006 gens=10 080827:155938:JGL320: file: SYSIN=jobtmp/JGL320/S0020_idcams_SYSIN bytes=84 080827:155938:JGL320: uvcp fili1=jobtmp/JGL320/__tempglm,filo1=jobtmp/JGL320/GDG/data/gl.account.master_000006 080827:155938:JGL320: EOF fili01 109 rds, 8720 size; jobtmp/JGL320/__tempglm 080827:155938:JGL320: EOF filo01 109 wrts, 0 size; jobtmp/JGL320/GDG/data/gl.account.master_000006 080827:155938:JGL320: DISAMdat: recs=109,rcsz=80,keys=1; jobtmp/JGL320/GDG/data/gl.account.master_000006 080827:155938:JGL320: Job Times: Begun=15:59:38 End=15:59:38 Elapsed=00:00:00 080827:155938:JGL320: moving jobtmp/JGL320/GDG/subdir/files back to $RUNDATA/subdirs/ `jobtmp/JGL320/GDG/data/gl.account.master_000006.dat' -> `data/gl.account.master_000006.dat' `jobtmp/JGL320/GDG/data/gl.account.master_000006.idx' -> `data/gl.account.master_000006.idx' 080827:155938:JGL320: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
jgl300 & jgl320 are intended to demonstrate CONDition (Return Code) testing. You could create a failure in step#1 & observe that step#2 would be inhibited. An easy way to cause step#1 to fail is to change the input data filename or to change the filename definition in the script.
jgl300 & jgl320 are almost the same (see listings on pages '1G2' & '1G4'). The difference is that jgl320 illustrates IF/THEN/ENDIF in addition to the CONDition codes (see notes with previous listings).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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).
/home/mvstest :-----testlibs <-- super directory for test libs subdirs : :-----cblx <-- executable (compiled) COBOL programs : :-----jcls <-- JCLs converted to Korn shell scripts :-----testdata <-- super directory for test/data subdirs & files : :-----ar : : :--I--customer.master : : :--O--customer.namelist <-- report created by jar100.ksh : : :--I--sales.items : :-----gl : : :--O--account.acntlist <-- report created by jgl100.ksh : : :--I--account.master_000001 : : :--I--account.master_000002 : : :--I--account.master_000003 : : :--O--account.master_000004 <-- updated master from jgl200.ksh : : :--O--account.master_000005 <-- new generation from jcl300.ksh : : :--O--account.master_000006 <-- 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 : :-----sysout : : :-----040429 <-- subdir for today's SYSOUT files : : : :-----SYSOUT.files... <-- no SYSOUTs created in these tests : :-----tmp <-- temp files for uvsort & misc use : :-----wrk : : :--O--JAR200_tempsls <-- sorted sales.items from jar200.ksh : : :--O--JGL200_tempglt <-- sorted GLtransctns from jgl200.ksh : : :--O--JGL300_tempglm <-- copy out backup from jgl300.ksh : : :--O--JGL320_tempglm <-- copy out backup from jgl320.ksh
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#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 data/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 data/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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#3. vi data/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
'jar200' sorts data/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 data/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=data/ar.sales.items,uop=r64 <-- list file no LineFeeds
=================================================
,filo1=tmp/sales.items.lst <-- output report default name
listrec2 - list (100 bytes/line) file=data/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
#3. jar200.ksh <-- run job to sort, update,& execute COBOL car200.cbl
==========
#4. vi data/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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
data/gl.account.master_ is a GDG file with packed fields, so must use 'uvhd':
#1. uvhd data/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
#2. jgl100.ksh <-- run job to execute COBOL cgl100.cbl
==========
#3. vi data/gl.account.acntlist_000000 <-- inspect report created by cgl100.cbl
==================================
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
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.
exec script $LOGDIR/log1/$LOGNAME/$(date +%y%m%d:%H%M%S)
========================================================
/home/appsadm
:-----log1 <-- log1 superdir for logs in progress
: :-----user1 <-- subdir for each userid to be logged
: :-----user2
: :-----mvstest
:------030925:080115 <-- sample logfile in progress
:
:-----log2 <-- log2 superdir for current month
: :-----user1
: :-----user2
: :-----mvstest
:------030921:102652 <-- logfiles for current month
:------030922:130116 - date/time stamped YYMMDD:HHMMSS
:------030923:074559 - processed from log1 on logoff/logon
:------030924:074559 (screen control codes removed)
:
:-----log3 <-- prior month logfiles
: :-----user1 - copied from log2 at end month (by cron)
: :-----user2 (then log2 subdirs cleared out)
: :-----mvstest
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
5a. jar100.ksh
==========
5b. jgl100.ksh
==========
5c. jgl200.ksh
==========
7a. logview <-- display list of date/time stamped logfiles in current month
=======
-rw-rw-r-- 1 mvs users 495823 Sep 21 13:01 030921:102652 -rw-rw-r-- 1 mvs users 69075 Sep 22 07:11 030922:130116 -rw-rw-r-- 1 mvs users 253990 Sep 23 09:02 030923:074559 -rw-rw-r-- 1 mvs users 178428 Sep 24 10:26 030924:221341 enter 1,2,3,etc to vi logfile (counting backwards) q to quit - may follow file# with -dprinterdest to print
--> 1 <-- to see the latest logfile (uses vi editor)
--> 1 -dprinter1 <-- to print the latest logfile
Logview prompts for the file# desired (1 is the latest & usually what you want to see). You may follow the file# with a printer destination. Or you could login as appsadm & print the file from the 'log2/mvstest' subdir.
Please see the next page for the console log result of running the 2 demo jobs.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Script started on Mon 17 Jul 2006 07:47:16 PM PDT
<@:mvstest:/home/mvstest> jar100.ksh 080827:155517:JAR100: Begin Job=JAR100 080827:155517:JAR100: /home/mvstest/testlibs/jcls/jar100.ksh 080827:155517:JAR100: Arguments: 080827:155517:JAR100: RUNLIBS=/home/mvstest/testlibs 080827:155517:JAR100: RUNDATA=/home/mvstest/testdata 080827:155517:JAR100: JTMP=jobtmp/JAR100 SYOT=sysout/JAR100 080827:155517:JAR100: RUNDATE=20080827 080827:155517:JAR100: Begin Step S0010 car100 (#1) 080827:155517:JAR100: file: CUSTMAS=data/ar.customer.master bytes=8192 080827:155517:JAR100: file: NALIST=data/ar.customer.nameadrs.list100 bytes=2858 080827:155517:JAR100: file: SYSOUT=sysout/JAR100/S0010_SYSOUT bytes=0 080827:155517:JAR100: Job Times: Begun=15:55:17 End=15:55:17 Elapsed=00:00:00 080827:155517:JAR100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
..... other logs omitted (only 1st & last shown) .....
<@:mvstest:/home/mvstest> jgl320.ksh 080827:155938:JGL320: Begin Job=JGL320 080827:155938:JGL320: /home/mvstest/testlibs/jcls/jgl320.ksh 080827:155938:JGL320: Arguments: 080827:155938:JGL320: RUNLIBS=/home/mvstest/testlibs 080827:155938:JGL320: RUNDATA=/home/mvstest/testdata 080827:155938:JGL320: JTMP=jobtmp/JGL320 SYOT=sysout/JGL320 080827:155938:JGL320: RUNDATE=20080827 080827:155938:JGL320: Begin Step S0010 iebgener (#1) 080827:155938:JGL320: gen0: SYSUT1=data/gl.account.master_000005 insize=8720 080827:155938:JGL320: file: SYSUT2=jobtmp/JGL320/__tempglm bytes=0 080827:155938:JGL320: uvcp fili1=data/gl.account.master_000005,filo1=jobtmp/JGL320/__tempglm 080827:155938:JGL320: EOF fili01 109 rds, 8720 size; data/gl.account.master_000005 080827:155938:JGL320: EOF filo01 109 wrts, 8720 size; jobtmp/JGL320/__tempglm 080827:155938:JGL320: Begin Step S0020 idcams (#2) 080827:155938:JGL320: file: TEMPGLM=jobtmp/JGL320/__tempglm bytes=8720 080827:155938:JGL320: gen+1: ACNTMAS=jobtmp/JGL320/GDG/data/gl.account.master_000006 gens=10 080827:155938:JGL320: file: SYSIN=jobtmp/JGL320/S0020_idcams_SYSIN bytes=84 080827:155938:JGL320: uvcp fili1=jobtmp/JGL320/__tempglm,filo1=jobtmp/JGL320/GDG/data/gl.account.master_000006 080827:155938:JGL320: EOF fili01 109 rds, 8720 size; jobtmp/JGL320/__tempglm 080827:155938:JGL320: EOF filo01 109 wrts, 0 size; jobtmp/JGL320/GDG/data/gl.account.master_000006 080827:155938:JGL320: DISAMdat: recs=109,rcsz=80,keys=1; jobtmp/JGL320/GDG/data/gl.account.master_000006 080827:155938:JGL320: Job Times: Begun=15:59:38 End=15:59:38 Elapsed=00:00:00 080827:155938:JGL320: moving jobtmp/JGL320/GDG/subdir/files back to $RUNDATA/subdirs/ `jobtmp/JGL320/GDG/data/gl.account.master_000006.dat' -> `data/gl.account.master_000006.dat' `jobtmp/JGL320/GDG/data/gl.account.master_000006.idx' -> `data/gl.account.master_000006.idx' 080827:155938:JGL320: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
<@:mvstest:/home/mvstest> exit
Script done on Mon 17 Jul 2006 07:47:53 PM PDT
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
jcl2ksh51 jcl0/JAR100.jcl <-- reconvert 1 JCL thru all steps
========================= jcl0 --> jcl1 --> jcl2 --> jcl3 ?--> jcls
- prompts to copy to jcls or not ?
--> y <-- reply y if OK to copy to jcls overwriting prior version
| Note |
|
jcl2ksh51A all <-- reconvert All JCL in directory
============= jcl0 --> jcl1 --> jcl2 --> jcl3 ?--> jcls
- prompts to continue at various points
--> cleanup PROCs, INCLUDEs,& control-cards ? --> y <-- usually reply 'y' unless very large numbers & only JCL needs reconvert
--> recreate ctl/datactl53I
--> n <-- reply 'n' if you have not changed any input JCLs, or the other 2
inputs for datafile info (LISTCAT & Excel spreadsheet)
--> copy to jcls (overwriting existing jcl/scripts) or not ?
--> n <-- reply 'n' if you have spent considerable time editing & debugging
- reply 'y' only early in conversion & testing
- when enhancements are made to JCL converter & control files
- before many JCL/scripts have been modified/tested/debugged
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
cnvMF51c cpy0/CAR100.cpy <-- reconvert 1 COBOL copybook thru all steps
======================== cpy0 --> cpy1 --> cpy2 --> ?--> cpys
- prompts to copy to cpys ?
--> y <-- reply y if OK to copy to cpys overwriting prior version
--> n <-- reply 'n' if you have spent a lot of time modifying copybook in cpys
- might reconvert to pick up some features of converter enhancements ?
- or improving search/replace tables
- cut & paste to combine new parts with old parts
cnvMF51Ac all <-- reconvert All copybook in directory
============ cpy0 --> cpy1 --> cpy2 --> ?--> cpys
- prompts to continue at various points
--> copy UNIXWORK1 & UNIXPROC1 from /home/uvadm/mvstest/cpy0 ?
--> y <-- reply y if 1st time conversion of this directory
--> cleanup complete, enter to convert --> y <-- reply y to continue
--> copy All copybooks from cpy2 to cpys
--> y <-- reply 'y' if OK to overwriting prior versions
- when enhancements are made to COBOL converter & search/replace tables
- before many copybooks have been modified/tested/debugged
--> n <-- reply 'n' if you have spent a lot of time modifying copybooks in cpys
cnvMF51 cbl0/CAR100.cbl <-- reconvert 1 COBOL program thru all steps
======================= cbl0 --> cbl1 --> cbl2 --> cbl3 ?--> cbls
- prompts to copy to cbls & recompile
--> y <-- reply y if OK to copy to cbls overwriting prior version
--> n <-- reply 'n' if you have spent a lot of time modifying program in cbls
- might reconvert to pick up some features of converter enhancements ?
- or improving search/replace tables
- cut & paste to combine new parts with old parts
cnvMF51A all <-- reconvert All programs in directory
=========== cbl0 --> cbl1 --> cbl2 --> cbl3 ?--> cbls
- prompts to continue at various points
--> cleanup complete, enter to convert
--> y <-- reply y to continue
--> copy All programs from cbl2 to cbls & recompile ?
--> y <-- reply 'y' if OK to overwrite prior versions & recompile all
- when enhancements are made to COBOL converter & search/replace tables
- before many programs have been modified/tested/debugged
--> n <-- reply 'n' if you have spent a lot of time modifying programs in cbls
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
I recommend you follow the procedures documented in part 1 of MVSJCL.doc before attempting to convert your own JCL. Page '1P1' & '1P2' instruct you to setup user 'mvstest' & copy the test/demo JCLs,Procs,etc to /home/mvstest/... from /home/uvadm/mvstest/... and then run the conversions starting on page '1Q1'.
You can then execute the converted JCL/scripts starting on page '1S3'. This will give you a good understanding of how these conversions work, before starting your own conversions as documented in Part_4. Part 4 recommends you take the time to setup 'appsadm', modify profiles,& setup your own directories as documented in ADMjobs.htm.
The procedures documented here are for customers who want a quick way to to convert some of their JCL without a lot of setup required. The minimum is to setup a userid, profile, and then use the 'mvslibsdirs' script to setup the required conversion subdirs (listed on page '1A1').
The following is a modified version of the setups shown on page '1P2'. For illustration we will assume userid 'userxx' running Korn shell (vs bash). For SUN systems you may need to code '/export/home' wherever I code '/home' in the following instructions.
#1. login as 'root'
#2. groupadd apps <-- setup group 'apps', if not already setup
============= (when uvadm was setup in install.htm)
#3. useradd -m -g apps -s /bin/ksh userxx <-- setup user 'userxx'
=====================================
#4. passwd userxx01 <-- prompts for password (userxx01 for example)
===============
#5. cp -p /home/uvadm/env/stub_profile /home/userxx/.profile
========================================================
- copy supplied 'stub' profile to userxx homedir & rename for ksh
#6. Logout from root
Now login as userxx & perform your conversions as shown on next page --->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1. login: userxx --> /home/userxx
==============================
#1a. OR, login under your existing userid --> /home/yourhomedir
==========================================================
#2. mkdir testlibs testdata cnvdata tmp
===================================
- make superdirs to hold subdirs
- you only need 'testlibs' to convert JCL/COBOL only
(vs converting data & executing JCL/scripts)
#3. cd testlibs <-- change into testlibs (before making subdirs)
=========== - testlibs must be defined in profiles
by env-vars $TESTLIBS & $RUNLIBS
#4. mvslibsdirs <-- create an empty set of the conversion subdirs
=========== - see subdirs illustrated on page '1A1'
- relevant subdirs for JCL conversion only are:
ctl, parm0, parms, proc0, procs, jcl0, jcl1, jcl2,& jcl3.
#5a. cp /home/uvadm/mvstest/ctl/* ctl <-- copy supplied control files
================================
- required for JCL & COBOL converters
#6. copy YOUR JCLs, PROCs,& Parms into jcl0, proc0,& parm0
#6a. cp /???/yourjcls/* jcl0 #6b. cp /???/yourprocs/* proc0 #6c. cp /???/yourparms/* parm0
#7. jcl2ksh51A all <-- run All JCL conversions
=============
See the script listed on page '9A2' & stored at /home/uvadm/sf/IBM/jcl2ksh51A.
If you have problems, I recommend you revert to the 'step by step' method as illustrated on pages '1Q1' thru '1Q8'.
| Note |
|
#8. cp /home/uvadm/sfun/* /home/appsadm/sfun <-- copy supplied functions
========================================
- required to execute JCL/scripts
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The profiles are designed to facilitate JCL conversions & script executions under 2 conditions:
export RUNLIBS=$HOME/testlibs
=============================
export RUNLIBS=/p1/apps/apps/testlibs
=====================================
All this is explained at ADMjobs.htm#1D1 thru 1D7.
Actually the conversion scripts will work in any directory containing the subdirs documented on page '1A1', but the executions will not work unless RUNLIBS is defined as specified above.
The recommended definitions are much more flexible since it allows your various programmers to each have their own RUNLIBS or more importantly, their own RUNDATA since:
export RUNLIBS=$HOME/testlibs =============================
export RUNDATA=$HOME/testdata =============================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| Note |
|
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.
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.htm#1A1 Profiles
| stub_profile |
|
| common_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
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.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.htm#3A1 cross-refs summary
CNVaids.htm#3B1 - xrefall generate ALL Cross-Ref reports
CNVaids.htm#3B2 - xref... generate any 1 Cross-Ref report
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
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
| statallmvs1 |
|
| statallvse1 |
|
| statmvsjcl1 |
|
| statvsejcl1 |
|
| statksh1 |
|
CNVaids.htm#4C1 - statlogin1
CNVaids.htm#4D1 - table2
CNVaids.htm#4D2 - table3d
CNVaids.htm#4E1 - tblext1
CNVaids.htm#4F1 - recsizes1
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
CNVaids.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.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.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.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.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.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.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
| 3A1. | Conversion support files - Overview |
| 3A2. | Vancouver Utilities 'uvadm' directories & contents |
| 3B1. | Profiles - profiles & related files in /home/uvadm/env/... |
| - listed begining at ADMjobs.htm#1C1 | |
| stub_profile - copied to homedirs, renamed as .bash_profile or .profile | |
| - defines RUNLIBS & RUNDATA | |
| common_profile - defines PATHs using RUNLIBS/RUNDATA | |
| bashrc/kshrc - required if console logging to define aliases |
| 3B2. | modifying stub_profiles for your site |
| 3C0. | Functions used in converted JCL/scripts |
| - job functions (jobset51,jobend51,jobabend51) moved to Part 5 '5K1'+ | |
| - GDG functions (exportgen0,exportgen1,etc) moved to Part 5 '5J1'+ |
| 3C1. | logmsg1 - display console messages with date:time:JOBID |
| 3C2. | logmsg2 - display console messages with date:time:JOBID |
| - for more critical messages: begin job/step, end job, errors | |
| - also writes to jobmsgs file |
| 3C3. | stepctl51 - step control function, providing pause/go facility |
| - JCL converter inserts this function at begin each step | |
| - also see scripts jobstop/jobclear used by operator to | |
| write/clear jobctl records tested by this function | |
| - jobstop to stop at next step or at a specified step# | |
| - see jobstop & jobclear listed on pages '9A6' & '9A7' | |
| (with the scripts, not here with the functions) |
| 3E1. | jclunixop51 - options for the JCL/script converter |
| 3E2. | GDGmkdirs - script to make subdirs for GDG files |
| 3E3. | Customizing the JCL converter options file for your site |
| 3F0. | control files for the JCL converter |
| - created from up to 6 sources |
| 3F1. | datajcl51,52 - control file extracted from ALL JCLs |
| 3F2. | datacat51,52 - control file extracted from mainframe LISTCAT report |
| 3F3. | dataxl151,52 - control file from Excel spreadsheet#1 |
| dataxl151,52 - control file from Excel spreadsheet#1 |
| 3F4. | dataedt52 - control file created with editor to supply missing info |
| 3F5. | datacnv51,52 - control file extracted from datafile scans |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
There are several 'conversion support files' that you should be aware of and that you may possibly need to modify to obtain optimum conversions.
I have categorized them into the groups shown above (profiles, functions, GDG functions, control files, scripts, uvcopy jobs).
Here in Part 3 we will list or give references to the more important control files that you may have to modify to optimize your conversion.
In Part_9 we will list or give references to the scripts, uvcopy jobs,& C programs, that you should not have to modify. If you think you need changes to these, please contact UV Software.
The next page illustrates the contents of the Vancouver Utilities distribution & identifies the subdirectories housing these groups.
There are certainly other important subdirs & file groups (such as src & bin, where the JCL converter is found), but you should not have to modify them.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/home/uvadm :-----batDOS :-----bin :-----cobs :-----ctl <-- '3E0' control files used in JCL conversion :-----dat1 :-----doc :-----dochtml :-----env <-- environmental profiles ADMjobs.htm#1C1 :-----hdr :-----htmlcode :-----lib :-----pf <-- '9B0' uvcopy jobs used by JCL conversion (& much more) : :-----adm : :-----demo : :-----IBM : :-----util :-----sf <-- '9A0' scripts used by JCL conversion (& much more) : :-----adm : :-----demo : :-----IBM : :-----util :-----sfun <-- '3C0','5J0','5K0' functions for JCL/scripts & GDG files :-----src :-----srcf :-----tf :-----tmp :-----mvstest : :-----testlibs : : :-----archive : : :-----cbl0 : : :-----cpy0 : : :-----Csub : : :-----ctl : : :-----jcl0 : : :-----pf : : :-----proc0 : : :-----sf : :-----tmp : :-----xref : :-----testdata : : :-----ar, gl, : : :-----jobctl, joblog, jobtmp : : :-----rpts, sysout, tmp, wrk
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/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/...
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
ADMjobs.htm#1C1 - stub_profile
- distributed in /home/uvadm/env/...
- copy (to user homedirs) & rename depending on the desired shell
(.bash_profile for bash, .profile for ksh)
- modify RUNLIBS/RUNDATA differently for programmers or operators
define RUNLIBS as testlibs for programmers OR prodlibs for operators
define RUNDATA as testdata for programmers OR proddata for operators
- contains user aliases, preferences, console logging on or off
- modify TERM & 'stty erase' character depending on user's terminal
- modify UVLPDEST to define a laser printer near the user
- calls common_profile
ADMjobs.htm#1C2 - common_profile, called by stub_profile
- defines search PATHs to libraries & data based on $RUNLIBS & $RUNDATA
- distributed in /home/uvadm/env/...
- you should copy to /home/appsadm/env/ & customize there
(to avoid overwriting when new versions of VU installed)
- contains most items, allows updates in 1 place for all
- modify TERM & 'stty erase' character depending on user's terminal
(distribution has TERM=linux & stty erase '^?')
- the common_profile should be correct for the majority of users
& the stub profiles can be modified for the exceptions
- change 'COBDIR' depending on where you have installed Micro Focus COBOL
ADMjobs.htm#1C6 - bashrc
- 'rc file' distributed in /home/uvadm/env/...
- copy (to user homedirs) & rename depending on the desired shell
(.bashrc for bash, .kshrc for ksh)
- master version supplied without the '.' for visibility
- required if you invoke another shell level (console logging script)
- carries aliases & umask which get lost on another shell level
- you should customize & store in /home/appsadm/env/...
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
export UVLPDEST="-dlp0" <-- change 'lp0' to your laser printer
=======================
| Note |
|
export COBDIR=/opt/microfocus/cobol <-- change for your site
===================================
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
| Note |
|
| 5J0. | exportgen_ functions to emulate GDG files on unix/linux |
| 5J1. | exportgen0 - get the latest generation for input |
| 5J2. | exportgen1 - get the next generation for output |
| 5J3. | exportgenall - get all generations for input |
| 5K1. | jobset51 - setup job environment for scripts converted from IBM MVS JCL |
| - JCL converter inserts a call to this function at begin script | |
| - changes directory to $RUNDATA, sets up subdirs, etc |
| 5K2. | jobend51 - display GDG files moved from jobtmp/subdirs |
| back to $RUNDATA/subdirs (so they show on console log) |
| 5K3. | jobabend51 - display GDG files NOT moved from jobtmp/subdirs |
| because of job Terminated Abnormally |
| 5J5. | exportfile - function to export Logical-FileName=Physical-FileName |
| (for non-GDG files, see GDG files in Part 5) | |
| - for the following COBOL program (select external LFN) | |
| - also displays filename for the console log (using logmsg1) |
| 3C1. | logmsg1 - display console messages with date:time:JOBID2: stamps |
| - this function used instead of 'echo's |
| 3C2. | logmsg1 - display console messages with date:time:JOBID2: stamps |
| - this function used instead of 'echo's |
| 3C3. | stepctl51 - step control function, providing pause/go facility |
| - JCL converter inserts this function at begin each step | |
| - also see scripts jobstop/jobclear used by operator to | |
| write/clear jobctl records tested by this function | |
| - jobstop to stop at next step or at a specified step# | |
| - see jobstop & jobclear listed on pages '9A6' & '9A7' | |
| (with the scripts, not here with the functions) |
| 3C4. | Customizing the Korn shell functions |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# logmsg1 - function to prefix echo/print messages with jobname & date/time
# - calling script must have defined symbol "JOBID2"
# - 2 versions of logmsg (as of Oct 11/2005)
#*logmsg1 - prints only to the screen (stdout)
# logmsg2 - prints to screen & appends to $RUNDATA/jobmsgs/yymmdd/ymd_HMS_JOBID
#
# logmsg1 "x---message---x" <-- sample command in calling JOBXXX
# 051011:124700:JOBXXXXX x---msg---x <-- sample output (at 12:47 Oct 11/05)
#
# logmsg1 "x---message---x" RV <-- arg2/3 "RV" for Reverse Video
# logmsg1 "x---message---x" ACK <-- arg2/3 "ACK" to force acknowledge y/n
# logmsg1 "x---message---x" RV ACK <-- arg2/arg3 either sequence
#
# export LOGMSGACK=y <-- profiles set LOGMSGACK=y to activate acknowledgement
# - default in common_defines could be overridden in user profiles
# - running JCL/scripts by cron automatically disables operator prompts
#
function logmsg1
{
REV='\033[7m'; OFF='\033[0m'; reply=x; rc=0;
#
if [[ "$2" = "RV" || "$3" = "RV" ]]
then msg="$REV$(date +%y%m%d:%H%M%S):$JOBID2: ${1}$OFF"
else msg="$(date +%y%m%d:%H%M%S):$JOBID2: $1"
fi
#
if [[ ("$2" = "ACK" || "$3" = "ACK") && ("$LOGMSGACK" = "y") ]]
then until [[ "$reply" = "y" || "$reply" = "n" ]]
do print -r "$msg y/n?"
tty -s || break # test login terminal, break if run by cron
read reply
done
else print -r "$msg"
fi
# return 1 if reply y, else 0
if [[ "$reply" = "y" ]]; then return 1; else return 0; fi
}
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# logmsg2 - function to prefix echo/print messages with jobname & date/time
# - calling script must have defined symbol "JOBID2"
#Aug02/2008 - $RUNDTTM on filenames (RUNDTTM exported by jobset51 in script)
#Jan25/2012 - change jobmsgs/yymmdd/yymmdd_HHMMSS_JOBID2
# to jobmsgs/yymmdd/HHMMSS_JOBID2
#
# logmsg1 - prints only to the screen (for infomsgs vs errmsgs)
#*logmsg2 - prints to the screen & appends to 2 files (for errmsgs vs infomsgs)
# - $RUNDATA/jobmsgs/yymmdd:HHMMSS_$JOBID2
# - $APPSADM/jobmsgs/yymmdd/yymmdd:HHMMSS_$JOBID2
# - use cron to remove $RUNDATA/jobmsgs/* files every day before batch shift
# - use cron to remove $APPSADM/jobmsgs/... subdirs older than 10 days ?
#
# logmsg2 "x---message---x" <-- sample command in calling JOBXXX
# 051011:124700:JOBXXXXX x---msg---x <-- sample output (at 12:47 Oct 11/05)
#
# logmsg2 "x---message---x" RV <-- arg2/3 "RV" for Reverse Video
# logmsg2 "x---message---x" ACK <-- arg2/3 "ACK" to force acknowledge y/n
# logmsg2 "x---message---x" RV ACK <-- arg2/arg3 either sequence
#
# export LOGMSGACK=y <-- profiles set LOGMSGACK=y to activate acknowledgement
# - default in common_defines could be overridden in user profiles
# - running JCL/scripts by cron automatically disables operator prompts
#
function logmsg2
{
REV='\033[7m'; OFF='\033[0m'; reply=x; rc=0;
DTTM="$(date +%y%m%d:%H%M%S)"
YMD="$(date +%y%m%d)"
if [[ "$HMS" = "" ]]; then HMS="$(date +%H%M%S)"; fi
# HMS="$(date +%H%M%S)" #<-- defined in jobset51
# HMS defined in jobset51, not here, else would change every logmsg2 in job
#
if [[ "$2" = "RV" || "$3" = "RV" ]]
then msg="$REV$DTTM:$JOBID2: ${1}$OFF"
else msg="$DTTM:$JOBID2: $1"
fi
if [[ ("$2" = "ACK" || "$3" = "ACK") && ("$LOGMSGACK" = "y") ]]
then until [[ "$reply" = "y" || "$reply" = "n" ]]
do print -r "$msg y/n?"
tty -s || break # test login terminal, break if run by cron
read reply
done
else print -r "$msg"
fi
# append msg to jobmsgs in $RUNDATA
# - $RUNDATA/jobmsgs/yymmdd:HHMMSS_$JOBID2
# make subdir if it does not yet exist
test -d $RUNDATA/jobmsgs/$YMD || mkdir $RUNDATA/jobmsgs/$YMD
print -r "$msg" >>$RUNDATA/jobmsgs/$YMD/${HMS}_$JOBID2
#
# return 1 if reply y, else 0
if [[ "$reply" = "y" ]]; then return 1; else return 0; fi
}
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh # stepctl51 - step control function # - for UNIX scripts converted from IBM MVS JCL # - this KORN shell function stored in $APPSADM/sfun # - see more doc at: www.uvsoftware.ca/mvsjcl.htm # # A call to this function (stepctl51) is inserted at begining of each step # - to provide operators with a means to pause multi-step jobs # - at begining of the next step, or at a specified step# (programmer debug?) # - scripts 'jobstop' & 'jobclear' are provided to pause & restart jobs #Jan14/11 - call uvtime in stepctl51 to calculate StepTimes # # jobstop jobname.ksh <-- pause specified JCL/script at begin next step # =================== - writes control file (tested by JCL/script) # - step# dflt S0000 meaning pause at all steps # - will wait wait for oprtr 'go' or 'clear' # jobstop jobname.ksh S0050 <-- pause job at step S0050 (step 5, inc by 10) # ========================= - will wait wait for oprtr 'go' or 'clear' # - 'go' does not clear, so rerun will pause again # jobclear jobname.ksh <-- clear the control file (same as clear response) # ==================== # # Step Control files are written to $RUNDATA/jobctl/... # - named same as JCL/script but with extension '.ctl' (vs .ksh) # - jobstop writes 1 line in the control file with: jobname.ksh step# date_time # - step# is the step# specified by oprtr as arg#2 on jobstop script command # - step# is S0000 if no step# spcfd on jobstop (indicates stop at all steps) # #Feb05/12 - change replies to: cont(inue), clear, endok, endab # - jobset51 now allows stop step#, for example 'stop=S0050' # - writes jobctl/jobname.ctl S0050 # - causes stepctl at S0050+ to display: cont,clear,endok,endab #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
function stepctl51 {
#Jan14/11 - call uvtime in stepctl51 (to save a line in JCL/scripts)
uvtime W1D2 steptimes
#Jan26/12 - arg2 filename disabled, now dummy
# - JCL converter modified to report prior step for JObTimes report
# - for pause, would need to specify prior step OK?
# begin loop to open stepctlfile, read 1st line,& test step#
# if open succesful and:
# - if step# S0000, display paused msg & wait for oprtr reply
# - if step#>S0000 & matches current step#, display pause msg & wait reply
# - else no msg, no pause, return immediately
alias goto=""; # ensure goto cleared in case reply endok/endab
while ((1))
do if [[ ! -f jobctl/$jobid2.ctl ]]; then break; fi
exec 3< jobctl/$jobid2.ctl # open step control file
openstat=$? # capture open file status
if (($openstat)); then break; fi
read -u3 job start2 stop2 date
exec 3<&- # close step control file
stop=${stop2##stop=}
if [[ $stop != S[0-9][0-9][0-9][0-9] ]]; then break; fi
if [[ $JSTEP < $stop ]]; then break; fi
logmsg1 "$jobid2.ksh paused by job control file: jobctl/$jobid2.ctl"
logmsg1 "- job control record: $job $stop $date"
logmsg1 "- waiting for reply: cont(inue), clear, endok, endab"
read reply1; logmsg2 "stepctl51: reply1=$reply1"
if [[ "$reply1" == "endok" ]]; then alias goto="<<S9000=A"; break; fi
if [[ "$reply1" == "endab" ]]; then alias goto="<<S9900=A"; break; fi
if [[ "$reply1" == "cont" ]]; then break; fi
if [[ "$reply1" == "clear" ]]; then
mv jobctl/$jobid2.ctl jobctl/$jobid2.ctl_old; break; fi
sleep 1
done
return 0
}
#
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are some important notes re the proper use of Korn shell functions.
These functions reside in /home/appsadm/sfun defined to the Unix/Linux KORN shell by the 'FPATH' variable in your profile, for example:
export FPATH=/home/appsadm/sfun ===============================
This is separate from the Unix/Linux KORN shell 'PATH' variable which is used to find normal scripts (in jcls & sf) for example:
export PATH=$PATH:$RUNLIBS/jcls:$RUNLIBS/sf ===========================================
'RUNLIBS' is defined in the profile prior to PATH or FPATH. For the 'mvstest' demos this was:
export RUNLIBS=/home/mvstest ============================
But for YOUR conversion & testing/production RUNLIBS might be:
export RUNLIBS=/p1/apps/testlibs <-- for Your Testing ================================ export RUNLIBS=/p2/apps/prodlibs <-- for Your Production ================================
These functions must be defined as 'autoload' in the calling scripts. Note that the JCL converter inserts the following about line #10 of each converted JCL/script.
autoload jobset51 logmsg1 exportfile stepctl51 ==============================================
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
jclunixop51:a1b2c0d3e2f3g1i1j0k3l50m4n3o0p0r0s0t1u1v0w0x0y1z0 #<-- options # ================================================= # jclunixop51:a1b2c0d1e2f3g1i1j7k3l40m4n3o0p0r0s0t1u1v3w0x0y1z0 #<-- Sears Java # ================================================== # Jan21/12 sears diff: d1 drop DDN LIB (not LOAD), j7 for Java, # v3 inhibit DELETE via IDCAMS & DISP=(MOD,DELETE) # a1 - append 1 on COBOL reserved word DDNAMES # b1 - generate blank line between steps # b2 - insert stepctl51 (mandatory as of Feb08/12) # c1 - program names UPPER case # c2 - filenames UPPER case (also uop=l2 jcldata52) # c4 - control card modulenames UPPER case # d1 - drop DDNAMES that begin/end with LOAD/LIB # d2 - drop DSNAMES that begin/end with load/lib # e1 - echo run command to test script w/o programs # e2 - option '-v' on cp & mv echo to console log # f1 - copy FTP commands from lib module to instream # f2 - use FTP option '-u' to inhibit authorization # g0 - create new GDG's in $RUNDATA/subdir/gdgfile_ # g1 - new GDGs $JGDG relative move to subdir/ at EOJ # g2 - new GDGs $JGDG absolute $RUNDATA/jobtmp/... # i1 - use datactl53I Indexed file for recsz,keys,etc # i0 - will try to load datactl53I into memory table # j1 - generate cmd line for JAVA (vs COBOL) # j2 - include -DDDNAME=$DDNAME for each file in step # j4 - special convert IKJEFT01, see MVSJCL.doc # k1 - FTP: insert 'open' prior to 1st line if IP# # k2 - FTP: insert 'user' prior 1st word if not cmd # l50 - limit SYSIN/SYSTSIN lines shown in script # m0 - generate exportfile modules original filename # m1 - redirect modules to $RUNDATA vs $RUNLIBS dflt # m2 - redirect SYSIN modules to $RUN____/parms/... # m4 - redirect ALL modules to $RUN____/parms/... # m8 - show original filename prior to $RUN____/parms # n0 - unrecognized JCL passed thru as is # n1 - unrecognized JCL cmntd out with '#?' cols 1-2 # n2 - if any '=' present, convert any ','s to ';'s # n3 - if n2 & no '=', cmnt out with '#?' cols 1-2 # n4 - convert unrecognized JCL to instream data # o1 - remove 1st segment of DDName overrides # p1 - append parm data on COBOL execution command # r0 - gen cobrun, executes .int's & allows animation # r1 - gen runw for .ints NetExpress/Windows # r2 - assume executable programs either unix/windows # r4 - assume executables in PATH (progname only) # r8 - generate 'findexec' Multi-Level program search # r16 - generate 'unikixvsam $RLX/COBOLX' # r32 - generate Natural call (natsec batch ...) # s1 - convert SORT for SYNCSORT (not uvsort) # t1 - disabled, see TOPNODE table & TOPDIRINSERT # u1 - use uvcp for IEBGENER/IDCAMS REPRO (vs cp) # u2 - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 # v1 - inhibit DELETE via IDCAMS DELETE # v2 - inhibit DELETE via DISP=(OLD/SHR/MOD,DELETE, # w1 - generate 'unikixbld -i -d $KIXDATA/filename' # w2 - insert $RUNDATA on exportfile/gen for unikix # x# - make all indexed output files IDXf# (1,3,4,8) # y1 - generate oprtr prompt to acknowledge Abterms # z1 - custom for DST, make topnode $SYMBOL no/sep # jclunixop51:b2c0d1e2f1g1i1j0k3l20m4n3o0p0r0s0t1u1w0x0y1z0 #mvstest Apr2009 # ---------------------------------------------------------------------------- # Note re w2 - use sfun/jobset52 if you use w2 # - $RUNDATA/... inserted on export JTMP, RPTS,& SYOT # uvadm/ctl/jclunixop51 - control file for MVS JCL to Korn shell converter # - must copy/modify to ctl/ subdir where jclunix converter executed # Following lines will be inserted in scripts until :ENDINSERT # - except for '# ' comment (col1 '#', col2 ' ' blank) # '#!/.......' is 1st line output - usually '#!/bin/ksh' or '#!/bin/ksh93' # ------------------------------------------------------------------------ #!/bin/ksh export JOBID2=JOBIDX jobid2=jobidx; scriptpath="$0"; args="$*" if [[ -z "$JOBID1" ]]; then export JOBID1=$JOBID2; fi for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done integer JCC=0 SCC=0 LCC=0 # init step status return codes autoload jobset51 jobset52 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 autoload exportfile exportgen0 exportgen1 exportgenall exportgenx . $APPSADM/env/stub.ini #<-- for control-M (see notes in env/stub.ini) jobset51 # call function for JCL/script initialization goto S0000=A :ENDINSERT: - above non #comment lines inserted at begin output scripts # jobset51 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 jclunixop51 # OR use alt jclunixop52 with JTMP JGDG defined with $RUNDATA/... # #------------------ general purporse search/replace tables ------------------ # REPTBL1 - replace any pattern on any INPUT (JCL before conversion to script) # - entries must be tidle filled & table ended by a line of all tildes # 01-30=search pattern, 31-60=replace pattern, 61-80=qualifier pattern # :REPTBL1: search/replace table for input IBM JCL oldpattern~~~~~~~~~~~~~~~~~~~~newpattern~~~~~~~~~~~~~~~~~~~~qualifier~~~~~~~~~~~ .DSN=~~~~~~~~~~~~~~~~~~~~~~~~~.,DSN=~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # REPTBL2 - replace any pattern on any OUTPUT (after conversion to script) :REPTBL2: search/replace table for output UNIX script oldpattern~~~~~~~~~~~~~~~~~~~~newpattern~~~~~~~~~~~~~~~~~~~~qualifier~~~~~~~~~~~ %%MDY~~~~~~~~~~~~~~~~~~~~~~~~~$(date +%m%d%y)~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # #--------------------- filename search/replace table --------------------- # 01-30=search pattern, 31-60=replace pattern, 61-80=qualifier pattern # - entries must be tidle filled & table ended by a line of all tildes # :FILEREP1: filename search/replace table for input JCL DSNs oldpattern~~~~~~~~~~~~~~~~~~~~newpattern~~~~~~~~~~~~~~~~~~~~qualifier~~~~~~~~~~~ HIQUAL.ENVIRON~~~~~~~~~~~~~~~~app_files~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # #----------------------- control table -------------------------------- :CTLTBL: TOPDIRDEFAULT~~~~~~~~~~~~~~~~~data~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINSERT~~~~~~~~~~~~~~~~~~data~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # TOPDIRDEFAULT - inserted if only 1 node (no High Level Qualifier) in DSN # - recommend 'wrk' (1 node files likely temp files) # TOPDIRINSERT - if specified, will be inserted above HLQ, retaining all '.'s # - some sites code this as 'mstr' # - TOPNODES table would be irrelevant if TOPDIRINSERT specified # - if NOT specified, the existing top-node is used as a subdir within $RUNDATA # use TOPNODES table to allow desired topnodes & convert unwanteds to 'misc' # - could use FILEREP1 table to convert any part of filenames before above # #------------------------ TOPNODES table ------------------------------ # table of TOPNODES allowed & replacements (optional) # 01-30 - topnodes allowed # 31-60 - topnode replacements (if col 31 not '~') # - if 01-30 of last entry 'ALLOTHER', any others replaced by 31-60 # - use statmvsjcl1 to create summary table of topnodes used in all JCL # - see www.uvsoftware.ca/mvsjcl.htm#6A2 # - code in lower case since applied at output time(script) vs input(JCL) :TOPNODES: data~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ALLOTHERS~~~~~~~~~~~~~~~~~~~~~data~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #Note1 - you must also code valid top-nodes in $RUNLIBS/ctl/GDGmkdirs # - called by jobset51 to setup subdirs for new generations of GDG files # - see listing at MVSJCL.htm#4E5 #Note2 - above TOPNODES table used for mvstest demo conversions # - verifies topnodes listed & converts others to 'misc' # - you could also change existing topnodes, for example: # c900pali~~~~~~~~~~~~~~~~~~~~~~ali~~~~~~~~~~~~~~~~~~~~~~~~~~~ # c900pfhb~~~~~~~~~~~~~~~~~~~~~~fhb~~~~~~~~~~~~~~~~~~~~~~~~~~~ # c900etc~~~~~~~~~~~~~~~~~~~~~~~etc~~~~~~~~~~~~~~~~~~~~~~~~~~~ # ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~ # - above mainframe topnodes are being shortened to 3 chars from 8 # - since 1st 5 chars always 'c900p' # # comment lines in output script by search patterns & qualifiers # - inserts '# ' in cols 1 & 2 if search & qualifier patterns present :CMTTBL: cmtsearch~~~~~~~~~~~~~~~~~~~~~cmtqualifier~~~~~~~~~~~~~~~~~~ BLKSIZE=6300~~~~~~~~~~~~~~~~~~INPFIL~~~~~~~~~~~~~~~~~~~~~~~~ BLKSIZE=6500~~~~~~~~~~~~~~~~~~OUTFIL~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # :DROPDDN: drop DDnames on input //DDname DD PROCLIB~~~~~~~~~~~~~~~~~~~~~~~ STEPLIB~~~~~~~~~~~~~~~~~~~~~~~ JOBLIB~~~~~~~~~~~~~~~~~~~~~~~~ SYSLIB~~~~~~~~~~~~~~~~~~~~~~~~ ESYLIB~~~~~~~~~~~~~~~~~~~~~~~~ RESLIB~~~~~~~~~~~~~~~~~~~~~~~~ DFSRESLB~~~~~~~~~~~~~~~~~~~~~~ SORTLIB~~~~~~~~~~~~~~~~~~~~~~~ SORTWK*~~~~~~~~~~~~~~~~~~~~~~~ SYSUDUMP~~~~~~~~~~~~~~~~~~~~~~ SYSABEND~~~~~~~~~~~~~~~~~~~~~~ SYSOUX~~~~~~~~~~~~~~~~~~~~~~~~ SYSDBOUT~~~~~~~~~~~~~~~~~~~~~~ SYSABOUT~~~~~~~~~~~~~~~~~~~~~~ SYSTSPRT~~~~~~~~~~~~~~~~~~~~~~ CEEDUMP~~~~~~~~~~~~~~~~~~~~~~~ DMPUBLIB~~~~~~~~~~~~~~~~~~~~~~ DMNETMAP~~~~~~~~~~~~~~~~~~~~~~ DMMSGFIL~~~~~~~~~~~~~~~~~~~~~~ DMPRINT~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Table of DSNnames to drop if pattern matched anywhere in filename # - optionally qualified by EXECname in cols 31-38 :DROPDSN: LINKLIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ LOADLIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JCLLIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ JCL.LIB~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PROD.LOAD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TEST.LOAD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ EMER.LOAD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ COBOLMVS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
STREAMW~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LOADRUN~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
PROD.JCL~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
USERCAT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
CATALOG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
SORTWK~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
# Table of STEP names to be #commented out
:COMMENTSTEP:
BMCSIU~~~~~~~~~~~~~~~~~~~~~~~~
XMOPEN~~~~~~~~~~~~~~~~~~~~~~~~
DSNUTILB~~~~~~~~~~~~~~~~~~~~~~
DSNOSTEP~~~~~~~~~~~~~~~~~~~~~~
AMUUMAIN~~~~~~~~~~~~~~~~~~~~~~
INFOPAC~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Oct21/07 - ADUUMAIN converted for eFunds
#Oct11/07 - DSNUTILB,DSNOSTEP,INFOPAC added for eFunds
# - IEFBR14 & IDCAMS removed (identified & converted in program)
#
# Table of symbols whose value is to be translated to lower case
:LOWERCASE:
APPLID~~~~~~~~~~~~~~~~~~~~~~~~
FLEV~~~~~~~~~~~~~~~~~~~~~~~~~~
DPC~~~~~~~~~~~~~~~~~~~~~~~~~~~
PE~~~~~~~~~~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#
#May06/06 - add table of 3rd party programs for EDS/RRD
# - to modify presumption of COBOL (construct cobrun)
:3RDPARTY:
CDEXEC~~~~~~~~~~~~~~$P3_CDEXEC/bin/cdexec~~~~~~~~~~~~~~~~~~~~~~~
ENGEXE~~~~~~~~~~~~~~$P3_ENGEXE/version/Engine~~~~~~~~~~~~~~~~~~~
FILEAID~~~~~~~~~~~~~$P3_FILEAID/bin/fileaid~~~~~~~~~~~~~~~~~~~~~
FTUCMD~~~~~~~~~~~~~~$P3_FTUCMD/bin/ftucmd~~~~~~~~~~~~~~~~~~~~~~~
INFOMOVR~~~~~~~~~~~~$P3_INFOMOVR/bin/infomovr~~~~~~~~~~~~~~~~~~~
MACH~~~~~~~~~~~~~~~~$P3_MACH/bin/mach~~~~~~~~~~~~~~~~~~~~~~~~~~~
NDMEXEC~~~~~~~~~~~~~$P3_NDMEXEC/bin/ndmexec~~~~~~~~~~~~~~~~~~~~~
PDRFILES~~~~~~~~~~~~$P3_PDRFILES/bin/pdrfiles~~~~~~~~~~~~~~~~~~~
PDRSW000~~~~~~~~~~~~$P3_PDRSW000/bin/sweaver~~~~~~~~~~~~~~~~~~~~
PKZIP~~~~~~~~~~~~~~~$P3_PKZIP/bin/pkzip~~~~~~~~~~~~~~~~~~~~~~~~~
SYNCsort~~~~~~~~~~~~$P3_SYNCsort/bin/syncsort~~~~~~~~~~~~~~~~~~~
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# user would define the $EXECNAMEs in the common_profile
# - as the PATH to the 3rd party apps dirs
# - & modify above table depending on bin, etc
# export P3_PDRSW000=/apps/StreamWeaver
# export P3_ENGEXE=/apps/dialogue
# - ENGEXE(dialogue) is special case with version subdir
# - taken from DSN of MSGSYM DDN, for example
# //MSGSYM DD DSN=STS2.EXSTREAM.V4R0M060.MESSAGES
#
#--------------------------------------------------------------
#Oct28/2010 - add table of Connect:Direct code
# export NDMAPICFG=$CDNDM/cfg/cliapi/ndmapi.cfg
# - above NDMAPICFG will be defined in profile
# - will replace PROCESSNAME with $JOBID2_$STEP_CD
# - Inode --> pnode if copy from mainframe(unix) to NT, else snode
# - Onode --> snode if copy from mainframe(unix) to NT, else pnode
#Nov09/10 - direct option '-s' removed for debug ?
:CONNECTDIRECT:
logmsg1 "/search for any CD ERROR codes in \$CDNDM/cfg/msgfile.cfg"
$CDNDM/bin/direct $CDOPTNS << EOJ
submit maxdelay=0 PROCESSNAME
process snode=$CDSERVER
step1 copy from (file=$INFILE Inode)
to (file=$OUTFILE Onode)
pend ;
EOJ
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#Nov14/10 - 'snode=CD.ZAOMNT02' replaced by 'snode=$CDSERVER'
# - 'export CDSERVER=CD.ZAOMNT02' added to comon_profile
#------------------------ end jclunixop51 ---------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# GDGmkdirs - make subdirs for new versions of GDG files
# saved in jobtmp/subdirs/... until Normal EOJ
# - by Owen Townsend, UV Software, Aug 25/2008
#
#Apr16/2009 - this script moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/
# - to allow multiple $RUNDATA's to have different GDG controls
#
# script in $RUNDATA/ctl/... called by jobset51 (called by all JCL/scripts)
# exportgen1 creates new GDG files in $RUNDATA/$JGDG/subdirs/...
# - where: JGDG=$RUNDATA/jobtmp/$JOBID2/GDG/
# - at normal EOJ, GDG files are moved to intended subdirs (NOT if Abterm)
#
# user must code names of his site's data file subdirs here
# - matching the TOPNODEs table in $RUNLIBS/ctl/jclunixop51
# - following subdirs are for the demo JCL/scripts
# (at www.uvsoftware.ca/mvsjcl.htm#Part_1)
#
#Mar14/09 - JCL converter option g1 inserts $JGDG/... on new GDGs exportgen1
# - new option 'g0' omits $GDG/ so new GDGs in same subdir as old
# - this GDGmkdirs script must still exist (since called by jobset51)
# BUT, subdirs created will not be used, since no files redirected to $JGDG/
#
if [[ ! -d $JTMP ]]; then
echo "JTMP not defined or not in \$RUNDATA"; exit 81; fi
#
# make $JGDG/ for gdg subdirs
# also make $GTMP/ for exportgen0/1 'ls' outputs to determine latest gen#s
if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi
if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi
#
# You MUST code mkdirs for the subdirs desired at your site
#==========================================================================
if [[ ! -d $JGDG/data ]]; then mkdir $JGDG/data; fi
#Aug29/2011 - consolidated all datafiles into 1 directory (data/...)
# old subdirs ar/ gl/ py/ #cmtd out, now top level node, for example:
# $RUNDATA/ar/customer.master --> $RUNDATA/data/ar.customer.master
#-------- old mkdirs below replaced by the 1 mkdir data above ----------
# if [[ ! -d $JGDG/ar ]]; then mkdir $JGDG/ar; fi
# if [[ ! -d $JGDG/gl ]]; then mkdir $JGDG/gl; fi
# if [[ ! -d $JGDG/py ]]; then mkdir $JGDG/py; fi
# if [[ ! -d $JGDG/mstr ]]; then mkdir $JGDG/mstr; fi
# if [[ ! -d $JGDG/data ]]; then mkdir $JGDG/data; fi
# if [[ ! -d $JGDG/tape ]]; then mkdir $JGDG/tape; fi
exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The files listed above is correct for the 'mvstest' system & will not need any changes to convert & execute the demo scripts & programs provided. However you will need to modify for your own JCL conversions. You should 1st run the 'mvstest' conversions beginning on page '1Q1' (& verify the results match the listings in section 1C1), before modifying for your own JCL conversions.
This file (ctl/jclunixop5) controls various activities performed by the jclunix51 conversion program. Several options are specified on line 1:
jclunixop51:b0c0d1g31e1f0i1j0k1l20m1n3o0p0r0s0t1u1w0x0y1z0 #<-- options ==========================================================
See explanations in the full listing above on page '3E1'.
Note the search/replace tables to modify conversion for site variances you can use REPTBL2 to modify the directory name taken from the top-node of DSNs.
you can use the DROPDDN & DROPDSN tables to get rid of mainframe file definitions that have no relevance to unix/linux scripts (such as PROCLIB, STEPLIB, JOBLIB, etc)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The JCL converter looks up an Indexed file 'ctl/datactl53I' to get information about the data-files (record-size, file-type, key-location/length, GDG or not). This info is required for SORTs, IDCAMS, IEBGENER, etc that are converted to uvsort & uvcp.
The mainframe JCL did not necessarily specify record-size etc, since this info could be obtained from the mainframe VTOC or LISTCAT. But there is no VTOC or LISTCAT on unix/linux, so we will supply that info to the JCL converter via an Indexed file (ctl/datactl53I). We can collect datafile info from 6 sources as described below.
We show the uvcopy utility jobnames below the -------> lines. For example uvcopy job 'jcldata51' is used to create 'ctl/datajcl51', which is then processed/resorted by 'jcldata52' to create 'ctl/datajcl52'.
#1. JCL -----------> ctl/datajcl51 -----------> ctl/datajcl52
jcldata51 jcldata52
- datafile info extracted from all JCL
- this is the primary & only mandatory datafile info source
- create null files for any files below not available
#2. LISTCAT -----------> ctl/datacat51 -----------> ctl/datacat52
catdata51 catdata52
- info extracted from LISTCAT (mainframe report)
- optional, if absent create null file >ctl/datacat52
#3. Excel spreadsheet#1 -----------> ctl/dataxl151 ----------> ctl/dataxl152
xl1data51 xldata52
- info extracted from Excel spreadsheet #1
- optional, if absent create null file >ctl/dataxl152
#4. Excel spreadsheet#2 -----------> ctl/dataxl251 -----------> ctl/dataxl252
xl2data51 xl2data52
- info extracted from Excel spreadsheet #2
- optional, if absent create null file >ctl/dataxl252
#5. ----------> ctl/dataedt52
editor
- info created manually with editor (no uvcopy job involved)
- may supply info not available from other 5 sources
- optional, if absent create null file >ctl/dataedt52
#6. EBCDIC datafiles -----------> ctl/datacnv51 -----------> ctl/datacnv52
cnvdata51 cnvdata52
- info created by scanning the EBCDIC datafiles
- currently indicates only if packed/binary fields present
- optional, if absent create null file >ctl/datacnv52
#7. Six ...52 files above -----------> ctl/datactl53 -----------> ctl/datactl53I
ctldata53 uvcp (load Indexed file)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| Note |
|
#01 &&TEMPGLM cntf=0016 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL1 #02 AR.CUSTOMER.MASTER cntf=0010 rca=00000 rcm=00000 typ=RSF src=J___________ job=jar100 prg=CAR100 #03 AR.CUSTOMER.NAMEADRS.LIST100 cntf=0002 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jar109 prg=CAR100 #04 GL.ACCOUNT.ACNTLIST(+1) cntf=0001 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100 #05 GL.ACCOUNT.MASTER cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14 #06 GL.ACCOUNT.MASTER(+1) cntf=0014 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL2 #07 GL.ACCOUNT.MASTER(0) cntf=0020 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl100 prg=CGL100 #08 GL.ACCOUNT.MASTER2 cntf=0002 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6) #09 GL.ACCOUNT.TRANS(+1) cntf=0005 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl211 prg=SORT #10 PY.PARMS(PPY200S1) cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy200 prg=SORT #11 PY.TIME.&DAY..&MONTH..&YEAR cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy910 prg=IEFBR14 #12 PYTEST.PAYROLL.MASTER cntf=0006 rca=00200 rcm=00200 typ=ISF src=Jk__________ job=jpy400 prg=IDCAMS key=(0,8)
#01 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL1 #02 rca=00000 rcm=00000 typ=RSF src=J___________ job=jar100 prg=CAR100 #03 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jar109 prg=CAR100 #04 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100 #05 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14 #06 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL2 #07 rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl100 prg=CGL100 #08 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6) #09 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl211 prg=SORT #10 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy200 prg=SORT #11 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy910 prg=IEFBR14 #12 rca=00200 rcm=00200 typ=ISF src=Jk__________ job=jpy400 prg=IDCAMS key=(0,8)
#02 ar.customer.master rca=00000 rcm=00000 typ=RSF src=J___________ job=jar100 prg=CAR100
#03 ar.customer.nameadrs.list100 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jar109 prg=CAR100
#04 gl.account.acntlist_ rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100
#05 gl.account.master rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14
#06 gl.account.master2 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6)
#07 gl.account.master_ rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl420 prg=COBOL2
#08 gl.account.master_ rca=00000 rcm=00000 typ=RSF src=J___________ job=jgl900 prg=IEFBR14
#09 gl.account.trans_ rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl211 prg=SORT
#10 py.parms@ppy200s1 rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy200 prg=SORT
#11 py.time.${DAY}.${MONTH}.${YEAR} rca=00000 rcm=00000 typ=RSF src=J___________ job=jpy910 prg=IEFBR14
#12 pytest.payroll.master rca=00200 rcm=00200 typ=ISF src=Jk__________ job=jpy400 prg=IDCAMS key=(0,8)
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The primary datafile info source for the JCL converter is ctl/datajcl51 which was shown on the previous page. There are 5 other sources which are illustrated below. If you don't have them, just create null files so the conversions run OK.
The files shown here were created for the 'mvstest' demos in Part_1. You can see some more realistic examples in Part 4 where we document the procedures for converting YOUR JCL (vs the test/demo JCL).
From the summary on page '3F0' you will know that most of the 6 sources are created in 2 stages. For example LISTCAT info is 1st extracted to ctl/datacat51, which is further processed to ctl/datacat52, which is then combined with the other 5 sources to create ctl/datactl53.
For most of the 5 secondary sources, we will show only the ...51 file. The main difference is that the ...52 files are converted from mainframe standards to VU ksh script standards (lowercase, &symbols to ${SYMBOLS}, etc).
PY.PAYROLL.MASTER rca=00128 rcm=00239 typ=IDXf8v cntr=15946788 src=__Lk________ key=(0000,0016) PY.TIME.CARDS rca=00080 rcm=00080 typ=RSF cntr=00000102 src=__Lr________ PYTEST.PAYROLL.MASTER rca=00256 rcm=00384 typ=IDXf8v cntr=00000537 src=__Lk________ key=(0010,0022) PYTEST.PAYROLL.MASTER2 rca=00128 rcm=00256 typ=IDXf8v cntr=00006597 src=__Lk________ key=(0000,0011)
py.payroll.master rca=00128 rcm=00239 typ=IDXf8v src=__Lk________ key=(0000,0016) py.time.cards rca=00080 rcm=00080 typ=RSF src=__Lr________ pytest.payroll.master rca=00256 rcm=00384 typ=IDXf8v src=__Lk________ key=(0010,0022) pytest.payroll.master2 rca=00128 rcm=00256 typ=IDXf8v src=__Lk________ key=(0000,0011)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
AR.CUSTOMER.MASTER cpy=____________ rca=00256 rcm=00256 src=____Xr______ PY.PAYROLL.MASTER cpy=____________ rca=00320 rcm=00320 src=____Xr______ PY.TIME.CARDS cpy=____________ rca=00088 rcm=00088 src=____Xr______ PYTEST.PAYROLL.MASTER cpy=____________ rca=00384 rcm=00384 src=____Xr______
AR.ACCOUNT.MASTER src=______Yi____ prg=IKJEFT01 GL.ACCOUNT.MASTER src=______Yi____ prg=PDM00800
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
py.payroll.master rca=00249 rcm=00249 typ=ISF key=(0,22) py.time.cards_ rca=00080 rcm=00080 typ=RSF
gl.account.trans_000001 src=__________A_ ar.customer.master src=__________Ap gl.account.acntlist_000001 src=__________Ap ar.nameadrs.list100 src=__________Ap
ar.customer.master src=__________Ap ar.nameadrs.list100 src=__________Ab gl.account.acntlist_ src=__________Ap gl.account.trans_ src=__________A_
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#02 ar.customer.master rca=00256 rcm=00256 typ=RSF src=J___Xr____Ap job=jar100 prg=CAR100
#03 ar.customer.nameadrs.list100 rca=00133 rcm=00133 typ=RSF src=Jr________Ap job=jar109 prg=CAR100
#04 gl.account.acntlist_ rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100
#05 gl.account.master rca=_____ rcm=_____ typ=RSF src=J___________ job=jgl900 prg=IEFBR14
#06 gl.account.master2 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6)
#07 gl.account.master_ rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl900 prg=COBOL24
#08 gl.account.trans_ rca=00080 rcm=00080 typ=RSF src=Jr__________ job=isrsupc1 prg=SORTUPC
#09 py.parms@ppy200s1 rca=_____ rcm=_____ typ=RSF src=J___________ job=jpy200 prg=SORT
#10 py.time.${DAY}.${MONTH}.${YEAR} rca=_____ rcm=_____ typ=RSF src=J___________ job=jpy910 prg=IEFBR14
#11 pytest.payroll.master rca=00384 rcm=00384 typ=IDXf8v src=JkLkXr______ job=jpy400 prg=IDCAMS key=(0010,0022)
#02 rca=00256 rcm=00256 typ=RSF src=J___Xr____Ap job=jar100 prg=CAR100 #03 rca=00133 rcm=00133 typ=RSF src=Jr________Ap job=jar109 prg=CAR100 #04 rca=00133 rcm=00133 typ=RSF src=Jr__________ job=jgl100 prg=CGL100 #05 rca=_____ rcm=_____ typ=RSF src=J___________ job=jgl900 prg=IEFBR14 #06 rca=00080 rcm=00080 typ=ISF src=Jk__________ job=jgl360 prg=IDCAMS key=(0,6) #07 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=jgl900 prg=COBOL24 #08 rca=00080 rcm=00080 typ=RSF src=Jr________A_ job=isrsupc1 prg=SORTUPC #09 rca=_____ rcm=_____ typ=RSF src=J___________ job=jpy200 prg=SORT #10 rca=_____ rcm=_____ typ=RSF src=J___________ job=jpy910 prg=IEFBR14 #11 rca=00384 rcm=00384 typ=IDXf8v src=JkLkXr______ job=jpy400 prg=IDCAMS key=(0010,0022)
uvlp14LD ctl/datactl53
======================
jcldata5A all
=============
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| 4A1. | Introduction & Overview |
| 4B1. | Plan Your conversion (vs the 'test/demo' conversions in Part_1) |
| - also see the 25 point preparation summary in uvprices.htm#G1. | |
| - the Vancouver Utilities makes the conversions fast, | |
| - but you must test all JCL/scripts & COBOL programs | |
| - we suggest allowing 6 months to 1 year for the conversion project | |
| - we suggest 4 to 8 weeks of UV Software onsite training | |
| & conversion assistance | |
| - install unix/linux O/S software (Red Hat, SUN, AIX, HP, etc) | |
| - setup userid 'uvadm' for the Vancouver Utilities | |
| - setup userid 'appsadm' (administrator for your applications) |
| 4B2. | Install the Vancouver Utilities |
| 4B3. | Setup the 'profiles' for uvadm, appsadm,& your conversion team members |
| - common_profile, 'rc' files in /home/appsadm/env | |
| - stub_profiles in each user homedir (overwrite .profile or .bash_profile) |
| 4C1. | Design/setup optimum directory structure for Your site |
| - for conversion, testing,& production | |
| - see several alternative designs at ADMjobs.htm#Part_2 |
| 4D1. | Copy Vancouver Utility supplied control files & functions |
| - control files supplied in /home/uvadm/ctl, copy to your $TESTLIBS/ctl/... | |
| (jclunixop51,cobdirectives,extfh.cfg,cnvcob5.tbl) | |
| - functions supplied in /home/uvadm/sfun, copy to your $APPSADM/sfun/... | |
| (jobset51 logmsg1 exportfile,exportgen0,exportgen1,exportgenall,etc) | |
| 4D2. | script to copy supplied control files & functions to your subdirs |
| 4E1. | JCL converter control file options - modify for your site |
| 4E2. | control file search/replace tables for TopNode/subdirs |
| 4E3. | Customize JCL conversion by modifying the control file ctl/jclunixop51 |
| 4E4. | full-PATH or relative-PATH data filenames |
| 4E5. | Running 'statmvsjcl1' to create a table summary of Top-Nodes in your JCL |
| - modify the TOPNODES table to change &/or consolidate topnodes | |
| (which are usually used as sub-directories for data files) | |
| 4E7. | ctl/GDGmkdirs - script to make topnode/subdirs for new generations of GDGs |
| - must be updated with your TopNode/subdirs |
| 4F1. | Transfer JCL, COBOL,& DATA files from the mainframe for initial testing |
| - suggest zipping all files of the same type | |
| - transfer any PROC's, SLI's, INCLUDE's, Parms, etc | |
| - run LISTCAT on mainframe & transfer to unix to assist datafile convert |
| 4G1. | Convert All COBOL copybooks & All COBOL programs |
| - COBOL conversion is the easiest & it makes sense to do it first | |
| - Initial conversion All programs must be performed as per MVSCOBOL.htm | |
| - script cnvMF51A provided for re-conversions during conversion period |
| 4G2. | Convert 1 COBOL copybook & 1 COBOL program at a time |
| - scripts cnvMF51c & cnvMF51 |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| 4H1. | Create the data conversion control file (ctl/datacnv54) from LISTCAT |
| - record sizes, indexed keys, file types | |
| - need to manually edit the copybook corresponding to each data file |
| 4I1. | Convert Your DATA files (at least enough for some initial testing) |
| - converting DATA before JCL makes sense because the LISTCAT info | |
| is required 1st for DATA conversion & then for JCL conversion | |
| - see complete details in MVSDATA.htm |
| 4I2. | You must follow MVSDATA.htm#Part_4 to generate DATA conversion jobs |
| 4I3. | $CNVDATA subirs required to generate & execute data conversion jobs |
| 4I4. | Re-executing the jobs to convert ALL datafiles (refreshed from mainframe) |
| - may need to do 2 or 3 times during 1 year conversion/test period |
| 4I5. | Copying converted data files to $TESTDATA |
| - creating subdirs for topnodes (using script 'copy2nodes') |
| 4I6. | Convert 1 datafile at a time, in $CNVDATA,& copying to $TESTDATA |
| 4J1. | Initial conversion of All Your JCL (directories involved) |
| 4J2. | Review preparations for conversion (4A1-4F1 above) |
| 4J3. | jcl2ksh51A (do everything script) vs step by step method below (4K1-4K5) |
| 4K1. | step by step conversion |
| cleanup mainframe JCL, PROCs, Parms,& expand PROCs |
| 4K2. | create the JCL conversion data control file from up to 6 sources |
| - info extracted from JCL, LISTCAT, spreadsheets,& edited info | |
| - result loaded to Indexed file ctl/datactl53I accessed by JCL converter |
| 4K5. | final step convert JCL with expanded procs to Korn shell scripts |
| - guided by data control file & JCL converter options file |
| 4L0. | Preparations Required Before you can begin testing/debugging your scripts |
| 4L1. | Create GDG control file (used to get no of generations for GDG files) |
| - see complete details in Part_5. | |
| - could initially create empty Indexed file so you test non-GDG jobs |
| 4L2. | Operating Instructions to create GDG control file |
| 4L3. | Cross References for COBOL & JCL/scripts are a big help for test/debug. |
| Generate & print the cross-references now before you begin test/debug. |
| 4L4. | Job-Flow reports are also a big help for test/debug. |
| - show the datafile I/O from step to step | |
| - generate all reports in subdir jobflow/... & print as needed |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| 4L5. | Extract control cards from JCL to separate files |
| - optional jobs to extract control cards from all JCLs so you can update | |
| them separately form the JCL/scripts. | |
| - control card files are date-stamped to allow updates for future dates. |
| 4M1. | Test/Debug a few JCL/scripts & use this experience to fine tune the |
| JCL/script conversion options & control files. | |
| Aids to assist test/debug of JCL/scripts | |
| 4M2. | 'testdatatinit' script to clear temp files to highlight new files created |
| 4M3. | joblog - capture console log from job being debugged |
| 4M4. | jobstop - activate stepctl51 to stop at begin each step until go/clear |
| 4N1. | Reconvert 1 JCL at a time as you modify & test/debug the scripts |
| - script 'jcl2ksh51' to reconvert 1 JCL |
| 4N2. | Reconvert All JCL to capture fine tuning benefits |
| - script 'jcl2ksh51A' reconverts All jcl0->jcl1->jcl2->jcl3 | |
| - JCL/scripts are copied 1 at a time from the converted subdir (jcl3) | |
| to the active-PATH subdir (jcls) only when programmer ready to test/debug |
| 4N4. | Assign JCLs to various conversion team members for test/debug |
| 4O1. | Aids & Techniques to assist test/debug |
| - set up testdata in your homedir to avoid conflicts with other programmers |
| 4O2. | using uvhd & uvhdcob to display your files with packed & binary fields |
| - uvhd already documented | |
| - uvhdcob displays COBOL copybook fieldnames beside data field contents |
| 4P1. | Determine conversion solutions for 3rd party software such as |
| DITTO, EASYTRIEVE, etc. | |
| The JCL converter does convert SORT, IDCAMS, IEBGENER, and some DITTOs. | |
| An Easytrieve to uvcopy converter is provided for the simpler jobs. | |
| You may have to write COBOL programs for with more complex Easytrieves. |
| 4Q1. | Setup Your backup scripts now to protect your programmers from 'oops' |
| - see several backup scripts in ADMjobs.htm#Part_4 | |
| - setup appsadm 'crontabs' to backup cnvdata, testdata,& testlibs | |
| every night to both tape & disc (see ADMjobs.htm#Part_5 | |
| - can have 1 or 2 days backups on disc for immediate recoveries |
| 4R1. | Setup console logging (essential for production) |
| - programmers can use the 'joblog' script for debugging | |
| - good idea to setup on the test machine to try it out before production |
| 4S1. | Run parallels with mainframe when you have enough JCL/scripts debugged |
| Re-transfer mainframe JCL,COBOL,& DATA a few times during conversion period | |
| Setup the production machine & Go live (over a weekend usually) | |
| Need to re-transfer all data files on the 'Go Live' weekend, but JCL | |
| & programs should not need re-transfer/reconvert at this point |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Part 4 is intended to present a plan for you to follow in converting 'YOUR' JCL (vs the test/demo conversions illustrated in Part_1.
Your JCL conversion will be the primary focus in Part 4, but we will refer you to other parts of the documentation for the many other procedures required to make the entire conversion successful.
In fact this (Part 4 of MVSJCL.doc) is probably your best roadmap to follow when planning & executing your conversion.
Note that you must follow the step by step method for your 'first' conversion of all JCL, but for subsequent conversion you may use the handy scripts provided to convert all JCL with 1 command.
Part 4 also gives the operating instructions for the scripts to re-convert All COBOL,& DATA files, but you must use the step by step method for the 'first' conversions as documented in MVSCOBOL.htm & MVSDATA.htm.
Before you dig into this very detailed conversion plan, I recommend you review the very concise '25 point preparation plan' presented in uvprices.htm#G1.
Also review the 'optional conversions' described at uvprices.htm#K0.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Part 4 is intended to present a plan for you to follow in converting 'YOUR' JCL (vs the test/demo conversions illustrated in Part_1.
The Vancouver Utilities makes the conversions fast. But since you must test all JCL/scripts & COBOL programs, you should allow from 6 months to 1 year for the conversion project.
We recommend having UV Software personnel onsite for training & conversion assistance. We suggest an initial 4 weeks & perhaps another 3 or 4 weeks 2 or 3 months later.
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.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Please see install.htm for detailed instructions to install the Vancouver Utilities from the distribution CD & to compile the C programs on your machine.
The profiles are supplied in /home/appsadm/env/... & consist of multiple parts.
See the profiles listed begining at ADMjobs.htm#1B1
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Profiles are split to 2 parts (stub_profile & common_profile). Profiles are supplied in /home/uvadm/env/... but should be copied to /home/appsadm/env/... & modified there depending on site requirements.
Note that the 'stub_profile' is copied to each users homedir & renamed as .bash_profile for Linux & .profile for unix. You must then modify the stub_profile definitions of RUNLIBS & RUNDATA depending on whether the user is a programmer or an operator.
Please see the profile listings at ADMjobs.htm#1C1 but here are some examples of critical definitions extracted from common_defines & stub_profile.
export TESTLIBS=/p1/apps/testlibs
export TESTDATA=/p1/apps/testdata
export PRODLIBS=/p2/apps/prodlibs
export PRODDATA=/p2/apps/proddata
export CNVDATA=/p4/apps/cnvdata
RUNLIBS, RUNDATA,& CNVDATA are assigned in the .profile or .bash_profile of programmers & operators. see the stub_profile listed at ADMjobs.htm#1C1. stub_profiles should use only the $symbols defined in common_defines.
export RUNLIBS=/p1/apps/testlibs <-- for programmers export RUNDATA=/p1/apps/testdata export CNVDATA=/p1/apps/cnvdata
export RUNLIBS=/p2/apps/prodlibs <-- for operators export RUNDATA=/p2/apps/proddata
export RUNLIBS=$HOME/testlibs <-- for programmers, who wish to test export RUNDATA=$HOME/testdata in their homedir, only for education export CNVDATA=$HOME/cnvdata & exception testing (no development)
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Up to this point the directory design was intended only to test/demo the UV conversion procedures using the supplied JCL & PROCs. In Part_1 we setup our test/demo directories in homedir (mvstest) for convenience & simplicity.
/home :----user1 :----user2 :-----etc- :----mvstest : :----testdata <-- $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/apps/testlibs <-- testlibs/testdata for programmers
export RUNDATA=/p1/apps/testdata
export RUNLIBS=/p2/apps/prodlibs <-- prodlibs/proddata for operators
export RUNDATA=/p2/apps/proddata
/p1, /p2, /p3, /p4 are file system mount points, which could be different on your system, but all our conversion scripts & generated JCL/scripts will work without change, since they all depend on RUNLIBS & RUNDATA, which are defined in the profiles of programmers & operators.
The next few pages will illustrate the details of testlibs/testdata & prodlibs/proddata, and also describe the uses of /p3 for backup/restore, and /p4 for data conversions.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/root /... <-- unix/linux O/S directories /... /home <-- home directories :----user1 :----user2 :----etc--- : /p1/apps <-- /p1 file system mount point :----testlibs - test-libraries & test-data :----testdata /p2/apps <-- /p2 file system mount point :----prodlibs - production-libraries & production-data :----proddata /p3/apps <-- /p3 file system mount point :----backup - backup & restore directories :----restore /p4/apps <-- /p4 file system mount point :----cnvdata - data conversion directories
Note that this file design is the first practical design that you would want to use for your development & production. The earlier test/demos used home directories (/home/mvstest) which should not be used for your development & production because:
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
Please understand the preceding notes about these directory structures.
'--MF--' marks subdirs transferred from your MainFrame for conversion
'--UV--' marks control files & functions supplied by UV Software
/p1/apps :-----testlibs <-- RUNLIBS=$TESTLIBS=/p1/apps/testlibs : :------Csub - C subroutines for COBOL programs : :--MF--cbl0 - your COBOL programs transferred from mainframe : :------cbl1 - cleaned up, cols 1-6 & 73-80 cleared, etc : :------cbl2 - cnvMF5 converts mainframe COBOL to Micro Focus COBOL : :------cbl3 - optional to convert accept sysin to read from a file : :------cbls - copy here (standard source library) before compiling : :------cblst - cobol source listings from compiles : :------cblx - compiled COBOL programs (.int's) : :--MF--cpy0 - for COBOL copybooks : :------cpy1 - cleaned up, cols 1-6 & 73-80 cleared, etc : :------cpy2 - cnvMF5 converts mainframe COBOL to Micro Focus COBOL : :------cpys - copy here (standard copybook library) : :------ditto0 - DITTO jobs from MainFrame : :------ditto1 - DITTO jobs cleaned up : :------dittos - DITTO jobs converted to uvcopy : :------ezt0 - EasyTrieve jobs from MainFrame : :------ezt1 - EasyTrieve jobs cleaned up : :------ezts - EasyTrieve jobs converted to uvcopy : :------ftp - subdir for FTP transfers : :--UV--ctl - conversion control files (jclunixop51, datactl53I) : :------include1 - optional (PROC expansion allows include files) : :--MF--jcl0 - your JCLs transferred from mainframe : :------jcl1 - intermediate conversion 73-80 cleared : :------jcl2 - PROCs expanded from procs : :------jcl3 - JCLs converted to Korn shell scripts : :------jcls - copy here manually 1 by 1 during test/debug : :------jobparmx1 - datacards extracted from JCL/scripts (date-stamped) : :------jobparmx2 - datacards extracted from JCL/scripts (no datestamps) : :------maps - 'cobmaps' record layouts generated from copybooks : :------pf - uvcopy jobs to replace utilities (easytrieve,etc) : :--MF--proc0 - your PROCs transferred from mainframe : :------procs - will be merged with jcl1, output to jcl2 : :------sf - for misc scripts you may wish to write : :------tmp - tmp subdir used by various conversions : :------xref - cross-references (see XREFjobs.htm)
mvslibsdirs <-- script to create above subdirs ===========
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p1/apps :-----testdata <-- RUNDATA=$TESTDATA=/p1/apps/testdata : :-----ar - option to use top-node as subdir : :-----gl : :-----py : :-----ctl - GDG control file : :-----jobctl - for jobstop stop at begin each step for debug : :-----joblog - Job Debug logs stored here (by joblog script) : :-----jobmsgs - progress msgs (step begin, end Normal/AbTerm) : :-----jobparms1 - current datacards from $RUNLIBS/jobparmx1 at 6PM : :-----jobparms2 - datacards from $RUNLIBS/jobparmx2 at 6PM : :-----jobtmp - job temporary files : :-----mstr - could put all datafiles in 1 subdir : :-----pf - user written uvcopy jobs : :-----rpts <-- reports : :-----sf - user written Korn shell scripts : :-----sysout - COBOL DISPLAY upon SYSLST reports : :-----tape <-- tape files reassigned to disc by JCL converter : :-----tmp - misc temp files & sort work files : :-----wrk <-- work files (inter-step)
mvsdatadirs <-- script to create above subdirs ===========
| Note |
|
See page '1X1', if you need to do a quick preliminary conversion of a few of your JCLs before you invest the time & effort that should be expended when you launch your mainframe conversion project.
You could setup the 'testlibs' superdir in a new user homedir or within your own homedir & use script 'mvslibsdirs' to setup the required subdirs. Page '1X2' uses script 'jcl2ksh51A' to perform all steps of JCL conversion.
BUT again, we strongly recommend you follow these detailed procedures in here in Part 4, to perform any serious mainframe conversion project.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| Note |
|
/p1/apps :-----testdata <-- RUNDATA=$TESTDATA=/p1/apps/testdata : :-----ar - option to use top-node as subdir : : :-----customer.master : : :-----sales.items : :-----gl : : :-----account.master : : :-----account.trans : :-----py : : :-----payroll.master : : :-----time.cards : :-----ctl - GDG control file : :-----joblog - Job Debug logs stored here (by joblog script) : :-----jobmsgs - vital/error messages here (date/time stamped) : :-----jobparms1 - current datacards from $RUNLIBS/jobparmx1 at 6PM : :-----jobparms2 - datacards from $RUNLIBS/jobparmx2 at 6PM : :-----jobtmp - job temporary files : : :-----jobname - subdir by jobset51 function : : : :-----S0080_E212540C - for job temp files (SYSINs, GDGs) : :-----mstr - could put all datafiles in 1 subdir : : :-----ar.customer.master (vs using topnode subdir as above) : : :-----ar.sales.items : :-----pf : :-----rpts - reports : : :-----070218 - subdir for today's reports : : :-----070219 - created by function jobset51 on 1st run of day : : : :-----JAR200_S0050_E212540C_074648 : :-----sf : :-----sysout : :-----tape - tape files reassigned to disc by JCL converter : : :-----070218 - subdir for today's tape file outputs : : :-----070219 : :-----tmp : :-----wrk - work files (inter-step)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p2/apps :-----prodlibs <-- RUNLIBS=$PRODLIBS=/p2/apps/prodlibs : :-----cbls - end point for converted COBOL programs : :-----cblst - cobol source listings from compiles : :-----cblx - compiled COBOL programs (.int's) : :-----cpys - converted, ready for compiles : :-----jcl3 - JCLs converted to Korn shell scripts : :-----jcls - copy here manually 1 by 1 during test/debug : :-----jobparmx1 - datacards extracted from JCL/scripts (date-stamped) : :-----jobparmx2 - datacards extracted from JCL/scripts (no datestamps) : :-----pf - uvcopy jobs to replace utilities (easytrieve,etc) : :-----sf - for misc scripts you may wish to write : :-----tmp - tmp subdir used by various conversions
Please compare these production libraries to the conversion & testing libraries on the preceding page. Note that many original mainframe & intermediate conversion subdirs have been dropped, retaining only the fully converted subdirs of COBOL programs, copybooks,& JCL(now Korn shell scripts).
/p2/apps :-----proddata <-- RUNDATA=$PRODDATA=/p2/apps/proddata : :-----ar - option to use top-node as subdir : : :-----customer.master : : :-----sales.items : :-----gl : : :-----account.master : : :-----account.trans : :-----ctl - GDG control file : :-----joblog - Job Debug logs stored here (by joblog script) : :-----jobmsgs - vital/error messages here (date/time stamped) : :-----jobparms1 - current datacards from $RUNLIBS/jobparmx1 at 6PM : :-----jobparms2 - datacards from $RUNLIBS/jobparmx2 at 6PM : :-----jobtmp - job temporary files : : :-----jobname1 - subdir jobname created at job init by jobset51 : :-----mstr - master files (or topnode subdirs as above) : :-----pf : :-----rpts - reports : : :-----070218 - subdir for today's reports : :-----sf : :-----sysout : :-----tape - tape files reassigned to disc by JCL converter : : :-----070218 - subdir for today's tape file outputs : :-----tmp : :-----wrk - work files (inter-step)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p3/apps/backup :-----homedirs <-- $HOMEDIRS backup from last night : :-----appsadm - showing only 1 user to save lines : : :-----ctl & showing only a few subdirs in 1st user : : :-----env : : :-----logs : : :-----... :-----homedirs-1 <-- $HOMEDIRS backup from 2 nights ago : :-----...same as above... :-----proddata <-- $PRODDATA backup from last night : :-----ap : :-----ar : :-----gl : :-----rpts : :-----wrk :-----proddata-1 <-- $PRODDATA backup from 2 nights ago : :-----...same as above... :-----prodlibs <-- $PRODLIBS backups from last night : :-----cbls : :-----cpys : :-----ctl : :-----jcls : :-----parms :-----prodlibs-1 <-- $PRODLIBS backup from 2 nights ago : :-----...same as above... :-----zip <-- last nights backup (only) : :-----homedirs_070529_0301.zip : :-----proddata_070529_0302.zip <-- sample for May 29/2007 : :-----prodlibs_070529_0303.zip : :-----... :-----Day <-- Daily backups in .zip files for last 40 days : :-----homedirs_070419_0301.zip : :-----proddata_070419_0302.zip <-- 40 days ago = April 19/2007 : :-----prodlibs_070419_0303.zip : :-----...(39 sets not shown) :-----Month <-- Monthly backups in .zip files for last 15 months : :-----homedirs_060201_0301.zip : :-----proddata_060201_0302.zip <-- 15 months ago = Feb 1/2006 : :-----prodlibs_060201_0303.zip : :-----...(14 sets not shown) :-----Year <-- Yearly backups in .zip files for last 7 years : :-----homedirs_000501_0301.zip : :-----proddata_000501_0302.zip <-- 7 years ago = Jan 1/2000 : :-----prodlibs_000501_0303.zip : :-----...(6 sets not shown)
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p4/apps :-----cnvdata - $CNVDATA=/tax/cnvdata ($symbol for PATH independence) : :------archive - copy unwanted files here for later deletion : :--MF--cpys <-- COBOL copybooks : :--MF--ctl <-- control files (LISTCAT from the mainframe) : :--MF--d0 <-- data files FTP'd from mainframe (variable length) : :------d0ebc - filenames lower case, '.clus.vseprd' dropped : :------d1ebc - converted to fixed length for conversion : :------d2asc - converted to ASCII (packed/binary preserved) : :------d3ebc - possible convert back to EBCDIC to verify : :------errs - error reports from conversion utilities : :------maps - copybooks converted to record layouts : :------pf - misc uvcopy jobs : :------pfv1 - uvcopy jobs to convert varlth to fixlth : :------pfv2 - copied here for execution : :------pfx1 - uvcopy skeleton jobs generated from 'maps' : :------pfx1a - uvcopy instructions extracted from pfx1 jobs : :------pfx2 - uvcopy jobs completed, datafilenames (vs cpybknms) : :------pfx3 - uvcopy jobs copied here for modify/execute : :------pfx3.bak - backup before regens to recover modified R/T code : :------pfx4 - optional jobs to convert back to EBCDIC for verify : :------sf - misc scripts : :------sfload - scripts to copy/sort/load d2asc/... to $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
The preceding pages have discussed our file design, which might be summarized as follows:
/home <-- home directories :----prgmr1 :----prgmr2 :----oper1 :----oper2 : /p1/apps <---- /p1/apps file system mount point :-----testlibs <-- RUNLIBS=$TESTLIBS=/p1/apps/testlibs : :-----cbls - COBOL programs : :-----jcls - JCL/scripts : :---etc--- - see other subdirs at ADMjobs.htm#2B1 :-----testdata <---- RUNDATA=$TESTDATA=/p1/apps/testdata : :-----mstr - data files (or use topnodes as subdirs) : :-----jobtmp - job temporary files : :---etc--- - see other subdirs at ADMjobs.htm#2B2 : /p2/apps <---- /p2/apps file system mount point :-----prodlibs <-- RUNLIBS=$PRODLIBS=/p2/apps/prodlibs : :-----cbls - COBOL programs (production) : :-----jcls - JCL/scripts (production) : :---etc--- :-----proddata : :-----mstr - data files (or use topnodes as subdirs) : :-----jobtmp - job temporary files : /p3/apps <---- /p3/apps file system mount point :-----backup - backup & restore directories :-----restore : /p4/apps <---- /p4/apps file system mount point :-----cnvdata - data conversion directories : :----d1ebc - EBCDIC data files from mainframe : :----d2asc - converted to ASCII (preserving packed)
export RUNLIBS=/p1/apps/testlibs <-- stub_profile_test for programmers export RUNDATA=/p1/apps/testdata
export RUNLIBS=/p2/apps/prodlibs <-- stub_profile_prod for operators export RUNDATA=/p2/apps/proddata
alias cdl='cd $RUNLIBS' <-- /p1/apps/testlibs(prgmr) or /p2/apps/prodlibs(oprtr) alias cdd='cd $RUNDATA' <-- /p1/apps/testdata(prgmr) or /p2/apps/proddata(oprtr)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
You must copy some control files (supplied with Vancouver Utilities) over to your $TESTLIBS/ctl. Here is a cut-down version of the testlibs dtree shown on page '4C3'. We have omitted most subdirs & to highlight the 'ctl' subdirs.
/p1/apps :-----testlibs <-- RUNLIBS=$TESTLIBS=/p1/apps/testlibs : :-----cbl0 : :-----cpy0 : :--*--ctl <-- control files (cobdirectives,datactl53I,jclunixop51) : :-----jcl0 : : :-----testdata <-- RUNDATA=$TESTDATA=/p1/apps/testdata : :-----ar : :--*--ctl <-- control files (gdgctl53,gdgctl53I.dat,gdgctl53I.idx) : :-----gl : :-----jobtmp : :-----wrk
#1. Login as yourself or appsadm --> your homedir or /home/appsadm
#2. cdl --> $RUNLIBS
#3. mvslibsdirs <-- setup LIBRARY subdirs for JCL & COBOL conversions
=========== - if not already setup (see page '4C3')
#4. cdd --> $RUNDATA
#5. mvsdatadirs <-- setup DATA subdirs for JCL/COBOL executions
=========== - if not already setup (see page '4C3')
#6. copymvsctls <-- copy supplied control files to $TESTLIBS/ctl/...
=========== - see the 'copymvsctls' script listed on the next page:
export FPATH=/home/appsadm/sfun
===============================
#7. cp /home/uvadm/sfun/* /home/appsadm/sfun <-- copy supplied functions
======================================== - required to execute JCL/scripts
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# copymvsctls - copy Vancouver Utility control files & functions # required to convert mainframe JCL & COBOL # - by Owen Townsend, UV Software, Oct 04/2008 # # Run this script after creating testlibs/subdirs for JCL/COBOL conversion # # 1. login <-- login (to your homedir, or as mvstest, or ?) # 2. mvstestdirs <-- setup subdirs required for JCL/COBOL conversion # 3. cdl <-- alias for 'cd $RUNLIBS or 'cd $TESTLIBS' # 4. mvslibsdirs <-- make about 25 subdirs in $RUNLIBS # 5. cdd <-- alias for 'cd $RUNDATA or 'cd $TESTDATA' # 6. mvsdatadirs <-- make about 10 subdirs in $RUNDATA # 7. copymvsctls <-- copy control files & functions for conversion & execution # =========== # # copy control files cp $UV/ctl/cnvcob5.tbl $RUNLIBS/ctl #search/replace table for COBOL cnvrtr cp $UV/ctl/cobdirectives $RUNLIBS/ctl #COBOL DIRECTIVES for compiler cp $UV/ctl/extfh.cfg $RUNLIBS/ctl #COBOL file handler configuration cp $UV/ctl/jclunixop51 $RUNLIBS/ctl #options for JCL to Korn shell converter # cp $UV/ctl/GDGmkdirs $RUNDATA/ctl #script make subdirs for new GDG files # cp $UV/ctl/gdgctl51_sample $RUNDATA/ctl #sample GDG ctlfile, regen/customize #Apr16/09 - GDG control files moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/... # to allow multiple $RUNDATA's to have different control files # #Feb18/11 - following disabled # cp $UV/ctl/jclperlop61 $RUNLIBS/ctl #options for JCL to Perl converter # cp $UV/sfun/* sfun # copy ksh functions, disabled Nov12/2010 #Nov12/2010 - functions now in $APPSADM/sfun/... # ------ function descriptions -------- # jobset51 - job init for insert at begin JCL/scripts # jobend51 - job end copy new GDGs from jobtmp to subdirs # jobabend51 - job ABend, ERRmsg & warn new GDGs not updated # logcron1 - console msg for scripts run by cron (date/time stamped) # logmsg1 - console msg (date/time stamp) # logmsg2 - console msg (date/time stamp) reverse video # exportfile - exports Logicalname=Physicalname (non GDG) # exportgen0 - exports for GDG file - current generation # or prior generation, -1, -2, etc # exportgen1 - exports for next generation, +2, +3, etc # stepctl51 - step ctl function for jcpause exit 0
'exportfile' & 'exportgen_' fucntions are vital to JCL conversion. See descriptions & listings starting in 'Part_5'. The JCL converter converts 'DD's to exportfile or exportgen, for example:
exportfile E212653 $MSTR/e2121653.mtaxe.piscines
exportgen0 0 E212044 $TAPE/tu.f01.e212-no.auxtxj_
When the JCL/scripts are executed, the export... functions will be called via the Korn shell 'FPATH' variable which is defined in the profile as $APPSADM/sfun.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are the 1st 50 lines from the JCL converter control file listed on '3E1'. You must review & modify these options appropriately for your site.
jclunixop51:a1b2c0d3e2f3g1i1j0k3l50m4n3o0p0r0s0t1u1v0w0x0y1z0 #<-- options # ================================================= # a1 - append 1 on COBOL reserved word DDNAMES # b1 - generate blank line between steps # b2 - insert stepctl51 (mandatory as of Feb08/12) # c1 - program names UPPER case # c2 - filenames UPPER case (also uop=l2 jcldata52) # c4 - control card modulenames UPPER case # d1 - drop DDNAMES that begin/end with LOAD/LIB # d2 - drop DSNAMES that begin/end with load/lib # e1 - echo run command to test script w/o programs # e2 - option '-v' on cp & mv echo to console log # f1 - copy FTP commands from lib module to instream # f2 - use FTP option '-u' to inhibit authorization # g0 - create new GDG's in $RUNDATA/subdir/gdgfile_ # g1 - new GDGs $JGDG relative move to subdir/ at EOJ # g2 - new GDGs $JGDG absolute $RUNDATA/jobtmp/... # i1 - use datactl53I Indexed file for recsz,keys,etc # i0 - will try to load datactl53I into memory table # j1 - generate cmd line for JAVA (vs COBOL) # j2 - include -DDDNAME=$DDNAME for each file in step # j4 - special convert IKJEFT01, see MVSJCL.doc # k1 - FTP: insert 'open' prior to 1st line if IP# # k2 - FTP: insert 'user' prior 1st word if not cmd # l50 - limit SYSIN/SYSTSIN lines shown in script # m0 - generate exportfile modules original filename # m1 - redirect modules to $RUNDATA vs $RUNLIBS dflt # m2 - redirect SYSIN modules to $RUN____/parms/... # m4 - redirect ALL modules to $RUN____/parms/... # m8 - show original filename prior to $RUN____/parms # n0 - unrecognized JCL passed thru as is # n1 - unrecognized JCL cmntd out with '#?' cols 1-2 # n2 - if any '=' present, convert any ','s to ';'s # n3 - if n2 & no '=', cmnt out with '#?' cols 1-2 # n4 - convert unrecognized JCL to instream data # o1 - remove 1st segment of DDName overrides # p1 - append parm data on COBOL execution command # r0 - gen cobrun, executes .int's & allows animation # r1 - gen runw for .ints NetExpress/Windows # r2 - assume executable programs either unix/windows # r4 - assume executables in PATH (progname only) # r8 - generate 'findexec' Multi-Level program search # r16 - generate 'unikixvsam $RLX/COBOLX' # r32 - generate Natural call (natsec batch ...) # s1 - convert SORT for SYNCSORT (not uvsort) # t1 - disabled, see TOPNODE table & TOPDIRINSERT # u1 - use uvcp for IEBGENER/IDCAMS REPRO (vs cp) # u2 - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 # v1 - inhibit DELETE via IDCAMS DELETE # v2 - inhibit DELETE via DISP=(OLD/SHR/MOD,DELETE, # w1 - generate 'unikixbld -i -d $KIXDATA/filename' # w2 - insert $RUNDATA on exportfile/gen for unikix # x# - make all indexed output files IDXf# (1,3,4,8) # y1 - generate oprtr prompt to acknowledge Abterms # z1 - custom for DST, make topnode $SYMBOL no/sep
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are lines 106-133 extracted from ctl/jclunixop51 (listed on page '3E1').
:CTLTBL: TOPDIRDEFAULT~~~~~~~~~~~~~~~~~$WRK~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINSERT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # TOPDIRDEFAULT - inserted if only 1 node (no High Level Qualifier) in DSN # - recommend '$WRK' or 'wrk' (1 node files likely temp files) # TOPDIRINSERT - if specified, will be inserted above HLQ, retaining all '.'s # (some sites code this as 'mstr') # - if NOT specified, the existing top-node is used as a subdir within $RUNDATA # - could use TOPNODES to convert any unwanted HLQs as desired # - could use FILEREP1 table to convert multiple nodes as desired # #------------------------ TOPNODES table ------------------------------ # table of TOPNODES allowed & replacements (optional) # 01-30 - topnodes allowed # 31-60 - topnode replacements (if col 31 not '~') # - if 01-30 of last entry 'ALLOTHER', any others replaced by 31-60 # - use statmvsjcl1 to create summary table of topnodes used in all JCL # - see www.uvsoftware.ca/mvsjcl.htm#6A2 # - code in lower case since applied at output time(script) vs input(JCL) :TOPNODES: ar~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ py~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rpts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #Note1 - you must also code valid top-nodes in $RUNLIBS/ctl/GDGmkdirs # - called by jobset51 to setup subdirs for new generations of GDG files # - see listing at MVSJCL.htm#4E5
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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/mvstest/testlibs/ctl/... If you performed the demos in Part_1, you would have setup user 'mvstest' & the demo files would now be in /home/mvstest/testlibs/ctl/... ($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/apps/testlibs/..., but you can place them wherever desired.
Topnode validation & subdir assignment is controlled by the :CTLTBL: & :TOPNODES: tables within the JCL converter control file (ctl/jclunixop51).
The supplied tables reflect the test/demos in Part_1 (using top-node/subdirs ar, gl, py). You should modify the :TOPNODES: table for your valid top-nodes.
You should code your most common top-nodes in the :TOPNODES: (allowed) table & all other (low volume) will be combined into a 'misc' directory.
You must also code your valid topnodes in the '$RUNLIBS/ctl/GDGmkdirs' script, listed on the page '4E5'.
| Note |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 (in ctl/jclunix41) are related to the above discussion.
| option g0 |
|
| option g1 |
|
| option g2 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
You can determine the topnodes used by your JCL, using the 'statmvsjcl1' job. See the demo summary table output listed below. Here are the concise operating instructions for your JCL.
This assumes that the JCL has been FTP'd into $TESTLIBS/jcl0/..., that the PROCs have been FTP'd into $TESTLIBS/proc0/..., and that $RUNLIBS & 'cdl' are defined in your profiles for your $TESTLIBS vs demo testlibs used for mvstest in Part_1.
1. Login --> your home directory
=====
2. cdl alias --> your TESTLIBS/RUNLIBS
===
3. jcl2ksh51A all <-- run partial conversion
============= - enough to expand the JCL/PROCs into $TESTLIBS/jcl2/...
- see jcl2ksh51A documented on pages '4J1' - 4J3
3. uvcopy statmvsjcl1,fild1=jcl2
=============================
- create summary tables for programs,procs,& topnodes
- just the 'topnodes' table listed below
(see programs & procs tables at CNVaids.htm#4B1)
statmvsjcl1 2008/08/08_20:03:18 Summary table of DSN Top-Nodes in jcl0
tbl#003 pg#001 -argument-
line# count % Top-Node
1 27 19 &&(ALLTempFiles)
2 33 23 AR
3 57 41 GL
4 10 7 PY
5 2 1 RPTS
6 3 2 WRK
7 1 0 WRK(IKJDEMO1)
138*100 *TOTAL*
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
5a. vi ctl/jclunixop51 <-- edit the JCL conversion control field
================== - replace demo topnodes with your topnodes
6a. vi ctl/GDGmkdirs <-- edit supplied GDGmkdirs script
================ - replace demo topnode/subdirs with yours
See the GDGmkdirs script listed on the next page --->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
'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 new versions of GDG files
# saved in jobtmp/subdirs/... until Normal EOJ
# - by Owen Townsend, UV Software, Aug 25/2008
#
#Apr16/2009 - this script moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/
# - to allow multiple $RUNDATA's to have different GDG controls
#
# script in $RUNDATA/ctl/... called by jobset51 (called by all JCL/scripts)
# exportgen1 creates new GDG files in $RUNDATA/$JGDG/subdirs/...
# - where: JGDG=$RUNDATA/jobtmp/$JOBID2/GDG/
# - at normal EOJ, GDG files are moved to intended subdirs (NOT if Abterm)
#
# user must code names of his site's data file subdirs here
# - matching the TOPNODEs table in $RUNLIBS/ctl/jclunixop51
# - following subdirs are for the demo JCL/scripts
# (at www.uvsoftware.ca/mvsjcl.htm#Part_1)
#
#Mar14/09 - JCL converter option g1 inserts $JGDG/... on new GDGs exportgen1
# - new option 'g0' omits $GDG/ so new GDGs in same subdir as old
# - this GDGmkdirs script must still exist (since called by jobset51)
# BUT, subdirs created will not be used, since no files redirected to $JGDG/
#
if [[ ! -d $JTMP ]]; then
echo "JTMP not defined or not in \$RUNDATA"; exit 81; fi
#
# make $JGDG/ for gdg subdirs
# also make $GTMP/ for exportgen0/1 'ls' outputs to determine latest gen#s
if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi
if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi
#
# You MUST modify following (ar,gl,etc) to the subdirs desired at your site
#==========================================================================
if [[ ! -d $JGDG/ar ]]; then mkdir $JGDG/ar; fi
if [[ ! -d $JGDG/gl ]]; then mkdir $JGDG/gl; fi
if [[ ! -d $JGDG/py ]]; then mkdir $JGDG/py; fi
if [[ ! -d $JGDG/mstr ]]; then mkdir $JGDG/mstr; fi
if [[ ! -d $JGDG/misc ]]; then mkdir $JGDG/misc; fi
if [[ ! -d $JGDG/tape ]]; then mkdir $JGDG/tape; fi
exit 0
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
I assume you will have FTP connections from the mainframe to unix/linux. Please see page '4C4' for the recommended directory design to receive the libraries onto the unix/linux system. By convention the directories receiving the mainframe modules have suffix '0', intermediate conversions have suffix 1,2,3,etc, and fully converted directories have suffix 's'. Only the '0' subdirs are shown here.
If possible create .zip files on the mainframe. You might name them cbl.zip, cpy.zip, jcl.zip, proc.zip, etc. FTP them into the appropriate subdirs. Then change into each subdir, unzip & remove the .zip file.
/p1/apps
:-----testlibs <-- RUNLIBS=$TESTLIBS=/p1/apps/testlibs
: :------
: :--MF--cbl0 <-- your COBOL programs transferred from mainframe
: :------
: :--MF--cpy0 <-- for COBOL copybooks
: :------
: :--MF--jcl0 <-- your JCLs transferred from mainframe
: :------
: :--MF--proc0 <-- your PROCs transferred from mainframe
: :------
'--MF--' - 'MF' indicates subdirs receiving from 'MainFrame'
/p4/apps :-----cnvdata <-- $CNVDATA=/p4/apps/cnvdata : :------ : :--MF--cpys <-- COBOL copybooks : :--MF--ctl <-- control files (LISTCAT) : :--MF--d0 <-- data files FTP'd from mainframe (variable length) : :------d0ebc - filenames lower case, '.clus.vseprd' dropped : :------d1ebc - converted to fixed length for conversion : :------d2asc - converted to ASCII (packed/binary preserved) : :------maps - copybooks converted to record layouts : :------pfx1 - uvcopy jobs generated from copybooks : :------.etc. - see other subdirs on page '4C7'
'd0' will hold the data files to be converted.
If possible, create LISTCAT reports on the mainframe & transfer to ctl/listcat0. We will extract record-sizes, indexed keys, etc to guide us in datafile & JCL conversions. See LISTCAT processing on page '4H1'.
The 'copybooks' are used to generate the 'uvcopy jobs' that perform the datafile conversions. Copybooks might be stored directly into $CNVDATA/cpys (to assist datafile conversion), but better if you 1st convert in $TESTLIBS (as instructed on page '4G1') & then copy from $TESTLIBS/cpys to $CNVDATA/cpys.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
COBOL conversion is covered here in the JCL conversion documentation to make this a complete review of all steps required for the several 'Re-Conversions' that may be performed during the mainframe conversion period.
But for your 1st COBOL conversions, you must follow the procedures documented in MVSCOBOL.htm. Initial conversions & compiles usually encounter many errors that can be resolved by modifying the search/replace tables provided for reserved word differences & customer site coding peculiarities.
Here in MVSJCL.doc we are summarizing the COBOL re-conversions, that might be performed 2 or 3 times during the conversion/test/debug period, to capture updates that have been made on the mainframe.
cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys
cleanup convert copy(cp)
#0a. Login as appsadm ---> /home/appsadm
#0b. cdl --> $TESTLIBS
#1. cnvMF51Ac 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
=======================
cbl0 -------> cbl1 -------> cbl2 --------> cbl3 ----------> cbls -------> cblx
cleanup convert copy(cp) sysin cnvt compile
#1. cnvMF51A all <-- convert ALL programs from cbl0 to cbl1 & cbl2
===========
#2. cp cbl3/* cbls <-- copy converted programs to cbls (used by compiler)
==============
#4. mfcblA all <-- recompile all cobol programs, cbls --> cblx
==========
#5. uvlpd1p cblx .err <-- print 1st page of all .err reports
================= - to guide programmers making corrections
- should be very few on these re-conversions
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are some handy scripts you can use to re-convert & re-compile 1 copybook or 1 COBOL program at a time (vs prior page ALL copybooks & ALL programs). The scripts are supplied in /home/uvadm/sf/IBM/... & are listed in MVSCOBOL.htm#5C1.
cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys
cleanup convert copy(cp)
#0a. Login as appsadm or yourself
#0b. cdl --> $TESTLIBS
#1. cnvMF51c 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
cbl0 -------> cbl1 -------> cbl2 ------> cbl3 ------> cbls ------> cblx
cleanup convert acpt cnv --- prompt for copy & compile ---
copy(cp) compile
#1. cnvMF51 cbl0/progname.cbl - convert 1 program cbl0->cbl1->cbl2->cbl3
========================= (prompts to copy cbl3->cbls)
#2. cp cbl3/progname.cbl cbls - copy cnvrtd program to cbls
========================= (if you replied`'n' above)
#3. mfcbl1 progname.cbl - recompile 1 cobol program cbls-->cblx
===================
#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
We assume the LISTCAT report has been transferred from the mainframe & stored at $CNVDATA/ctl/listcat0. 'catdata51' will extract filenames, avg-recsize, max-recsize, indexed key start(lth) onto 1 line per file.
Initial data conversions must be performed as instructed in MVSDATA.htm. Here in MVSJCL.doc, we are covering 'Re-Conversion', because you might reconvert all JCL,COBOL,DATA 2 or 3 times during conversion period
You will not recreate the DATA conversion control file ($CNVDATA/ctl/datacnv54), because it required manual editing to add copybook names.
But you might want to recreate the 'JCL conversion control file' ($TESTLIBS/ctl/datactl53I), because a newer LISTCAT from the mainframe might provide more accurate information on the datafiles for the JCL converter.
#1a. Login as appsadm ---> /home/appsadm
#1b. cdc --> $CNVDATA
#2. uvcopy catdata51,fili1=ctl/listcat0,filo1=ctl/datacat51
=======================================================
- extract data conversion info from mainframe LISTCAT report
#3. sort -o ctl/datacat52 ctl/datacat51
===================================
- sort by data file name, see sample listing on page '3F2'
- see full listing at MVSDATA.htm#8B1.
#4. uvlp12 ctl/datacat52 <-- list the output file
====================
#5. vi ctl/datacat52 <-- edit the datacat52 extract
================
- drop unwanted files (not required for conversion)
- add any missing files (not on disc when LISTCAT run)
#6. uvlp12 ctl/datacat52 <-- re-list the datacat52 extract report
====================
- store in 3 ring binder for frequent reference during conversion
#7. cp ctl/datacat52 $TESTLIBS/ctl
==============================
- copy datacat52 from $CNVDATA to $TESTLIBS for later use in JCL conversion
- see page '4K1' to create JCL conversion control file ctl/datactl53I
from up to 6 sources (JCL itself, LISTCAT, spreadsheets, edited info)
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
DATA conversion is covered here in the JCL conversion documentation to make this a complete review of all steps required for the several 'Re-Conversions' that may be performed during the mainframe conversion period.
The mainframe data files might be re-transferred & reconverted 2 or 3 times during the test/debug period, & of course 1 final time on the 'go live' weekend.
For your 1st DATA file conversions, you must follow the procedures documented in MVSDATA.htm. MVSDATA.doc shows you how to generate the data conversion 'uvcopy jobs' from the COBOL copybooks. This can be completely automatic, unless you have files with multiple record types, in which case some manual coding is required.
For subsequent DATA file conversions, you can use the data conversion uvcopy jobs that were generated (& modified) during the initial conversion. You may need changes to some jobs if the mainframe copybooks change during the conversion period.
Here in MVSJCL.doc, we will briefly review how to re-convert datafiles, assuming the data conversion jobs have already been generated as documented in MVSDATA.htm#Part_4. You can use the data re-convert instructions when you re-transfer data files from the mainframe, which you might do several times during the testing period.
BUT, if you change any copybooks (from which data conversion jobs are generated) or the control file ctl/datacnv54I (which relates copybooks to datafilenames & provides file types & keys), then you must refer to MVSDATA.htm#PART_4 to re-generate the data conversion 'uvcopy jobs' in $CNVDATA/pfx3.
| Note |
|
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p4/apps/cnvdata/ <-- Data conversion superdir ($CNVDATA) :-----cpys - COBOL copybooks :-----ctl - conversion control files :-----maps - 'cobmaps' record layouts generated from copybooks :-----pfx1 - conversion jobs generated from COBOL copybooks by 'uvdata51' :-----pfx2 - conversion jobs with actual datafile names & indexed keys : - coded by utility 'uvdata52' using control file ctl/datacnv54I :-----pfx3 - uvcopy jobs copied from pfx2 & modified for various reasons : - for Multi Record Type files (insert code to test types) : - will execute the jobs from pfx3
cpys ---------> maps ---------> pfx1 ---------> pfx2 ----------> pfx3/...
cobmap1 uvdata51 uvdata52 cp & vi (data cnvt jobs)
(ctl file req'd)
The data conversion jobs are generated from the COBOL copybooks, but we also need a control file to relate the copybooks to the datafilenames, and also to supply file types, indexed keys, etc.
The mainframe 'LISTCAT' report is the best place to get this information. We can transfer the mainframe file & extract the information into a control file used in the conversion job generations. See procedures at MVSDATA.htm#4E1 thru page 4F6.
mainframe unix/linux
LISTCAT -----> ctl/listcat0 ---------> ctl/datacat51 ----------> ctl/datacnv54I
FTP catdata51 (many steps omitted)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p4/apps/cnvdata/ <-- Data conversion superdir ($CNVDATA)
:-----cpys - COBOL copybooks :-----ctl - conversion control files :-----maps - 'cobmaps' record layouts generated from copybooks :-----pfx1 - conversion jobs generated from COBOL copybooks by 'uvdata51' :-----pfx2 - conversion jobs with actual datafile names & indexed keys :-----pfx3 - uvcopy jobs copied from pfx2 & modified for multi R/T files : - will execute the uvcopy jobs from pfx3
(in same superdir as above)
:-----d0ebc <-- EBCDIC data files FTP'd from mainframe : :---AR.DATA.FILE1 - filenames UPPER case : :---GL.DATA.FILE1(0) - GDG file suffixes (0), G1234V00, etc : :---GL.DATA.FILE2.G1234V00 - GDG file suffixes (0), G1234V00, etc : :---...etc... :-----d1ebc <-- EBCDIC data filenames changed to unix stds : :---ar.data.file1 - filenames lower case : :---gl.data.file1_000001 - GDG file suffixes changed to VU conventions : :---gl.data.file2_000001 - GDG file suffixes changed to VU conventions : :---...etc... :-----d2asc <-- to receive ASCII conversions : :---ar.data.file1 - ASCII data files from most recent conversion : :---gl.data.file1_000001 - copy from here to refresh testdata subdirs : :---gl.data.file2_000001 - copy from here to refresh testdata subdirs : :---...etc...
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
FTP rename convert copy to TopNode subdirs
mainframe -----> d0ebc-------->d1ebc-------->d2asc------->$TESTDATA/TNsub/...
FTP cpd0d1rename pfx3/jobs copy2nodes
You might need to re-transfer/re-convert data files several times during the testing period. You can use the following 'Execution' Instructions for this, provided you have not changed any copybooks or the control file that relates copybooks to datafilenames & file types, keys,etc.
If you have changed any copybooks or the control file, then you MUST follow the data conversion job 'Generation' Instructions detailed in MVSDATA.htm#Part_4
The following Execution Instructions originate from MVSDATA.htm#4G2.
#00. Transfer (FTP) mainframe DATA files ---> $CNVDATA/d0ebc
#01. cdc ---> alias 'cd $CNVDATA' ---> /home/mvstest/cnvdata for example
============================
#02. ls d0ebc >tmp/ls_d0ebc
======================
- create mainframe filenames to be converted to unix/linux conventions
#03. uvcopy mksfd0d1,fili1=tmp/ls_d0ebc,filo1=sf/cpd0d1rename
========================================================
- make script to copy d0ebc to d1ebc, changing filenames
from mainframe conventions to unix/linux VU standards
GDG filename(0) --> filename_000001, etc
#04. sf/cpd0d1rename <-- execute script to copy/rename
===============
#__. ................ <-- many steps omitted (see MVSDATA.htm#4G2)
================
#23. uvcopyxx 'pfx3/*'
=================
- execute all jobs to convert all files from d1ebc to d2asc
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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. mvsdatadirs <-- 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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The following Execution Instructions originate from MVSDATA.htm#4G2.
#00. Transfer (FTP) mainframe DATA files ---> $CNVDATA/d0ebc
#01. Login as appsadm or yourself
#02. cdc --> alias 'cd $CNVDATA' --> /app/risk/cnvdata for example
===========================
| Note |
|
#03. cp d0ebc/DBDPDW.PDW200.$ADDR.DLY(0) d1ebc/dbdpdw.pdw200._addr.dly_000001
========================================================================
| Note |
|
#10. uvcopy pfx3/dbdpdw.pdw200._addr.dly_000001
==========================================
- execute 1 job to convert 1 file from d1ebc to d2asc
Most mainframe conversion sites choose to use the topnode as a sub-directory on the unix/linux system.
#11. cp d2asc/dbdpdw.pdw200._addr.dly_000001
========================================
$TESTDATA/dbdpdw/pdw200._addr.dly_000001
========================================
- copy 1 converted datafile to $TESTDATA topnode subdir
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
You should perform the initial conversion of All Your JCL, using the step by step method documented in this section. Then you should test/debug 1 or 2 JCL/scripts to verify the conversions.
From the testing & debugging 1 or 2 JCL/scripts you may find improvements that can be made to the JCL converter options file (ctl/jclunixop51) & to the data information file (ctl/datactl53I). After modifying these control files you can reconvert the 1 or 2 JCLs using the 'jcl2ksh51' script (page '4N1')
After you are satisfied with the conversion & testing of 1 or 2 JCL/scripts, you can the use the 'jcl2ksh51A' script to reconvert all JCL/scripts, to realize the improvements in all JCL/scripts.
This works well because automatic conversions stop at jcl3, & we copy JCL/scripts from jcl3 to jcls, only when we are ready to test/debug each JCL/script.
/p1/apps :-----testlibs <-- RUNLIBS=$TESTLIBS=/p1/apps/testlibs : :------ : :--MF--ctl <-- control files : :------ - jclunixop51 specifies options for JCL conversion : :------ - datactl53I supplies file types,recsizes,indexed keys : :------ - datajcl51 (filenames) extracted from all JCL : :------ supplies file info for files missing from datactl53I : :------ (work files scratched, not present for LISTCAT) : :------ - you can edit dataedt52 to override datajcl51 entries : :------ : :--MF--jcl0 <-- your JCLs transferred from mainframe : :------jcl1 - intermediate conversion 73-80 cleared : :------jcl2 - PROCs expanded from procs : :------jcl3 - JCLs converted to Korn shell scripts : :------jcls - copy here manually 1 by 1 during test/debug : :------ : :--MF--proc0 <-- your PROCs transferred from mainframe : :------ : :--MF--slis <-- SLI library may be included in JCLs : :------
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
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.
export RUNLIBS=/p1/apps/testlibs ================================
| Note |
|
#5a. login appsadm --> /home/appsadm
#5b. cd $RUNLIBS <-- change to the conversion superdir '/p1/apps/testlibs'
#5b. cdl <-- same as above but easier
=== alias cdl='cd $RUNLIBS' is defined in the profile
#5c. mvslibsdirs <-- setup 30 subdirs for JCL & COBOL conversions
===========
#6a. copymvsctls <-- script to copy control files from /home/uvadm/ctl
=========== to $RUNLIBS/ctl/...
#7a. vi ctl/jclunixop51 <-- modify JCL converter options
==================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
For your initial conversion we recommend you use the 'step by step' method (starting on page '4K1'), because you can more easily notice any errors.
If you do try the 'do everything' script (jcl2ksh51A), be prepared to revert to the step by step method if you have problems. Or you could activate 'console logging' to capture all screen messages, or you could login from a 'putty' terminal with a large windows history.
#1. Login as appsadm ---> /home/appsadm
#2a. cd $TESTIBS <-- change to the conversion superdir '/p1/apps/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. jcl2ksh51A all <-- convert JCL thru all steps, as illustrated below
============= - reply null (take default) at all prompts
- or reply 'y' for prompts that demand a y/n response
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
cleanup PROC/SLI expand convert to ksh copy 1 at a time
(before test/debug)
| Note |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1a. uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl #<-- cleanup JCL
================================================
#1b. uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.proc #<-- cleanup PROCs
===================================================
#1c. uvcopyx cleanup sli0 slis uop=q0i7g8n1,arg1=.sli #<-- cleanup SLIs
================================================
#1d. uvcopyx cleanup parm0 parms uop=q0i7g8n1 #<-- cleanup parms
========================================
#2. jclpx51 jcl1 jcl2 procs slis
===========================
- expand procs as we copy JCL from subdir jcl1 to subdir jcl2
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
The JCL converter needs an Indexed file 'ctl/datactl53I' to get information about the data-files (record-size, file-type, key-location/length, GDG or not). This info is required for SORTs, IDCAMS, IEBGENER, etc that are converted to uvsort & uvcp.
The mainframe JCL did not necessarily specify record-size etc, since this info could be obtained from the mainframe VTOC or LISTCAT. But there is no VTOC or LISTCAT on unix/linux, so we will supply that info to the JCL converter via an Indexed file (ctl/datactl53I). We can collect datafile info from up to 'six' sources. See detailed descriptions in Part_6 begining on page '6C1'.
The only mandatory source is the JCL itself. Utility job 'jcldata51' will extract all DSN's from all JCL. These are sorted & duplicates dropped resulting in 1 line per unique datafilename found in all JCL.
#3. uvcopy jcldata51,fild1=jcl2,filo2=ctl/datajcl51
===============================================
- generate data info control file for JCL converter
- extract DSNs from all JCL, sort, drop dups
#3a. uvcopy jcldata51 <-- same as above (files default as shown)
================
#4. uvcopy jcldata52,fili1=ctl/datajcl51,filo2=ctl/datajcl52
========================================================
- convert mainframe filenames to conventions used in Korn shell scripts
- translate UPPER case to lower case
- convert any embedded '$' '#' to '_'s
- convert any filename(module) to filename@module
- modify GDG (0), (+1), G0587V00, etc to '_000001'
#4a. uvcopy jcldata52 <-- same as above (files default as shown)
================
Please see sample outputs listed on the next page --->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
DB2.PROD.DWPARM(QUDW33) cntf=0002 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdwkscix prg=DSNUTILB DBDPCSM.CSM781.$CHP14.EFDS.MERGE(+1) cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=csm781m prg=CSM78100 DBDPCSM.CSMUNLK3.$MDBCID.IN.PDW.%%MDY cntf=0005 rca=00147 rcm=00147 typ=RSF src=Jr__________ job=csmunlk3 prg=SORT DBDPDW.DBDFTP.$ABA.MONTHLY(0) cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200 DBDPCSM.CSMSRT.$WELLS.G0587V00 cntf=0001 rca=00753 rcm=00753 typ=RSF src=Jr__________ job=csmwel_1 prg=SYNCSORT DBDPDW.PDW202.$ADDR.USG.WKY(+1) cntf=0001 rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw202p1 prg=PDW20200
db2.prod.dwparm@qudw33 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdwkscix prg=DSNUTILB dbdpcsm.csm781._chp14.efds.merge_ rca=00000 rcm=00000 typ=RSF src=J___________ job=csm781m prg=CSM78100 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY rca=00147 rcm=00147 typ=RSF src=Jr__________ job=csmunlk3 prg=SORT dbdpdw.dbdftp._aba.monthly_ rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200 dbdpdw.dbdftp._aba.monthly_ rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200 dbdpdw.pdw202._addr.usg.wky_ rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw202p1 prg=PDW20200
db2.prod.dwparm@qudw33 cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdwkscix prg=DSNUTIL dbdpcsm.csm781._chp14.efds.merge_ cpy=nasc354.cpy rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdw100pe prg=PDW2100 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY cpy=____________ rca=00147 rcm=00147 typ=RSF src=J___XrYi__D_ job=pdm825mp prg=SORT dbdpdw.dbdftp._aba.monthly_ cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW2020 dbdpdw.dbdftp._aba.monthly_ cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW2020 dbdpdw.pdw202._addr.usg.wky_ cpy=____________ rca=00039 rcm=00039 typ=RSF src=Jr____Yi__Dp job=pdw301p1 prg=PDW2020
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The easy way to create the JCL converter DATA-INFO control file is to use script 'jcldata5A'.
'jcldata5A' creates ctl/datajcl51 & ctl/datajcl52 (shown above) & merges ctl/datajcl52 with 5 other optional sources to create the final result (ctl/datactl53I used by the JCL converter).
The 5 optional information files must have been created before you run script 'jcldata5A' (or 'jcl2ksh51A' which calls jcldata5A & performs all conversions). See Part 6 pages '6C1' thru 6C5 for descriptions of the 5 optional files. You should get the mainframe LISTCAT & create ctl/datacat52 if at all possible.
You can make null files for any of the 5 optional information sources that you do not have. If you had none of the 5 optional files you could create null files as follows. We sequence from #5b to #5f to indicate that the 1st file #5a (ctl/datajcl52) has already been created above.
#5b. >ctl/datacat52 #5c. >ctl/dataxl152 #5d. >ctl/dataxl252 #5e. >ctl/datacnv52 #5f. >ctl/dataedt52
#6. jcldata5A <-- create datajcl51 & datajcl52 & sort 6 files together:
========= (datajcl52+datacat52+dataxl152+dataxl252+dataedt52+datacnv52)
- to create datactl53 & load Indexed file datactl53I
After your 1st conversion, you might notice that some files do not have record sizes (in converted SORTs etc), & you might want to add the record sizes into the control file & reconvert all JCL.
You should not modify ctl/datajcl52 or ctl/datacat52 since any rerun of jcldata5A or LISTCAT reconvert would overwrite your manual changes.
'ctl/dataedt52' is provided for you to code any missing record sizes, file types, etc.
#5f. vi ctl/dataedt52 <-- create ctl/dataedt52 to override file info
================ on matching filenames in ctl/datajcl51
#6. jcldata5A <-- rerun to sort 6 files together & create ctl/datactl53I
=========
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#6. jclxx51 jcl2 jcl3 <-- convert expanded JCL to Korn shell scripts
=================
- JCL converter called for each JCL found in jcl2 & ksh written to jcl3
- uses ctl/datactl53 to get file characteristics (record-sizes,etc)
| Note |
|
Here is the alternative to the above 'step by step' conversion documented on the previous 4 pages. You were advised to use the 'step by step' method for your 1st conversion to better understand & detect errors sooner.
But, do use the 'jcl2ksh51A' script for your subsequent re-conversions after you have proven the conversions work OK at your site.
#1. jcl2ksh51A all <-- convert JCL thru all steps, as illustrated above
============= - reply null (take default) at all prompts
- or reply 'y' for prompts that demand a y/n response
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
cleanup PROC/SLI expand convert to ksh manual copy
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Depending on your site, you may have some initial preparations that must be performed before you can begin testing & debugging your JCL/scripts.
Before you can execute any JCL/scripts, you must create the GDG control file. 'ctl/gdgctl51I' is an Indexed file that is accessed by GDG functions (exportgen0, exportgen1,& gdgupab1) to supply the number of generations for each datafile & also to record a history of the last 14 accesses or errors).
Please study 'Part_5' for complete details, but if you are anxious to run some jobs (that do not contain GDG files), here is the minimum instructions with few explanations.
Utility job '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'.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1a. login mvstest,appsadm,or yourself --> /home/mvstest,appsadm,homedir
#1b. cdl --> $TESTLIBS (/home/mvstest/testlibs, /p1/apps/testlibs, ???)
- see directories,profiles,$RUNLIBS,etc discussed page '1A1' +
#2. [ jcl2ksh51A all ] <-- we assume JCL conversion already completed
================= - left all converted scripts in jcl3/...
#3. uvcopy jcldata56,fild1=jcl3,filo2=ctl/datafiles56
=================================================
#3a. uvcopy jcldata56 <-- same as above (files default as shown above)
================ - sample output shown below
gl/account.master_ gdg=31
gl/account.trans_ gdg=31 opt=c
These samples are based on the test/demo JCLs shown in Part_1 (but most lines removed for this illustration).
#4. cp ctl/datafiles56 $RUNDATA/ctl/gdgctl51
========================================
- copy/rename for GDG control file
| Note |
|
#5. cdd (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata
===
#6. vi ctl/gdgctl51 <-- edit to modify no of generations as desired
=============== - replace any $SYMBOLS with values
(see '5F1', could ignore for early testing)
#7. uvcopy 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
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'.
| xcobcall1 |
|
| xcobcall2 |
|
| xcobcopy1 |
|
| xcobcopy2 |
|
| xcobfile2 |
|
| xcobsql1 |
|
| xcobsql2 |
|
| xjkshfile1 |
|
| xjkshfile2 |
|
| xjkshprog1 |
|
| xjkshprog2 |
|
#1. xrefall cbls jcl3 ksh <-- crossref COBOL & ksh scripts
=====================
#2. uvlpd12D xref <-- print all files in the directory (Duplex)
=============
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
| Note |
|
The VSE JCL converter has an option to #comment out all embedded control cards (for dates, rates, etc) & to create filename references to those records in subdir $RUNDATA/jobparms1 & $RUNDATA/jobparms2.
Utility job 'jobparmx1' is provided to extract the embedded control cards from i JCL/scripts into separate files that can be updated before JCL/scripts are executed.
Control files will have a date-stamp appended (current date at generation time). Run control administrators may duplicate the files & append future dates which will be selected when the current data reaches or passes file dates.
Also see 'jobparms1' which will be run at 6PM (before batch shift) to copy $RUNLIBS/jobparmx1/* to $RUNDATA/jobparms1, selecting the appropriate control card from any multiple dates for any 1 jobname_step_program
See more details in Part_6 (optional procedures) begining on page '6D1'.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The previous section '4J1' - 4K4 documented the initial conversion of All JCL. Now you should test/debug 1 or 2 JCL/scripts to verify the conversions.
From the testing & debugging 1 or 2 JCL/scripts you may find improvements that can be made to the JCL converter options file (ctl/jclunixop51) & to the data information file (ctl/datactl53I). After modifying these control files you can reconvert the 1 or 2 JCLs using the 'jcl2ksh51' script (page '4N1')
After you are satisfied with the conversion & testing of 1 or 2 JCL/scripts, you can the use the 'jcl2ksh51A' script to reconvert all JCL/scripts, to realize the improvements in all JCL/scripts.
This works well because automatic conversions stop at jcl3, & we copy JCL/scripts from jcl3 to jcls, only when we are ready to test/debug each JCL/script.
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
cleanup PROC/SLI expand convert to ksh prompt & copy
We will present the operating instructions for jcl2ksh51 & jcl2ksh51A on page '4N1' & '4N2', but 1st we will remind you of a few aids to assist you in testing & debugging. These & many more aids were 1st presented in 'Part_2'.
2a. joblogA - capture logs And turn on COBOL Animation
- saves having to 'export ANIM=+A' to animate
We will illustrate using these aids as we test/debug JCL/script 28401d23.ksh
28401d23.ksh <-- execute JCL/script to demo debug aids ============
joblog 28401d23.ksh <-- execute & capture log in $TESTLIBS/joblog/28401d23.log ====================
joblogA 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
You can use the 'testdatainit' script before running your JCL/script tests, to clear out any old outputs & enable you to more easily examine the outputs of your current test runs.
You can run testdatainit anytime, if you have changed your profile (as shown above) to redefine 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
: :-----ftp ---
: :-----jobctl 0 <-- '0' marks subdirs cleared by testdatainit
: :-----joblog 0 - Job Debug logs stored here (by joblog script)
: :-----jobmsgs 0 - vital/error messages here (date/time stamped)
: :-----jobparms1 --- SYSIN data cards, originally embedded in JCL
jobparmx1 utility extracts to $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. joblog 28401d23.ksh <-- run JCL/script being test/debugged
===================
#4. llr rpts <-- display report files
======== - 'llr' lists all subdirs & all files in rpts
#5. llr jobtmp <-- display temp/work/inter-step files
==========
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Console logging is highly recommended (especially for production) since it captures everything that happens on the screen, including operator commands & replies to prompts. See console logging activation on page '1U1' & '1U2'.
But until you get console logging activates, you could use the joblog script (provided in /home/uvadm/sf/IBM/...).
These scripts capture the JCL/script screen displays into a file using the unix/linux 'tee' command. The log filename is created by dropping the '.ksh' extension from the jobname & then appending '.log'.
28401d23.ksh <-- execute JCL/script (with no logging) ============
joblog 28401d23.ksh <-- execute & capture log in $TESTLIBS/joblog/28401d23.log ====================
joblogA 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
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)
==============
./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
The JCL converter inserts a call to function 'stepctl51' st the begining of each step. This function normally just calculates StepTimes, but can be activated to stop at the begining of each step (or a specified step) & wait for the operator to enter cont(inue), clear, endok,or endab.
stepctl51 # test oprtr jobstop/jobclear #======== # inserted at begining of each step by JCL converter option 'b2'
Pausing at the begining of each step allows you to investigate the files in data/... & jobtmp/JOBXX/GDG/data/... that might be deleted at the end of the step. Also note JCL converter option 'v3' will #comment out the 'rm's (converted from original 'DELETE's).
#1. Login --> /home/mvstest OR your homedir #2. cdd --> $HOME/testdata
#3. jobstop jobxx.ksh <-- activate stop at begin each step
================= - stores control record in jobctl/jobxx.ctl
#4. joblog jobxx.ksh <-- execute the job
================ - will get following display at begin each step
--> jobxx.ksh paused by job control file: jobctl/jobxx.ctl
- job control record: jobxx.ksh S0000 111125_124512
- waiting until reply 'go' or 'clear'
#5. Login on a 2nd screen --> $HOME #6. cdd --> $HOME/testdata
#7. l data <-- investigate data files on screen#2
======= - while jobxx paused on screen#1
#8. l jobtmp/JOBXX/GDG/data/ <-- investigate GDG files in jobtmp
========================
The 'jobstop' script may also specify the 1st step# to stop (art end of step)
#6a. jobstop jobxx.ksh stop=S0030 <-- store jobctl file with stop step#
============================
#6b. joblog jobxx.ksh <-- execute the job
================ - will stop at end of step S0030
& subsequent steps if you reply 'cont'inue
See 'jobstop' script listed on page '9A6'
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Pages '4J1' - 4K4 documented the initial conversion of All JCL. Then you should test/debug 1 or 2 JCL/scripts to verify the conversions.
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
cleanup PROC/SLI expand convert to ksh prompt & copy
As an example, we will convert 'JAR100', a demo JCL supplied with Vancouver Utilities in /home/uvadm/mvstest/jcl0/JAR100. You can see it listed on page '1C1' & the expected output script on page '1C2'.
#0a. Login as appsadm ---> /home/appsadm
#0b. cdl --> $TESTLIBS
#1. jcl2ksh51 jcl0/JAR100.jcl <-- convert 1 JCL at a time
=========================
#1a. jcl2ksh51 jcl0/28401D23.jcl <-- convert 1 JCL at a time
===========================
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
| '4J1' | - 4K4 documented the initial conversion of all JCL. |
'4M1' suggested test/debug 1 or 2 JCL/scripts & modifying option/control files for optimum results.
We now suggest you reconvert all JCL/scripts, to realize the improvements in all JCL/scripts. You can do this quickly using the 'jcl2ksh51A' script (vs step by step method required on the initial conversion of All JCL).
cleanup jclproc51 jclunix51 cp
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls
cleanup PROC/SLI expand convert to ksh prompt & copy
#0a. Login as appsadm ---> /home/appsadm
#0b. cdl --> $TESTLIBS
#1. jcl2ksh51A all
=============
- convert all JCL from jcl0/... thru several steps to scripts in jcl3/...
- jclunixop51 has options to use ctl/datactl53I to supply file types,
record sizes, Indexed keys, etc
- see more explanations on pages '4K1' - 4K3.
#3. cp jcl3/??? jcls
================
- team members will copy JCL/scripts 1 at a time to jcls/... (in PATH)
just before they are ready to test/debug each script
- this allows us to reconvert anytime to jcl3/... to improve conversions
after updating datactl53 & reloading datactl53I (as shown above)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
#3. newold jcl3 <-- script to 'mv jcl3 jcl3.old' & 'mkdir jcl3'
===========
#4. jclxx51 jcl2 jcl3 <-- reconvert all JCL in jcl2 to ksh in jcl3
=================
#5. alldiff2 jcl3.old jcl3 <-- run alldiff2 script
====================== - saves jcl3.dif in the tmp subdir
#6. uvlp12 tmp/jcl3.dif <-- print the jcl3.dif file
=================== - or vi, more, etc
Here is a sample dif file resulting from updating ctl/datactl53I. We added 'topi=$TAPE2' onto the control file line for data file 'tu.f01.e212801.adrpos'. We then ran uvcopy loadcat3I to reload the indexed file & reconverted all JCL as shown above.
37c37 < exportgen0 0 E211801 $TAPE/tu.f01.e211801.adrpos_ --- > exportgen0 0 E211801 $TAPE2/tu.f01.e211801.adrpos_ diff file# 10 - jcl3.old/... vs jcl3/24599j04.ksh
97c97 < exportgen1 +1 E212990 $TAPE/tu.f01.e211801.adrpos_ --- > exportgen1 +1 E212990 $TAPE2/tu.f01.e211801.adrpos_ diff file# 78 - jcl3.old/... vs jcl3/28401j04.ksh
2 different of 280 files compared jcl3.old to jcl3
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
If you have multiple programmers, you might need to setup the testdata superdir in programmer homedirs to prevent update conflicts.
/p1/apps :-----testdata <-- RUNDATA=$TESTDATA=/p1/apps/testdata : :-----jobctl - for jobstop stop at begin each step for debug : :-----joblog - Job Debug logs stored here (by joblog script) : :-----jobmsgs - progress msgs (step begin, end Normal/AbTerm) : :-----jobparms1 - current datacards from $RUNLIBS/jobparmx1 at 6PM : :-----jobparms2 - datacards from $RUNLIBS/jobparmx2 at 6PM : :-----jobtmp - job temporary files : :-----mstr - master files : :-----rpts - reports : :-----sysout - COBOL DISPLAY upon SYSLST reports : :-----tape - tape files reassigned to disc by JCL converter : :-----tmp - misc temp files & sort work files : :-----wrk - work files (inter-step)
Here is how 'userx' might setup his own testdata superdir, copy all data files, & modify his profile to use the private version of testdata.
#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
| uvhd |
|
| uvhdcob |
|
uvcopy cobmap1,fili1=tf/custmas1,filo1=tmp/custmas1 =================================================== - make the cobmap required from supplied copybook
uvhdcob dat1/custmas1 tmp/custmas1 ==================================
dat1/custmas1 rcsz=256 totrecs=32 current=1 fsiz=8192 fptr=0 cobmapfile=maps/custmas1 today=199911291108 datalastmod=1999112910 rec# 1 fieldname occurs bgn end typ<------ data (hex if typ=p/b) -----> 001 cm-num 0 5 n 130140 002 cm-delete 6 9 003 cm-name 10 34 EVERGREEN MOTORS LTD. 004 cm-adrs 35 59 1815 BOWEN ROAD 005 cm-city 60 75 NANAIMO 006 filler001 76 76 007 cm-prov 77 78 BC 008 filler002 79 79 009 cm-postal 80 89 V9S1H1 010 cm-phone 90 101 604-754-5531 011 cm-contact 102 119 012 cm-thisyr-sales 012 120 124pns 001234567C 013 cm-lastyr-sales 012 180 184pns 001234567D 014 cm-thisyr-xft 240 244pns 4320202020 015 cm-lastyr-xft 245 249pns 2020202020 016 filler003 250 255 null=next,r#=rec,s=search,u=update,p=print,i=iprint,w=write,t=tally,c=checkseq ,e=exit to uvhd, q=quit, ?=help --> q
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1a. Login as yourself --> your homedir
#1b. cdd <-- change to $TESTDATA
#2. uvhdcob mstr/e2121653/mtaxe.piscines.dat $TESTLIBS/maps/e212159b r83
====================================================================
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 -->
We can use the data conversion control file (ctl/datacnv54I) & the 'uvhdc' script to save having to specify the copybook map & to enable running uvhdcob from any location & avoid having to code recsize for indexed files.
#2a. uvhdc mstr/e2121653/mtaxe.piscines
==================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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.
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
Setup Your backup scripts now to protect your programmers from 'oops'. See several backup scripts suggested in ADMjobs.htm#Part_3 (& Part 4).
We recommend setting up 'crontabs' to backup cnvdata, testdata,& testlibs every night to both tape & disc (documented in ADMjobs.htm#Part_5). Those procedures provide 2 days backups on disc for immediate recoveries
The backup scripts & crontabs are stored in the 'appsadm' home directory.
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
This is a VITAL feature to replace the console logging systems provided by proprietary mainframe systems. Console Logging uses the Unix/Linux 'script' command inserted at the end of the profile to create a date/time stamped console log file which captures all console I/O until the operator logs off.
Console log files must be processed (to remove screen control codes) before being viewed or printed & this is accomplished automatically when the user logs off & back on. He may then use the logview script to view or print the latest (or earlier) log file.
See the sample console log created when the conversion test/demo jobs are executed on page '1U3'. See complete details about console logging in ADMjobs.htm#Part_6.
Console logging is activated by uncommenting 4 lines at the end of the supplied profile. See the stub_profile listed at ADMjobs.htm#1C1. You must also setup a subdir in /home/appsadm/log1,2,3 matching your userid.
Console logging should be mandatory for operators, but can be optional for programmers, who can use the 'joblog' script during test/debug.
#1. vi .bash_profile <-- edit your profile
================ - uncomment following 4 lines near end
login1 || exit 2 # exit here if 2nd login
logfixA # process log1 file to log2 (to allow read/print)
echo 'console logging requires aliases to be stored in .bashrc or .kshrc'
exec script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)
#2a. cd /home/appsadm <-- change to appsadm & make subdirs matching userid #2b. mkdir log1/userx <-- make subdir in log1 for current log collection #2c. mkdir log2/userx <-- make subdir in log2 for current month collection #2d. mkdir log3/userx <-- make subdir in log3 for last month history
#3a. exit <-- logoff #3b. Login <-- log back in to activate console logging
#4a. 28401d23.ksh <-- run some of your JCL/scripts
============
#4b. llr rpts <-- list some directories, etc
========
#5. logoff & back on to process console log
(from /home/appsadm/log1/userx/... to log2/userx/...)
#6. logview <-- display your log files
=======
--> 1 <-- enter 1 to view the latest
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| 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' |
| 5C6. | Updating the gdgctl Indexed file directly with 'uvhd'. |
| 5C7. | Updating the gdgctl Indexed file directly with 'vi' (dangerous). |
| 5C9. | Alternate location for the GDG control file ($APPSADM/ctl) |
| 5D1. | Sample JCL/script jgl100.ksh using GDG files |
| 5D2. | GDG logic explained, how we prevent GDG# increments on failed runs |
| 5D3. | Test data files supplied to illustrate GDG processing |
| 5D4. | Op. Instrns. for jgl100.ksh to demo GDG processing - successful run |
| 5D5. | Console log & directory listings after new generation created |
| - new generations (written to jobtmp) MOVED to $RUNDATA/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
| 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
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.
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The indexed control file allows us to provide some significant enhancements that go well beyond the original GDG implementation on the mainframe.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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:
//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.
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
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
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 |
|
| g0 |
|
For g0, you could restart failed jobs at step after failure, else you must remove any new GDGs created up to failure before rerunning.
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
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
The actual GDG control file used by exportgen0,exportgen1,etc is an Indexed file for random lookup by filename, but it is much easier to prepare the contents as a text file (for easy editing).
A sample text file is provided in /home/uvadm/ctl/gdgctl51. You could use this as a guide, add your own filenames & desired generations, then load it into the Indexed GDG control file which is $RUNDATA/ctl/gdgctl51I as follows.
This assumes you have setup a user such as 'mvstest' with profiles,directories,& environmental variables (RUNLIBS & RUNDATA) as described in MVSJCL.htm#Part_1.
If setting up your own directories (vs subdirs copied from /home/uvadm/mvstest) you could use scripts mvslibsdirs & mvsdatadirs as at MVSJCL.htm#4C3 & '4C4' and use script copymvsctls to copy sample control files from /home/uvadm/ctl/ as on MVSJCL.htm#4D1.
#1. login mvstest --> /home/mvstest
#2. cd $RUNDATA --> /home/mvstest/testdata
#3. uvcopy 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
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 0 GLMSTR gl/account.master_ <-- JCL/script coding to define the file ==================================== for the following COBOL program
export GLMSTR=gl/account.master_000005 <-- effective result ======================================
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 ==========================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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.
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
==============================******============================
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
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
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
#1a. login mvstest,appsadm,or yourself --> /home/mvstest,appsadm,homedir
#1b. cdl --> $TESTLIBS (/home/mvstest/testlibs, /p1/apps/testlibs, ???)
- see directories,profiles,$RUNLIBS,etc discussed page '1A1' +
#2. [ jcl2ksh51A all ] <-- we assume JCL conversion already completed
================= - left all converted scripts in jcl3/...
#3. uvcopy 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 |
|
#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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#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
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
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
uvhd ctl/gdgctl51I.dat r2048u <-- execute uvhd to display gdgctl file ============================= - options: r2048=record-size, u=update
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 - - -
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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'
==================================================
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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#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
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
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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The location of the GDG control file is determined by the common_profile (stored at /home/appsadm/env/common_profile & called by .profile or .bash_profile). Here are lines 61-64 of $APPSADM/env/common_profile.
export GDGCTL=$RUNDATA/ctl #<-- default location # export GDGCTL=$APPSADM/ctl #<-- could change to this ? #Mar14/12 - allow gdgctl51I.dat/.idx & GDGmkdirs to be located anywhere # - vs $RUNDATA/ctl, see doc at www.uvsoftware.ca/mvsjcl.htm#5C2
If you have multiple RUNDATA directories you might want to activate 'export GDGCTL=$APPSADM/ctl' & #comment out 'export GDGCTL=$RUNDATA/ctl' so you would have only 1 GDG control file vs multiple.
If you created the GDG control file as instructed on page '5C2', you could now copy the GDG control files to $APPSADM as follows (assuming you are in $RUNDATA).
#1. cp ctl/gdgctl51* $APPSADM/ctl
=============================
- GDG control file created/edited on page '5C2'
#2. cp ctl/GDGmkdirs $APPSADM/ctl
=============================
- script to make GDG subdirs in $RUNDATA/jobtmp/GDG
- previously copied to $RUNDATA/ctl by copymvsctls on page '4D1'
'GDGmkdirs' is also copied to the alternate location, since it is called (in jobset51) using the same path ('$GDGCTL') as for the GDG control file. A sample GDGmkdirs was copied to $RUNDATA/ctl by script 'copymvsctls' on page '4D1'.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 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 0 ACCTMAS gl/account.master_ <--Note4
exportgen1 +1 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
export ACCTMAS=gl/account.master_000003
=======================================
exportgen1 +1 ACTLIST $JTMP/gl/account.acntlist_000004
======================================================
#exportgen1 assign to $JTMP/subdir/file, move to subdir/file at Normal EOJ
| Note |
|
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/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
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 joblog as below
#6a. joblog 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
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
/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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will now cause a run failure & rerun to illustrate that the new generations of GDG files are not stored in the $RUNDATA/subdirs if AbTerm 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 |
|
#6. jgl100.ksh <-- execute JCL/script to demo GDG files
========== - BETTER to use joblog as below
#6a. joblog 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
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
/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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#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
==========
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 111127:131222:JGL100: WARN: files in jobtmp/GDG subdirs (from prior AbTerm ERR?) 111127:131222:JGL100: ---- files in jobtmp/JGL200/GDG/*/* listed below: jobtmp/JGL200/GDG/data/gl.account.acntlist_000005 111127:131222:JGL100: If NO restart by step#, GDG files jobtmp/ will be cleared 111127:131222:JGL100: - allows rerun from begin job with no worry about GDGs 111127:131222:JGL100: If RESTARTing by step#, example--> jobname.ksh step=S0050 111127:131222:JGL100: - GDG files in jobtmp/... will NOT be cleared 111127:131222:JGL100: - will be available to steps after restart step# 111127:131222:JGL100: - will be restored to data/... subdir at JobEnd=Normal 111127:131222:JGL100: enter to continue 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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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)_______ _____ _________ .
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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:
/home/mvstest/testdata :-----gl : :-----account.trans_000001 : :-----account.trans_000002 : :-----account.trans_000003 : :-----account.trans_000004 : :-----account.trans_000005 : : - - - etc - - - : :-----account.trans_000012
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 ========================================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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.
-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 |
|
//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
#!/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
autoload exportfile exportgen0 exportgen1 exportgenall exportgenx
jobset51 # call function for JCL/script initialization
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; #calc StepTimes & check jobstop/goto end
goto
##STEP020 EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND
export PROGID=cgl200
export PARM="$YEAREND"
exportgen0 0 GLMSOLD gl/account.master_
exportgen0 0 GLTRANS gl/account.trans_
exportgen1 +1 GLMSNEW $JGDG/gl/account.master_
#exportgen1 $JGDG/subdir/tempfiles restored to outdir at Normal EOJ
logmsg2 "Executing--> cobrun $ANIM $RLX/cgl200"
#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:20110116 a1b2c0d3e2f3g1i1j0k3l20m4n3o0p0r0s0t1u1w0x0y1z0
#9======================================================================
S9900=A
logmsg2 "JobEnd=AbTerm, 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
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 |
|
#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
#1. jgl220.ksh <-- execute JCL/script to demo GDG files
========== - BETTER to use joblog as below
#1a. joblog jgl220.ksh <-- alternative to capture console log file
=================
#2. vi joblog/jgl220.log <-- view console log
====================
#2b. uvlp12 joblog/jgl220.log <-- OR, print console log
======================== see listing on the next page -->
#3. ls -l 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:
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
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
-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
#1. jgl220.ksh <-- execute JCL/script to demo GDG files
========== - BETTER to use joblog as below
#1a. joblog jgl220.ksh <-- alternative to capture console log file
=================
#2a. vi joblog/jgl220.log <-- view console log
====================
#2b. uvlp12 joblog/jgl220.log <-- OR, print console log
======================== see listing on the next page -->
#3. ls -l 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:
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
-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
#1. jgl220.ksh <-- execute JCL/script to demo GDG files
==========
#1a. joblog jgl220.ksh <-- alternative to capture console log file
=================
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
#1. jgl220.ksh <-- execute JCL/script to demo GDG files
==========
#1a. joblog jgl220.ksh <-- alternative to capture console log file
=================
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
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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
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.
$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
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
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 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
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 0 E212990 tape/tu.f01.e212-no.soldes_
exportgen1 +1 E212991 $JTMP/tape/tu.f01.e212-no.soldav_
---------- lines omitted -----------
....... SORT step .......
# cat > $SYS011 <</*EOD
# SORT FIELDS=(18,6,A),FORMAT=BI,WORK=4
# OPTION FILNM=(E212084,E212990),SORTOUT=020,SORTIN=(014)
# /*EOD
exportfile SORTOUT $E212084
exportfile SORTIN1 $E212990
## EXEC SORT
#3----------------------------------------------------------------------
uxsort "fili1=$SORTIN1,typ=RSF,rcs=354,filo1=$SORTOUT,keys=(17,6,b,a)"
#4----------------------------------------------------------------------
| Note |
|
#3---------------------------------------------------------------------- uxsort "fili1=$E212990,typ=RSF,rcs=354,filo1=$SORTOUT,keys=(17,6,b,a)" #4----------------------------------------------------------------------
## 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
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):
//* 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),...
exportfile SORTIN gl/account.tran1 exportgen1 +1 SORTOUT $JTMP/gl/account.trans_ #<--Note1 #exportgen1 assigns $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 +1 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 0 GLMSOLD gl/account.master_ exportgen1 +1 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
We noticed a problem when converting VSE JCL's with tape files to GDG's.
The VSE JCL carried a comment indication INPUT or OUTPUT, and we added an option to the JCL converter to use the I/O indicator to generate 'exportgen1' for OUTPUT & 'exportgen0' for INPUT. We also coded the tape files in a 'tape/...' subdir.
Using the example on the previous page the write & read back file definitions might be:
exportgen1 +1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)
exportgen0 0 GLTRANS tape/account.trans_ #Note2 (readback on following step)
exportgen1 +1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)
exportgen1 0 GLTRANS $JTMP/tape/account.trans_ #2 (readback on following step)
Correction method #1 is similar to the example on the previous page, resulting for the fact that the mainframe programmer would have coded both files with suffix '(+1)'.
exportgen1 +1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)
exportgen0 0 GLTRANS $JTMP/tape/account.trans_ #2 (readback on following step)
Correction method #2 is to leave the function as 'exportgen0' & simply add the '$JTMP/' prefix onto the file.
Note that the '$JTMP/' directory is honoured by exportgen0, but is ignored by exportgen1 when determining the latest generation within a directory. Function 'exportgen1' will 1st remove any '$JTMP/' prefix before it determines the latest generation, but 'exportgen0' will not.
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| 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
# 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 (0:-50) - determine current generation (highest generation#)
# or any prior generation (-1),(-2),(-3),...(-50)
# exportgen1 (+1:+50) - determine future generations (+1),(+2),(+3),...(+50)
# exportgenall - concatenates all existing generations
# exportfile - non-GDG, 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 **
#
#jan08/11 - 'exportgen0' combines exportgen0,p,q,r to access any existing gen#
# - handles (0),(-1),(-2),...,(-50)
# - also see 'exportgen+' to determine future gen# (+1),(+2),...(+50)
#
#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
#
# ** sample usage illustrated **
#
# gl/account.master_000001
# gl/account.master_000002 <-- assume $RUNDATA contains these files:
# gl/account.master_000003
#
#command: exportgen0 0 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=$APPSADM/sfun #<-- must define FPATH in common_profile
# ========================== - directory holding these ksh functions
#
# ** coding for function exportgen0 **
#
function exportgen0 # function name here must match physical filename
{
if (($# < 3)); then
logmsg2 "ERR: exportgen0 $# requires 3 args: gen#=$1, LFD=$2, LBL=$3"
exit 9; fi
integer gn=$1;
lfd=$2; lbla=$3; # capture args into named variables
if (($gn > 0)); then
logmsg2 "ERR: exportgen0 arg1 gen# $gn must be 0,-1,-2,etc"
exit 9; fi
#
#Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles
# - extract subdir/filename from $RUNDATA/subdir/filename
lbl1=${lbla##*/} # drop large left to get filename
lbl2=${lbla%/*} # drop small right to get $RUNDATA/subdir
lbl3=${lbl2##*/} # drop large left to get subdir
lbl4=$lbl3/$lbl1 # create subdir/filename (to match coding in gdgctl51I)
lbld=$(echo $lbl4 | tr "/" "_") # convert any '/' to '_' in DSNname
# # for filename to hold ls of gdg filenames
#
# verify that filename 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>/dev/null
#
# if no existing files, define ..._000001 filename, warning msg,& early return
if [[ ! -s $lslbls ]]; then # if NO existing files ?
lblgena=${lbla}000001 # create filename for 1st generation
export $lfd=$lblgena # export LFD=lbl of next generation
logmsg2 "ERR: gen0: No existing file, gen_000001 exported, $lfd=$lblgena "
logmsg2 "ERR: gen0: 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=$gn,rop=i63
#===============================================================================
# arg1 = DDN (ex: GLMSTR)
# arg2 = DSN filename key for lookup gdgctl file (ex: gl/account.master_)
# arg3 = gen# desired (0,-1,-2,etc)
# fili1 = $lslbls ls of all matching filenames_* to underscore (+ 6 digits)
# filo2 = $lblxG output file for gdgctl entry (possible override, prior gen#)
# output file has 1 line with 4 fields as follows:
# ===============================
# gen# gdg=... next=... opt=...
# 000004 gdg=15
# 000006 gdg=24 next=000006(000001:000012)070529:235959 opt=c
# ============================================================
# field1 = gen# determined by gdgget52 (Oct18/08 chnaged from filename_gen#)
# field2 = gdg=... no of generations maintained for this file
# field3 = next=... in gdgctl file (not/used except for debug/audit)
# field4 = opt=c from gdgctl file, causes prompt for confirm/change
#Oct18/08 - gdgget52 changed to return just gen# vs filename_gen#
# - exportgen0 changed to concat filename_ + gen#
#
# read the file written by uvcopy, 1 line with 4 fields (as above)
exec 3< $lblxG # open the file
read -u3 genx gens next opts # read 1st 4 fields (4th field options)
exec 3<&- # close file
lblgenx=$lbla$genx # concat filename_ + gen#
#
export $lfd=$lblgenx # export LFD=LBL for selected filename
#===================
#
# get filesize & display results for console log
fsize="";
if [[ $lblgenx == /* ]]; then lblx=$lblgenx; else lblx=$RUNDATA/$lblgenx; fi
## if [[ -f $lblx ]]; then fsize=$(stat -c%s $lblx); fi
#Nov09/10 - SUN unix does not have stat to get filesize
#Nov19/10 - use 'du' as portable way to get filesize
#Oct15/11 - du option 'h' reports in 4K increments (but OK)
du -sh $lblgenx | read fsize dummy
#
logmsg1 "gen$gn $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
# 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 (0:-50) - determine current generation (highest generation#)
# or any prior generation (-1),(-2),(-3),...(-50)
# exportgen1 (+1:+50) - determine future generations (+1),(+2),(+3),...(+50)
# exportgenall - concatenates all existing generations
# exportfile - non-GDG, 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 **
#
#Jan08/11 - arg1 now specifies gen desired +1,+2,+3,etc max 50
#
#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
#
# ** July 2008+ version **
#
# - this version avoids GDG incrementing if job abends
# - does not write new GDG files directly to $RUNDATA/subdirs
# - JCL converter changed to write exportgen1 files to $JTMP
# for move back to $RUNDATA/subdirs by jobend51 at Normal EOJ
# - must modify jobset51 & jobend51 to create required subdirs
#
# - July 2008 version gets gdg=... values from indexed file
# - gdg priority: 1st = arg3 on exportgen1, 2nd = Indexed file
# 3rd = default hard coded in this function (15 as of May 25/07)
# - text file ctl/gdgctl51 created by uvcopy job '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
#
# ** Vital Requirements **
#
# 1. Directory holding these functions must be defined by FPATH (for Korn shell)
# export FPATH=$APPSADM/sfun #<-- in common_profile
# ==========================
#
# ** command format & sample usage **
#
#format: exportgen1 gen DDname DSname [generations] [touch option]
# =========================================================
# - arg1 gen desired +1,+2,etc (as of Jan 2011)
# - arg2 Logical filename
# - arg3 physical filename
# - arg4 generations to maintain (see default below if absent)
# - arg5 option to touch (create new empty file)
#
#example: exportgen1 +1 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 genx; # define next gen# 6 digits Right just, zero fill
typeset integer gensdflt=15; # generations default 15
typeset integer gens=$gensdflt # init gens to gensdflt
integer filecnt=0; integer excess=0; integer lblcnt=0; # clear counters
#
lfd=$2; lbla=$3; # capture args into named variables
gn=$1; # capture gen desired +1,+2,etc (Jan08/11+)
# integer gn=$1; # alternate possible ?
#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 (($# < 3)); then
logmsg2 "ERR: exportgen1 $1 requires 3 args: gen=$1, LFD=$2, lbl=$3"
exit 91; fi
#
# retrieve gdg=.., if specified on arg4 of command line
if [[ "$4" == gdg=* ]]; then gens=${gdg#gdg=}; fi
#
# verify that filename (arg3 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 ${lbl4}000000 ]]; then touch ${lbl4}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>/dev/null
#
# read back file of filenames created by 'ls' above & use last name
exec 3< $lslbls # open file of 'ls' names
while read -u3 lblgenr # read lines of ls filenames
do lblgenh=$lblgenr # save highest generation filename
((filecnt+=1)) # count files for excess delete
done #
exec 3<&- # close file
#
gen0=${lblgenh##*_} # drop filename, capture gen# of last filename
genx=$gen0
((genx+=$gn)) # calc next generation
#
#Sep28/09 - display for DEBUG
## echo "DEBUG1: lbla=$lbla gen0=$gen0 genx=$genx"
## read reply
#
lblgenx=${lbla}${genx} # 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
lblG=$GTMP/${step}G$gn_$lbld # create filename for outfile
#
uvcopy gdgget51,fili1=$lslbls,filo2=$lblG,arg1=$lbl4,arg2=$genx,arg3=$gn,rop=i63
#===============================================================================
gens=$? # capture gdg=... value from return code
#
# verify generations min/max, if invalid set to default
if (($gens<4)) || (($gens>250)); 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 ${lbl4}000000 ]]; then rm -f ${lbl4}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$gn $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
# 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
typeset -RZ4 step="$JSTEP" # capture step# from calling job
if [[ -z "$step" ]]; then step=0000; fi # set 0000 if undefined
#
#Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles
# - extract subdir/filename from $RUNDATA/subdir/filename
lbl2=${lbl1##*/} # drop large left to get filename
lbl3=${lbl1%/*} # drop small right to get $RUNDATA/subdir
lbl4=${lbl3##*/} # drop large left to get subdir
lbla=$lbl4/$lbl2 # create subdir/filename (to match coding in gdgctl51I)
lblc=$(echo $lbla | tr "/" "_") #convert any '/' to '_' in DSNname
# # for use as filename of filenames in $JGDG/gtmp
#
#Jun05/03 - verify that filename (arg2 on call) ends with '_'
if [[ ! "$lbla" == *_ ]]; then
logmsg2 "ERR: gen filenames should end with '_', continue?, need fix?"
read reply; fi
#
cat /dev/null > $lbla
cat ${lbla}[0-9][0-9][0-9][0-9][0-9][0-9] > $lbla 2>$GTMP/${step}GAERR_$lblc
#===========================================================================
#Nov29/11 - redirect stderr to file in gtmp/...
#
export $lfd=$lbla # result export DDNAME=DSNname_
#================
#
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# get filesize & display results for console log
fsize="";
if [[ $lbla == /* ]]; then lblb=$lbla; else lblb=$RUNDATA/$lbla; fi
##if [[ -f $lblb ]]; then fsize=$(stat -c%s $lblb); fi
##Nov09/10 - SUN unix does not have stat to get filesize
logmsg1 "genall: $lfd=$lbla bytes=$fsize"
#=======================================
#
#Aug29/08 - call gdgget52 to add exportgenall 'GA' entry to ctlfile history
# capture all matching GDG filenames into a file for readback to get low#/high#
# - 1st create filename for 'ls' write lslbls=jobtmp/$JOBID2/${JSTEP}I_$lbla
# - with all filenames matching up to the trailing '_'
lslbls=$GTMP/${step}I_$lblc # assign filename for ls write
ls $lbla[0-9][0-9][0-9][0-9][0-9][0-9] >$lslbls 2>/dev/null
#
# call uvcopy job gdgget52 to select control file entry for matching filename
# - from indexed file ctl/gdgctl51I using filename as key
lblxG=$GTMP/${step}GA_$lblc # create filename to be written by uvcopy
#Oct18/08 - remove $RUNDATA/ if present due to option e1 in jclunixop51
lblr=${lbla#$RUNDATA/} # remove $RUNDATA/ for optn e1 jclunixop51
#Note - output file not required for exportgenall (simply adding history)
#
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 = 'GA' indicates All Generations, coded in gdgctl (GDG History file)
# vs codes 00,01-,02-,etc for exportgen0 & 01+,02+,etc for exportgen1
# fili1 = $lslbls ls of all matching filenames_* to underscore (+ 6 digits)
# filo2 = $lblxG output file for gdgctl entry (NOT required for exportgenall)
#
return 0
}
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# exportgenx - function to report error in JCL to script conversion
# - when GDG JCL not as expected
# - see GDG doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5
#
# exportgen0 - current generation (0) & prior (-1),(-2),(-3)
# exportgen1 - future generations not yet existing (+1),(+2),etc
# exportgenx - (this function) errmsg if GDG JCL was not as expected
# exportgenall - concatenates all existing generations
#
# This 'exportgenx' reports an error if script run before manual correction
#
function exportgenx
{
lfd=$1; lbl=$2 # capture args into named variables
logmsg2 "ERR: exportgenx - ERR in JCL to UNIX script conversion"
logmsg2 "- LFD=$lfd, LBL=$lbl."
logmsg2 "- see GDG doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5"
logmsg2 "- correct script $JOBID2 & rerun"
logmsg2 "- enter=continue, or kill job by interrupt (del or ^C)"
read reply # wait for operator to enter or kill
return 9
}
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# exportfile - function to export DDname=DSName for Micro Focus external names
# DDname (logical name in program) = DSName (physical filename)
#
# exportfile CUSTMAS ap/customer.master <-- example of use
# =====================================
#
# export CUSTMAS=ap/customer.master <-- result
# =================================
#
# exportfile - display non-GDG filenames on console (& console-log)
# - also see GDG functions:
# exportgen0 - to determine current generation (0) highest gen#
# exportgen1 - to determine next generation (+1)
#
#Note - functions must be in directory defined by FPATH in profiles as follows:
#
# export FPATH=$APPSADM/sfun
# ==========================
#
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
#Nov09/10 - SUN unix does not have stat to get filesize
#Nov19/10 - use 'du' as portable way to get filesize
if [[ -f $lblc ]]; then du -sh $lblc | read fsize dummy
elif [[ -f $lblc.dat ]]; then du -sh $lblc.dat | read fsize dummy
fi
logmsg1 "file: $lfd=$lbl fsize=$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
# jobset51 - setup environment for UNIX scripts converted from MVS JCL
# - this KORN shell function stored in $APPSADM/sfun
# - see more doc at: www.uvsoftware.ca/mvsjcl.htm
#
# 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/apps/prodlibs #<-- production libraries
# export RUNDATA=/p2/apps/proddata #<-- production Data superdir
#
# - JCL/scripts are found via $RUNLIBS/jcls in the profile PATH
# - COBOL program subdir defined here in jobset51 as '$RUNLIBS/cblx'
# (this allows programs to have same names as JCL/scripts)
#
# ** change history **
#
#Mar14/12 - gdgctl51I & GDGmkdirs located via env-var $GDGCTL vs $RUNDATA
# - common_profile default "export GDGCTL=$RUNDATA/ctl"
# - could change to "export GDGCTL=$APPSADM/ctl"
#Nov27/11 - remove recovergdg code, just WARN re clear if no restart
#Nov25/10 - remove '-i' option from mv below for SUN Solaris
#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 **
#
# See explanations at www.uvsoftware.ca/mvscobol.htm#2E1 - 2E9
# - COBOL converter inserts unixwork1.cpy, unixproc1.cpy,& perform unixproc1
# - unixproc1 reformats $RUNDATE into various date formats for COBOL use
#
function jobset51
{ #Feb07/12 - export lower case of $JOBID2 for start/stop, stepctl51, etc
typeset -l jobid2; jobid2=$JOBID2; export jobid2
#
# Default RUNDATE to system date yyyymmdd, but allow cmd line override
# --> jobname.ksh RUNDATE=20091120 <-- override system date for this job
if [[ -z "$RUNDATE" ]]; then RUNDATE=$(date +%Y%m%d); fi; export RUNDATE
export RUNDTTM=$(date +%y%m%d_%H%M%S)
export YMD=$(date +%y%m%d)
export HMS=$(date +%H%M%S)
#
#Jan25/12 - export HMS in jobset51 for logmsg2
cd $RUNDATA #change to working dir for production (or test)
cdstatus=$? # capture status of cd $RUNDATA
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)
export QJS=$RUNLIBS/qjs # path to access QUIKJOB code (converted to uvcopy)
export EZTS=$RUNLIBS/ezts # path to access EasyTrieve code (cnvrtd to uvcopy)
# - 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
#Nov16/11 - change SYOT to following:
export SYOT=sysout/$RUNDATE
#NOTE - this is ***jobset51***, so above un-comntd & folwng #comntd
# export JTMP=$RUNDATA/jobtmp/$JOBID2
# export RPTS=$RUNDATA/rpts
# export SYOT=$RUNDATA/sysout/$RUNDATE
#
# 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 ctl/nullfile present & empty, for use on DD DUMMY
>ctl/nullfile # ensure present & empty
export NULLFILE=ctl/nullfile
# could use /dev/null, but some unix variants had problems with that
#feb14/10 - changed from wrk/nullfile to ctl/nullfile at Everis
#
# 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
if [[ ! -f $GDGCTL/GDGmkdirs ]]
then logmsg2 "ERR: \$GDGCTL/GDGmkdirs script not found"
logmsg2 "- \$GDGCTL=$GDGCTL undefined in profile or GDGmkdirs absent"
logmsg1 "- enter to exit"; read reply; exit 93; fi
$GDGCTL/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)
#Nov27/11 - recovergdg code removed, saved as sfun/jobset51_recovergdg
lsgdgs=$(ls $JGDG/*/* 2>/dev/null); # capture filenames in GDG/subdirs
if [[ -n "$lsgdgs" ]]; then
logmsg2 "WARN: files in jobtmp/GDG subdirs (from prior AbTerm ERR?)"
logmsg2 "---- files in $JGDG/*/* listed below:"
echo "$lsgdgs"
logmsg2 "If NO restart by step#, GDG files in jobtmp/... will be cleared"
logmsg2 " - allows rerun from begin job with no worry about GDGs"
logmsg2 "If RESTARTing by step#, example--> jobname.ksh start=S0050"
logmsg2 " - GDG files in jobtmp/... will NOT be cleared"
logmsg2 " - will be available to steps after restart step#"
logmsg2 " - will be restored to data/... subdir at JobEnd=Normal"
logmsg2 "enter to continue"
read reply
fi
# initialize step counters
export JSTEP=S0000 XSTEP=0
integer JCC=0 SCC=0 LCC=0;
#
# Allow for RESTART at any step by start=... argument on command line:
# --> jobname.ksh start=S0020 <-- restart at step 2
if [[ -z "$start" ]]; then export start=S0000; fi
if [[ $start != S[0-9][0-9][0-9][0-9] ]]; then
logmsg2 "ERR: start=$start invalid"; exit 94; fi
alias goto="<<${start}=A"
#
if [[ $start != S0000 ]]; then
logmsg2 "WARN: **START** at start=$start";
else
# ensure $JGDG/subdirs exist to hold exportgen1 files until Normal EOJ
# Normal EOJ will move $JGDG/subdir/files back to $RUNDATA/GDG/subdirs
#Note - create user set of subdirs in 2 places, above for file test
# - and here after 'rm -fr $JTMP/*' for non-restart
#Nov16/11 - remov 'rm -fr $SYOT/*' SYOT now sysout/yymmdd/JOBID_step#_DDN
rm -fr $JTMP/*;
if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi
if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi
#
$GDGCTL/GDGmkdirs #<-- make GDG/subdirs for datafile topnodes
#================ - user must code his subdirs in GDGmkdirs
#Mar14/12 - gdgctl51I & GDGmkdirs located via env-var $GDGCTL vs $RUNDATA
# - common_profile default "export GDGCTL=$RUNDATA/ctl"
# - could change to "export GDGCTL=$APPSADM/ctl"
fi
#------------------------------------------------------------------------
#Feb06/12 - add 'stop step' feature
if [[ -n "$stop" ]]; then
if [[ $stop != S[0-9][0-9][0-9][0-9] ]]; then
logmsg2 "ERR: stop=$stop invalid"; exit 95; fi
exec 4>jobctl/$jobid2.ctl
print -u4 "$jobid2.ksh start=$start stop=$stop $(date +%y%m%d_%H%M%S)"
exec 4>&-;
logmsg2 "WARN: **STOP** at: stop=$stop";
fi
#------------------------------------------------------------------------
#Nov24/10 - setup OBSLOGDIR for Old Mutual, #cmt out at UVSI
## export OBSDATE=$(date +%y%m%d)
## export OBSLOGDIR=$RUNDATA/obslog/$OBSDATE
## if [[ ! -d $OBSLOGDIR ]]; then mkdir $OBSLOGDIR; fi
#------------------------------------------------------------------------
# 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 "TESTPROD=$TESTPROD"
logmsg1 "RUNLIBS=$RUNLIBS"
logmsg1 "RUNDATA=$RUNDATA"
logmsg1 "JTMP=$JTMP SYOT=$SYOT"
logmsg1 "RUNDATE=$RUNDATE"
## logmsg1 "OBSLOGDIR=$OBSLOGDIR"
uvtime W1D0 jobbgn # get start time for later elapsed time calc
#Jan26/12 - arg2 filename disabled, no dummy
return 0
}
#----------------------------- end jobset51 -----------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# jobend51 - common function called at Normal EOJ of JCL/scripts
# - by Owen Townsend, UV Software, May 23/2007
# - this KORN shell function stored in $APPSADM/sfun
# - see more doc at: www.uvsoftware.ca/mvsjcl.htm#
# 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 $RUNDATA/ctl/GDGmkdirs to make desired subdirs
#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=$RUNDATA/jobtmp/GDG (jobset51)
# g2 - inserts $JGDG/ on exportgen1 & JGDG=jobtmp/GDG (jobset52)
# - jobend51,jobabend51 did not have to change ($JGDG defined in jobset51/52)
#Nov25/10 - remove '-v' option from 'mv' below for SUN Solaris
#
function jobend51
{
#Jan15/12 - call uvtime option D2 to report elapsed time of last step
uvtime W1D2 steptimes
# report jobtime (July2008 moved into jobend51 to save line in all scripts)
uvtime W1D4 jobtimes NormalEnd
# 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 [[ -n "$lspsd" ]]; then
sd=${psd##*/}
mv -i $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
#==============
# disable any jobctl file for job ending (change name to allow insection)
test -f jobctl/$jobid2.ctl && mv jobctl/$jobid2.ctl jobctl/$jobid2.ctl_old
return 0
}
#------------------------------ end jobend51 ----------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# jobabend51 - function called at Abnormal Termination of JCL/scripts
# - by Owen Townsend, UV Software, June 18/2007
# - ksh function stored in $APPSADM/sfun
# - see doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5
# 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
#
function jobabend51
{
#Jan15/12 - call uvtime option D2 to report elapsed time of last step
uvtime W1D2 steptimes
# report jobtime (July2008 moved into jobabend51 to save line in all scripts)
uvtime W1D4 jobtimes ***AbEnd
#
# 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 [[ -n "$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
# disable any jobctl file for job ending (change name to allow insection)
test -f jobctl/$jobid2.ctl && mv jobctl/$jobid2.ctl jobctl/$jobid2.ctl_old
return 0
}
#---------------------------- end jobabend51 --------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| Note |
|
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
# 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
#
#Mar14/12 - define gdg file using $GDGCTL (default in profile $RUNDATA/ctl)
#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
#
# ** 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=?${GDGCTL}/gdgctl51,rcs=256,typ=LST
filo1=?${GDGCTL}/gdgctl51I,rcs=2047,typ=ISF,isk1=0(50)
#
# load zeros entries for next gen# & exportgen0 update/history entries
# 1 2 3 4 5 6 7
#1234567890123456789012345678901234567890123456789012345678901234567890
lodv3=k0(100)
next=gen###(lowgen:higen#)yymmdd:HHMMSS <-- next gen# override
next=000000(000000:000000)000000:000000
next=######(######:######)######:###### <-- verify user coding
yymmdd:HHMMSS:G1_123456(123456:123456)jobname S1234 programid <-- history
000000:000000:___000000(000000:000000)_______ _____ _________
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#1234567890123456789012345678901234567890123456789012345678901234567890
# 1 2 3 4 5 6 7
@run
opn all open I/O files
sxo 128,'0(50)' open the sort
#
# 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
#
# 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
# gdgget51 - get gdg=... for any file in $GDGCTL/gdgctl51I
# - called by exportgen1 function
# - by Owen Townsend, UV Software, May 2007
# - see GDG doc at www.uvsoftware.ca/mvsjcl.htm#Part_5
#
#Mar14/12 - define gdg file using $GDGCTL (default in profile $RUNDATA/ctl)
#Jan08/11 - exportgen1,2,3 combined into exportgen1
# - exportgen1 arg1 now +1,+2,+3,etc max 50
#Apr16/09 - GDG control files moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/...
# to allow multiple $RUNDATA's to have different control files
#Oct25/08 - chg to manulock filr1 typ=ISFl4, redm5l4, updl4
#Sep03/08 - add autolock option l2 on filr1=ctl/gdgctl51I,typ=ISFl2
#Aug26/08 - increase recsize to 2047+1=2048 (allows 30 history entries)
#Aug28/08 - name changes getgdg51->gdgget51,getgdg52->gdgget52,
# gdgctlload1->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
# =========================================================================
# - arg3 +1,+2,+3,etc max 50
# - use arg1=... filename as key to read Indexed file & return gdg=... value
#
# gdg=$? <-- calling script can capture gdg=... from return code
# ======
#
# ** 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
#
uop=i31
was=a2000c9000k2000
filr1=${GDGCTL}/gdgctl51I,typ=ISFl4s2,rcs=2047,isk1=0(50)
fili1=?lslbls,rcs=128,typ=LST
filo2=?gdgctl1,rcs=128,typ=LSTt
# load zeros entries for next gen# & exportgen0 update/history entries
# 1 2 3 4 5 6 7
#1234567890123456789012345678901234567890123456789012345678901234567890
lodv3=k0(100)
next=gen###(lowgen:higen#)yymmdd:HHMMSS <-- next gen# override
next=000000(000000:000000)000000:000000
next=######(######:######)######:###### <-- verify user coding
yymmdd:HHMMSS:00 123456(123456:123456)jobname S1234 programid <-- history
000000:000000:01+000000(000000:000000)_______ _____ _________
######:######: <-- verify history ents
$date1:$time1 <-- values inserted above
${JSTEP}
${JOBID2}
${PROGID}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#1234567890123456789012345678901234567890123456789012345678901234567890
# 1 2 3 4 5 6 7
# k000=next=gen#..., k100=next=000..., k200=next=###...
# k300=yym..., k400=000..., k500=###...
# k600=$date1:$time1, k700=${JSTEP}, k800=${JOBID2}, k900=${PROGID}
#
# uvcopy gdgget51,fili1=$lslbls,filo2=$lblcG,arg1=$lblb,arg2=$gen2,arg3=+1
# ========================================================================
# - use arg1=... filename as key to read Indexed file & return gdg=... value
# - arg3 +1,+2,+3,etc max 50
@run
opn all open files
mvn g0(6),$arg2(6) store gen# selected by exportgen1
mvn $ca1,$arg3(4) store gen desired +1,+2,+3,etc
mvn g30(3+),$ca1 store gen for history update
mvc g50(30),$jobstamp retrieve yymmdd:HHMMSS:JOBID
#
# begin loop to read ls filenames to get low & high gen#s for history entry
# - disregard gen _000000, created to avoid problems when no existing files
man20 get fili1,a0(200) get next ls filename
skp> man26
mvc a200(200),a0 save high entry before EOF
cmn g10(6),0 low gen# already stored ?
skp> man20
scnr a0(90),'_' scan back to '_' ID gdg#
mvc g10(6),ax1 save low gen# for history
skp man20
#
# EOF - extract high gen# from saved last record before EOF
man26 scnr a200(90),'_' scan back to '_' ID gdg#
mvc g20(6),ax201 save high gen# for history
#
# 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 $ca2,cx5(3) store gdg for return code
#
# build history action entry for exportgen0 in w/s for later move to ctlrec
man50 mvc k400(13),k602 date:time
mvc k414(3),g30 arg3 01+,02+,etc
mvc k417(6),g0 gen# selected
mvc k424(6),g10 low gen#
mvc k431(6),g20 high gen#
mvc k438(9),k800 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
#
# error check gen request +1,+2,+3 etc max 50
cmn $ca1,1 err chk gen request
skp< err3
cmn $ca1,50
skp> err3
#
# common point to close file, cancel job,& return gdg value or 0
man90 cls all close files
can ' ',$ca2 cancel with return code gdg or 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 $ca2,0 set return code 0
## skp man50 go store history entry in gdgctl
##Nov25/10 - chg man50 to man90, cant update if have not read
skp man90 go end job & return 0
#
err2 msg c0(80) show filename update err
msgw 'ERR: updating gdgctl51I record for jobend action'
can ' ',92
#
err3 msg c0(80) show filename update err
msgwv1 'ERR: gen request=$ca1, must be +1,+2,+3,etc max 50'
can ' ',93
#
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Part 6 documents optional jobs that might be required or desired at some sites. Part 4 (which documents the step by step conversion procedures) will refer you to Part 6 for these optional procedures.
Optional jobs are documented very briefly in Part 4 with references to details & examples elsewhere (such as here in Part 6).
| 6A1. | Assigning mainframe files to sub-directories on unix/linux systems. |
| You might want to use the top-node of DSNs as a sub-directory, rather | |
| than storing all data files in 1 directory. You can do this using the | |
| TOPNODES table in the JCL conversion control file (jclunixop51). |
| 6B1. | Alternate illustrations of topnode/subdir assignment, based on longer |
| more complex DSNs than those used in the 'mvstest' demos of Part_1. |
| 6C1. | creating JCL conversion control files. |
| The JCL converter uses an Indexed file 'ctl/datactl53I' to get information | |
| about data-files (record-size, file-type, key-location/length, GDG or not). | |
| 'ctl/datactl53I' may be created from up to 6 component control files | |
| - the 1st component ctl/datajcl52 is extracted from the JCL itself | |
| and its creation is documented in Part 4 on pages '4K1' - 4K3. | |
| - the other 5 optional components are documented here in Part 6. |
| 6D1. | jobparmx1/jobparms1 (optional) can be used to extract control cards |
| from all JCLs so you can update them separately form the JCL/scripts. | |
| The control card files are date-stamped to allow updates for future dates. | |
| - see details & examples begining on page '6D1'. |
| 6E1. | jclstrip1 - cleanup converted JCL/scripts |
| - remove non-essential code & extraneous comments | |
| - remove mainframe steps that do not apply to unix/linux | |
| - remove commented original JCL stmnts that may have been | |
| useful during conversion & testing |
| 6F1. | Manual changes for DDNAMEs required in scripts converted from JCL, |
| if the DDNAME is a forward reference. This sometimes occurs in a multi-part | |
| file when 1 part is a DDNAME reference to INSTREAM data which is declared | |
| after the multi-part file. |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
You might want to use the top-node of DSNs as a sub-directory, rather than storing all data files in 1 directory. You can do this using the TOPNODES table in the JCL conversion control file (jclunixop51). To illustrate this, we will first show you some sample DSNs & the converted equivalents, based on the demo JCL conversions documented in 'Part_1'.
//CUSTMAS DD DSN=AR.CUSTOMER.MASTER,DISP=SHR //SORTIN DD DSN=AR.SALES.ITEMS,DISP=SHR //SORTOUT DD DSN=&&TEMPSLS,DISP=(NEW,PASS), //GLMSOLD DD DSN=GL.ACCOUNT.MASTER(0),DISP=OLD //GLMSNEW DD DSN=GL.ACCOUNT.MASTER(+1),DISP=(,CATLG,DELETE),
exportfile CUSTMAS ar/customer.master exportfile SORTIN ar/sales.items exportfile SORTOUT $JTMP/__tempsls exportgen0 0 GLMSOLD gl/account.master_ exportgen1 +1 GLMSNEW $JTMP/gl/account.master_ #exportgen1 assign $JTMP/subdir/file, move to subdir/file at Normal EOJ exportfile PAYMSTR misc/pytest.payroll.master
/home/mvstest <-- $RUNDATA subdirs - from topnodes/... :-----testdata - test/demo data files supplied : :-----ar/... - A/R datafiles in ar/... subdir (topnode AR.) : :-----gl/... - G/L datafiles in gl/... subdir (topnode GL.) : :-----py/... - Payroll datafiles in py/... subdir (topnode PY.) : :-----misc/... - other topnodes in misc/... subdir (see control table) : :-----jobtmp - temporary files for SYSIN instream data : :-----tmp - tmp subdir for uvsort & misc use : :-----wrk - interstep temporary work files
exportfile CUSTMAS mstr/ar.customer.master exportfile SORTIN mstr/ar.sales.items exportfile SORTOUT $JTMP/__tempsls exportgen0 0 GLMSOLD mstr/gl.account.master_ exportgen1 +1 GLMSNEW $JTMP/mstr/gl.account.master_ #exportgen1 assign $JTMP/subdir/file, move to subdir/file at Normal EOJ exportfile PAYMSTR mstr/pytest.payroll.master
/home/mvstest <-- $RUNDATA - all datafiles in mstr/... :-----testdata - test/demo data files supplied : :-----mstr/... - all datafiles in mstr/...existing.nodes.retained... : :-----jobtmp - temporary files new GDGs, SYSINs, etc : :-----tmp - tmp subdir for uvsort & misc use : :-----wrk - interstep temporary work files
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
To help you decide whether to use topnodes as subdirs, OR put all datafiles in mstr/..., you can run 'statmvsjcl1' to table summarize existing topnodes used in your mainframe JCL.
Here are the operating instructions illustrated for the mvstest demos (Part_1).
#1. login mvstest ---> /home/mvstest
#2. cdl ---> $RUNLIBS ---> /home/mvstest/testlibs
#3. uvcopy statmvsjcl1,fild1=jcl2 (fild1=... defines input directory)
=============================
- creates 3 table summaries in stats/... (programs,procs,& topnodes)
- see topnodes on next page, see other reports on page '2K2'
#4. uvlp12 stats/jcl0_topnodes <-- print result (stored in stats subdir)
==========================
statmvsjcl1 2008/08/08_20:03:18 Summary table of DSN Top-Nodes in jcl0
tbl#003 pg#001 -argument-
line# count % Top-Node
1 27 19 &&(ALLTempFiles)
2 33 23 AR
3 57 41 GL
4 10 7 PY
5 5 3 PYTEST
6 2 1 RPTS
7 3 2 WRK
8 1 0 WRK(IKJDEMO1)
138*100 *TOTAL*
From the table summary above, you can see that sub-dirs such as AR & GL have high file counts, and others such as PYTEST have low files counts.
You might want to use a separate subdirs for files with high-count topnodes, but combine low-count files into 1 'misc' subdir. On the following pages, we will show you how to do that, using the TOPNODES table in the JCL conversion control file (jclunixop51).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The JCL conversion control table is designed for the 'mvstest' demo JCL & the TOPNODES table (about line 75+) converts topnodes to subdirs. The control file is supplied in /home/uvadm/mvstest/testlibs/ctl/jclunixop51. It is copied to /home/mvstest/testlibs/ctl/jclunixop51 if you perform the 'mvstest' demos in 'Part_1'.
Here are lines 67-97 extracted from /home/mvstest/testlibs/ctl/jclunixop51:
# TOPDIRDEFAULT - used if only 1 node (no High Level Qualifier) in DSN # - should specify in case no HLQ present on DSN # - recommend '$WRK' or 'wrk' (1 node files likely temp files) # TOPDIRINSERT - if specified, will be inserted above HLQ, retaining all '.'s # - vs replacing HLQ/topnode # - omit (leave tildes) to convert HLQ's to subdirs # - if specified, I recommend 'mstr' :CTLTBL: TOPDIRDEFAULT~~~~~~~~~~~~~~~~~$WRK~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINSERT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <-- omitted ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # table of TOPNODES allowed & replacements (optional) # 01-30 - topnodes allowed # 31-60 - topnode replacements (if col 31 not '~') # - if 01-30 of last entry is 'ALLOTHER' # then any others replaced by 31-60 of last entry :TOPNODES: ar~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ <-- TOPNODES spcfd py~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rpts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Compare above control file (for datafiles in topnode/subdirs) with the control file on the next page (for all datafiles in 1 directory).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
If you wish to assign all datafiles into 1 directory (such as mstr/...), with filenames unchanged (retain all nodes), you would change lines 67-97 of the control file as follows (demo for mvstest).
#1. login mvstest ---> /home/mvstest
#2. cdl ---> $RUNLIBS ---> /home/mvstest/testlibs
#3. vi ctl/jclunixop51 <-- edit JCL conversion control file
==================
#3a. code 'TOPDIRINSERT' as 'mstr' (supplied as null/tildes)
#3b. remove existing TOPNODES table entries (supplied as ar,gl,py)
# TOPDIRDEFAULT - used if only 1 node (no High Level Qualifier) in DSN # - should specify in case no HLQ/topnode present on DSN # - recommend '$WRK' or 'wrk' (1 node files likely && temp files) # TOPDIRINSERT - if specified, will be inserted above topnode, retain all '.'s # - vs replacing HLQ/topnode # - omit (leave tildes) to convert HLQ's to subdirs # - if specified, I recommend 'mstr' :CTLTBL: TOPDIRDEFAULT~~~~~~~~~~~~~~~~~$WRK~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINSERT~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~ <-- insert 'mstr' ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # table of TOPNODES allowed & replacements (optional) # 01-30 - topnodes allowed # 31-60 - topnode replacements (if col 31 not '~') # - if 01-30 of last entry is 'ALLOTHER' # then any others replaced by 31-60 of last entry :TOPNODES: # --- omitted, since 'mstr' spcfd for TOPDIRINSERT above --- <-- omit TOPNODES ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ (ar,gl,py)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The pages above illustrated mainframe file assignment to topnode/subdirs, based on the 'mvstest' demos of Part_1.
The following pages present alternate illustrations of topnode/subdir assignment, based on longer more complex DSNs that are used on many mainframes.
//C9INFILE DD DSN=H200PALI.T300.F075.DDF(0)
//C9UNEARN DD DSN=H200PALK.NIXX.C9R13.UNEARN(0)
//CCRDJRNL DD DSN=H200PFHB.NIXX.C9R01.CCRDJRNL(+1)
//C9VSEQOP DD DSN=H200PFHD.VIXX.C9RVH.IIVSEQOP
//SORTOUT DD DSN=H200PKAH.NIXX.C9R09.TEMPRECS,
//C9RPSFLE DD DSN=H200PMSF.NIXX.C9R01.C9RPSFLE(+1)
exportgen0 0 C9INFILE h200pali/t300.f075.ddf_
exportgen0 0 C9UNEARN h200palk/nixx.c9r13.unearn_
exportgen1 +1 CCRDJRNL $JTMP/h200pfhb/nixx.c9r01.ccrdjrnl_
exportfile C9VSEQOP h200pfhd/vixx.c9rvh.iivseqop
exportfile SORTOUT h200pkah/nixx.c9r09.temprecs
exportgen1 +1 C9RPSFLE $JTMP/h200pmsf/nixx.c9r01.c9rpsfle_
The conversion default has converted the top-node to a subdir. You can see that the top-nodes used on the mainframe would be unnecessarily long when used as subdirs on Unix/Linux. The system was all 'H200' & the 'P' was for Production (vs Test), which we don't need since we handle prod/test with environmental variables on Unix/Linux.
In this case, it might make sense to convert the top-nodes to 3 character subdirs as shown below. This is a good example of something we can do during conversion to make it simpler & easier to work with for many years to come.
exportgen0 0 C9INFILE ali/t300.f075.ddf_ exportgen0 0 C9UNEARN alk/nixx.c9r13.unearn_ exportgen1 +1 CCRDJRNL $JTMP/fhb/nixx.c9r01.ccrdjrnl_ exportfile C9VSEQOP fhd/vixx.c9rvh.iivseqop exportfile SORTOUT kah/nixx.c9r09.temprecs exportgen1 +1 C9RPSFLE $JTMP/msf/nixx.c9r01.c9rpsfle_
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p1/apps :-----testdata <-- RUNDATA=$TESTDATA=/p1/apps/testdata : :-----ali : :-----alk : :-----fhb <-- subdirs for above sample data files : :-----fhd : :-----kah : :-----msf : :-----misc <-- subdir for low volume files to be combined : :-----jobtmp : :-----...... <-- see other required subdirs on page '6B4'
You can use the 'statmvsjcl1' utility to read all your JCL & create a summary table of all top nodes used. You will probably want to use a separate subdir for top-nodes with high file counts, but combine files into 1 'misc' subdir for top-nodes with low file counts.
We will show you later how to use the control file 'TOPNODES' replacement table, but first we will run 'statmvsjcl1' to create the summary table to help us decide which top-nodes are to be combined into 'misc'.
#1. login appsadm ---> /home/appsadm
#2. cdl ---> $RUNLIBS (/p1/apps/testlibs, using file design from page '6B3')
#3. uvcopy statmvsjcl1,fild1=jcl2 (fild1=... defines input directory)
=============================
- creates 3 table summaries in stats/... (programs,procs,& topnodes)
- see topnodes on next page, see other reports on page '2K2'
#4. uvlp12 stats/jcl2_topnodes <-- print result (stored in stats subdir)
==========================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Job: table3d Dir: jcl2 Keyword(s): DSN
Qual1: . Qual2: & Blanked: .='" Userops: q1c0f0l0k0m0p1w1
table3d 2007/09/13_08:56:35 Counts by Targetword following specified Keyword
tbl#001 pg#001 -argument-
line# count % target-word
1 358 6 H200P
2 623 11 H200PALI
3 609 11 H200PALK
4 619 11 H200PFHB
5 600 11 H200PFHD
6 610 11 H200PKAH
7 1,268 24 H200PMSF
8 22 0 J300PALI
9 21 0 J300PALK
10 3 0 IATM
11 1 0 IATMPN
12 4 0 PSTTMR6
13 8 0 SYS1
5,272*100 *TOTAL*
Use the table3d analysis above to decide which top-nodes you wish to retain and all others can be consolidated into a 'misc' subdir, by coding the 'TOPNODES' table in the control file (ctl/jclunixop51).
# table of TOPNODES allowed & replacements (optional) # 01-30 - topnodes allowed # 31-60 - topnode replacements (if col 31 not '~') # - if 01-30 of last entry is 'ALLOTHER' # then any others replaced by 31-60 of last entry :TOPNODES: h200pali~~~~~~~~~~~~~~~~~~~~~~ali~~~~~~~~~~~~~~~~~~~~~~~~~~~ h200palk~~~~~~~~~~~~~~~~~~~~~~alk~~~~~~~~~~~~~~~~~~~~~~~~~~~ h200pfhb~~~~~~~~~~~~~~~~~~~~~~fhb~~~~~~~~~~~~~~~~~~~~~~~~~~~ h200pfhd~~~~~~~~~~~~~~~~~~~~~~fhd~~~~~~~~~~~~~~~~~~~~~~~~~~~ h200pkah~~~~~~~~~~~~~~~~~~~~~~kah~~~~~~~~~~~~~~~~~~~~~~~~~~~ h200pmsf~~~~~~~~~~~~~~~~~~~~~~msf~~~~~~~~~~~~~~~~~~~~~~~~~~~ ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
But if you wanted to retain your original 'topnodes' as 'subdirs', you would simply leave the right side of the replacement table all tildes as shown below.
Then only the left-side topnodes become subdirs & 'ALLOTHERS' are changed to to 'misc'.
# table of TOPNODES allowed & replacements (optional) # 01-30 - topnodes allowed # 31-60 - topnode replacements (if col 31 not '~') # - if 01-30 of last entry is 'ALLOTHER' # then any others replaced by 31-60 of last entry :TOPNODES: h200pali~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ h200palk~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ h200pfhb~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ h200pfhd~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ h200pkah~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ h200pmsf~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//C9VSEQOP DD DSN=H200PFHD.VIXX.C9RVH.IIVSEQOP
//SORTOUT DD DSN=J300TEMP.NIXX.C9R09.TEMPRECS,
exportfile C9VSEQOP h200pfhd/vixx.c9rvh.iivseqop
exportfile SORTOUT misc/h200pkah.nixx.c9r09.temprecs
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1. login appsadm ---> /home/appsadm #2. cdl ---> $RUNLIBS
#3. uvcopy statksh1,fild1=jcl3 <-- create table stats from Korn shell scripts
==========================
#4a. vi stat/jcl3_topnodes <-- view topnode/subdir table summary
=====================
#4b. uvlp12 tmp/jcl3_topnodes <-- print result
========================
Job: table3d Dir: jcl3 Keyword(s): exportfile:exportgen0:exportgen1
Qual1: . Qual2: Blanked: /. Userops: q1c0f0l0k0m0p1w1w2
table3d 2007/09/13_08:53:41 Counts by Targetword following specified Keyword
tbl#001 pg#001 -argument-
line# count % target-word
1 458 12 ali
2 451 12 alk
3 461 13 fhb
4 451 12 fhd
5 447 12 kah
6 891 25 msf
7 269 7 misc
3,541*100 *TOTAL*
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The JCL converter needs an Indexed file 'ctl/datactl53I' to get information about the data-files (record-size, file-type, key-location/length, GDG or not). This info is required for SORTs, IDCAMS, IEBGENER, etc that are converted to uvsort & uvcp.
The mainframe JCL did not necessarily specify record-size etc, since this info could be obtained from the mainframe VTOC or LISTCAT. But there is no VTOC or LISTCAT on unix/linux, so we will supply that info to the JCL converter via an Indexed file (ctl/datactl53I). We can collect datafile info from 6 sources as described below.
The only mandatory source is the JCL itself. Utility job 'jcldata51' will extract all DSN's from all JCL. These are sorted & duplicates dropped resulting in 1 line per unique datafilename found in all JCL. The output is written to ctl/datajcl51. A 2nd utility 'jcldata52' then converts the mainframe filenames to the conventions used in the Korn shell scripts:
The next page will summarize the creation of the 6 possible information files. Utility ctldat53 is then used to combine all 6 files. Script 'jcldata5A' is an easier way to run ctldata53 & also create the Indexed file used by the JCL converter to get file info (record sizes,etc).
The 5 optional information files must have been created before you run jcldata5A (or 'jcl2ksh51A' which performs all steps of JCL conversion). Just make null files for any of the 5 optional information sources that you do not have.
| Note |
|
#5. jcldata5A <-- create datajcl51 & datajcl52 & sort 6 files together:
========= (datajcl52+datacat52+dataxl152+dataxl252+dataedt52+datacnv52)
- to create datactl53 & load Indexed file datactl53I
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We show the uvcopy utility jobnames below the -------> lines. For example uvcopy job 'jcldata51' is used to create 'ctl/datajcl51', which is then processed/resorted by 'jcldata52' to create 'ctl/datajcl52'.
#1. JCL -----------> ctl/datajcl51 -----------> ctl/datajcl52
jcldata51 jcldata52
#2. LISTCAT -----------> ctl/datacat51 -----------> ctl/datacat52
catdata51 catdata52
#3. Excel spreadsheet#1 -----------> ctl/dataxl151 ----------> ctl/dataxl152
xl1data51 xldata52
#4. Excel spreadsheet#2 -----------> ctl/dataxl251 -----------> ctl/dataxl252
xl2data51 xl2data52
#5. ----------> ctl/dataedt52
editor
#6. EBCDIC datafiles -----------> ctl/datacnv51 -----------> ctl/datacnv52
cnvdata51 cnvdata52
#7. Six ...52 files above -----------> ctl/datactl53 -----------> ctl/datactl53I
ctldata53 uvcp (load Indexed file)
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are just a few lines of all 6 info files that might be used to supply record-sizes, file types, keyloc/keylen, copybooknames, etc for both JCL & DATA file conversion.
#01 DB2.PROD.DWPARM(QUDW33) cntf=0002 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdwkscix prg=DSNUTILB #02 DBDPCSM.CSM288.$KM001.BATCH.%%MDY cntf=0014 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800 #03 DBDPCSM.CSM288.$KM001.SYNTAX.%%MDY cntf=0007 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800 #04 DBDPCSM.CSM781.$CHP14.EFDS.MERGE(+1) cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=csm781m prg=CSM78100 #05 DBDPCSM.CSMUNLK3.$MDBCID.IN.PDW.%%MDY cntf=0005 rca=00147 rcm=00147 typ=RSF src=Jr__________ job=csmunlk3 prg=SORT #06 DBDPCSM.CSMUNLK3.$MDBCID.OUT.%%MDY cntf=0003 rca=00000 rcm=00000 typ=RSF src=J___________ job=csmunlk3 prg=IEFBR14 #07 DBDPDW.DBDFTP.$ABA.MONTHLY(0) cntf=0001 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200 #08 DBDPCSM.CSMSRT.$WELLS.G0587V00 cntf=0001 rca=00753 rcm=00753 typ=RSF src=Jr__________ job=csmwel_1 prg=SYNCSORT #09 DBDPDW.PDW202.$ADDR.USG.WKY(+1) cntf=0001 rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw202p1 prg=PDW20200 #10 DBDPDW.PDW828.$SCA01.CNSM.ACT.XRF.HIST.SRT cntf=0003 rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw828h1 prg=SORT
Utility jcldata52 copies datajcl51 to datajcl52, changing filename conventions from mainframe to the standards adopted for the Vancouver Utility ksh scripts.
#01 db2.prod.dwparm@qudw33 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdwkscix prg=DSNUTILB #02 dbdpcsm.csm288._km001.batch.%%MDY rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800 #03 dbdpcsm.csm288._km001.syntax.%%MDY rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800 #04 dbdpcsm.csm781._chp14.efds.merge_ rca=00000 rcm=00000 typ=RSF src=J___________ job=csm781m prg=CSM78100 #05 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY rca=00147 rcm=00147 typ=RSF src=Jr__________ job=csmunlk3 prg=SORT #06 dbdpcsm.csmunlk3._mdbcid.out.%%MDY rca=00000 rcm=00000 typ=RSF src=J___________ job=csmunlk3 prg=IEFBR14 #07 dbdpdw.dbdftp._aba.monthly_ rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200 #08 dbdpdw.dbdftp._aba.monthly_ rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200 #09 dbdpdw.pdw202._addr.usg.wky_ rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw202p1 prg=PDW20200 #10 dbdpdw.pdw828._sca01.cnsm.act.xrf.hist.srt rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw828h1 prg=SORT
#01 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdwkscix prg=DSNUTILB #02 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800 #03 rca=00080 rcm=00080 typ=RSF src=Jr__________ job=csm288km prg=CSM28800 #04 rca=00000 rcm=00000 typ=RSF src=J___________ job=csm781m prg=CSM78100 #05 rca=00147 rcm=00147 typ=RSF src=Jr__________ job=csmunlk3 prg=SORT #06 rca=00000 rcm=00000 typ=RSF src=J___________ job=csmunlk3 prg=IEFBR14 #07 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200 #08 rca=00000 rcm=00000 typ=RSF src=J___________ job=pdw202p1 prg=PDW20200 #09 rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw202p1 prg=PDW20200 #10 rca=00039 rcm=00039 typ=RSF src=Jr__________ job=pdw828h1 prg=SORT
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
** sample input#2 - datacat52
py.payroll.master rca=00128 rcm=00239 typ=IDXf8v src=_L_ key=(0000,0016) py.time.cards rca=00080 rcm=00080 typ=RSF src=_L_ pytest.payroll.master rca=00256 rcm=00384 typ=IDXf8v src=_L_ key=(0010,0022) pytest.payroll.master2 rca=00128 rcm=00256 typ=IDXf8v src=_L_ key=(0000,0011)
| Note |
|
aoe.tfi132._473bkp_ cpy=t0473w.cpy rca=_____ rcm=_____ dbdpcsm.csm501._aif01.batch2 cpy=nasc354.cpy rca=_____ rcm=_____ dbdpcsm.csmftp._aif01.srcin.aif1 cpy=shrf025.cpy rca=_____ rcm=_____ dbdpdw.dbd714._jpalog.weekly.&weekdate cpy=____________ rca=00200 rcm=00200 dbdpdw.dbd714._n905s.%%mdy cpy=t0905o.cpy rca=00184 rcm=00184 dbdpdw.dbd715._j1214.weekly.&weekdate cpy=t1214i.cpy rca=_____ rcm=_____ dbdpdw.dbd715._nformfi.%%mdy.@03del cpy=____________ rca=00132 rcm=00132 dbdpdw.dbd900._copy.chkclln.evnt cpy=____________ rca=00080 rcm=00080 dbdpnas.nas258._aif01.batch.aif1 cpy=csmf501.cpy rca=_____ rcm=_____
db2.prod.dwparm@qudw30 cpy= rca=_____ rcm=_____ src=______Yi__ db2.prod.dwparm@qudw33 cpy= rca=_____ rcm=_____ src=______Yi__ dbdpcrm.dbd40700._crm028.scan_ cpy= rca=_____ rcm=_____ src=______Yi__ dbdpcsm.convert._sca02.efdbcid_ cpy= rca=_____ rcm=_____ src=______Yi__ dbdpcsm.csm288._km001.batch.%%MDY cpy= rca=_____ rcm=_____ src=______Yi__ dbdpcsm.csm288._km001.batch.%%MDY cpy= rca=_____ rcm=_____ src=______Yi__ dbdpcsm.csm781._chp14.efds.merge_ cpy= rca=_____ rcm=_____ src=______Yi__ dbdpcsm.csm781._chp14.efds.merge_ cpy= rca=_____ rcm=_____ src=______Yi__ dbdpcsm.csm783._chx01.efdbcid_ cpy= rca=_____ rcm=_____ src=______Yi__
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# dataedt52 - manually edited additions to datafile info # - this file used for JCL conversions, # Create with editor & store in $TESTLIBS/ctl/dataedt52 # Will be merged with 5 other info source files # (datajcl52,datacat52,dataxl152,dataxl252,datacnv52+dataedt52) # to create datactl53 & datactl53I Indexed file used by JCL converter # (these '#'comment lines will be dropped on merge) # # Edit these filenames to match filenames in converter output # - lower case, any '$' in mainframe filenames entered as '_'s # - GDG files ID by trailing '_' underscores # - keywords may follow filenames after at lest 1 space # - rca=...,rcm=... should be 5 digits # dbdpnas.nas258._aif01.batch.aif1 rca=00080 rcm=00080 typ=RSF dbdpnas.nas258._aif01.batch.bkp1_ rca=00080 rcm=00080 typ=RSF
db2.prod.dwparm@qudw33 src=__________D_ dbdpcsm.csm288._km001.batch.%%MDY src=__________D_ dbdpcsm.csm783._chx01.efdbcid_ src=__________Db dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY src=__________D_ dbdpdw.dbdftp._aba.monthly_ src=__________D_ dbdpods.dbd353._odsf013.extract src=__________Db dbdpods.dbdchp01._weekly.valid src=__________D_ dbdpods.dbdsrt._rod197b.deduped.dly_ src=__________Dp dbdpods.dbdsrt._rod197b.deduped.dly_ src=__________Dp dbdpods.dbdsrt._rod197b.deduped.dly_ src=__________Dp
'datacnv52' is created by scanning the 1st 5000 bytes of each datafile for packed/binary fields & identifying those files with the Dp/Db you see above.
This was for DATA conversions, so we can know the files where it is mandatory to have copybooks to properly generate data conversion jobs to preserve packed/binary fields (vs translating entire record).
'datacnv52' is not required for JCL conversions, but we include all 6 sources for datactl53 used by JCL conversions. We then create 'datacnv53' from 'datactl53' for the DATA conversions.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is a sample of 'ctl/datactl53' which is loaded into an Indexed file (ctl/datactl53I) to supply file info (record-sizes, etc) to the JCL converter.
#01 db2.prod.dwparm@qudw33 cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdwkscix prg=DSN #02 dbdpcsm.csm288._km001.batch.%%MDY cpy=nasc354.cpy rca=_____ rcm=_____ typ=RSF src=J___X_Yi__D_ job=pdmkeyen prg=NAS #03 dbdpcsm.csm288._km001.batch.%%MDY cpy=nasc354.cpy rca=_____ rcm=_____ typ=RSF src=J___X_Yi__D_ job=pdmkeyen prg=NAS #04 dbdpcsm.csm781._chp14.efds.merge_ cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdw100pe prg=PDW #05 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY cpy=____________ rca=00147 rcm=00147 typ=RSF src=J___XrYi__D_ job=pdm825mp prg=SOR #06 dbdpcsm.csmunlk3._mdbcid.in.pdw.%%MDY cpy=____________ rca=00147 rcm=00147 typ=RSF src=J___XrYi__D_ job=pdm825mp prg=SOR #07 dbdpdw.dbdftp._aba.monthly_ cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW #08 dbdpdw.dbdftp._aba.monthly_ cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW #09 dbdpdw.pdw202._addr.usg.wky_ cpy=____________ rca=00039 rcm=00039 typ=RSF src=Jr____Yi__Dp job=pdw301p1 prg=PDW #10 dbdpdw.pdw828._sca01.cnsm.act.xrf.hist cpy=____________ rca=00039 rcm=00039 typ=RSF src=Jr____Yi__Dp job=pdw828h1 prg=PDW
#01 cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdwkscix prg=DSNUTILB #02 cpy=nasc354.cpy rca=_____ rcm=_____ typ=RSF src=J___X_Yi__D_ job=pdmkeyen prg=NAS25300 #03 cpy=nasc354.cpy rca=_____ rcm=_____ typ=RSF src=J___X_Yi__D_ job=pdmkeyen prg=NAS25300 #04 cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_____Yi__D_ job=pdw100pe prg=PDW21000 #05 cpy=____________ rca=00147 rcm=00147 typ=RSF src=J___XrYi__D_ job=pdm825mp prg=SORT #06 cpy=____________ rca=00147 rcm=00147 typ=RSF src=J___XrYi__D_ job=pdm825mp prg=SORT #07 cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW20200 #08 cpy=____________ rca=_____ rcm=_____ typ=RSF src=J_________D_ job=pdw202p1 prg=PDW20200 #09 cpy=____________ rca=00039 rcm=00039 typ=RSF src=Jr____Yi__Dp job=pdw301p1 prg=PDW20200 #10 cpy=____________ rca=00039 rcm=00039 typ=RSF src=Jr____Yi__Dp job=pdw828h1 prg=PDW82800
We have shown a ten line sample twice since the lines are too long for hard-copy documentation. We have omitted filenames on the 2nd display, but you can relate using the inserted sequence#s.
We are illustrating these sample control files here before documenting the conversion Operating Instructions to help you understand the process. When you later study the operating instructions, it may clarify things if you refer back to these control file samples.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| Note |
|
The VSE JCL converter has an option to #comment out all embedded control cards (for dates, rates, etc) & to create filename references to those records in subdir $RUNDATA/jobparms1 & $RUNDATA/jobparms2.
Utility job 'jobparmx1' is provided to extract the embedded control cards from i JCL/scripts into separate files that can be updated before JCL/scripts are executed.
Control files will have a date-stamp appended (current date at generation time). Run control administrators may duplicate the files & append future dates which will be selected when the current data reaches or passes file dates.
Also see 'jobparms1' which will be run at 6PM (before batch shift) to copy $RUNLIBS/jobparmx1/* to $RUNDATA/jobparms1, selecting the appropriate control card from any multiple dates for any 1 jobname_step_program
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
#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
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
=======================
If you need to convert a new JCL, specify the JCL/script name via ',arg1=...' The instructions below will output directly to jobparmx1/jobparmx2.
You could use tmp1/tmp2 to ensure no overwriting files in jobparmx1/jobparmx2. 'arg1=...' may specify a prefix to extract control cards from all JCL/scripts matching the prefix specified.
#1. cd $RUNLIBS <-- change to libraries (where jcls area)
#2. uvcopy jobparmx1,fild1=jcls,fild2=jobparmx1,fild3=jobparmx2,arg1=jclprefix
==========================================================================
- extract control cards from 1 JCL/script direct to jobparmx1/jobparmx2
- 'jcl2ksh41' (convert 1 JCL) uses arg1=jclname
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The JCL converter generate lines 2-5 as '#<' comments. The SYS011 logical name used by COBOL program is defined by the exportfile on line 1 above, reproduced below on line 1a & followed by lines 1b & 1c showing sample values for the $SYMBOLS.
#1a. exportfile SYS011 jobparms1/${JOBID2}_${JSTEP}_${PROGID}
========================================================
#1b. exportfile SYS011 jobparms1/30905d04_S0020_e212108c
===================================================
cd $RUNDATA <-- jobset41 (function called at begin all jcls)
- changes directory to $RUNDATA
- so effective pathname might be as follows:
#1c. exportfile SYS011 /tax/testdata/jobparms1/30905d04_S0020_e212108c
=================================================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
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
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
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
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.
#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
| 6E2. | lists 2 steps DYNUTIL & IDCAMS before jclstrip1 (54 lines) |
| 6E3. | lists the 2 steps after jclstrip1 (28 lines) |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1======================== begin step#S0010_DYNUTIL =========================
S0010=A
JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)"
stepctl51; #calc StepTimes & check jobstop/goto end
goto
export PROGID=DYNUTIL
export PARM="";
exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
exportfile E212528 e2125528/ttaxe.b8401d03
exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID}
#< cat > $SYS011 <</*EOD
#< DELETE 'SORTWK1 ==',POOL=POLMU5
#< /*EOD
## EXEC DYNUTIL,SIZE=96K
#3----------------------------------------------------------------------
# DYNUTIL - convert DELETES only (but not for SORTWK_)
#4----------------------------------------------------------------------
: # dummy step set cc 0 for status tests
LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto="";
if ((SCC != 0))
then logmsg1 "step $JSTEP DYNUTIL abterm $SCC"
alias goto="<<S9900=A"; fi
goto
#1======================== begin step#S0020_IDCAMS =========================
S0020=A
JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0;
logmsg1 "Begin Step $JSTEP IDCAMS (#$XSTEP)"
stepctl51; #calc StepTimes & check jobstop/goto end
goto
export PROGID=IDCAMS
export PARM="";
exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID}
#< cat > $SYS011 <</*EOD
#< DEL E2125528.TTAXE.B8401D03 PURGE -
#< CATALOG(VSAM.USERCAT.CATALOG.MU5585 UCAT1)
#< DEF CL (NAME(E2125528.TTAXE.B8401D03) -
#< VOL(PRD318 ) -
#< RECSZ(546 546) -
#< FILE(E212528) -
#< CISZ(6144) -
#< CYL(70 70) -
#< CATALOG(VSAM.USERCAT.CATALOG.MU5585 UCAT1)
#< /*EOD
## EXEC IDCAMS,SIZE=200K
#3----------------------------------------------------------------------
rm -f e2125528/ttaxe.b8401d03
uxcp "fili1=wrk/nullfile,typ=RSF,rcs=546,filo1=e2125528/ttaxe.b8401d03,typ=RSF,rcs=546"
LCC=$?; ((SCC+=LCC));
#4----------------------------------------------------------------------
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
#1======================== begin step#S0010_DYNUTIL =========================
S0010=A
JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0;
logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)"
stepctl51; #calc StepTimes & check jobstop/goto end
goto
export PROGID=DYNUTIL
export PARM="";
exportfile E212528 e2125528/ttaxe.b8401d03
#1======================== begin step#S0020_IDCAMS =========================
S0020=A
JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0;
logmsg1 "Begin Step $JSTEP IDCAMS (#$XSTEP)"
stepctl51; #calc StepTimes & check jobstop/goto end
goto
export PROGID=IDCAMS
export PARM="";
exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID}
exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID}
## EXEC IDCAMS,SIZE=200K
#3----------------------------------------------------------------------
rm -f e2125528/ttaxe.b8401d03
uxcp "fili1=wrk/nullfile,typ=RSF,rcs=546,filo1=e2125528/ttaxe.b8401d03,typ=RSF,rcs=546"
LCC=$?; ((SCC+=LCC));
#4----------------------------------------------------------------------
S0020C=$SCC; ((JCC+=SCC)); alias goto="";
if ((SCC != 0))
then logmsg1 "step $JSTEP IDCAMS abterm $SCC"
alias goto="<<S9900=A"; fi
goto
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# jclstrip1 - strip non-essential code from JCL/scripts # - for City of Laval, June 2008, by Owen Townsend, UV Software # # 1a. mv jcls jcls.old <-- rename current jcls directory # 1b. mkdir jcls <-- make new dir to receive stripped JCL/scripts # # 2. uvcopy jclstrip1 jcls.old jcls <-- strip all JCL/scripts # ============================== while copying jcls.old to jcls # opr='$jobname - strip non-essential steps in JCL/scripts' fild1=?indir,typ=DIR,rcs=80 #input directory fili1=xxxxxxxx,typ=LST,rcs=256 #current input file from directory fild2=?outdir,typ=DIR,rcs=80 #output directory filo2=xxxxxxxx,typ=LSTtp775,rcs=256 #current output file # # Table of STEP names to be stripped lod=k0(20) LISTLOG PRTLOG TDYNASN DYNUTIL DYNOPEN BSTTWAIT E173001C VSECMD IPCPBTCH SPOB766 ~~~~~~~~~~~~~~~~~~~~ #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
@run
opn fild1 open input directory
opn fild2 open output directory (must exist)
msgwya1 '- did you: mv jcls jcls.old & mkdir jcls (new/empty) ?'
cmc $arg1(1),'y'
skp= man10
can 'cancelled - reply not "y"'
#
# begin outer loop to read directory for next filename
man10 get fild1,a0(80) get next record (filename) in directory
skp> man90 (cc set > at EOD)
skp< man10 (cc set < on subdir vs file)
#
# create input filename by concat: indir/infile & open
clr f0(300),' '
mvu f100(80),$fild1,x'00' move dirname until ending null
cat f100(80),'/' concat the '/'
cata8 f100(80),a0(80) concat current filename (a8 null terms)
mvc $fili1,f100 store input filename before open
opn fili1 open current input file
#
# create same filename in output subdir & open
mvu f200(80),$fild2,x'00' move output dirname until null reached
cat f200(80),'/' concat the '/'
cata8 f200(80),a0(80) concat current filename (a8 null terms)
mvc $filo2,f200 store output filename before open
opn filo2 open current output file
#
# copy JCL/script to 1st step divider line
man20 bal getr get next line into area 'b'
skp> man80
cmc b0(5),'#1===' step divider line ?
skp= man30
put filo2,b0 copy to output file
skp man20
#
# begin each step (step divider line found)
# #1======================== begin step#S0020_DYNUTIL ========================
# extract step-name & match to table of steps to be stripped
man30 mvn $ca0,0 clear step strip switch
clr d0(200),' ' clear work area
scn b0(80),'_' scan to '_' preceding stepname
mvu d0(8),bx1,' ' isolate stepname
lok k0(20),k0(8),d0(8) lookup table of steps to strip
skp! 1
man32 mvn $ca0,1 set step strip switch
skp man60 go copy step divider & get next
#
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# begin loop to copy until next step divider line
# On all steps - drop the '#<' comment lines
# - original SYSIN lines on IDCAMS, etc
# On steps matching table above (strip switch set)
# - drop all lines except for:
# S0020=A
# JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0;
# logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)"
# stepctl41 # test oprtr jobstop/jobclear
# export PROGID=DYNUTIL
# export PARM="";
# exportfile E212003 $MSTR/e2123003.itaxe.transdam <- drop SYSOUT/SYS011
# exportgen1 +1 E212999 $JTMP/$TAPE/tu.f01.e212-foncie_
#
man40 cmc b0(5),'#1===' step divider line ?
skp= man60 yes - go output & get next
cmc b0(2),'#<' orig SYSIN IDCAMS, etc
skp= man62 yes - bypass output & get next
cmn $ca0,1 stripping this step ?
skp< man60 no - go output & get next
#
# strip switch set - drop lines (except as described above)
man42 cmcp b0(7),'S####=A'
skp= man60
cmc b0(6),'JSTEP='
skp= man60
cmc b0(6),'logmsg'
skp= man60
cmc b0(7),'stepctl'
skp= man60
cmc b0(7),'export '
skp= man60
cmc b0(9),'exportgen'
skp= man60
cmc b0(10),'exportfile'
skp= man44
skp man62 drop, bypass output, get next
#
# exportfile (strip switch set) - drop if SYSOUT or SYS011
man44 cmc b10(3),' SYS'
skp= man62 yes: drop, bypass output, get next
skp man60 retain exportfiles except SYS...
#
# common point to copy current line & return to get next
# - until end of current step
man60 put filo2,b0(256) output record
man62 bal getr get next line
skp> man80
cmc b0(5),'#1===' step divider line ?
skp= man30
skp man40
#
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# EOF current file - output counts, close files,& return for next file pair
man80 cls fili1 close current input file
cls filo2 close current output file
skp man10
#
# end input directory - display stats, close all dirs & files, & eoj
man90 cls all
eoj
#
#----------------------------------------------------------------------
# getr - subrtn to get next line of JCL/script from current input file
# - bypasses cmts, clrs 72-80, squeezes to 1 blank between words
getr get fili1,b0 get next line of current JCL/script
skp> getr9 (cc > at EOF)
#
# copy to area c & squeeze to 1 blank between words
# - ##commented out, not required yet ?
## mvc c0(256),b0
## sqzl1c1 c0(100),' ' squeeze to 1 blank between words (c1)
# & leave 1 blank before 1st word (l1)
# return with cc= (not EOF) or cc> (at EOF)
getr8 ret=
getr9 ret>
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Manual changes for DDNAMEs (in scripts converted from JCL) are required, if the DDNAME is a forward reference. We see this situation in a multi-part file when 1 part is a DDNAME reference to INSTREAM data which is declared after the multi-part file.
//IEBCOPY2 JOB test DDNAME=XXX when XXX is a forward reference //* - requires manual fix to converted script //* - must move XXX def & instream data prior to DDNAME def //STEP1 EXEC PGM=IEBCOPY
//INDD1 DD DDNAME=HEADERS <-- concat 1 // DD DSN=AR.SALES.PRODUCTS <-- concat 2
//HEADERS DD * <-- instream 1 PRODUCT# DESCRIPTION <-- instream 2 ===================================== <-- instream 3 /* <-- instream 4
//OUTDD1 DD DSN=AR.PRODUCT.LIST //SYSIN DD * COPY INDD=INDD1 OUTDD=OUTDD1 /*
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| Note |
|
#1======================= begin step#S0010 IEBCOPY ======================== S0010=A JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto=""; logmsg2 "******** Begin Step $JSTEP iebcopy (#$XSTEP) ********" ##STEP1 EXEC PGM=IEBCOPY export PROGID=iebcopy export PARM=""
exportfile INDD101 $HEADERS #DDNAME=HEADERS <-- concat 1 (see ERR note below)
exportfile INDD102 ar/sales.products <-- concat 2
exportfile INDD1 $JTMP/_headers02 <-- concat 3
cat $INDD101 $INDD102 \ <-- concat 4
>$INDD1 <-- concat 5
#----DDNAME in multi-part file above, ensure def precedes
HEADERS=$JTMP/${JSTEP}_${PROGID}_HEADERS <-- instream 1
exportfile HEADERS $HEADERS <-- instream 2
cat > $HEADERS <</* <-- instream 3
PRODUCT# DESCRIPTION <-- instream 4
======================================== <-- instream 5
/* <-- instream 6
exportfile OUTDD1 ar/product.list
SYSIN=$JTMP/${JSTEP}_${PROGID}_SYSIN
exportfile SYSIN $SYSIN
cat > $SYSIN <</*
COPY INDD=INDD1 OUTDD=OUTDD1
/*
logmsg2 "Executing--> uvcp \"fili1=$INDD1,rcs=80,typ=LST,filo1=$OUTDD1,r..."
#3----------------------------------------------------------------------
uvcp "fili1=$INDD1,rcs=80,typ=LST,filo1=$OUTDD1,rcs=80,typ=LSTt"
#4----------------------------------------------------------------------
| Note |
|
exportfile INDD101 $HEADERS #DDNAME=HEADERS <-- concat 1 (see ERR note below) ===========================
HEADERS=$JTMP/${JSTEP}_${PROGID}_HEADERS <-- instream 1
========================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is the listing, AFTER we have moved the INSTREAM file definition up prior to the multi-part file definition.
#1======================= begin step#S0010 IEBCOPY ======================== S0010=A JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto=""; logmsg2 "******** Begin Step $JSTEP iebcopy (#$XSTEP) ********" ##STEP1 EXEC PGM=IEBCOPY export PROGID=iebcopy export PARM=""
HEADERS=$JTMP/${JSTEP}_${PROGID}_HEADERS <-- instream 1
exportfile HEADERS $HEADERS <-- instream 2
cat > $HEADERS <</* <-- instream 3
PRODUCT# DESCRIPTION <-- instream 4
======================================== <-- instream 5
/* <-- instream 6
exportfile INDD101 $HEADERS #DDNAME=HEADERS <-- concat 1
exportfile INDD102 ar/sales.products <-- concat 2
exportfile INDD1 $JTMP/_headers02 <-- concat 3
cat $INDD101 $INDD102 \ <-- concat 4
>$INDD1 <-- concat 5
exportfile OUTDD1 ar/product.list
SYSIN=$JTMP/${JSTEP}_${PROGID}_SYSIN
exportfile SYSIN $SYSIN
cat > $SYSIN <</*
COPY INDD=INDD1 OUTDD=OUTDD1
/*
logmsg2 "Executing--> uvcp \"fili1=$INDD1,rcs=80,typ=LST,filo1=$OUTDD1,r..."
#3----------------------------------------------------------------------
uvcp "fili1=$INDD1,rcs=80,typ=LST,filo1=$OUTDD1,rcs=80,typ=LSTt"
#4----------------------------------------------------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
IEBCOPY2.jcl (JCL illustrating DDNAME forward reference, listed on page '6F1') is provided in /home/uvadm/mvstest/testlibs/jcl0. You can convert, fix,& run the demo JCL/script, if you have setup user 'mvstest' as in Part_1 (or copied to subdir testlibs/jcl0 in your homedir, as instructed on page '1P4').
#1. Login as mvstest (or as yourself if testlibs/testdata in your homedir)
#2. cdl --> $HOME/testlibs (alias cdl='cd $RUNLIBS)
#3. jcl2ksh51 jcl0/IEBCOPY2.jcl
===========================
- convert JCL to script in jcls/iebcopy2.ksh
#4. iebcopy2.ksh <-- attempt to run before fix
============ - will get ERROR
#5. vi jcls/iebcopy2.ksh <-- manual changes to fix DDNAME forward reference
==================== - see BEFORE & AFTER on pages '6F2' & '6F3'
#6. iebcopy2.ksh <-- run after fix
============
#7. check results, display output file, confirm concatenation OK
#7a. cdl --> $HOME/testdata (alias cdd='cd $RUNDATA)
#7b. cat ar/product.list <-- display output, confirm files concatenated
===================
PRODUCT# DESCRIPTION
========================================
BBQ010 BAR-B-Q
CHR015 LAWN CHAIR
HAM010 CLAW HAMMER
HAM020 BALL PEEN HAMMER
HAM035 JACK HAMMER
SAW011 HAND SAW
SAW012 RIP SAW
SAW051 POWER SAW
TAB012 LAWN TABLE
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#8. joblog iebcopy2.ksh <-- rerun with script 'joblog'
=================== - captures log in joblog/iebcopy2.log
#9. cat joblog/iebcopy2.log <-- display console log file
=======================
091029:141026:IEBCOPY2: Begin Job=IEBCOPY2 091029:141026:IEBCOPY2: /home/mvstest/testlibs/jcls/iebcopy2a.ksh 091029:141026:IEBCOPY2: Arguments: 091029:141026:IEBCOPY2: RUNLIBS=/home/mvstest/testlibs 091029:141026:IEBCOPY2: RUNDATA=/home/mvstest/testdata 091029:141026:IEBCOPY2: JTMP=jobtmp/IEBCOPY2 SYOT=sysout/IEBCOPY2 091029:141026:IEBCOPY2: RUNDATE=20091029 091029:141026:IEBCOPY2: ******** Begin Step S0010 iebcopy (#1) ******** 091029:141026:IEBCOPY2: file: HEADERS=jobtmp/IEBCOPY2/S0010_iebcopy_HEADERS bytes= 091029:141026:IEBCOPY2: file: INDD101=jobtmp/IEBCOPY2/S0010_iebcopy_HEADERS bytes=63 091029:141026:IEBCOPY2: file: INDD102=ar/sales.products bytes=179 091029:141026:IEBCOPY2: file: INDD1=jobtmp/IEBCOPY2/_headers02 bytes= 091029:141026:IEBCOPY2: file: OUTDD1=ar/product.list bytes=242 091029:141026:IEBCOPY2: file: SYSIN=jobtmp/IEBCOPY2/S0010_iebcopy_SYSIN bytes= 091029:141026:IEBCOPY2: Executing--> uvcp "fili1=jobtmp/IEBCOPY2/_headers02,rcs=80,typ=LST,filo1=ar/product.list,r... 091029:141026:IEBCOPY2: uvcp fili1=jobtmp/IEBCOPY2/_headers02,filo1=ar/product.list 091029:141026:IEBCOPY2: EOF fili01 11 rds, 242 size; jobtmp/IEBCOPY2/_headers02 091029:141026:IEBCOPY2: EOF filo01 11 wrts, 242 size; ar/product.list 091029:141026:IEBCOPY2: Job Times: Begun=14:10:26 End=14:10:26 Elapsed=00:00:00 091029:141026:IEBCOPY2: EOF filr01 rds=5 size=10240: /home/mvstest/testdata/ctl/gdgctl51I 091029:141026:IEBCOPY2: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The manual correction procedure (described on the following page) is OK, if the problem incidence rate is low, but in case your site has dozens or hundreds of jobs with the DDNAME problem, we have provided uvcopy job 'ddnamefix1' to fix the problem automatically.
This automatic fix assumes that all instances of #DDNAME= are part of a multi- part file & DDNAME=... is a forward reference to INSTREAM data. This was true for the first batch of JCL/scripts we saw with this problem.
#1. Login as yourself or appsadm
#2. cdl --> $TESTLIBS
#3. mkdir jcl4 <-- make new subdir for output
==========
#4. uvcopyx ddnamefix1 jcl3 jcl4 uop=q0i7 <-- run uvcopy job 'ddnamefix1'
=====================================
- copies all JCL/scripts from jcl3 to jcl4
- fixes jobs with the problem, copies others unchanged
#5a. alldiff2 jcl3 jcl4 <-- create difference report
==================
#5b. vi tmp/jcl4.dif <-- examine diff report to verify chanages
===============
#6. vi jcl4/... <-- possible manual corrections
=========== - none required in our 1st batch of JCL/scripts
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# ddnamefix1 - fix JCL/scripts with DDNAME forward refs to INSTREAM data
# - in multi-part files (1 part DDNAME ref to instream following)
# - see www.uvsoftware.ca/mvsjcl.htm#6F1
# - by Owen Townsend, UV Software, Oct30/2009
#
# uvcopy ddnamefix1,fili1=jcl3/jobx.ksh,filo1=jcl4/jobx.ksh
# =========================================================
# - fix 1 job at a time (for testing)
#
# uvcopyx ddnamefix1 jcl3 jcl4 uop=q0i7
# =====================================
# - fix all jobs in directory (while copying from jcl3/... to jcl4/...)
#
# ** problem illustrated - original JCL **
#
# //INDD1 DD DDNAME=HEADERS #DDNAME=HEADERS <-- assume IDs multi-part file
# // DD DSN=AR.SALES.PRODUCTS <-- end multi-part file
# //HEADERS DD * <-- col 1 match to DDNAME (begin instream group)
# PRODUCT# DESCRIPTION <-- instream data (max 8 lines for this fix)
# /* <-- /* marks end of instream data
#
# ** problem illustrated - converted script to be fixed **
#
# exportfile INDD101 ar/sales.products <-- 1st of multi-part file
# exportfile INDD102 $HEADERS #DDNAME=HEADERS <-- #DDNAME= IDs problem
# exportfile INDD1 $JTMP/_headers02
# cat $INDD101 $INDD102
# >$INDD1
# #----DDNAME in multi-part file above, ensure def precedes
# HEADERS=$JTMP/${JSTEP}_${PROGID}_HEADERS <-- col 1 match to DDNAME
# exportfile HEADERS $HEADERS - IDs begin instream data
# cat > $HEADERS <</*
# PRODUCT# DESCRIPTION
# /* <-- end of instream data
#
# ** logic **
#
# Read entire JCL/script into memory table
# Begin loop to search table for next #DDNAME=
# (unique pattern inserted by converter & assumed to be in multi-part file)
# - if #DDNAME not 1st in multi-part, search back to the '01' part
# - search following 20 lines max for DDNAME value match starting in col 1
# - then search following 30 lines max for instream data end '/*' in cols 1&2
# - swap 2 groups of lines
# Repeat above loop until end of table reached (all DDNAMEs fixed)
# - write table to output dir/file
#
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
was=a200000g5000
fili1=jcl3/iebcopy2.ksh,rcs=128,typ=LST
filo1=jcl4/iebcopy2.ksh,rcs=128,typ=LSTt
@run
opn all
rtb fili1,a0(100),a0(100) read entire job into memory table
mvn $ra,0 init rgstr for table search
clr n0(100),' ' clear work area (DDNAME store, etc)
#
# begin loop to search for next '#DDNAME=' (assumed part of multi-part file)
man20 sts aa0(100),a0(100),'#DDNAME='
skp! man90
mvn $re,$ra save ptr to begin next search (+100)
mvu n0(20),ax8,' ' store DDNAME=... value
mvn $rn,$rx save length of name
#
# allow DDNAME not 1st part by search back to 01 (of INDD101 in folwng exmple)
# exportfile INDD101 ar/sales.products
# exportfile INDD102 $HEADERS #DDNAME=HEADERS
man22 scnn2 aa0(50),' ' search to 2nd blank
mvn $rf,$rx save dsplcmnt to 2nd blank in perm rgstr
sub $rf,2 back up 2 to adrs last 2 digits DDN
add $rf,$ra + dsplcmnt to #DDNAME= line
cmc af0(2),'01' reached 01 part ?
skp<= man30
sub $ra,100 backup to prior line
skp man22 repeat til nonblank begin mp found
#
# save dsplcmnt to 1st part & search for DDNAME def in col 1 (20 lines max)
man30 mvn $rb,$ra save dsplcmt to begin multi-part file
lok aa0(100),aa0($rn20),n0($rn20) search for DDNAME def col 1 folwng
skp! man80
mvn $rc,$ra save dsplcmt to DDNAME def (begin instream)
mvn $re,$ra save ptr to begin next search (+100)
# ensure matching DDNAME within 20 lines of begin multi-part file
mvn $rj,$rc dsp to DDNAME def line
sub $rj,$rb - dsp to begin multi-part file
cmn $rj,2000 within 20 lines ?
skp> man80
#
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# search for end of INSTREAM data '/*' in cols 1-2 (within 30 lines)
man40 lok aa0(100),aa0(2),'/*'
skp! man80
mvn $rd,$ra save dsp to '/*' end instream
mvn $re,$ra save ptr to begin next search (+100)
# ensure /* within 30 lines of begin instream
mvn $rk,$rd dsp to '/*' end instream
sub $rk,$rc - dsp to begin instream
cmn $rk,3000 within 30 lines ?
skp> man80
#
# now swap the 2 groups of lines (move instream ahead of multi-part file)
# - by moving out to alternate area 'g' & moving back
# group1 - from $rb for length of $rc-$rb (already calc'd in $rj)
# group2 - from $rc for length of $rd-$rc+100 (or $rk+100)
man50 add $rk,100 calc length of group2
mvn $rg,$rk calc total length
add $rg,$rj = grp1 lth + grp2 lth
clr g0(5000),' ' clear work area (max 50 lines)
mvc g0($rk3000),ac0 move group2 to 1st part alt area
mvc gk0($rj2000),ab0 move group1 to 2nd part alt area
mvc ab0($rg5000),g0 move swapped groups back to table
#
# end of each #DDNAME ID'd multi-part file & instream test/swap
# - or end point if swap criteria not all met
man80 mvn $ra,$re load saved dsp to begin next search
add $ra,100 + 1 line, so we dont find same again
skp man20 repeat loop until end of table
#
# end of table reached - write out & close files
man90 wtbe filo1,a0(100),a0(100)
cls all
eoj
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| 7A1. | Overview of Console Logging, Job Debug Logging,& Job Message Logging |
| 7A2. | Console Logging, captures all console I/O for entire batch shift |
| - activate by uncommenting 6 lines at end of profile | |
| - console logs created in /home/appsadm/log1/userid/... | |
| - see more details at ADMjobs.htm#Part_6 |
| 7A3. | Job Debug Logging, for programmers to capture 1 joblog at a time |
| 7A4. | Demo 'joblog' to capture log from JCL/script jgl100.ksh |
| 7A5. | Job Message Logging, captures only the most critical console messages |
| 7A6. | Demo 'jobmsgs1' script to concatenate separate jobmsglogs |
| - also see demo begining on page '7D1' |
| 7B1. | Demo/Execute JCL/script jgl200.ksh 4 times, forcing ERRors on some runs |
| 7B3. | Listing of the 'jgl200.ksh' JCL/script |
| 7C1. | Listing of the 'Console Log' (6 pages) |
| 7D1. | Running the 'jobmsgs1' script to combine jobmsglogs to ALL & ERR files |
| 7D2. | Listing the 'ALL' jobmsglog |
| 7D3. | Listing the 'ERR' jobmsglog |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Console logs are essential to running batch JCL/COBOL applications on mainframe systems. There is no built-in console logging on Unix/Linux systems, but the Vancouver Utilities provide 3 methods of console logging to fit the needs of operators, programmers,& applications administrators.
Please see MVSJCL.htm#Part_7 for samples & demos of the Vancouver Utility logging systems. Part_7 also illustrates GDG file ERROR recovery. New generations of GDG files are written to the 'jobtmp' directory until the 'Normal EOJ' is reached, when they are moved to their intended directories.
Note that the GDG error Abnormal Termination cannot be missed, since the operator is forced to acknowledge the error. If run by cron overnight, any errors any Abnormal Terminations are emailed to the Applications Administrator.
When the job is rerun, the JCL/script system gives operators the choice of re- running the error job from the begining, or restarting from any specified step.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Console Logging is documented at ADMjobs.htm#Part_6. Here is a brief review:
Console Logging is activated by uncommenting 6 lines at the end of the supplied stub_profile (renamed .profile or .bash_profile). Listing at ADMjobs.htm#1C1.
........ last few lines of profile ........
#--------------------------------------------------------------------------
# Capture console log files (see details at www.uvsoftware.ca/admjobs.htm)
# ---> uncomment next 6 lines in profiles of users who require logging
# login1 || exit 2 # exit here if 2nd login
# logfixA # process log1 file to log2 (to allow read/print)
# echo "console logging requires aliases to be stored in .bashrc or .kshrc"
# echo "--> . aliases <-- 'dot' execute aliases NOW, if not in .bashrc/.kshrc"
# echo "--> logview <-- execute logview script to see prior console logs"
# exec script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)
# - 'exec script' must be the last non-comment line in the profile
# - 'script' disables 'aliases', put them in '.bashrc' to make them effective
#--------------------------- end of stub_profile ---------------------------
/home/appsadm :-----log1 <-- log files created here (for active users) : :-----user1 - sub-directoried by user login : : :-----yymmdd_HHMMSS - date/time stamped log files : :-----user2 : : :-----yymmdd_HHMMSS - only 1 file per user in log1/user/... : :-----.etc. :-----log2 <-- processed to log2 to remove screen ctl chars : :-----user1 to enable viewing & printing : : :-----yymmdd_HHMMSS - files collected for 1 month : : :-----080806_110500 - multiple date/time stamped files per user : :-----user2 : : :-----yymmdd_HHMMSS : :-----.etc.
Console logs are date/time stamped & collected in $APPSADM/log1/userid/... and processed to $APPSADM/log2/userid/... to remove screen control characters to enable viewing & printing. This processing & printing might be performed by a cron script every night after batch shifts are completed.
If desired you can force the console log processing at any time simply by logging off & back on (due to the code at the end of your .bash_profile). You would then use the 'logview' script to see your latest logfile (or any previous logfile).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Console Logging (described above) is primarily intended to capture all console messages for all JCL/scripts run by an operator during an entire batch shift.
This is not convenient for programmers, who may want to capture the log for just 1 job at a time, since console logging requires logoff/logon/logview to see the log.
Script joblog is provided for programmers to capture the console messages for 1 job at a time.
/home/mvstest :-----testdata <-- RUNDATA=$TESTDATA=$RUNDATA=/home/mvstest/testdata : :-----ar : :-----gl - datafile directories, option to use top-nodes : :-----py (or could put all datafiles in mstr/...) : :-----ftp : :-----jobctl - for jobstop stop at begin each step for debug : :-----joblog - Job Debug logs stored here (by joblog script) : :-----jobmsgs - job progress msgs (step begin, end Normal/AbTerm) : :-----jobtmp - job temporary files (new GDGs restored at EOJ_ : :-----mstr - could put all datafiles in 1 subdir : :-----pf - user written uvcopy jobs : :-----rpts - reports : :-----sf - user written Korn shell scripts : :-----sysout - COBOL DISPLAY upon SYSLST reports : :-----tape - tape files reassigned to disc by JCL converter : :-----tmp - misc temp files & sort work files : :-----wrk - work files (inter-step)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1. Login as mvstest --> /home/mvstest
================
#2. cdd --> alias 'cd $RUNDATA' --> /home/mvstest/testdata
===
#3. jgl100.ksh <-- execute JCL/script
==========
#4. more joblog/jgl100.ksh <-- display the joblog
======================
080827:092705:JGL100: Begin Job=JGL100 080827:092705:JGL100: /home/mvstest/testlibs/jcls/jgl100.ksh 080827:092705:JGL100: Arguments: 080827:092705:JGL100: RUNLIBS=/home/mvstest/testlibs 080827:092705:JGL100: RUNDATA=/home/mvstest/testdata 080827:092705:JGL100: JTMP=jobtmp/JGL100 SYOT=sysout/JGL100 080827:092705:JGL100: RUNDATE=20080827 080827:092705:JGL100: Begin Step S0010 cgl100 (#1) 080827:092705:JGL100: gen0: ACCTMAS=gl/account.master_000003 insize=8720 080827:092705:JGL100: gen+1: ACTLIST=jobtmp/JGL100/GDG/gl/account.acntlist_000004 gens=8 080827:092705:JGL100: file: SYSOUT=sysout/JGL100/S0010_SYSOUT bytes=0 080827:092706:JGL100: Job Times: Begun=09:27:05 End=09:27:06 Elapsed=00:00:01 080827:092706:JGL100: moving jobtmp/JGL100/GDG/subdir/files back to $RUNDATA/subdirs/ `jobtmp/JGL100/GDG/gl/account.acntlist_000004' -> `gl/account.acntlist_000004' 080827:092706:JGL100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
This is an overview of 'Job Message Logging'. Also see the jobmsglog demo later begining on page '7D1'.
'Job Message Logging' captures just the most vital console messages (vs all messages captured by 'Console Logging').
These vital/ERRor messages are captured by the 'logmsg2' script called from the JCL/scripts (vs 'logmsg1' used for less important messages).
A date/time stamped jobmsglog file is written (for each JCL/script executed), to $RUNDATA/jobmsgs/... For example after running jgl100.ksh & jgl200.ksh, you might see:
l jobmsgs - list message logs in $RUNDATA/jobmsgs =========
-rw-rw-r-- 1 mvstest apps 159 Aug 3 20:47 080803:204707_JGL100 -rw-rw-r-- 1 mvstest apps 208 Aug 3 20:47 080803:204726_JGL200
more jobmsgs/* <-- show ALL files in jobmsgs/... ==============
080803:204707:JGL100: Begin Job=JGL100 <--file#1 080803:204707:JGL100: Begin Step S0010 cgl100 (#1) 080803:204707:JGL100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010 080803:204726:JGL200: Begin Job=JGL200 <-- file#2 080803:204726:JGL200: Begin Step S0010 sort (#1) 080803:204726:JGL200: Begin Step S0020 cgl200 (#2) 080803:204726:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
After running a batch shift of many JCL/scripts, you would see many separate files in $RUNDATA/jobmsgs/... Script 'jobmsgs1' makes it easier to review all jobmsgs by concatenating them all together (inserting blank line separators), into $RUNDATA/jobmsgs1/yymmddALL.
The script also writes to $RUNDATA/jobmsgs1/yymmddERR if any 'ERR' message is found anywhere in a jobmsglog file.
jobmsgs1 jobmsgs <-- concatenate to jobmsgs1/yymmddALL & jobmsgs1/yymmddERR ================
l jobmsgs1 <-- display output filenames ==========
-rw-rw-r-- 1 mvstest apps 1934 Aug 4 09:12 ALL -rw-rw-r-- 1 mvstest apps 1516 Aug 4 09:12 ERR
more jobmsgs1/yymmddALL <-- display ALL file contents (concatenated together) ======================= - blank line separators inserted by jobmsgs1 script
080803:204707:JGL100: Begin Job=JGL100 080803:204707:JGL100: Begin Step S0010 cgl100 (#1) 080803:204707:JGL100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
080803:204726:JGL200: Begin Job=JGL200 080803:204726:JGL200: Begin Step S0010 sort (#1) 080803:204726:JGL200: Begin Step S0020 cgl200 (#2) 080803:204726:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
| Note |
|
We suggest you run a nightly cron script, which would execute the 'jobmsgs1' script to create the jobmsgs1/yymmddALL & jobmsgs1/yymmddERR reports, and then clear all files from the jobmsgs/... directory for re-accumulation the next day.
For multi-day jobmsglog history, JCL/script/logmsg2 also writes files to $APPSADM/jobmsgs/yymmdd/yymmdd:HHMMSS_JOBID. You could use a cron script to remove files older than 10 or 15 days ?
See sample 'crontabs' & scripts in ADMjobs.htm#Part_5.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
If you have setup 'mvstest' & converted the demo JCL & COBOL (as documented begining at MVSJCL.htm#1P1, you can run the following demo. You must also activate 'console logging' as described in ADMjobs.htm#Part_6.
#0a. Login as mvstest --> /home/mvstest
================
#0b. cdd --> alias 'cd $RUNDATA' --> /home/mvstest/testdata
===
#0c. testdatainit <-- clear any prior jobmsgs, etc
============
#0d. l gl <-- list gl/... (BEFORE new GDG's created)
====
#1. jgl200.ksh <-- run#1, Terminates Normally
==========
#2a. cdl --> alias 'cd $RUNLIBS' --> /home/mvstest/testlibs'
===
#2b. vi jcls/jgl200.ksh <-- modify JCL/script to force ERR on step 2
================== - change line #65 from 'LCC=$?' to LCC=99'
#2c. jgl200.ksh <-- run#2, Terminates Abnormally
==========
#3a. vi jcls/jgl200.ksh <-- correct line #65 back to 'LCC=$?'
==================
#3b. jgl200.ksh <-- run#3, Terminates Normally, BUT you get WARNing
========== 'GDG files NOT moved from jobtmp to gl/... subdir'
--> reply 'n' <-- to rerun from begining (vs restart step2)
(usually best to rerun from begining & reply 'n')
----- OR -----
#3c. jgl200.ksh step=S0020 <-- run#3 RESTART from step#2
=====================
--> reply 'y' <-- to move GDG files from jobtmp to gl/...
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#4. jgl200.ksh <-- run#4, Terminates Normally
==========
#5. l gl <-- list gl/... (AFTER new GDG's created)
====
#6a. exit & log back in to process the console log
==================
#6b. logview <-- run script to view latest console log
=======
#7a. cdd --> alias 'cd $RUNDATA' --> /home/mvstest/testdata
===
#7b. l jobmsgs <-- list files created by 4 executions of jgl200.ksh
=========
#7c. jobmsgs1 jobmsgs <-- concatenate jobmsgs1/yymmddALL & jobmsgs1/yymmddERR
================
#7d. more jobmsgs1/yymmddALL <-- inspect ALL jobmsgs
=======================
#7e. more jobmsgs1/yymmddERR <-- inspect ERR jobmsgs
=======================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is the JCL/script we use to demo console & job message logging. Note line k#067, which we change from 'LCC=$?' to LCC=99' to force an ERRor and demo the GDG file system ERRor recovery.
k#001 #!/bin/ksh k#002 ##JGL200 JOB (1234),'TEST/DEMO MVS JCL CONVERSION' k#003 export JOBID2=JGL200 jobid2=jgl200; scriptpath="$0"; args="$*" k#004 if [[ -z "$JOBID1" ]]; then export JOBID1=$JOBID2; fi k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done k#006 integer JCC=0 SCC=0 LCC=0 # init step status return codes k#007 autoload jobset51 jobset52 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 k#008 autoload exportfile exportgen0 exportgen1 exportgenall exportgenx k#009 . $APPSADM/env/stub.ini #<-- for control-M (see notes in env/stub.ini) k#010 jobset51 # call function for JCL/script initialization k#011 goto k#012 S0000=A k#013 # * SORT TRANSACTIONS & UPDATE GL ACCOUNT MASTER k#014 # * - demo GDG processing, write gltrans(+1) & read back as (+1) k#015 ##STEPA EXEC PGL200,HLQ=GL,YEAREND=2003 #<-PROC1call k#016 ##PGL200 PROC HLQ=GL,YEAREND=2002 k#017 HLQ="GL";YEAREND="2002"; k#018 ##STEPA EXEC PGL200,HLQ=GL,YEAREND=2003 #<-PROC1exp k#019 HLQ="GL";YEAREND="2003"; k#020 # * SORT GL TRANSACTIONS BEFORE UPDATING ACCOUNT MASTER k#021 #1======================= begin step#S0010 SORT ======================== k#022 S0010=A k#023 stepctl51; #calc StepTimes & check jobstop/goto end k#024 goto k#025 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto=""; k#026 logmsg2 "******** Begin Step $JSTEP sort (#$XSTEP) ********" k#027 ##STEPA EXEC PGM=SORT,REGION=2048K k#028 export PROGID=sort k#029 export PARM="" k#030 exportfile SORTIN1 data/gl.account.tran1 k#031 exportgen1 +1 SORTOUT $JGDG/data/gl.account.trans_ k#032 #exportgen1 $JGDG/subdir/tempfiles restored to outdir at Normal EOJ k#033 exportfile SYSIN $RUNLIBS/parms/pgl200s1 k#034 #2-------------------------- parms/pgl200s1 --------------------------- k#035 # SORT FIELDS=(1,8,CH,A,69,12,CH,A) k#036 logmsg2 "Executing--> uvsort \"fili1=$SORTIN1,typ=RSF,rcs=80,filo1=$SORT..." k#037 #3---------------------------------------------------------------------- k#038 uvsort "fili1=$SORTIN1,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\ k#039 ,keys=(0,8,c,a,68,12,c,a)" k#040 #4---------------------------------------------------------------------- k#041 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto=""; k#042 if ((S0010C != 0)) #need to modify for COND step S0020 k#043 then logmsg2 "ERR: step#$JSTEP sort abterm $SCC" k#044 alias goto="<<S9900=A"; fi k#045 goto k#046 #/=* UPDATE ACCOUNT.MASTER WITH TRANSACTION DETAIL k#047 #1======================= begin step#S0020 CGL200 ======================== k#048 if ((SCC > 4)); then # COND=(4,LT,STEP010) k#049 alias goto="<<S9000=A"; fi k#050 goto k#051 S0020=A k#052 stepctl51; #calc StepTimes & check jobstop/goto end k#053 goto k#054 export JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto=""; k#055 logmsg2 "******** Begin Step $JSTEP cgl200 (#$XSTEP) ********" k#056 ##STEP020 EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND k#057 export PROGID=cgl200 k#058 export PARM="2003" k#059 exportgen1 +1 GLTRANS $JGDG/data/gl.account.trans_ k#060 #exportgen1 $JGDG/subdir/tempfiles restored to outdir at Normal EOJ k#061 exportgen0 0 GLMSOLD data/gl.account.master_ k#062 exportgen1 +1 GLMSNEW $JGDG/data/gl.account.master_ k#063 logmsg2 "Executing--> cobrun $ANIM $RLX/cgl200" k#064 #3---------------------------------------------------------------------- k#065 cobrun $ANIM $RLX/cgl200 k#066 #4---------------------------------------------------------------------- k#067 LCC=99; S0020C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0020R=1; alias goto=""; k#068 if ((S0020C != 0)) k#069 then logmsg2 "ERR: step#$JSTEP cgl200 abterm $SCC" k#070 alias goto="<<S9900=A"; fi k#071 goto k#072 #/=*.#PEND1 PGL200 k#073 #8====================================================================== k#074 S9000=A k#075 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs k#076 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP" k#077 exit 0 #ver:20120208 a1b2c0d1e2f3g1i1j0k3l40m4n3o0p0r0s0t1u1v3w0x0y1z0 k#078 #9====================================================================== k#079 S9900=A k#080 logmsg2 "JobEnd=AbTerm, JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK k#081 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs k#082 exit $JCC
| Note |
|
k#067 LCC=99; S0020C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0020R=1; alias goto=""; =============
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Script started on Mon 04 Aug 2008 09:07:16 AM PDT
<@:mvstest:/home/mvstest> cdd
===
<@:mvstest:/home/mvstest/testdata> l
drwxrwxr-x 2 mvstest apps 4096 May 27 21:26 ar
drwxrwxr-x 2 mvstest apps 4096 Aug 4 09:06 gl
drwxrwxr-x 2 mvstest apps 4096 Jul 26 2007 glsave
drwxrwxr-x 2 mvstest apps 4096 Dec 2 2005 jobctl
drwxrwxr-x 2 mvstest apps 4096 Aug 4 09:04 joblog
drwxrwxr-x 2 mvstest apps 4096 Aug 4 09:04 jobmsgs
drwxrwxr-x 2 mvstest apps 4096 Aug 4 09:04 jobmsgs1
drwxrwxr-x 2 mvstest apps 4096 Aug 4 09:04 jobtmp
drwxrwxr-x 2 mvstest apps 4096 Mar 19 16:17 pf
drwxrwxr-x 2 mvstest apps 4096 Apr 20 14:42 rpts
drwxrwxr-x 2 mvstest apps 4096 May 23 2007 sf
drwxrwxr-x 2 mvstest apps 4096 Aug 4 09:04 sysout
drwxrwxr-x 2 mvstest apps 4096 May 28 10:50 tape
drwxrwxr-x 2 mvstest apps 4096 Aug 4 09:04 tmp
drwxrwxr-x 2 mvstest apps 4096 Aug 4 09:04 wrk
<@:mvstest:/home/mvstest/testdata> l gl
====
-rw-rw-r-- 1 mvstest apps 3394 Aug 4 09:06 account.acntlist_000001
-rw-rw-r-- 1 mvstest apps 3394 Aug 4 09:06 account.acntlist_000002
-rw-rw-r-- 1 mvstest apps 3394 Aug 4 09:06 account.acntlist_000003
-rw-rw-r-- 1 mvstest apps 8720 Aug 4 09:06 account.master_000001
-rw-rw-r-- 1 mvstest apps 8720 Aug 4 09:06 account.master_000002
-rw-rw-r-- 1 mvstest apps 8720 Aug 4 09:06 account.master_000003
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.tran1
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.trans_000001
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.trans_000002
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.trans_000003
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.trans_000004
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.trans_000005
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
<@:mvstest:/home/mvstest/testdata> jgl200.ksh <-- run#1, Terminates Normally
==========
080829:151518:JGL200: Begin Job=JGL200
080829:151518:JGL200: /home/mvstest/testlibs/jcls/jgl200.ksh
080829:151518:JGL200: Arguments:
080829:151518:JGL200: RUNLIBS=/home/mvstest/testlibs
080829:151518:JGL200: RUNDATA=/home/mvstest/testdata
080829:151518:JGL200: JTMP=jobtmp/JGL200 SYOT=sysout/JGL200
080829:151518:JGL200: RUNDATE=20080829
080829:151518:JGL200: Begin Step S0010 sort (#1)
080829:151518:JGL200: file: SORTIN=gl/account.tran1 bytes=1600
080829:151518:JGL200: gen+1: SORTOUT=jobtmp/JGL200/GDG/gl/account.trans_000006 gens=18
080829:151518:JGL200: file: SYSIN=gl/parms/pgl200s1 bytes=
080829:151518:JGL200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 bytes=34
080829:151518:JGL200: uvsort fili1=gl/account.tran1,filo1=jobtmp/JGL200/GDG/gl/account.trans_000006
080829:151518:JGL200: EOF fili01 20 rds, 1600 size; gl/account.tran1
080829:151518:JGL200: sort phase complete, used 64 megabytes, sort output begin
080829:151518:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/JGL200/GDG/gl/account.trans_000006
080829:151518:JGL200: Begin Step S0020 cgl200 (#2)
080829:151518:JGL200: gen+1: GLTRANS=jobtmp/JGL200/GDG/gl/account.trans_000006 gens=18
080829:151518:JGL200: gen0: GLMSOLD=gl/account.master_000003 insize=8720
080829:151518:JGL200: gen+1: GLMSNEW=jobtmp/JGL200/GDG/gl/account.master_000004 gens=10
080829:151518:JGL200: Job Times: Begun=15:15:18 End=15:15:18 Elapsed=00:00:00
080829:151518:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/
`jobtmp/JGL200/GDG/gl/account.master_000004' -> `gl/account.master_000004'
`jobtmp/JGL200/GDG/gl/account.trans_000006' -> `gl/account.trans_000006'
080829:151518:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
<@:mvstest:/home/mvstest/testdata> cdl
===
<@:mvstest:/home/mvstest/testlibs> vi jcls/jgl200.ksh
==================
--- use vi to change line 99 of jgl200.ksh from 'LCC=$?' to 'LCC=99'
--- to force failure on next run (to demo jobmsglog ERRors)
<@:mvstest:/home/mvstest/testlibs> cdd
===
<@:mvstest:/home/mvstest/testdata> jgl200.ksh <-- run#2, Terminates Abnormally
==========
080829:151556:JGL200: Begin Job=JGL200
080829:151556:JGL200: /home/mvstest/testlibs/jcls/jgl200.ksh
080829:151556:JGL200: Arguments:
080829:151556:JGL200: RUNLIBS=/home/mvstest/testlibs
080829:151556:JGL200: RUNDATA=/home/mvstest/testdata
080829:151556:JGL200: JTMP=jobtmp/JGL200 SYOT=sysout/JGL200
080829:151556:JGL200: RUNDATE=20080829
080829:151556:JGL200: Begin Step S0010 sort (#1)
080829:151556:JGL200: file: SORTIN=gl/account.tran1 bytes=1600
080829:151556:JGL200: gen+1: SORTOUT=jobtmp/JGL200/GDG/gl/account.trans_000007 gens=18
080829:151556:JGL200: file: SYSIN=gl/parms/pgl200s1 bytes=
080829:151556:JGL200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 bytes=34
080829:151556:JGL200: uvsort fili1=gl/account.tran1,filo1=jobtmp/JGL200/GDG/gl/account.trans_000007
080829:151556:JGL200: EOF fili01 20 rds, 1600 size; gl/account.tran1
080829:151556:JGL200: sort phase complete, used 64 megabytes, sort output begin
080829:151556:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/JGL200/GDG/gl/account.trans_000007
080829:151556:JGL200: Begin Step S0020 cgl200 (#2)
080829:151556:JGL200: gen+1: GLTRANS=jobtmp/JGL200/GDG/gl/account.trans_000007 gens=18
080829:151556:JGL200: gen0: GLMSOLD=gl/account.master_000004 insize=8720
080829:151556:JGL200: gen+1: GLMSNEW=jobtmp/JGL200/GDG/gl/account.master_000005 gens=10
080829:151556:JGL200: ERR: step#S0020 cgl200 abterm 99
080829:151556:JGL200: ERR: Terminated Abnormally,JCC=99,StepsExec=2,Last=S0020 y/n?
080829:151558:JGL200: Job Times: Begun=15:15:56 End=15:15:58 Elapsed=00:00:02
080829:151558:JGL200: ERR: GDG files NOT moved from jobtmp/subdirs to /home/mvstest/testdata/subdirs
080829:151558:JGL200: - can rerun OK, since GDGs not added to RUNDATA/subdirs
080829:151558:JGL200: - OR restart at abterm step & reply y to move prompt
080829:151558:JGL200: ERR: jobtmp/JGL200/GDG/gl/files NOT moved to $RUNDATA/gl/ listed below:
gl/account.trans_000007
gl/account.master_000005
080829:151558:JGL200: - reply y/n acknowledge GDG msg, but no auto action y/n?
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
<@:mvstest:/home/mvstest/testdata> cdl
===
<@:mvstest:/home/mvstest/testlibs> vi jcls/jgl200.ksh
==================
--- use vi to change line 99 of jgl200.ksh from 'LCC=99' back to 'LCC=$?'
--- to demo recovery from GDG files NOT moved from jobtmp/... to gl subdir
<@:mvstest:/home/mvstest/testlibs> cdd
===
<@:mvstest:/home/mvstest/testdata> jgl200.ksh <-- run#3, Terminates Normally,
========== BUT you get WARNing
080829:151615:JGL200: Begin Job=JGL200
080829:151615:JGL200: /home/mvstest/testlibs/jcls/jgl200.ksh
080829:151615:JGL200: Arguments:
080829:151615:JGL200: RUNLIBS=/home/mvstest/testlibs
080829:151615:JGL200: RUNDATA=/home/mvstest/testdata
080829:151615:JGL200: JTMP=jobtmp/JGL200 SYOT=sysout/JGL200
080829:151615:JGL200: RUNDATE=20080829
111127:131222:JGL200: WARN: files in jobtmp/GDG subdirs (from prior AbTerm ERR?)
111127:131222:JGL200: ---- files in jobtmp/JGL200/GDG/*/* listed below:
jobtmp/JGL200/GDG/gl/account.master_000005
jobtmp/JGL200/GDG/gl/account.trans_000007
111127:131222:JGL200: If NO restart by step#, GDG files jobtmp/ will be cleared
111127:131222:JGL200: - allows rerun from begin job with no worry about GDGs
111127:131222:JGL200: If RESTARTing by step#, example--> jobname.ksh step=S0050
111127:131222:JGL200: - GDG files in jobtmp/... will NOT be cleared
111127:131222:JGL200: - will be available to steps after restart step#
111127:131222:JGL200: - will be restored to data/... subdir at JobEnd=Normal
111127:131222:JGL200: enter to continue
080829:151617:JGL200: Begin Step S0010 sort (#1) 080829:151617:JGL200: file: SORTIN=gl/account.tran1 bytes=1600 080829:151617:JGL200: gen+1: SORTOUT=jobtmp/JGL200/GDG/gl/account.trans_000007 gens=18 080829:151617:JGL200: file: SYSIN=gl/parms/pgl200s1 bytes= 080829:151617:JGL200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 bytes=34 080829:151617:JGL200: uvsort fili1=gl/account.tran1,filo1=jobtmp/JGL200/GDG/gl/account.trans_000007 080829:151617:JGL200: EOF fili01 20 rds, 1600 size; gl/account.tran1 080829:151617:JGL200: sort phase complete, used 64 megabytes, sort output begin 080829:151617:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/JGL200/GDG/gl/account.trans_000007 080829:151617:JGL200: Begin Step S0020 cgl200 (#2) 080829:151617:JGL200: gen+1: GLTRANS=jobtmp/JGL200/GDG/gl/account.trans_000007 gens=18 080829:151617:JGL200: gen0: GLMSOLD=gl/account.master_000004 insize=8720 080829:151617:JGL200: gen+1: GLMSNEW=jobtmp/JGL200/GDG/gl/account.master_000005 gens=10 080829:151617:JGL200: Job Times: Begun=15:16:17 End=15:16:17 Elapsed=00:00:00 080829:151617:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/ `jobtmp/JGL200/GDG/gl/account.master_000005' -> `gl/account.master_000005' `jobtmp/JGL200/GDG/gl/account.trans_000007' -> `gl/account.trans_000007' 080829:151617:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
<@:mvstest:/home/mvstest/testdata> jgl200.ksh <-- run#4, Terminates Normally
==========
080829:152825:JGL200: Begin Job=JGL200
080829:152825:JGL200: /home/mvstest/testlibs/jcls/jgl200.ksh
080829:152825:JGL200: Arguments:
080829:152825:JGL200: RUNLIBS=/home/mvstest/testlibs
080829:152825:JGL200: RUNDATA=/home/mvstest/testdata
080829:152825:JGL200: JTMP=jobtmp/JGL200 SYOT=sysout/JGL200
080829:152825:JGL200: RUNDATE=20080829
080829:152825:JGL200: Begin Step S0010 sort (#1)
080829:152825:JGL200: file: SORTIN=gl/account.tran1 bytes=1600
080829:152825:JGL200: gen+1: SORTOUT=jobtmp/JGL200/GDG/gl/account.trans_000008 gens=18
080829:152825:JGL200: file: SYSIN=gl/parms/pgl200s1 bytes=
080829:152825:JGL200: file: SYSIN=/home/mvstest/testlibs/parms/pgl200s1 bytes=34
080829:152825:JGL200: uvsort fili1=gl/account.tran1,filo1=jobtmp/JGL200/GDG/gl/account.trans_000008
080829:152825:JGL200: EOF fili01 20 rds, 1600 size; gl/account.tran1
080829:152825:JGL200: sort phase complete, used 64 megabytes, sort output begin
080829:152825:JGL200: EOF filo01 20 wrts, 1600 size; jobtmp/JGL200/GDG/gl/account.trans_000008
080829:152825:JGL200: Begin Step S0020 cgl200 (#2)
080829:152825:JGL200: gen+1: GLTRANS=jobtmp/JGL200/GDG/gl/account.trans_000008 gens=18
080829:152825:JGL200: gen0: GLMSOLD=gl/account.master_000005 insize=8720
080829:152825:JGL200: gen+1: GLMSNEW=jobtmp/JGL200/GDG/gl/account.master_000006 gens=10
080829:152825:JGL200: Job Times: Begun=15:28:25 End=15:28:25 Elapsed=00:00:00
080829:152825:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/
`jobtmp/JGL200/GDG/gl/account.master_000006' -> `gl/account.master_000006'
`jobtmp/JGL200/GDG/gl/account.trans_000008' -> `gl/account.trans_000008'
080829:152825:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
<@:mvstest:/home/mvstest/testdata> l gl
====
-rw-rw-r-- 1 mvstest apps 3394 Aug 4 09:06 account.acntlist_000001
-rw-rw-r-- 1 mvstest apps 3394 Aug 4 09:06 account.acntlist_000002
-rw-rw-r-- 1 mvstest apps 3394 Aug 4 09:06 account.acntlist_000003
-rw-rw-r-- 1 mvstest apps 8720 Aug 4 09:06 account.master_000001
-rw-rw-r-- 1 mvstest apps 8720 Aug 4 09:06 account.master_000002
-rw-rw-r-- 1 mvstest apps 8720 Aug 4 09:06 account.master_000003
-rw-rw-r-- 1 mvstest apps 8720 Aug 4 09:08 account.master_000004
-rw-rw-r-- 1 mvstest apps 8720 Aug 4 09:12 account.master_000005
-rw-rw-r-- 1 mvstest apps 8720 Aug 4 09:12 account.master_000006
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.tran1
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.trans_000001
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.trans_000002
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.trans_000003
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.trans_000004
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:06 account.trans_000005
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:08 account.trans_000006
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:12 account.trans_000007
-rw-rw-r-- 1 mvstest apps 1600 Aug 4 09:12 account.trans_000008
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
<@:mvstest:/home/mvstest/testdata> l jobmsgs
=========
-rw-rw-r-- 1 mvstest apps 208 Aug 4 09:08 080804:090804_JGL200
-rw-rw-r-- 1 mvstest apps 701 Aug 4 09:10 080804:091055_JGL200
-rw-rw-r-- 1 mvstest apps 831 Aug 4 09:12 080804:091137_JGL200
-rw-rw-r-- 1 mvstest apps 208 Aug 4 09:12 080804:091216_JGL200
<@:mvstest:/home/mvstest/testdata> jobmsgs1 jobmsgs
================
joblogr1 - copy all files from 1 directory to a 2nd directory
080804:091252:joblogr1: uvcopy ver=20080526 pf=/home/uvadm/pf/IBM/joblogr1
uvcopy DISAM ext=dat LNX L64 license=20080526V site=UV_Software
080804:091252:joblogr1: EOF fili01 rds=10 size=701: jobmsgs/080804:091055_JGL200
080804:091252:joblogr1: EOF fili01 rds=4 size=208: jobmsgs/080804:091216_JGL200
080804:091252:joblogr1: EOF fili01 rds=4 size=208: jobmsgs/080804:090804_JGL200
080804:091252:joblogr1: EOF fili01 rds=12 size=831: jobmsgs/080804:091137_JGL200
080804:091252:joblogr1: EOF fild01 rds=6 size=4096: jobmsgs
080804:091252:joblogr1: EOF filo02 wrts=34 size=1934: jobmsgs1/080804ALL
080804:091252:joblogr1: EOF filo03 wrts=24 size=1516: jobmsgs1/080804ERR
ALL files from jobmsgs combined into jobmsgs1/080804ALL for easier review ---> enter to display jobmsgs1/080804ALL (with more) files with any ERR msgs combined into jobmsgs1/080804ERR to check for ERRs ---> enter to display jobmsgs1/080804ERR (with more)
-------- jobmsgs1/ALL & jobmsgs1/ERR removed from this 'Console Log' --------
| Note |
|
<@:mvstest:/home/mvstest/testdata> l jobmsgs1
=========
-rw-rw-r-- 1 mvstest apps 1934 Aug 4 09:12 ALL
-rw-rw-r-- 1 mvstest apps 1516 Aug 4 09:12 ERR
<@:mvstest:/home/mvstest/testdata> exit
====
Script done on Mon 04 Aug 2008 09:13:25 AM PDT
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
On page '7B1', we ran JCL/script 'jgl200.ksh' 4 times forcing some GDG file ERRors on run#2. On pages '7C1' thru '7C6', we illustrated the 'console log' which contains all console messages & is quite lengthy.
We will now illustrate the 'job message logs' which are much shorter, since they contain only the more vital & ERRor messages.
The 'logmsg2' function in the JCL/scripts writes the vital/ERR messages to $RUNDATA/jobmsgs/... creating a separate jobmsglog for each JCL/script execution. These files are date/time stamped (ex: 080805:112600_JGL200).
To make it easier to review all jobmsglogs, we will use script 'jobmsgs1' to concatenate the separate jobmsglogs to 2 files in $RUNDATA/jobmsgs1/yymmddALL & $RUNDATA/jobmsgs1/yymmddERR.
We already ran the 'jobmsgs1' script on page '7B1', but it will not hurt to run it again here, since it will simply recreate the ALL & ERR files from the multiple jobmsglogs created by 4 executions of jgl200.ksh.
#1. cdd --> alias 'cd $RUNDATA' --> /home/mvstest/testdata
===
#2. jobmsgs1 jobmsgs <-- concatenate to jobmsgs1/yymmddALL & jobmsgs1/yymmddERR
================
#3. l jobmsgs1 <-- display output filenames
==========
-rw-rw-r-- 1 mvstest apps 1934 Aug 4 09:12 ALL
-rw-rw-r-- 1 mvstest apps 1516 Aug 4 09:12 ERR
#4. more jobmsgs1/yymmddALL <-- inspect ALL jobmsglogs
======================= - please see the output on the next page -->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#4. more jobmsgs1/yymmddALL <-- inspect ALL jobmsglogs
======================= - concatenated together with blank line separators
080829:151518:JGL200: Begin Job=JGL200 080829:151518:JGL200: Begin Step S0010 sort (#1) 080829:151518:JGL200: Begin Step S0020 cgl200 (#2) 080829:151518:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/ 080829:151518:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020 080829:151615:JGL200: Begin Job=JGL200 111127:131222:JGL200: WARN: files in jobtmp/GDG subdirs (from prior AbTerm ERR?) 111127:131222:JGL200: ---- files in jobtmp/JGL200/GDG/*/* listed below: jobtmp/JGL200/GDG/gl/account.master_000005 jobtmp/JGL200/GDG/gl/account.trans_000007 111127:131222:JGL200: If NO restart by step#, GDG files jobtmp/ will be cleared 111127:131222:JGL200: - allows rerun from begin job with no worry about GDGs 111127:131222:JGL200: If RESTARTing by step#, example--> jobname.ksh step=S0050 111127:131222:JGL200: - GDG files in jobtmp/... will NOT be cleared 111127:131222:JGL200: - will be available to steps after restart step# 111127:131222:JGL200: - will be restored to data/... subdir at JobEnd=Normal 111127:131222:JGL200: enter to continue
080829:151617:JGL200: Begin Step S0010 sort (#1) 080829:151617:JGL200: Begin Step S0020 cgl200 (#2) 080829:151617:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/ 080829:151617:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
080829:151556:JGL200: Begin Job=JGL200 080829:151556:JGL200: Begin Step S0010 sort (#1) 080829:151556:JGL200: Begin Step S0020 cgl200 (#2) 080829:151556:JGL200: ERR: step#S0020 cgl200 abterm 99 *080829:151556:JGL200: ERR: Terminated Abnormally,JCC=99,StepsExec=2,Last=S0020* *080829:151558:JGL200: ERR: GDG files NOT moved from jobtmp/subdirs to /home/mvstest/testdata/subdirs* 080829:151558:JGL200: - can rerun OK, since GDGs not added to RUNDATA/subdirs 080829:151558:JGL200: - OR restart at abterm step & reply y to move prompt 080829:151558:JGL200: ERR: jobtmp/JGL200/GDG/gl/files NOT moved to $RUNDATA/gl/ listed below: *080829:151558:JGL200: - reply y/n acknowledge GDG msg, but no auto action*
080829:152825:JGL200: Begin Job=JGL200 080829:152825:JGL200: Begin Step S0010 sort (#1) 080829:152825:JGL200: Begin Step S0020 cgl200 (#2) 080829:152825:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/ 080829:152825:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#5. more jobmsgs1/yymmddERR <-- inspect ERR jobmsglogs
=======================
080829:151556:JGL200: Begin Job=JGL200 080829:151556:JGL200: Begin Step S0010 sort (#1) 080829:151556:JGL200: Begin Step S0020 cgl200 (#2) 080829:151556:JGL200: ERR: step#S0020 cgl200 abterm 99 *080829:151556:JGL200: ERR: Terminated Abnormally,JCC=99,StepsExec=2,Last=S0020* *080829:151558:JGL200: ERR: GDG files NOT moved from jobtmp/subdirs to /home/mvstest/testdata/subdirs* 080829:151558:JGL200: - can rerun OK, since GDGs not added to RUNDATA/subdirs 080829:151558:JGL200: - OR restart at abterm step & reply y to move prompt 080829:151558:JGL200: ERR: jobtmp/JGL200/GDG/gl/files NOT moved to $RUNDATA/gl/ listed below: *080829:151558:JGL200: - reply y/n acknowledge GDG msg, but no auto action*
080829:151615:JGL200: Begin Job=JGL200 111127:131222:JGL200: WARN: files in jobtmp/GDG subdirs (from prior AbTerm ERR?) 111127:131222:JGL200: ---- files in jobtmp/JGL200/GDG/*/* listed below: jobtmp/JGL200/GDG/gl/account.master_000005 jobtmp/JGL200/GDG/gl/account.trans_000007 111127:131222:JGL200: If NO restart by step#, GDG files jobtmp/ will be cleared 111127:131222:JGL200: - allows rerun from begin job with no worry about GDGs 111127:131222:JGL200: If RESTARTing by step#, example--> jobname.ksh step=S0050 111127:131222:JGL200: - GDG files in jobtmp/... will NOT be cleared 111127:131222:JGL200: - will be available to steps after restart step# 111127:131222:JGL200: - will be restored to data/... subdir at JobEnd=Normal 111127:131222:JGL200: enter to continue
080829:151617:JGL200: Begin Step S0010 sort (#1) 080829:151617:JGL200: Begin Step S0020 cgl200 (#2) 080829:151617:JGL200: moving jobtmp/JGL200/GDG/subdir/files back to $RUNDATA/subdirs/ 080829:151617:JGL200: JobEnd=Normal, StepsExecuted=2, LastStep=S0020
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
| 8A1. | Quiz: profiles, env-vars, JCL/scripts, etc |
| 8A2. | stub_profile & common_profile |
| 8A3. | $RUNLIBS & $RUNDATA used by JCL/scripts |
| 8A4. | filenames defined 'RELATIVELY' from $RUNDATA |
| 8A5. | profile changes for Training, Conversion,& Production |
| 8A6. | profiles in appsadm/env/ vs uvadm/env/ |
| 8B1. | Condition Codes (program status Return-Codes) |
| 8B2. | Sample JCL/script 'cgl100.ksh to demo return code testing & GDGs |
| 8C1. | write new GDG's in Temp subdirs until Normal EOJ |
| - forcing 'Abterm' to test GDG recovery |
| 8D1. | JCL converter inserts code to Restart JCL/scripts from any step |
| 8E1. | capturing jobmsgs for programmer testing/review |
| - captures console log for 1 job at a time for immediate review |
| 8F1. | capture all console I/O messages for entire login session |
| - primarily for production run error checking | |
| - cleanup console logs (remove screen control characters) |
| 8F2. | Viewing your 'cleaned up' console log files |
| - processing console logs via nightly 'cron' jobs |
| 8G1. | capturing console logs from cron jobs by mail |
| 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
| 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
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'.
Assuming mainframe conversions, the stub_profile (renamed .profile or .bash_profile) calls 'common_profile' via the 'source' command or '.', for example:
. /home/uvadm/env/common_profile
================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
'common_profile' defines many environmental-variables. What is an environmental-variable ? Some important env-vars for mainframe conversions are TESTLIBS, TESTDATA, PRODLIBS,& PRODDATA. 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/apps/testlibs <-- defs in common_defines
export TESTDATA=/p1/apps/testdata
export PRODLIBS=/p2/apps/prodlibs
export PRODDATA=/p2/apps/proddata
The 'stub_profile' defines 'RUNLIBS' & 'RUNDATA' in terms of these, for example:
export RUNLIBS=/p1/apps/testlibs <-- for programmers
export RUNDATA=/p1/apps/testlibs
- - - OR - - -
export RUNLIBS=/p2/apps/testlibs <-- for operators
export RUNDATA=/p2/apps/testlibs
The 'common_profile' uses $RUNLIBS & $RUNDATA to define other items, example:
export PATH=$PATH:$RUNLIBS/jcls
#04. What are some other items defined using $RUNLIBS & $RUNDATA ?
(You could use 'vi' to /search common_profile for /RUNLIBS & /RUNDATA)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
========================
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) ========================
On our system JCL/scripts are found via $PATH, but COBOL programs are executed explicitly from $RLX/... (or RUNLIBS/cblx/...).
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
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').
'exportfile' is a 'function'.
We could have defined the file with the unix 'export' command as follows:
export CUSTMAS=ar/customer.master
=================================
For GDG generation files, we would use 'exportgen0' to get the current generation & 'exportgen1' to determine the name of the next generation.
For example, see jgl100.ksh listed on page '8B2' (lines 28 & 29):
exportgen0 0 ACCTMAS gl/account.master_
=======================================
exportgen1 +1 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')
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Earlier, we explained that the RUNLIBS & RUNDATA might be defined in stub_profile as follows:
export RUNLIBS=/p1/apps/testlibs <-- for programmers
export RUNDATA=/p1/apps/testdata
export RUNLIBS=/p2/apps/prodlibs <-- for operators
export RUNDATA=/p2/apps/proddata
But the supplied stub_profile defines RUNLIBS/RUNDATA as follows:
export RUNLIBS=$HOME/testlibs <-- overrides defs in common_defines
export RUNDATA=$HOME/testdata - remove these for actual conversions
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The profiles are supplied in /home/uvadm/env/... and the stub_profile sources ('.' executes) the common_profile as follows:
. /home/uvadm/env/common_profile
================================
ADMjobs.htm#1D1 - 1D7 recommends setting up user 'appsadm', & copying /home/uvadm/env/* to /home/appsadm/env/..., and change the source execution to:
. /home/appsadm/env/common_profile
==================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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.
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.
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.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#001 #!/bin/ksh
k#002 ##JGL100 JOB (1234),'LIST GL MASTER CHART OF ACCOUNTS'
k#003 export JOBID2=JGL100 jobid2=jgl100; scriptpath="$0"; args="$*"
k#004 if [[ -z "$JOBID1" ]]; then export JOBID1=$JOBID2; fi
k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
k#006 integer JCC=0 SCC=0 LCC=0 # init step status return codes
k#007 autoload jobset51 jobset52 jobend51 jobabend51 logmsg1 logmsg2 stepctl51
k#008 autoload exportfile exportgen0 exportgen1 exportgenall exportgenx
k#009 . $APPSADM/env/stub.ini #<-- for control-M (see notes in env/stub.ini)
k#010 jobset51 # call function for JCL/script initialization
k#011 goto
k#012 S0000=A
k#013 # * MVS JCL CONVERSION DEMO - PROCs & GDG files
k#014 ##STEPA EXEC PGL100,HLQ=GL,YEAREND=2003 #<-PROC1call
k#015 ##PGL100 PROC HLQ=GL,YEAREND=2002
k#016 HLQ="GL";YEAREND="2002";
k#017 ##STEPA EXEC PGL100,HLQ=GL,YEAREND=2003 #<-PROC1exp
k#018 HLQ="GL";YEAREND="2003";
k#019 # * LIST G/L CHART OF ACCOUNTS FROM ACCOUNT.MASTER
k#020 #1======================= begin step#S0010 CGL100 ========================
k#021 S0010=A
k#022 stepctl51; #calc StepTimes & check jobstop/goto end
k#023 goto
k#024 export JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
k#025 logmsg2 "******** Begin Step $JSTEP cgl100 (#$XSTEP) ********"
k#026 ##STEPA EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND
k#027 export PROGID=cgl100
k#028 export PARM="2003"
k#029 exportgen0 0 ACCTMAS data/gl.account.master_
k#030 exportgen1 +1 ACTLIST $JGDG/data/gl.account.acntlist_
k#031 #exportgen1 $JGDG/subdir/tempfiles restored to outdir at Normal EOJ
k#032 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_SYSOUT
k#033 logmsg2 "Executing--> cobrun $ANIM $RLX/cgl100"
k#034 #3----------------------------------------------------------------------
k#035 cobrun $ANIM $RLX/cgl100
k#036 #4----------------------------------------------------------------------
k#037 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
k#038 if ((S0010C != 0))
k#039 then logmsg2 "ERR: step#$JSTEP cgl100 abterm $SCC"
k#040 alias goto="<<S9900=A"; fi
k#041 goto
k#042 #/=*.#PEND1 PGL100
k#043 #8======================================================================
k#044 S9000=A
k#045 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs
k#046 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP"
k#047 exit 0 #ver:20120208 a1b2c0d1e2f3g1i1j0k3l40m4n3o0p0r0s0t1u1v3w0x0y1z0
k#048 #9======================================================================
k#049 S9900=A
k#050 logmsg2 "JobEnd=AbTerm, JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK
k#051 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
k#052 exit $JCC
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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#010 jobset51 # call function for JCL/script initialization
k#030 exportgen1 ACTLIST $JGDG/gl/account.acntlist_
k#045 jobend51 #move GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs
k#051 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
When I was debugging the GDG file handling, I forced step failures to test recoveries/reruns.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The JCL converter inserts code to allow the JCL/scripts to be restarted from any step. A step#/code is inserted at the begining of each step, for example here are relevant lines extracted from jar200.ksh (listed on page '1D2'.
k#002 ##JGL100 JOB (1234),'LIST GL MASTER CHART OF ACCOUNTS' k#003 export JOBID2=JGL100 jobid2=jgl100; scriptpath="$0"; args="$*" k#004 if [[ -z "$JOBID1" ]]; then export JOBID1=$JOBID2; fi k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
k#010 jobset51 # call function for JCL/script initialization
k#011 goto <-- where does this goto ?
k#012 S0000=A
k#015 S0010=A
- - - step 1 details - - -
k#42 S0020=A
- - - step 2 details - - -
k#64 S9000=A
- - - Normal Termination - - -
k#69 S9900=A
- - - Abnormal Termination - - -
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).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The 'joblog' scripts allow programmers to run JCL/scripts and capture console messages in a file for reviewing. The file is written into subdir joblog/... in your current working directory.
For example, you could run demo JCL/script jar100.ksh & capture the log into $RUNLIBS/joblog/jar100.log as follows:
#1. login as yourself --> your homedir #2. cdl --> alias cdl='cd $RUNLIBS' (might be /home/userxx/testlibs/.)o
#3. jar100.ksh <-- run directly, shows log on screen only
==========
#3a. joblog jar100.ksh <-- run via joblog script
================= - to capture log in a file
$RUNLIBS/joblog/jar100.log
#4. more joblog/jar100.log <-- display the log file
======================
080827:155517:JAR100: Begin Job=JAR100 080827:155517:JAR100: /home/mvstest/testlibs/jcls/jar100.ksh 080827:155517:JAR100: RUNLIBS=/home/mvstest/testlibs 080827:155517:JAR100: RUNDATA=/home/mvstest/testdata 080827:155517:JAR100: Begin Step S0010 car100 (#1) 080827:155517:JAR100: file: CUSTMAS=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
#44a. vi $UV/sf/IBM/joblog <-- examine script to answer question above
====================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
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
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'
=======
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 |
|
| crontab_appsadm |
|
| nightly1 |
|
| logfixN |
|
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The pages above reviewed procedures to capture console logs from JCL/scripts run by logged-in operators (from their command line shell prompts). See complete documentation at ADMjobs.htm#5A1 - 5H1.
BUT, the above method of cpaturing console logs does NOT work for JCL/scripts scheduled by cron (nightly batch jobs). It does not work because their is NO logged-in user to execute the 'script' command (at end of profile) to collect the console messages into a file.
However, cron jobs DO mail console msgs to the owner of the crontab file that scheduled the JCL/scripts. We setup 'appsadm' to own & issue the crontab comamnds. Each morning 'appsadm' could read his mail to see if there were any errors in last night's cron jobs.
BUT, it might be nicer if we could caapture the mail from nightly cron jobs into date/time stamped files (similar to the log files captured from logged- in operators). ADMjobs.htm#5I1 - 5K7 documents how we can do this. Here are some of the subdirs & files used in /home/appsadm/...
/home/appsadm :-----cronlog1 <-- 1 line status msgs (optional) : :-----090423_174201_cronscript1 : :----- :-----cronlog2 <-- console logs captured by mail from cron : :-----090423_174301_cronscript1 : :----- :-----env <-- profiles called by cronscript1 : :-----stub_profile_cronlogdemo : :-----common_profile :-----sf <-- crontabs & scripts for demo & production models : :-----cronscript1 : :-----cronmailsave1 : :-----crontab2
See 'cronscript1' listed at ADMjobs.htm#5K3 & note it executes the profile on line 99 as follows:
. $APPSADM/env/stub_profile_cronlogdemo =============================================== - special version of stub_profile listed at ADMjobs.htm#5K6
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
After the initial conversion, you will probably need to & want to modify the JCL/scripts for many reasons, such as:
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
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 |
|
export PARM="July 31, 2009" <-- see line #22 in jar120.ksh =========================== - similar to line #22 jar100.ksh page '1C2'
| Required |
|
rptdate=" "
until [[ "$rptdate" > " " ]]
do echo "enter report date (ex: January 31, 2009)"
read rptdate
done
export PARM=$rptdate
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
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 :-----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 |
|
Here is line 29 of jgl100.ksh ('1E3') using function 'exportgen0' to determine the latest generation of the account.master_ GDG file.
exportgen0 0 ACCTMAS 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
| Required |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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).
# 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
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'.
#!/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
#!/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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/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 0 SORTIN gl/account.trans_
exportgen1 +1 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
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh
# sorttrans5 - sort account.trans_ file by account#
# - writing new scripts tutorial stage#5 (see MVSJCL.doc#8N5)
# - changes from stage#4 (sorttrans4)
# - add 2nd step to calculate transaction total $amount
# - add common points for Terminated Normally & Abnormally
# - insert step# codes S0000,S0010,S0020 to allow restart at any step
export JOBID2=sorttrans5; args="$*" # $JOBID2 & args used by jobset51
for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done
autoload jobset51 exportfile logmsg1 logmsg2 jobend51 jobabend51
jobset51 # call function to setup job environment
goto
S0000=A
S0010=A
exportgen0 0 SORTIN gl/account.trans_
exportgen1 +1 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 0 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
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.
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
| 9A0. | Conversion support 'scripts' |
| - most scripts are listed in detail |
| 9B0. | Conversion support 'uvcopy jobs' |
| - important uvcopy job names are given | |
| - only 1 job is listed in detail | |
| (since uvcopy jobs are longer than scripts) |
There are over 500 scripts & uvcopy jobs supplied with the Vancouver Utilities. We will name the most important scripts & uvcopy jobs here in Part 9, that are directly involved in JCL conversion.
You can inspect any of these with 'vi' or print with 'uvlp12', for example:
vi /home/uvadm/sf/IBM/jcl2ksh51 <-- view script to convert 1 JCL to ksh ===============================
uvlp12 /home/uvadm/pf/IBM/procNF <-- print uvcopy to summarize missing PROCs ================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is a list of some of the script names used for JCL conversion, followed by a detail listing of the most important scripts (those with links).
| 9A1. | jcl2ksh51 - convert 1 MVS JCL thru all stages |
| - cleanup, PROC/INCLUDE expansion, JCL conversion, copy to jcls | |
| - jcl0 ---> jcl1 ---> jcl2 ---> jcl3 ---> jcls |
| 9A2. | jcl2ksh51A - convert all JCL from jcl0 thru jcl3 |
| 9A3. | jcldata5A - creates ctl/datajcl51, ctl/datajcl52 & sorts 6 files together: |
| (datactl52+datacat52+dataxl151+dataxl252+dataedt52+datacnv52) | |
| - creates datactl53 & loads indexed file datactl53I | |
| - to supply record-sizes, keys, file types to the JCL converter |
| 9A4. | jclpx51 - expand PROCs & INCLUDEs while copying JCL from jcl1 to jcl2 |
| 9A5. | jclxx51 - convert all JCLs from jcl2 --> jcl3 |
| 9A6. | jobstop - pause a JCL/script at the next step or a specified step |
| 9A7. | jobclear - clear the pause condition |
| cnvMF51 |
|
| cnvMF51A |
|
| mfcbl1 |
|
| mfcblA |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh
# jcl2ksh51 - convert 1 job at a time (by OT, UVSI, Aug2004)
# - recommend converting all JCL's in directory (page 1Q1 MVSJCL.doc)
# - might use this to convert new jobs brought over from mainframe
# - see page 1Q8 MVSJCL.doc or www.uvsoftware.ca/mvsjcl.htm#1Q8
#July2006 - JCL converter program changed from jclunix5 to jclunix51
# - reduces front end code from 30 to 10 lines, via new 'jobset51' function
#
# - assumes input JCL has been stored in subdir 'jcl0'
# - assumes any PROC's present in procs (cleaned up from proc0)
# - assumes any control card members present in parms (cleanup from parm0)
# - assumes control file ctl/datactl53I previously created
# to supply file info (recsizes, key loc/lth, ID GDG files, etc)
# - will convert JCL from jcl0 --> jcl1 --> jcl2 --> jcl3
# - you will then manually copy to subdir jcls for test/debug
#
if [[ -d jcl1 && -d jcl2 && -d jcl3 && -f "$1" ]]; then :
else echo "arg1 must be a file (in jcl0) & jcl1,jcl2,jcl3 must be present"
echo "usage: jcl2ksh51 jcl0/JCLfilename [options]"
echo " ===================================="
echo " any arg2 options override options in ctl/jclunixop51"
exit 1; fi
#
typeset -l fn="$1" # convert filename to lower case
fx=$(basename $fn) # strip off jcl0/ directory from left side
f=${fx%.*} # strip off .extension from right side
#
uvcopy cleanup,fili1=$1,filo1=jcl1/$f.jcl,uop=q0i7g8n1
#=====================================================
# - cleanup JCL, strip CR's, clear cols 73-80,& shorten to last nonblank
#
jclproc51 jcl1/$f.jcl jcl2/$f.jcl procs parms
#===============================================
# - expand PROCs & INCLUDEs as we copy jcl from subdir jcl1 to subdir jcl2
#
jclunix51 jcl2/$f.jcl jcl3/$f.ksh $2
#===================================
# - convert expanded mainframe JCL to Korn shell script
# - any '$2' options override options in ctl/jclunixop51
#
echo "jcl0/$f.jcl converted to jcl3/$f.ksh OK to copy to jcls (overwriting) ?"
reply=n; read reply
until [[ "$reply" = "y" || "$reply" = "n" ]]
do echo "OK to copy to jcls subdir (overwrite prior) y/n ?"; read reply; done
if [[ "$reply" = "n" ]]; then echo "reply=$reply, exiting"; exit 1; fi
#
cp jcl3/$f.* jcls # copy converted JCL/script to jcls (in PATH)
#================ # Aug06/07 - use .* (vs .ksh) to allow .java
exit 0
#
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh
# jcl2ksh51A - convert All MVS JCL to Korn shell scripts
# - by Owen Townsend, UVSI, revised Sept 19,2007
# - call script jcldata5A replacing sortload53I
#
# - assumes input JCL has been stored in subdir 'jcl0'
# - assumes input PROC's stored in proc0
# - assumes control card members stored in parm0
# - assumes INCLUDE modules stored in parms (changed from include1 Oct 17/06)
# - converts JCL from: jcl0 ---> jcl1 ---> jcl2 ---> jcl3 -x-> jcls
# - manually copy to subdir jcls for test/debug
#
#Note - dont use this script for your 1st conversion
# - use the step by step method shown on pages 1Q1-1Q7 of MVSJCL.doc
# (or www.uvsoftware.ca/mvsjcl.htm#1Q1 - 1Q7)
#
if [[ -d jcl0 && -d jcl1 && -d jcl2 && -d jcl3 && -d proc0\
&& -d procs && -d parm0 && -d parms && "$1" = "all"\
&& -f ctl/jclunixop51 ]]; then :
else echo "usage: jcl2ksh51A all"
echo " ============="
echo "subdirs required: jcl0/1/2/3,proc0/1,parm0/s,"
echo "ctl/jclunixop51 - JCL converter control file must be present"
echo "ctl/datactl53I - data file info (prompt to create below)"
exit 1; fi
#
echo "jcl2ksh51A to perform all steps of JCL conversion to Korn shell scripts"
echo "jcl0--------->jcl1------------->jcl2----------->jcl3---------->jcls"
echo " cleanup Proc-Expand convert manual "
echo "- all steps reqd if you retransfer JCL, PROCs,or Parms"
echo "- run 'jclxx51' to reconvert jcl2-->jcl3 after converter/option changes"
echo "for 1st conversion - see step by step in 1Q1-1Q5 of MVSJCL.doc"
echo "jcl2ksh51A can omit cleanup proc0-->procs & parm0-->parms"
echo "- reply 'n' saves time if no new PROCs or PARMs (SYSIN modules)"
echo "convert proc0-->procs & parm0-->parms y/n ? (n if already converted)"
reply=x; read reply
until [[ "$reply" = "y" || "$reply" = "n" ]]
do echo "cleanup proc0-->procs & parm0-->parms y/n ?"; read reply; done
if [[ "$reply" = "y" ]]; then
#
reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]]
do echo "OK to remove all files (cleanup output) from procs & parms ? y/n";
read reply; done
if [[ "$reply" = "y" ]]; then rm -f procs/*; rm -f parms/*; fi
#
reply=x; g=g8; # default to clear cols 73-80
until [[ "$reply" = "y" || "$reply" = "n" ]]
do echo "clear cols 73-80 of procs & parms y/n ?"; read reply; done
if [[ "$reply" = "n" ]]; then g=g0; fi
uvcopyx cleanup proc0 procs uop=q0i7n1$g,arg1=.proc #<-- cleanup PROCs
#==================================================
echo "cleanup procs complete, enter to cleanup parms"; read reply
uvcopyx cleanup parm0 parms uop=q0i7n5$g #<-- cleanup parms
#=======================================
#Nov10/11 - option $g changed to g0 to NOT clear cols 73-80 of parms
#Dec05/11 - chnage option g0 back to $g
fi
echo "now cleanup jcl0--->jcl1 & expand PROCs jcl1--->jcl2"
reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]]
do echo "OK to remove all files from jcl1,jcl2,jcl3 ? y/n"; read reply; done
if [[ "$reply" = "y" ]]; then rm -f jcl1/*; rm -f jcl2/*; rm -f jcl3/*; fi
#
# 1. cleanup JCL, strip CR's, clear cols 73-80,& shorten to last nonblank
uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl #<-- cleanup JCL
#===============================================
echo "cleanup complete, enter to perform PROC expansion"; read reply
#
# 2. expand procs as we copy JCL from subdir jcl1 to subdir jcl2
jclpx51 jcl1 jcl2 procs parms
#===============================
echo "PROC expansion complete, enter to generate data control file"; read reply
#
# 3. generate data info file (ctl/datactl53I) for JCL converter
#
reply=x;
until [[ "$reply" = "y" || "$reply" = "n" ]]
do echo "generate data info file (ctl/datactl53I) for JCL converter ?"
echo "- could bypass if no change to JCL since datactl53I last created"
echo "- reply 'y' to create now, or 'n' to bypass"
read reply; done
if [[ "$reply" = "y" ]]; then
jcldata5A #<-- script to create datactl53I (4 uvcopy jobs)
#========
if (($?)); then
echo "jcldata53I failed, missing files ? (make null files if N/A)"
echo "datajcl52+datacat52+dataxl152+dataxl252+dataedt52 --> datactl53"
exit 99; fi
fi
echo " "
echo "enter to convert JCL to ksh "; read reply
#
# 4. convert expanded JCL to Korn shell scripts (jclxx51/jclunix51 July2006)
jclxx51 jcl2 jcl3
#================
#
echo "uvlp12 errs/procNF.rpt <-- print summary report of PROCs Not Found"
echo "uvlp12 errs/includeNF.rpt <-- print summary report INCLUDEs Not Found"
echo "uvlp12 errs/parmNF.rpt <-- print summary report of PARMs Not Found"
#
# 5. copy scripts from jcl3 to jcls 1 by 1 as you test/debug
echo "all JCLs converted from jcl0 --> jcl1 --> jcl2 --> jcl3 (Not to jcls)"
echo "copy scripts from jcl3 to jcls (in PATH) 1 by 1 as you test/debug"
exit 0
#
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# jcldata5A - extract datafile info (recsizes,etc) from all JCL
# & re-create 'datactl53I' Indexed file for JCL converter
# - see MVSJCL.doc or www.uvsoftware.ca/mvsjcl.htm
# - by Owen Townsend Sept 19/2007
# Oct30/07 - increase recsize to 191
#
# ** Functions performed by this script **
#
# 1. jcldata51 extracts DSNs from all JCLs in jcl2/...
# & writes control file ctl/datajcl51
#
# 2. jcldata52 copies ctl/datajcl51 to ctl/datajcl52, converting the
# filenames from mainframe to unix/linux script & VU standards
#
# 3. ctldata53 combines ctl/datajcl52 with 5 other control files
# (LISTCAT,Excel#1,Excel#2,Edited,DataInfo) to create ctl/datactl53.
#
#Note - the 5 other control files must already exist
# - if not available, make null files
#
# 4. ctl/datactl53 is loaded into an Indexed file to supply datafile info
# to JCL converter (record sizes, Indexed keylocs/keylens, file types, etc)
#
# ** Notes **
#
# 1. This script is called by jcl2ksh51A which performs all steps
# of JCL conversion
#
# 2. You may run this script separately anytime you want to update
# the JCL conversion control file (ctl/datactl53 & ctl/datactl53I)
# when any 1 of the 6 source files has been updated
#
# 3. You may then run script 'jclxx51 jcl2 jcl3' to reconvert all JCL
# (if no new JCLs have been added to jcl0,jcl1,jcl2)
#
# 4. If new JCLs have been added, use 'jcl2ksh51A' (which calls this jcldata5A)
# before it reconverts all JCL to ksh scripts
#
#Note - all uvcopy jobs stored at $UV/pf/IBM/... ($UV usually /home/uvadm)
# - all scripts stored at $UV/sf/IBM/...
# - all data info files discussed here stored at $TESTLIBS/ctl/...
# ($TESTLIBS might be something like: /app/risk/testlibs)
#
# ** sources for data info files **
#
# 1. JCL, all DSNs extracted, sorted,& reduce to 1 record
# per unique datafilename with available file info keyworded on right side
# (rca=avg-recsize, rcm=max-recsize, key=..., etc)
# uvcopy job#1: jcldata51 reads all JCL, writes ctl/datajcl51
# uvcopy job#2: jcldata52 reads ctl/datajcl51, writes ctl/datajcl52
#
# 2. LISTCAT report from mainframe transfered to unix/linux,
# - reformated similarily to the JCL info
# uvcopy job#1: catdata51 reads listcat0, writes ctl/datacat51
# uvcopy job#2: catdata52 reads datacat51, writes ctl/datacat52
# --> these jobs must be executed BEFORE JCL conversion
# Optional, if not available make empty file so JCL conversion will run
#
# 3. Excel spreadsheet#1 (created on windows)
# - export tab delimited file 'dataxl1.txt' & transfer to linux
# - datafilenames followed by: copybookname, recsize, etc
# - copybooks not required for JCL convert, required for DATA convert
# uvcopy job#1: xl1data51 reads ctl/dataxls1.txt, writes ctl/dataxl151
# uvcopy job#2: xl1data52 reads ctl/dataxl151, writes ctl/dataxl152
# --> these jobs must be executed BEFORE JCL conversion
# Optional, if not available make empty file so JCL conversion will run
#
# 4. Excel spreadsheet#2 (created on windows)
# - export tab delimited file 'dataxl2.txt' & transfer to linux
# uvcopy job#1: xl2data51 reads ctl/dataxl2.txt, writes ctl/dataxl251
# uvcopy job#2: xl2data52 reads ctl/dataxl251, writes ctl/dataxl252
# Optional, if not available make empty file so JCL conversion will run
#
# 5. Edited data info file ctl/dataedt52 (create on Linux with any editor)
# - allows additions & overrides to above
# Optional, if not available make empty file so JCL conversion will run
# Note - may also code copybooknames for datafilenames
# - copybooks not required for JCL convert, required for DATA convert
# Note - you must code filenames to match filenames output by JCL converter
# - lower case, mainframe '$' keyed as '_' underscores
# - GDG files Identified by trailing '_' underscores
# - no uvcopy jobs process this file (as for other 5 files)
#
# 6. Data conversion control file (created from data-files)
# uvcopy job#1: cnvdata51 reads ctl/datacnv.txt, writes ctl/datacnv51
# uvcopy job#2: cnvdata52 reads ctl/datacnv51, writes ctl/datacnv52
# Optional, if not available make empty file so JCL conversion will run
#
# Note - this file indicates which files have packed or binary fields
# - 1st 5000 bytes of EBCDIC datafiles are scanned for x'0C' & x'00
# - result coded on src=... as 'Dp' or 'Db'
#
# Note - the data conversion control file ctl/datacnv54I created as follows:
# - uvcopy cnvdata53 reads ctl/datacnv52,& ctl/ctlfile53I
# (to get cpy=..., rcs=..., etc0),& writes ctl/datacnv53
# which is copied to ctl/datacnv54
# - you must manually edit ctl/datacnv54 to add any copybooknames
# if missing for datafiles with Packed or Binary fields
#
echo "jcldata5A - create 'datactl53I' data file info for JCL converter"
echo " - data file info may be supplied from 6 sources:"
echo "JCL + LISTCAT + Excel#1 + Excel#2 + Edited + Datafiles"
echo "datajcl51,52 + datacat51,52 + dataxl151,52 + dataxl251/52 + dataedt51,52"
echo " - combined to ctl/datactl53, then loaded to Indexed file ctl/datactl53I"
echo " 1. this script runs jcldata51 & jcldata52 to create ctl/datajcl52"
echo " 2. must have run catdata51,52 (separately) to create ctl/datacat52"
echo " OR create nullfile >ctl/datacat52"
echo " 3. must have run xl1data51,52 (separately) to create ctl/dataxl152"
echo " OR create nullfile >ctl/dataxl152"
echo " 4. must have run xl2data51,52 (separately) to create ctl/dataxl252"
echo " OR create nullfile >ctl/dataxl252"
echo " 5. must have run edtdata51,52 (separately) to create ctl/dataedt52"
echo " OR create nullfile >ctl/dataedt52"
echo " 6. must have run cnvdata51,52 (separately) to create ctl/datacnv52"
echo " OR create nullfile >ctl/datacnv52"
reply=x;
until [[ "$reply" = "I" || "$reply" = "E" || "$reply" = "A" ]]
do echo "enter 'I' to Init 5 files & create datactl53I from JCL only"
echo "enter 'E' to create datactl53I from JCL & Existing 5 files(some null)"
echo "enter 'A' to Abort (perhaps to create some files & Rerun)"
read reply; done
if [[ "$reply" = "A" ]]; then echo "reply=$reply, Aborting"; exit 1; fi
if [[ "$reply" = "I" ]]; then >ctl/datacat52; >ctl/dataxl152;
>ctl/dataxl252; >ctl/dataedt52; >ctl/datacnv52; fi
#
# ** jcldata5A - script to create datafile info for JCL converter **
#
uvcopy jcldata51,fild1=jcl2,filo2=ctl/datajcl51,uop=q1,rop=r0
#============================================================
# - extract DSN from all JCL, sort reduce to 1 entry with file info on right
#
uvcopy jcldata52,fili1=ctl/datajcl51,filo2=ctl/datajcl52,rop=r0,uop=l1
#=====================================================================
# - modify filenames for scripts, GDG (0),(+1) converted to trailing '_'
# - convert embedded '$ '#' to '_'s, leading '&&' to '__'
# - convert filenames to lower/UPPER case depending on uop=l1/l2
# - uop=l1/l2 must agree with jclunixop51 option c0/c2
#
uvcopy ctldata53,fili1=ctl/datajcl52,fili2=ctl/datacat52,fili3=ctl/dataxl152\
,fili4=ctl/dataxl252,fili5=ctl/dataedt52,fili6=ctl/datacnv52\
,filo7=ctl/datactl53,rop=r0,uop=q0
#============================================================================
# - combine file info from: JCL + LISTCAT + Excel spreadsheet
#
uvcp "fili1=ctl/datactl53,rcs=191,typ=LST,key1=0(44),filo1=ctl/datactl53I\
,typ=ISF,isk1=0(44)"
#=========================================================================
# - create Indexed file used by JCL converter to get recsize, keys, etc
#
rc=$? # capture script status for script return code
exit $rc
#
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh
# jclpx51 - Korn shell script from UVSI stored in: /home/uvadm/sf/IBM/
# jclpx51 - script to execute the jclproc51.c program
# - to expand PROCs in IBM MVS JCL
# - see MVSJCL.doc, or www.uvsoftware.ca/mvsjcl.htm
#Oct17/06 - includes combined with parms (chg subdir include1 to parms)
#
# usage: jclpx51 indir outdir [PROCdir INCLUDEdir options]
# =================================================
#example: jclpx51 jcl1 jcl2 procs parms <-- arg3 & arg4 defaults
# =============================
#
# indir - contains the JCL's with PROCs to be expanded
# - any file with no // in cols 1&2 of 1st line will be bypassed
# outdir - will receive the expanded JCL
# - output filenames same as input, with .jcl ensured
#
# jclproc51 indir/jclfile outdir/jclfile PROCdir INCLUDEdir [options]
# ===================================================================
#
#May2004 - jclproc51 appends to an error message file --> errs/jclproc51.err
# - init now (1st create errs subdir within current dir if not already present)
if [[ ! -d errs ]]; then mkdir errs; fi # make errs subdir if not existing
>errs/jclproc51.err # init errmsg collection file
#
echo "script to expand PROCs in MVS JCL"
if [[ -d "$1" && -d "$2" && -d "$3" && -d "$4" ]]; then :
else echo "USAGE: jclpx51 indir outdir procdir includes/parmsdir options"
echo " ======================================================"
exit 1; fi
reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]]
do echo "OK to remove all files from outdir $2 y/n ?"; read reply; done
if [[ "$reply" = "y" ]]; then rm -f $2/*; fi
x=0
for i in $1/*
do
a=${i##*/}
## b=${a%.*} #Oct2001 leave .jcl extensions on
typeset -l c=$a #Oct2001 was 'c=$b'
jclproc51 $i $2/$c $3 $4 $5
#==========================
let x=x+1
done
echo "$x MVS JCLs in $1 expanded, PROCs $3, INCLUDEs $4, output $2"
#
echo "PROC expansion complete, enter to report any PROCs/INCLUDEs NOT found"
read reply
uvcopy procNF,fili1=errs/jclproc51.err,filo1=errs/procNF.rpt,uop=q0i7
#====================================================================
uvcopy includeNF,fili1=errs/jclproc51.err,filo1=errs/includeNF.rpt,uop=q0i7
#==========================================================================
exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh
# jclxx51 - Korn shell script from UVSI stored in: /home/uvadm/sf/IBM/
# jclxx51 - script to execute the jclunix51.c program
# - to convert IBM mainframe MVS JCL to UNIX scripts
#
# usage: jclxx51 indir outdir [options]
# ==============================
#example: jclxx51 jcl2 jcl3 j1
# ====================
#
# script calls jclunix51 C program using only 1st 2 or 3 args of possible 5
# - will default args 3,4,5 to null, ctl/jclunixop51, ctl/datafiles53[I]
# - datafiles... carries recsizes, indexkeys, filetypes, gdg gen#-limit
# - options default as spcfd on 1st line of ctl/jclunixop51
# - may override jclunixop51 options with arg3
# example above (j1) changes cobol calls to java calls
#
# jclunix51 indir outdir j1 ctl/jclunixop51 ctl/datafiles53I
# =========================================================
#
# - jclunix51 appends to an error message file --> errs/jclunix51.err
# - init now (1st create errs subdir within current dir if not already present)
if [[ ! -d errs ]]; then mkdir errs; fi # make errs subdir if not existing
>errs/jclunix51.err # init errmsg collection file
#
echo "script to convert mainframe JCLs to UNIX scripts"
if [ -d "$1" -a -d "$2" ]; then :
else echo "ERROR - usage: jclxx51 indir outdir options"
exit 1; fi
reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]]
do echo "OK to remove all files from outdir $2 y/n ?"; read reply; done
if [[ "$reply" = "y" ]]; then rm -f $2/*; fi
x=0
for i in $1/*
do a=${i##*/}
typeset -l c=$a
jclunix51 $i $2/$c $3
let x=x+1
done
echo "$x IBM MVS JCLs converted from $1 to UNIX KORN shell scripts in $2"
echo "JCL to ksh complete, enter to report any control card members NOT found"
read reply
#
uvcopy parmNF,fili1=errs/jclunix51.err,filo1=errs/parmNF.rpt,uop=q0i7
#====================================================================
exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh
# jobstop - write control record to stop JCL/script at specified step#
# - for UNIX scripts converted from IBM JCL
# - this KORN shell script stored at /home/uvadm/sf/IBM/jobstop
# - see more doc at: www.uvsoftware.ca/mvsjcl.htm
#Feb09/12 - name changed from jcpause to jobstop, but this may be obsolete
# - because jobset51 modified to allow "stop=S####" (as well as "start=S####")
# - jcpause changed to jobclear, obsolete because jobend51/jobabend51 clear
#
# 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 can use scripts to pause/restart jobs ('jobstop' & 'jobclear')
#
# 1. jobstop jobname.ksh <-- pause specified job at begin next step
# =================== - or all steps if entered before job begun
#
# 2. jobstop jobname.ksh S0050 <-- pause job at step S0050 (step 5, inc by 10)
# ========================= - also be used by programmers debugging ?
#
# 3. jobclear 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)
# - jobstop writes 1 line in the control file with jobname.ksh & step#
# - step# is the step# specified by oprtr as arg#2 on jobstop script command
# - step# is S0000 if no step# spcfd on jobstop (indicates stop at next step)
#
jfn="$1" # capture jobfilename from arg1
if [[ -f $RUNLIBS/jcls/$jfn ]]; then :
else echo "usage: jobstop jobname.ksh stop=S####"
echo " =============================="
echo "- JCL/script $jfn not found in $RUNLIBS/jcls/..."
exit 1; fi
#
# capture stopstep# & verify or default to S0000 if not spcfd
if [[ -n "$2" ]]; then stopstep="$2"; else stopstep="stop=S0000"; fi
if [[ "$stopstep" != stop=S[0-9][0-9][0-9][0-9] ]]; then
echo "usage: jobstop jobname.ksh stop=S####"
echo " =============================="
echo "- step# must be 'S' followed by 4 digits"
exit 2; fi
#
# format control filename & record contents & write
jbn=${jfn%.*} # strip .ksh extension
cfn=$jbn.ctl # append .ctl convention
ctlrec="$jfn start=S0000 $stopstep $(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
#!/bin/ksh
# jobclear - clear control record to pause specified JCL/script
# - for UNIX scripts converted from IBM JCL
# - this KORN shell script stored at /home/uvadm/sf/IBM/jobclear
# - see more doc at: www.uvsoftware.ca/mvsjcl.htm
#Feb09/12 - name changed from jcclear to jobclear (& jcpause chg to jobstop)
# - obsolete because jobend51/jobabend51 now rename to jobctl/jobid2.ctl_old
# - and jobset51 modified to allow "stop=S####" (as well as "start=S####")
#
# 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 can use scripts to pause or restart jobs ('jobstop' & 'jobclear')
#
# 1. jobstop jobname.ksh <-- pause specified job at begin next step
# ===================
# 2. jobstop jobname.ksh S0050 <-- pause job at step S0050 (step 5, inc by 10)
# ========================= - also be used by programmers debugging ?
#
# 3. jobclear 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)
# - jobstop writes 1 line in the control file with jobname.ksh & step#
# - step# is the step# specified by oprtr as arg#2 on jobstop script command
# - step# is S0000 if no step# spcfd on jobstop (indicates stop at next step)
#
jfn="$1" # capture jobfilename from arg1
if [[ -f $RUNLIBS/jcls/$jfn ]]; then :
else echo "usage: jobclear jobname.ksh"
echo " ======================="
echo "- JCL/script $jfn not found in $RUNLIBS/jcls/..."
exit 1; fi
#
# create control file name
jobid=${jfn%.*} # strip .ksh extension
# disable control file for specified job (change name for audit trail)
mv $RUNDATA/jobctl/$jobid.ctl $RUNDATA/jobctl/$jobid.ctl_old
#===========================================================
exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 |
|
| uvcopy parmNF |
|
| uvcopy tblext1 |
|
| uvcopy cleanup |
|
| uvcopy jcldata51 |
|
| uvcopy cnvMF5 |
|
| uvcopy cobmap1 |
|
| uvcopy table2 |
|
| uvcopy loadctlI |
|
| Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# procNF - create table summary report of 'PROCs NOT FOUND'
# - see www.uvsoftware.ca/mvsjcl.htm (mainframe JCL conversion)
# This uvcopy job is called at end of 'jclpx51'
# - jclpx51 is the script that performs PROC expansion
# by calling the 'jclproc51' C program for all files in the directory
# - jclproc51 collects errmsgs into errs/jclproc51.err
# - this job will search for 'PROC1 NOT FOUND' or PROC2 NOT FOUND errmsgs
# then extract the PROC name & create table summary report with counts
# - if desired, you could run this standalone (after jclpx51) as follows:
#
# uvcopy procNF,fili1=errs/jclproc51.err,filo1=errs/procNF.rpt
# ==============================================================
#
# ** 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/jclproc51.err,rcs=128,typ=LST
filo1=errs/procNF.rpt,rcs=128,typ=LSTt
@run
opn all
# begin loop to get lines from errmsg file until EOF reached
man20 get fili1,a0(128) get next line from errfile
skp> eof (cc set > at EOF)
# select only lines with 'PROC1 NOT FOUND' or PROC2 NOT FOUND
# extract the procname following EXEC
# & build summary table of procnames with counts
clr b0(32),' ' clear work area for procname extract
sqzc1 a0(128),' ' squeeze input to 1 blank btwn words
scn a0(120),'PROC1 NOT FOUND'
skp= man30
scn a0(120),'PROC2 NOT FOUND'
skp= man30
skp man20
man30 scn a0(80),' EXEC ' set rgstr 'x' to ' EXEC '
mvum b0(32),ax6,' ,' move until blank or comma at end procname
rep b0(32),'PROC=','' remove any 'PROC='procname
rep b0(32),'PGM=','' cnvrtr may chg PROC= to PGM=
tblt1f4 b0(32),'PROCname not found'
skp man20 repeat loop til EOF
# 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
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
| 7A2 | $appsadm: console logs created in $APPSADM |
| 1X3 | $home: using 'runlibs' not in $HOME |
| 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 |
| 4I3 | $testdata: subdirs for $TESTDATA |
| 4I5 | $testdata: copying converted data files to $TESTDATA |
| 4I6 | $testdata: copying converted data file to $TESTDATA |
| 4D1 | $testlibs: Copying VU control files & functions to Your $TESTLIBS |
| 4D1 | $testlibs: Copying VU ctl/... to Your $TESTLIBS |
| 4D1 | ...: Copying VU ctl/... to Your $TESTLIBS |
| 5E2 | ...: gl/... files for GDG range demo |
| 6A2 | ...: topnode/subdirs OR all files in mstr/... ? |
| 6A4 | ...: changing control file for all datafiles in mstr/... |
| 6A4 | ...: control file - AFTER change for all datafiles in mstr/... |
| 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) |
| 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 |
| 4M4 | Activated: execute job with jobstop activated |
| 4Q1 | Administrator: appsadm - Application Administrator |
| 5A2 | Advanced: Vancouver Utility GDG system - Advanced Features |
| 4C9 | Aliases: in profiles for quick change |
| 6A1 | All.nodes.retained: sample conversions - files in mstr/all.nodes.retained |
| 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 |
| 6D4 | 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 |
| 4D1 | Appsadm: setup appsadm profiles & functions |
| 4Q1 | Appsadm: - Application Administrator |
| 8A6 | Appsadm: profiles in appsadm/env/ vs uvadm/env/ |
| 1C3 | Args: scriptpath & args |
| 1C4 | Arguments: JCL/script arguments |
| 6A1 | Assigning: mainframe files to subdirs |
| 6B1 | Assigning: alternate demo - assigning mainframe files to subdirs |
| 4E3 | Assignment: topnode/subdir assignment |
| 1S2 | Attempting: BEFORE attempting to Test/Debug YOUR JCL/scripts |
| 6F6 | Automatically: uvcopy job to fix DDNAMEs automatically |
| 4L3 | 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 |
| 1I1 | Batch: IKJEFT01 - TSO Batch job for DB2 |
| 4L1 | Begin: Preparations Required before test/debug can begin |
| 1C8 | Better: example#2 - better way to prompt & verify a variable |
| 1C8 | 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 |
| 1E1 | Called: proc0/PGL100 - PROC called by JGL100 |
| 1F1 | Called: parm0/PGL200S1 - library member called by PGL200 |
| 1F1 | Called: proc0/PGL200 - PROC called by JGL200 |
| 4L1 | Can: Preparations Required before test/debug can begin |
| 4M3 | Capture: joblog - capture logs via 'tee' |
| 6F5 | Capture: optional - rerun to capture console log |
| 7A1 | Capturing: console logs on Unix/Linux systems |
| 8G1 | Capturing: logs from cron jobs by mail |
| 1T3 | Car100: jar100/car100 - sample output report |
| 1F4 | Card: SYSIN control card member conversion |
| 1F4 | Card: control card library members |
| 6D4 | Card: control card selections by current date |
| 1I1 | Cards: parms/ikjdemo1 - SYSTSIN control cards for IKJEFT01 |
| 1Q2 | Cards: cleanup mainframe JCL, PROCs,& Control Cards |
| 4L5 | Cards: Extract control cards from JCL to separate files |
| 6D1 | Cards: Extract control cards from JCL to separate files |
| 6D2 | Cards: extract control cards from 1 JCL/script |
| 6D2 | Cards: initial extract control cards |
| 5F0 | Caveats: GDG system - Caveats |
| 5B4 | Changing: disadvantages of changing the JCL/scripts |
| 6A4 | Changing: control file for all datafiles in mstr/... |
| 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 |
| 4N1 | City: alternate example from City of Lynn Valley |
| 4O3 | City: uvhdcob sample for City of Lynn Valley |
| 8F1 | Cleaning: up the log files |
| 1C1 | Cleanup: jcl1/jar100.jcl - after cleanup |
| 1Q2 | Cleanup: mainframe JCL, PROCs,& Control Cards |
| 6E1 | Cleanup: jclstrip1 - cleanup converted JCL/scripts |
| 4M2 | Clear: testdatainit - clear output subdirs before testing |
| 9A7 | Clear: jobclear - clear the pause control file |
| 4M2 | Cleared: TESTDATA subdirs cleared by testdatainit |
| 1G5 | Cluster: jgl360.jcl IDCAMS DEFINE CLUSTER - Create VSAM |
| 1G6 | Cluster: jgl360.ksh IDCAMS DEFINE CLUSTER converted to uvcp |
| 1C8 | Cmd: example#1 - prompt for date if not entered on cmd line |
| 1L1 | Cmp: ISRSUPC conversion to 'cmp' & 'uvcmp' |
| 1L1 | Cmp: converted to cmp/uvcmp - jcl3/isrsupc.ksh |
| 1A2 | Cobol: setup required to convert your own JCL,COBOL,DATA |
| 1B1 | Cobol: test/demo JCL PROCs,& COBOL |
| 1C11 | Cobol: COBOL EXECs converted to 'cobrun's |
| 1C9 | Cobol: sample COBOL step - converted to ksh |
| 1C9 | Cobol: sample COBOL step - in JCL |
| 1C9 | 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: script 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: Converting Mainframe COBOL to Unix/Linux Micro Focus COBOL |
| 1R3 | Cobol: Converting Mainframe COBOL to Unix/Linux Micro Focus COBOL |
| 1R4 | Cobol: compiling COBOL programs on Unix/Linux |
| 1R5 | Cobol: COBOL compile console logs |
| 1R5 | Cobol: Note re MicroFocus COBOL |
| 1V2 | Cobol: reconvert & recompile COBOL - 1 program at a time |
| 1V2 | Cobol: reconvert & recompile COBOL - All programs in directory |
| 1V2 | Cobol: reconvert COBOL copybook - 1 at a time |
| 1V2 | Cobol: reconvert COBOL copybooks - All in directory |
| 4G1 | Cobol: Converting COBOL copybooks/programs & Compiling |
| 4G2 | Cobol: Converting 1 COBOL copybook/program & Re-compiling |
| 4L3 | Cobol: Cross References for COBOL & JCL/scripts |
| 8B1 | Cobol: sample JCL/script for COBOL with cc test |
| 1C11 | Cobrun: COBOL EXECs converted to 'cobrun's |
| 1U1 | Collection: Console Log Collection subdirs |
| 3F5 | Combined: ctl/datactl53 - 6 datafile info sources combined |
| 8D1 | Command: Restart command |
| 4B3 | Common_defines: |
| 8A2 | Common_profile: stub_profile & common_profile |
| 0A7 | Compile: Compile 'C' programs if not Linux |
| 1R4 | Compile: Print Compile Error Reports |
| 1R4 | Compile: copy converted programs to compile library |
| 1R5 | Compile: COBOL compile console logs |
| 4G2 | Compile: only if compile fails |
| 1R4 | Compiling: COBOL programs on Unix/Linux |
| 1R5 | Compiling: under SFU/UWIN/CYGWIN on Windows |
| 4G1 | Compiling: Converting COBOL copybooks/programs & Compiling |
| 4G1 | Compiling: converting All PROGRAMs & compiling |
| 5J3 | Concatenate: exportgenall concatenate all generations |
| 7A6 | Concatenate: jobmsgs1 script to concatenate jobmsglogs |
| 1C12 | Condition: testing program Return Condition |
| 1G1 | Condition: jcl2/jgl300.jcl - demo IEBGENER/IDCAMS & CONDition codes |
| 8B1 | Condition: Condition Codes (program status Return-Codes) |
| 6B5 | Confirming: top-node/subdirs in converted scripts |
| 1J2 | Console: log from FTP test/demo |
| 1R5 | Console: COBOL compile console logs |
| 1S3 | Console: Execute demo scripts & observe console displays |
| 1S3 | Console: Notes re 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 |
| 6F5 | Console: optional - rerun to capture console log |
| 7A1 | Console: capturing console logs on Unix/Linux systems |
| 7A1 | Console: samples of Console, Debug,& Error Logs |
| 7A2 | Console: Console Logging |
| 7A2 | Console: logs created in $APPSADM |
| 7B1 | Console: Demo Console Logging & Job Message Logging |
| 7C1 | Console: Console Log |
| 8F1 | Console: Console Logging |
| 8F2 | Console: Viewing your console log files |
| 8N6 | Console: log illustrating restart |
| 1F4 | Control: SYSIN control card member conversion |
| 1F4 | Control: card library members |
| 1H2 | Control: Control file to supply recsizes, ID GDG files, etc |
| 1H3 | Control: Control file to supply recsizes, ID GDG files, etc |
| 1I1 | Control: parms/ikjdemo1 - SYSTSIN control cards for IKJEFT01 |
| 1Q2 | Control: cleanup mainframe JCL, PROCs,& Control Cards |
| 1Q3 | Control: Creating the DataFile Info control file |
| 3C3 | Control: stepctl51 - JCL/script step control pause/go |
| 3E1 | Control: ctl/jclunixop51 JCL Conversion control file |
| 3E3 | Control: Customizing the JCL Conversion control file |
| 3F2 | Control: Secondary control files for JCL converter |
| 4D1 | Control: Copying VU control files & functions to Your $TESTLIBS |
| 4D2 | Control: script to copy supplied control files & functions |
| 4E2 | Control: tables for Top-Nodes |
| 4H1 | Control: create Data conversion control file from LISTCAT |
| 4I2 | Control: creating the data conversion control file |
| 4K2 | Control: creating JCL converter DATA-INFO control file |
| 4K4 | Control: modifying JCL conversion control files |
| 4L5 | Control: Extract control cards from JCL to separate files |