Part_0 | - Introduction & Summary of Major Benefits |
Part_1 | - Demo conversion using supplied Test files (JCL, COBOL,& DATA files) |
- do these first & ensure your results match those listed | |
- helps you to understand these tools & ensure they work at your site |
Part_2 | - Testing & Debugging Aids |
- Cross-References, Jobflow reports, job logging, etc | |
- many other scripts & utilities valuable during conversions | |
- several of these can be run using supplied test files | |
- get familiar with these, so you will know when they can save you time | |
- Micro Focus COBOL Error codes listed here for your convenience |
Part_3 | - Conversion Support Files - profiles, functions, control files |
- supplied versions are tuned for the Test/Demo conversions | |
- you may want to modify for Your conversions |
Part_4 | - Directory Design & Operating Instructions for YOUR conversions |
(vs the demos in Part_1 for UV Software supplied test files) | |
- Conversion procedures for a sample customer (City of Lynn Valley) | |
- reviews all procedures required during conversion period | |
- includes summaries & scripts for COBOL & DATA re-conversions | |
(1st time, use step by step procedures in VSECOBOL.doc & VSEDATA.doc) | |
- suggests several aids & techniques to test/debug your JCL/scripts |
Part_5 | - GDG files (Generation Data Group) files |
- enhanced in May 2007, some features surpass mainframe implementation | |
- new generations written to jobtmp, copied to $RUNDATA on Normal EOJ | |
so Abterms do not create some new generations making reruns difficult | |
but if you can restart at the step, you will be prompted to copy back | |
- Indexed control file provides for number of generations per file | |
- may update control file to process prior gens 1 time or by expiry date | |
- may update control file to increment thru a range of prior generations | |
- option to prompt operator to confirm gen# or enter an alternate gen# |
Note |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Part_6 | - optional conversions (referenced from Part 4 as needed) |
Jobparmx1/Jobparms1 - extract control cards (for dates, etc) from JCL | |
- to separate files (easier to update, without modifying JCL) | |
JCLstrip1 - cleanup converted JCL/scripts | |
- remove non-essential mainframe code & extraeous comments | |
- remove original JCL stmnts that may have been useful during debug | |
Changing data file-types & record-sizes AFTER conversion | |
- advantages changing some fixed-length files to Text files | |
- can use unix/linux system utilities (vi,lp,more,etc) | |
- convenient for input files, parameter files, date control files, etc | |
- not possible for files with packed &/or binary fields. | |
- change DATA files, JCL/scripts,& COBOL programs (ORG LINE Seqntl) |
Part_8 | - JCL/script Review, Modifying, Writing new scripts |
- Quiz to test your understanding of profiles, environmental-variables | |
console logging, capturing logs from jobs scheduled by cron | |
- modifying converted JCL/scripts (examples & exercises) | |
- writing new scripts to Vancouver Utility standards |
Part_9 | - scripts & uvcopy jobs used in MVS JCL conversion |
Part_10 | - Pilot Project before high volume conversions |
- select a few JCL,COBOL,DATA files for a small standalone system | |
- can compare output reports to the mainframe (proof of concept) | |
- use JCL & COBOL cross-references (provided with Vancouver Utilities) | |
to determine data-files, program,& copybooks required |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Note |
|
MVSJCL2.htm#Part_26 - Special conversions for SORT/SYNCSORT, FTP, etc - Manual Changes Required for SORT/SyncSort - uvsort has all the powerful capabilities of SyncSort, but some of the more complex conversions may require manual correction. - Alternate solutions for SORTs with too many OMIT/INCLUDEs - Merging SyncSort converted parameters into VU JCL/scripts - FTP conversion examples
MVSJCL2.htm#Part_27 - Scanning for Problems & Mass-Change Fix-ups - grep, sed, uvcopy scan1d, scan2d, rep1d, rep2d, etc
MVSJCL2.htm#Part_28 - Special Considerations, Problems & Solutions - CONDition tests - Run a JCL/script when an input file is detected (ftrigger51) - detect FTP'd files & move/rename to a 2nd subdir to prevent overwrite - Convert mainframe JCL containing Cybermatics ESP scheduler coding - Process scripts converted from mainframe JCL containing BMC Control-M to allow testing on unix before unix version of control-M installed.
XREFjobs.htm - Cross-References - copybooks, called programs, JCL files & programs - COBOL files info, reads all programs in directory & for each program reports: file Org,Access,Open mode,rec-size,copybook,int/ext names
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 |
MVSJCL2.htm | - MVS/VSE JCL Conversion Parts 26,27,28 |
VSEJCL.htm | - VSE JCL Conversion <--- This Document |
MVSCOBOL.htm | - VSE COBOL Conversion |
VSECOBOL.htm | - MVS COBOL Conversion |
MVSDATA.htm | - Convert MVS EBCDIC Data to ASCII, preserving packed fields |
- high volume (all files in directory) |
VSEDATA.htm | - Convert VSE EBCDIC Data to ASCII, preserving packed fields |
- high volume (all files in directory) |
DATAcnv1.htm | - Basic DATA conversion (1 file at a time) |
Owen Townsend, UV Software, 4667 Hoskins Rd., North Vancouver BC, V7K2R3
Tel: 604-980-5434 Fax: 604-980-5404
The VSE mainframe did not have GDG files, but we have found them useful to supply tape generation handling for VSE conversions. The Vancouver Utility GDG system was enhanced in May 2007, and some features now surpass the MVS mainframe implementation.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
VSEJCL.doc is the detailed step by step instructions for converting IBM VSE JCL to Unix/Linux, using the Vancouver Utilities from UV Software Inc.
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.
uvlp13L - prints Landscape Simplex at 13 cpi to fit 132 cols on 11" wide - prints at 8.1 lpi to fit 60 lines in 8 1/2 deep uvlp13LD - prints Landscape Duplex (otherwise similar to uvlpLS1) uvlpLA1 - prints Landscape Simplex if < 500 lines, Duplex if > 500 lines uvlpLS1C - prints Landscape Simplex (same as above), but allows multiple copies to be specified as arg2 on the command line
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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. GDG was not part of the VSE system. GDG was a feature of the MVS O/S, and it is fully documented for the MVS JCL conversions at: https://www.uvsoftware.ca/mvsjcl.htm#Part_5
The VU GDG system is mentioned here because VSE sites converting to Unix/Linux may be able to use the VU GDG system to supply the functionality of their tape management system on the mainframe.
All tape files are converted to disc files & we have an option to convert the TLBL references to the GDG format, which uses function exportgen0 to read the latest generation & exportgen1 to write the next generation.
The VU GDG system has some features that go well beyond the original features provided on the mainframe.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
In March of 2004, the VSE JCL conversion package and this documentation were significantly enhanced. Test/Demo JCL, PROCs, COBOL programs,& DATA files are now provided, for you to run the conversion procedures & verify you results match the results listed in this documentation.
The Test/Demo conversion sessions will give you a clear understanding of these conversion procedures & make it easier for you to get started on your own conversions. If you are reading this on the web site (www.uvsoftware.ca), the test/demo documentation will make it easier for you to understand these conversion concepts.
If you have not yet purchased the Vancouver Utilities conversion package, UV Software invites you to send samples of your JCL for conversion & return by email attachments. Please be sure to include all referenced PROCs and any library members containing SORT keys, etc.
You can run the test/demos without the extensive planning & file system setup recommended for your own conversions. After installing Vancouver Utility versions March 2004 or later, the test/demo subdirs & files will be found in directory 'vsetest' (/home/uvadm/vsetest if installed as recommended).
We recommend you do not run the test/demos in /home/uvadm/vsetest, since any updated installation of Vancouver Utilities would wipe this out. So we advise you to setup a new user 'vsetest' (/home/vsetest) and copy all the test/demo subdirs & files from /home/uvadm/vsetest to /home/vsetest.
Although you could copy the 'vsetest' directory to a subdir within your home directory, we recommend the new user 'vsetest', so you will not have to modify your own profile yet. When you decide to proceed with your own conversions, you will be adding the supplied addition to your profile and the profiles of all programmers & operators involved.
As of October 2003, the Vancouver Utilities are distributed with the 'C' utility programs already compiled (into /home/uvadm/bin) using Red Hat 3.0. If you are running any Linux, you should not have to recompile. If you are running Unix, please see install.htm for the compile instructions for the various flavors of Unix. If you are running on Windows with SFU (Services For Unix), please see WindowsSFU.htm for compile instructions.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The Vancouver Utilities & the conversion tools & scripts may now be run on Windows systems, using SFU, UWIN, or CYGWIN (unix emulators for windows). You can download SFU from https://www.microsoft.com/windows/sfu, UWIN from https://www.wipro.com/uwin, and CYGWIN from https://www.cygwin.com.
There is also a low cost version of Vancouver Utilities for native windows, but that package does not include the conversion tools since the conversions depend on many unix style scripts that can only be run on windows with the aid of an emulator such as SFU, UWIN, CYGWIN, or KMS Tools.
Please see WindowsSFU.htm for important notes on installing SFU & VU. Please see CygwinUwin.htm for important notes on installing UWIN & CYGWIN for the Vancouver Utilities.
The various JCL & COBOL conversions illustrated in this documentation have been tested on SFU, UWIN, & CYGWIN as well as on Unix & Linux. Notes are made where there is any difference.
COBOL compile scripts are different since the Micro Focus COBOL compiler is different (Server Express for Unix/Linux vs Net Express for Windows). The script to compile 1 program at a time is 'mfcbl1' for unix/linux, and 'mfnxcbl1' for SFU/UWIN/CYGWIN (see listings at VSECOBOL.htm#5E0). To compile all programs in a directory the scripts are 'mfcblA' & 'mfnxcblA'.
JCL/scripts use functions (exportgen0, exportgen1, etc) to simulate mainframe generation files. Until June 2004, these complex functions required the 1993 version of the Korn shell & would not work under 'bash' (default shell for CYGWIN) or under 'pdksh' (public domain ksh), which is supplied with CYGWIN and UWIN (and aliased as 'ksh'). In June 2004, the exportgen functions were modified & tested for SFU (probably also OK for CYGWIN).
Please see pages F9 & F10 of the VU installation guide install.htm#F9 to download ksh93 from https://www.kornshell.com, and add the required files to the CYGWIN /bin.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
1A1. | Directory Design for UV test/demo JCL Conversion |
1B1. | JCL test/demo conversion Overview |
1C1. | Sample Conversion of test/demo JCL JAR100 (typical 1 step COBOL) |
1C2. | Sample Korn shell script 'jar100.ksh' output of JCL conversion above |
1C3. | Front end code inserted into all output scripts |
1C4. | Arguments on command line |
1C5. | jobset51 function called at begin all JCL/scripts |
1C6. | jobset51 functions explained |
1C8. | sample conversion of a COBOL step (JCL & equivalent ksh script) |
1C9. | DLBL conversion to exportfile |
1C10. | TLBL conversion to date/time stamped file in tape subdir |
1C11. | COBOL EXEC conversion to 'cobrun' for easy animation (debugging) |
1C12. | Testing program return status |
1C13. | EOJ Terminated Normally & Abnormally |
1C14. | SYSOUT printer file inserted into all steps |
1D1. | Sample conversion of test/demo JCL 'JAR120' |
- to illustrate conversion of printer ASSGN & LST |
1E1. | Sample Conversion of test/demo JCL 'JAR200' to Korn Shell Script |
- illustrates PROC expansion & SORT conversion to 'uvsort' |
1F1. | Sample conversion of IDCAMS Utility |
1F2. | jgl350.jcl - IDCAMS REPRO, copy Tape to Disc |
1F3. | jgl360.jcl - IDCAMS DEFINE CLUSTER, Create VSAM Indexed file |
1G1. | jgl600.jcl - tape file conversion to VU GDG generation file system |
1P1. | Op. Instrns to setup vsetest & copy test/demo files from uvadm |
- setup user 'vsetest' & copy supplied test/demo files from 'uvadm/vsetest' |
1Q1. | Op. Instrns to Convert the Test/Demo JCLs to Korn shell scripts |
1R1. | Op. Instrns to Convert the Test/Demo COBOL CopyBooks |
1R2. | COBOL program compile - overview |
1R3. | Op. Instrns to Convert & Compile the Test/Demo COBOL Programs |
1S1. | Operating Instructions to Execute the Test/Demo JCL/scripts |
- expected console displays |
1T1. | Checking Test/Demo Output Results |
1U1. | Re-Execute Test/Demo JCL/scripts with Console Logging |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/home/vsetest <-- setup user 'vsetest' & copy subdirs from uvadm/vsetest :-----testlibs : :--*--Csub - C subroutines for COBOL programs : :--*--cbl0 - COBOL programs ('*' means files present) : :-----cbl1 - cleaned up, cols 1-6 & 73-80 cleared, etc : :-----cbl2 - cnvMF4 converts mainframe COBOL to MicroFocus COBOL : :-----cbl3 - sysin1 converts instream ACCEPTs to READs from a file : :-----cbl4 - sysout1 converts DISPLAY on SYSOUT to WRITE to a file : :-----cbls - copy here (standard source library) before compiling : :-----cblst - cobol source listings from compiles : :-----cblx - compiled COBOL programs (.int's) : :--*--parm0 - control cards & includes (SORT FIELDS, etc) : :-----parms - control cards with 73-80 cleared : :-----cpy0 - for COBOL copybooks : :-----cpy1 - cleaned up, cols 1-6 & 73-80 cleared, etc : :-----cpy2 - cnvMF4 converts mainframe COBOL to MicroFocus COBOL : :-----cpys - copy here (standard copybook library) : :--*--ctl - conversion control files (jclunixop41, datafiles41) : :-----errs - JCL converter writes ERROR reports here : :--*--jcl0 - test/demo JCLs supplied : :-----jcl1 - intermediate conversion 73-80 cleared : :-----jcl2 - PROCs expanded from procs : :-----jcl3 - JCLs converted to Korn shell scripts : :-----jcls - copy here manually 1 by 1 during test/debug : :-----maps - 'cobmaps' record layouts generated from copybooks : :-----pf - uvcopy jobs to replace utilities (easytrieve,etc) : :--*--proc0 - test/demo PROCs supplied : :-----procs - will be merged with jcl1, output to jcl2 : :-----rpts - for optional statistics reports : :-----sf - for misc scripts you may wish to write : :--*--sfun - korn shell functions (jobset51,exportgen0,etc) : :-----tmp - tmp subdir used by various conversions : :-----xref - cross-references (see XREFjobs.htm)
:--*--testdata - test/demo data files supplied : :--*--ap - Accounts Payable : :--*--ar - Accounts Receivable : :--*--gl - General Ledger : :-----jobtmp - temporary files for SYSIN instream data : : :----030926 - jobtmp subdir created in jobset51 (script line 10) : :-----sysout - SYSOUT printer files : :-----tmp - tmp subdir for uvsort & misc use : :-----wrk - interstep temporary work files
These directories are supplied as part of the Vancouver Utility package. They allow you to test/demo the conversion procedures, to give you a clear understanding of the process, before converting your own JCL's.
You will be later instructed to setup a test/demo userid/login 'vsetest' and copy all above subdirs from /home/uvadm/vsetest to /home/vsetest before running the various conversion jobs.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The sub directories illustrated on the previous page are included on the Vancouver Utility distribution media and after installation will be contained within /home/uvadm/vsetest (1 of about 20 directories in the package).
You will later be instructed to setup a test/demo userid/login 'vsetest' and copy the subdirs from /home/uvadm/vsetest to /home/vsetest. Please do not run tests within /home/uvadm because new distributions of Vancouver Utilities would destroy your test results.
The above structure is for test/demo convenience. Please see the directory design suggested for your own conversions & production beginning on page '4A2'. Note that the DATA directories will be repositioned to a separate file system. The Library & Data directories used by the converted JCL/scripts is determined by environmental variables 'RUNLIBS' & 'RUNDATA' defined in user profiles.
The following pages will list several test/demo JCLs & PROCs provided and their converted equivalents (Korn shell scripts). Studying the Before/After (JCL/script) examples given starting on page '1C1' will give you a good understanding of the JCL conversion process.
If you have just installed the package, you can run the conversion procedures (starting on page '1P1') and verify that you get the same results listed here. If you have not yet purchased the package, you are invited to send samples of your JCL & PROCs to UV Software for conversion & return.
Note that the directory design listed here is for test/demo convenience only. The recommended directory design for your own testing & production is illustrated later on pages '4A2'. The big difference is that you should assign your data directories to a separate file system from the libraries.
If you wish to create the (empty) sub-dirs shown on the previous page for testing in your homedir (or elsewhere), you can use the scripts provided (vselibsdirs & vsedatadirs).
2. mkdir testlibs testdata <-- make superdirs =======================
3a. cd testlibs <-- change into superdir for libraries
3b. vselibsdirs <-- make library subdirs (cbl0,cbl1,etc...) ===========
4a. cd ../testdata <-- change into superdir for data
4b. vsedatadirs <-- make data subdirs (ap,ar,gl,etc) ===========
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The Library & Data directories used by the converted JCL/scripts is determined by environmental variables 'RUNLIBS' & 'RUNDATA' defined in user profiles. See recommended profiles for this test/demo listed at ADMjobs.htm#3B1.
$RUNLIBS is used in the PATH to define where the JCL/scripts are to be found.
$RUNDATA is used in the jobset51 function called at the beginning of each script to perform a change directory to the data files super directory.
All data files are addressed relative to RUNDATA, which allows us to easily switch between test data & production data simply by changing the value of RUNDATA. This is done most reliably by providing different profiles to the programmers & the production personnel.
The stub_profile is copied/renamed as .profile for ksh & .bash_profile for bash. The stub_profile listed at ADMjobs.htm#3C2 defines RUNLIBS & RUNDATA as follows:
export RUNLIBS=$HOME/testlibs #============================ export RUNDATA=$HOME/testdata #============================
If you setup separate user 'vsetest' for these tests, the expansions would be:
export RUNLIBS=/home/vsetest/testlibs #==================================== export RUNDATA=/home/vsetest/testdata #====================================
Alternatively, you could create a 'vsetest' subdir within your current HOME dir, in which case you would modify the exports as follows:
export RUNLIBS=/home/userxx/testlibs #=================================== export RUNDATA=/home/userxx/testdata #===================================
Note that setting up RUNLIBS & RUNDATA as subdirs in your homedir is a convenience to get you started testing quickly. You would NOT do this for serious testing & definitely not for production.
See the recommendations for your serious testing & production described later on pages '4A1' thru '4A6'
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will illustrate the conversion (before & after) of the following JCLs:
JAR100 |
|
JAR200 |
|
Our test/demo mainframe JCLs, PROCs, COBOL programs,& control card members are supplied in the 'vsetest' sub-directories illustrated on page '1A1'.
By convention, we have given these UPPER case names to reinforce their mainframe origins. The cleanup, PROC expansion,& conversion procedures will convert the UPPER case names to lower case names & append a .extension ('.jcl' for JCL, '.prc' for PROCs, '.ksh' for converted scripts,& '.cbl' for COBOL programs).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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). See TOPDIRDFL1/2 in the conversion control file listed later on page '3E1'.
We have supplied the test data files in /home/uvadm/vsetest/testdata. Later on page '1P1', you will be instructed to setup userid 'vsetest' & copy the testdata files to the following structure.
/home/vsetest/ :-----testdata/ : :-----ar/ : : :--customer.master : : :--sales.items : :-----gl/ : : :--account.master : : :--account.trans
Our test/demo data files have already been converted from EBCDIC to ASCII, preserving packed fields & correcting zoned signed fields to Micro Focus COBOL standards. You can see the details of the data conversions in DATAcnv1.htm & VSEDATA.htm.
By our conventions, all converted filenames are in lower case. This eliminates a lot of confusion on Unix/Linux systems where filenames are case sensetive.
We will later (after converting JCL & compiling COBOL programs) be using these test data files to execute our converted JCLs & COBOL programs.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will illustrate the conversion of VSE JCL to Unix/Linux Korn shell scripts with the input & output listings of a simple 1 step COBOL VSE JOB.
Note that we have inserted a sequence# on the left side to facilitate references. We have prefixed the JCL sequence#s with 'j#' and the Korn shell script sequence#s with 'k#'.
The detailed operating instructions for the conversion will be presented later beginning on page '1Q1'.
** sample input - VSE JCL (1 step COBOL) ** // JOB JAR100 TEST VSE JCL CONVERSION TO UNIX/LINUX KORN SHELL 00000010 * EXECUTES COBOL CAR100 CUSTOMER NAME&ADDRESS LISTING 00000020 // DATE 03/20/08 *COBOL program has ACCEPT FROM DATE 00000030 // DLBL CUSTMAS,'AR.CUSTOMER.MASTER',,VSAM,CAT=UCAT01 00000040 // DLBL NALIST,'AR.CUSTOMER.NAMEADRS.LIST100',0,SD 00000050 // EXTENT SYS017,DYNWRK,1,0,1,10 00000060 // EXEC PGM=CAR100,SIZE=AUTO 00000070 /& 00000080
See the output (Korn shell script equivalent) on the next page --->
The Korn shell output for a 1 step job is much longer than the JCL input, since there are about 30 lines of front end code & 10 lines of back end code that are inserted into all output scripts.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#001 #!/bin/ksh k#002 ##JOB JAR100 TEST VSE JCL CONVERSION TO UNIX/LINUX KORN SHELL k#003 export JOBID2=JAR100; scriptpath="$0"; args="$*" k#004 if [[ -z "$JOBID1" ]]; then JOBID1=JAR100; fi; export JOBID1 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done k#006 integer JCC=0 SCC=0 LCC=0 # init step status return codes k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 exportfile k#008 autoload exportgen0 exportgenall exportgenx exportgen1 k#010 jobset51 # call function to setup: directory equates, UPSI, etc k#011 #jobset51 stores any restart step# in alias 'goto' k#012 goto k#013 S0000=A k#014 #1======================== begin step#S0010_CAR100 ========================= k#015 S0010=A k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; k#017 logmsg2 "Begin Step $JSTEP CAR100 (#$XSTEP)" k#018 stepctl51 # test oprtr jcpause/jcclear k#019 export PROGID=CAR100 k#020 export PARM=""; k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} k#022 logmsg1 " EXECUTES COBOL CAR100 CUSTOMER NAME&ADDRESS LISTING" k#023 export RUNDATE=03/20/08 k#024 exportfile CUSTMAS ar/customer.master k#025 exportfile NALIST ar/customer.nameadrs.list100 k#026 ## EXEC PGM=CAR100,SIZE=AUTO k#027 #3---------------------------------------------------------------------- k#028 cobrun $ANIM $RLX/car100 k#029 #4---------------------------------------------------------------------- k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto=""; k#031 if ((SCC != 0)) k#032 then logmsg2 "ERR: step $JSTEP CAR100 abterm $SCC" k#033 alias goto="<<S9900=A"; fi k#034 goto k#035 #8====================================================================== k#036 S9000=A k#037 jobend51 #move any GDG files from jobtmp/subdirs to RUNDATA/subdirs k#038 logmsg2 "EOJ Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP" k#039 exit 0 #UVSI jclunix41 ver: 20080930 options: d0e1j1l1p0r0s0t12u1y0 k#040 #9====================================================================== k#041 S9900=A k#042 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK k#043 jobabend51 #report GDGs NOT moved from jobtmp/JOBID/GDG to outdirs k#044 exit $JCC
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The following block of front end code is inserted at the beginning of each Korn shell script (output from the JCL converter). This is the same for all jobs, except for the JOB name & description which is extracted from the // JOB card & inserted on lines 3 & 4 below.
k#001 #!/bin/ksh k#002 ##JOB JAR100 TEST VSE JCL CONVERSION TO UNIX/LINUX KORN SHELL k#003 export JOBID2=JAR100; scriptpath="$0"; args="$*" k#004 if [[ -z "$JOBID1" ]]; then JOBID1=JAR100; fi; export JOBID1 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done k#006 integer JCC=0 SCC=0 LCC=0 # init step status return codes k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 exportfile k#008 autoload exportgen0 exportgenall exportgenx exportgen1 ======== k#010 jobset51 # call function to setup: directory equates, UPSI, etc ======== k#011 #jobset51 stores any restart step# in alias 'goto' k#012 goto k#013 S0000=A
Note |
|
k#003 export JOBID2=JAR100; scriptpath="$0"; args="$*"
k#004 if [[ -z "$JOBID1" ]]; then JOBID1=JAR100; fi; export JAR100
'$JOBID2' always holds the name of the current job, which may have been called by a 'parent' job, whose name is probably held in '$JOBID1' ($JOBID1 holds the name of the 1st job in a series of called jobs).
'$scriptpath' & '$args' will be displayed by the 'jobset51' function which is listed on page '1C5' & 1C6 (see lines js#111 & js#112).
"$0" & "$*" had to be saved as labelled variables, since a called function would receive numbered $arguments from the function call not the script call.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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/prodlibs #<-- production libraries js#017 # export RUNDATA=/p2/proddata #<-- production Data superdir js#018 # js#019 # - JCL/scripts are found via $RUNLIBS/jcls in the profile PATH js#020 # - COBOL program subdir defined here in jobset51 as '$RUNLIBS/cblx' js#021 # (this allows programs to have same names as JCL/scripts) js#022 # js#044 cd $RUNDATA #change to working dir for production or test ** js#045 cdstatus=$? # capture status of cd $RUNDATA js#046 if ((cdstatus)) # ERR if cdstatus not zero (OK) js#047 then logmsg2 "ERR: cd \$RUNDATA ($RUNDATA) failed in jobset51" js#048 logmsg2 "- investigate, RUNDATA definition in profiles" js#049 logmsg1 "- enter to exit"; read reply; exit 91; fi js#050 # js#051 # cd $RUNDATA means all files are referenced relative to $RUNDATA ** js#052 # - allows switching between prod & test files by changing $RUNDATA js#053 # - JCL converter has converted HLQs of DSNs to subdirs in $RUNDATA js#054 # - High Level Qualifiers might be applications (ar,gl,mstr,tape,etc) js#055 # js#056 export RLX=$RUNLIBS/cblx # path for loading COBOL programs ** js#057 export RPX=$RUNLIBS/rpgx # path for loading RPG programs js#061 # - COBOL programs are found via $RLX/progname in JCL/scripts js#062 # - RPG programs are found via $RPX/progname in JCL/scripts js#064 # js#065 if [ -z "$ANIM" ]; then ANIM=-F; fi js#066 # 'ANIM=-F' inhibits non-numeric field checks (could change to +F ?) js#067 # - cobol programs are called via ---> cobrun $ANIM $RLX/progname <--- js#068 # js#069 # Make subdirs for work files, instream data files,& GDG subdirs ** js#079 export JTMP=jobtmp/$JOBID2 ** js#080 export RPTS=rpts * js#081 export SYOT=sysout/$JOBID2 * js#086 # js#087 # Define jobtmp/subdirs for new GDG files ** js#088 umask 002 # ensure perms to create dirs/files 775/664 (group share) * js#089 export JGDG=$JTMP/GDG * js#090 export GTMP=$JTMP/gtmp * js#091 if [[ ! -d $JTMP ]]; then mkdir $JTMP; fi ** js#092 if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi ** js#093 if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi * js#094 # JTMP/... - for work files & instream data files js#095 # GTMP/... - for exportgen0,1,etc 'ls' output files js#096 # GDG matching filenames readback to determine latest gen# js#097 # JGDG/subdirs - store new GDGs for move back at Normal EOJ js#098 # - see $RUNDATA/ctl/GDGmkdirs called later in jobset51 js#102 # js#110 # Define subdir that might be used for printer output ** js#111 # - some sites might sub-directory by date rpts/yymmdd/... * js#112 # export RPTS=rpts/$(date +%y%m%d) # use this for subdirs by date * js#113 if [[ ! -d $RPTS ]]; then mkdir $RPTS; fi ** js#114 # js#115 # make subdir for SYSOUT files (or any file w/o DSN=...) js#116 # $RUNDATA/$SYOT/step#_SYSOUT (where SYOT=sysout/JOBNAME) js#117 if [[ ! -d $SYOT ]]; then mkdir $SYOT; fi js#118 # js#119 # $JTMP & $SYOT are vital - ensure created successfully else exit js#120 if [[ -d $JTMP && -d $SYOT ]]; then : js#121 else logmsg2 "ERR: $JTMP &/or $SYOT failed creation (in jobset51)" js#122 logmsg2 "- investigate: permissions,JTMP,SYOT dirnames changed?" js#123 logmsg1 "- enter to exit"; read reply; exit 92; fi js#128 # js#129 # define subdir for interstep temp/work files & in IDCAMS conversions js#130 # ensure wrk/nullfile present & empty, for use on DD DUMMY js#131 >wrk/nullfile # ensure present & empty js#132 # could use /dev/null, but some unix variants had problems with that js#133 # js#134 # Begin code to preserve GDGs if jobs abort js#135 # - see doc at www.uvsoftware.ca/mvsjcl.htm#Part_5 # --> GDG explanations omitted here in Part 1 <-- # js#190 # Default RUNDATE to system date yyyymmdd, but allow cmd line override ** js#191 # --> jobname.ksh RUNDATE=20091120 <-- override sysdate for this job * js#192 # See explanations at www.uvsoftware.ca/mvscobol.htm#2E1 - 2E9 * js#193 # COBOL converter inserts unixwork1.cpy,unixproc1.cpy,perform unixproc1 * js#194 # - unixproc1 reformats $RUNDATE into various date formats for COBOL * js#195 if [[ -z "$RUNDATE" ]]; then RUNDATE=$(date +%Y%m%d); fi; export RUNDATE* js#197 # js#198 # Display various information at begining of JCL/script execution ** js#199 # - for the console log, info may be useful to debug problems * js#200 logmsg2 "Begin Job=$JOBID2" * js#201 logmsg1 "$scriptpath" * js#202 logmsg1 "Arguments: $args" * js#203 logmsg1 "RUNLIBS=$RUNLIBS" * js#204 logmsg1 "RUNDATA=$RUNDATA" * js#205 logmsg1 "JTMP=$JTMP SYOT=$SYOT" * js#206 logmsg1 "RUNDATE=$RUNDATE" * js#207 uvtime W1D0 $JTMP/jobbgn js#208 export JSTEP=S0000 XSTEP=0 js#209 integer JCC=0 SCC=0 LCC=0; js#210 # js#211 # Allow for RESTART at any step by step=... argument on command line: ** js#212 # --> jobname.ksh step=S0020 <-- restart at step 2 * js#213 if [[ -n "$step" ]]; then STEP="$step"; fi * js#214 if [[ -z "$STEP" ]]; then export STEP=S0000; fi * js#215 if [[ $STEP != S[0-9][0-9][0-9][0-9] ]] * js#216 then logmsg2 "ERR: STEP=$STEP invalid"; exit 91; fi * js#217 alias goto="<<${STEP}=A" ** js#218 return 0 js#219 } js#220 #----------------------------- end jobset51 -----------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 1 COBOL EXEC step, extracted from the JCL & Korn shell script listed previously. This typical step is the basis for much discussion on the following pages.
j#001// JOB JAR100 TEST VSE JCL CONVERSION TO UNIX/LINUX KORN SHELL j#002* EXECUTES COBOL CAR100 CUSTOMER NAME&ADDRESS LISTING j#003// DATE 03/20/08 *COBOL program has ACCEPT FROM DATE j#004// DLBL CUSTMAS,'AR.CUSTOMER.MASTER',,VSAM,CAT=UCAT01 j#005// DLBL NALIST,'AR.CUSTOMER.NAMEADRS.LIST100',0,SD j#006// EXTENT SYS017,DYNWRK,1,0,1,10 j#007// EXEC PGM=CAR100,SIZE=AUTO j#008/&
k#014 #1======================== begin step#S0010_CAR100 ======================= k#015 S0010=A k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; k#017 logmsg2 "Begin Step $JSTEP CAR100 (#$XSTEP)" k#018 stepctl51 # test oprtr jcpause/jcclear k#019 export PROGID=CAR100 k#020 export PARM=""; k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} k#022 logmsg1 " EXECUTES COBOL CAR100 CUSTOMER NAME&ADDRESS LISTING" k#023 export RUNDATE=03/20/08 k#024 exportfile CUSTMAS ar/customer.master k#025 exportfile NALIST ar/customer.nameadrs.list100 k#026 ## EXEC PGM=CAR100,SIZE=AUTO k#027 #3---------------------------------------------------------------------- k#028 cobrun $ANIM $RLX/car100 k#029 #4---------------------------------------------------------------------- k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto=""; k#031 if ((SCC != 0)) k#032 then logmsg2 "ERR: step $JSTEP CAR100 abterm $SCC" k#033 alias goto="<<S9900=A"; fi k#034 goto
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#004 // DLBL CUSTMAS,'AR.CUSTOMER.MASTER',,VSAM,CAT=UCAT01 j#005 // DLBL NALIST,'AR.CUSTOMER.NAMELIST',0,SD j#006 // EXTENT SYS017,DYNWRK,1,0,1,10
k#024 exportfile CUSTMAS ar/customer.master k#025 exportfile NALIST ar/customer.nameadrs.list100
'exportfile' is a function (see listing on page '5J5') that displays the filenames (for the console log), in addition to generating the korn shell 'export'. For the above examples, the 'export's would be:
export CUSTMAS=ar/customer.master export NALIST=ar/customer.nameadrs.list100
The 'export's load the environmental variables for the 'Logical File Names' with the values for the 'Physical File Names'. These values are available to the COBOL programs, since the COBOL converter has inserted 'external' into the file 'select' clauses.
Note that the High Level Qualifier ('ar' in this case) becomes a subdir (within $RUNDATA) & the data files will be converted correspondingly. Any EXTENT info is ignored (not applicable to unix/linux).
Filenames with only 1 node (no '.'s) will be assigned to the subdir defined by TOPDIRDFL1/2 in the conversion control file (see ctl/jclunixop41 listed on page '3E1'). The directory may also be specified via TOPDIRINS1/2 or individually by file using topr=... in ctl/datafiles43 (see listing page '3E3' & discussion page '3E4').
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
// TLBL BERCURB,'TBE0T.BERCURB',,,,,,2
exportfile BERCURB tape/bercurb_$(date +%y%m%d)_$(date +%H%M%S)
This illustrates all TLBL tape conversion options. Conversion options may be specified in the conversion control file (ctl/jclunixop41) which is listed later on page '3E1'.
t1 |
|
t2 |
|
t4 |
|
t7 |
|
We don't want to copy our tape files directly to tape as on the mainframe. We can eliminate a lot of tape file handling by writing all tape files to disc & depending on the enhanced backup systems on the unix/linux systems.
We need to append date/time stamps because the mainframe would have created separate tape reels, but now that we are outputting to disc, we would be overwriting the same file if we did not use the date/time stamps.
If the reason for the tape backup were contingency only & when restore required the tape file was manually selected & input into a restore JCL, then this plan should work even better. We would investigate the console log to identify the backup file required & restore it with a simple unix/linux 'cp'.
Of course we need some plan to remove the old date/time stamped files. We can do this conveniently using a 'cron' script to automatically delete tape files older than a specified number of days. Assigning tape files into a separate directory (tape) allows us to run the cron script on the entire directory. If you could not agree on a set number of days for all tape files, you could probably use wild card matching on the tape filename prefixes to achieve the desired effect.
See the sample 'crontab_appsadm1' & 'nightly1' at ADMjobs.htm#5B1 & 5C1.
Tape conversions have been changed to GDG generation files. Here is an example from JCL/script jgl350 example on pages '1F1' & '1F2'.
// TLBL DSFO,'GL.ACCOUNT.MASTER',0,,1,1,1
exportgen1 DSFO $JGDG/tape/gl.account.master_
See a more extensive example (jgl600) on pages '1G1' & '1G2'.
See GDG files documented in 'Part_5'
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#007 // EXEC PGM=CAR100,SIZE=AUTO
k#026 ## EXEC PGM=CAR100,SIZE=AUTO k#027 #3---------------------------------------------------------------------- k#028 cobrun $ANIM $RLX/car100 k#029 #4----------------------------------------------------------------------
COBOL 'EXEC's converted to 'cobrun's for Micro Focus COBOL. 'cobrun' will execute/interpret the '.int' (car100.int in this example). '.int's are much smaller than executables & allows animation(debugging) without having to recompile or modify any JCL/script, for example:
--> export ANIM=+A <-- activate the Animation option --> jar100.ksh <-- run the job (will animate COBOL programs) --> export ANIM="" <-- deactivate Animation
The '.int's usually do not run significantly slower than executables. But if you had some programs doing a lot of memory table indexing, you can compile it to an executable & remove the 'cobrun $ANIM' from the script.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
After each EXEC, code is inserted to test the program return status. The mainframe did this automatically, but unix/linux scripts must test success/fail after each program execution.
j#006 // EXEC PGM=CAR100,SIZE=AUTO,PARM="MARCH 11, 2005"
k#027 #3---------------------------------------------------------------------- k#028 cobrun $ANIM $RLX/car100 k#029 #4---------------------------------------------------------------------- k#030 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto=""; k#031 if ((SCC != 0)) k#032 then logmsg1 "step $JSTEP CAR100 abterm $SCC" k#033 alias goto="<<S9900=A"; fi k#034 goto
The Korn shell store the program status in '$?'. Our converted script saves the status from this temporary variable to a dedicated variable constructed from the current step# (S0010C in example above).
If the status is non-zero, we display the 'abterm' message and we 'goto' the Abnormal termination (tag 'S9900=A') at the end of the program.
This code is a little complex since ksh does not have a real 'goto'. We are using redirected input to 'eat up' the script itself until we reach the stop pattern ('S9900=A' in the example above).
We assigned the redirected input statement to an alias 'goto' in case we needed a $variable in the stop pattern. The goto alias is initialized to null on line k#030 (goto=""), so that if the return code is 0, then the goto on line k#034 will do nothing.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#035 #8====================================================================== k#036 S9000=A k#037 jobend51 #move any GDG files from jobtmp/subdirs to RUNDATA/subdirs k#038 logmsg2 "EOJ Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP" k#039 exit 0 #UVSI jclunix41 ver: 20080930 options: d0e1j1l1p0r0s0t12u1y0 k#040 #9====================================================================== k#041 S9900=A k#042 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK k#043 jobabend51 #report GDGs NOT moved from jobtmp/JOBID/GDG to outdirs k#044 exit $JCC
If all step return codes were zero (normal), then we would reach 'Terminated Normally' & exit 0.
If any step return code was non-zero, then we would 'goto' the 'S9900=A' label (line k#041 above), display 'Terminated Abnormally',& exit with non-zero condition code.
This also allows you to add some code here to perform whatever ABTERM steps you wish.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} =========================================================
COBOL programs can 'DISPLAY UPON SYSOUT' or they can 'WRITE' to a file. If they WRITE reports, the converter will treat the printer files the same as any other data file. The files would be assigned to a directory derived from the top level node in the VSE JCL data file name.
COBOL programs that 'DISPLAY UPON SYSOUT' do not need to declare a printer file, and the VSE JCL did not need to include a DLBL/TLBL for the printer file.
The COBOL converter could convert the 'DISPLAY UPON SYSOUT' to 'WRITE's to a file which is inserted into the COBOL program (using select name 'SYSOUT').
We can now give special treatment to the SYSOUT files. The SYSOUT files directory is converted to '$SYOT', which is assigned to the 'sysout' directory. The expansion might be as follows:
exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} <-- before expansion ====================================================
export SYSOUT=sysout/JAR100_001_CAR100 <-- after symbol expansion ======================================
'SYOT' is assigned to sysout in the 'jobset51' function which is inserted about line 10 of each converted jcl/script. You can see jobset51 listed on page '5K1'. If desired, you could sub-directory by date or jobname.
Printer files might be sent to a spooling package to allow page restarts, etc. EasySpooler is a popular Unix/Linux spooling package.
For laser printers, you could use one of the 'uvlp' scripts provided by UV Software. For example, 'uvlp13LD' will print a mainframe style report (originally on 15x11 paper) Landscape & Duplex, reducing the cpi & lpi to fit on standard 8 1/2 by 11 (leaving margins for 3 hole punched paper).
The JCL conversion might be enhanced to send the printer files to the spooling package or a uvlp script at the Terminated Normally end of script.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#001 // JOB JAR120 TEST/DEMO VSE JCL PARM-DATA CONVERSION j#002 * CUSTOMER NAME & ADDRESS LISTING WITH DATE FROM PARM=... j#003 // DLBL CUSTMAS,'AR.CUSTOMER.MASTER',,VSAM,CAT=UCAT01 j#004 // ASSGN SYS020,F93 j#005 * $$ LST LST=F93,CLASS=E,DISP=K,USER=ARDEPT,DEST=(*,ARDEPT),JNM=JAR121 j#006 // EXEC PGM=CAR120,SIZE=AUTO,PARM='MARCH 12, 2005' j#007 FISCALYEAR=2004 j#008 /* j#009 /&
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#001 #!/bin/ksh k#002 ##JOB JAR120 TEST/DEMO VSE JCL PARM-DATA CONVERSION
- - - - lines 3-11 removed (same as ex#1) - - - -
k#014 #1======================== begin step#S0010_CAR120 ========================= k#015 S0010=A k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; k#017 logmsg2 "Begin Step $JSTEP CAR120 (#$XSTEP)" k#018 stepctl51 # test oprtr jcpause/jcclear k#019 export PROGID=CAR120 k#020 export PARM="MARCH 12, 2005" k#021 logmsg1 "PARM=MARCH 12, 2005" k#022 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} k#023 logmsg1 " CUSTOMER N&A LISTING WITH DATE FROM PARM=... (CAR120.cbl using WS)" k#024 logmsg1 " - also see JAR125 & CAR125.cbl using PARM data in LINKAGE SECTION" k#025 exportfile CUSTMAS ar/customer.master k#026 ## ASSGN SYS020,F93 k#027 # $$ LST LST=F93,CLASS=E,DISP=K,USER=ARDEPT,DEST=(*,ARDEPT),JNM=JAR121 k#028 exportfile SYS020 $RPTS/jar121___E_car120_${JSTEP}_01_$(date +%y%m%d%H%M%S) k#029 exportfile SYSIN $JTMP/${JSTEP}_${PROGID} k#030 cat > $SYSIN <</*EOD k#031 FISCALYEAR=2004 k#032 /*EOD k#033 ## EXEC PGM=CAR120,SIZE=AUTO,PARM='MARCH 12, 2005' k#034 #3---------------------------------------------------------------------- k#035 cobrun $ANIM $RLX/car120 k#036 #4---------------------------------------------------------------------- k#037 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto=""; k#038 # uvlpLS13 $SYS020 k#039 if ((SCC != 0)) k#040 then logmsg2 "ERR: step $JSTEP CAR120 abterm $SCC" k#041 alias goto="<<S9900=A"; fi k#042 goto k#043 #8====================================================================== k#044 S9000=A k#045 jobend51 #move any GDG files from jobtmp/subdirs to RUNDATA/subdirs k#046 logmsg2 "EOJ Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP" k#047 exit 0 #UVSI jclunix41 ver: 20080930 options: d0e1j1l1p0r0s0t12u1y0 k#048 #9====================================================================== k#049 S9900=A k#050 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK k#051 jobabend51 #report GDGs NOT moved from jobtmp/JOBID/GDG to outdirs k#052 exit $JCC
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Control stream data is redirected to a data file in the tmp subdir since Unix/Linux COBOL has no control stream concept. The COBOL converter converts 'ACCEPT's from control stream to 'READ's from a data file (select & FD inserted in COBOL program).
j#006 // EXEC PGM=CAR100,SIZE=AUTO,PARM="MARCH 11, 2005" j#007 FISCALYEAR=2004 j#008 /*
k#029 exportfile SYSIN $JTMP/${JSTEP}_${PROGID} k#030 cat > $SYSIN <</*EOD k#031 FISCALYEAR=2004 k#032 /*EOD k#033 ## EXEC PGM=CAR120,SIZE=AUTO,PARM='MARCH 12, 2005' k#034 #3---------------------------------------------------------------------- k#035 cobrun $ANIM $RLX/car120 k#036 #4----------------------------------------------------------------------
A unique filename is constructed from jobname,step#,& programname which is 'export'ed as logical name 'SYSIN' for the COBOL program name.
The instream data is redirected via the 'cat' & '<</*' into the tmp data file until the ending '/*' is encountered.
Note that control stream data is repositioned ahead of the EXEC/cobrun since it must be redirected into the data file before the COBOL program is executed.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
This example will illustrate the conversion of mainframe SORT to 'uvsort' (Vancouver Utility replacement for SORT & SYNCSORT).
j#001 // JOB JAR200 TEST/DEMO VSE JCL CONVERT & PROC EXPANSION j#002 * PAR200 - TEST/DEMO VSE JCL CONVERT (PROC CALLED BY JAR200) j#003 * SORT SALES ITEMS BY PRODUCT#(MAJOR) & CUSTOMER#(MINOR) j#004 // DLBL SORTIN1,'AR.SALES.ITEMS',,VSAM,CAT=UCAT01 j#005 // DLBL SORTOUT,'%SALES.SORTFILE',0,VSAM,CAT=WKCAT,DISP=(NEW,KEEP), C j#006 RECORDS=(100,1000),RECSIZE=64 j#007 // DLBL SORTWK1,'%SORTWORK1',0 j#008 // EXTENT SYS003,DYNWRK,,,1,200 j#009 // EXEC SORT,SIZE=100K j#010 SORT FIELDS=(31,6,A,1,6,A),FORMAT=CH,WORK=1 j#011 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85')) j#012 RECORD TYPE=F,LENGTH=64 j#013 INPFIL BLKSIZE=6400 j#014 OUTFIL BLKSIZE=6400 j#015 END j#016 /* j#017 * STEP2 - LIST SALES ITEMS BY PRODUCT# j#018 // DLBL SALEDTL,'%SALES.SORTFILE',0,VSAM,CAT=WKCAT,DISP=(,DELETE) j#019 // DLBL CUSTMAS,'AR.CUSTOMER.MASTER.INDEXED',,VSAM j#020 // ASSGN SYS035,F91 REPORT OUTPUT j#021 * $$ LST LST=F91,DISP=D,CLASS=E,DEST=(*,ARDEPT),JNM=SALESRPT j#022 // EXEC PGM=CAR200,SIZE=AUTO,PARM='MARCH 11, 2005' j#023 FISCALYEAR=2004 j#024 /&
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#014 #1======================== begin step#S0010_SORT ========================= k#015 S0010=A k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; k#017 logmsg2 "Begin Step $JSTEP SORT (#$XSTEP)" k#018 stepctl51 # test oprtr jcpause/jcclear k#019 export PROGID=SORT k#020 export PARM=""; k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} k#022 logmsg1 " PAR200 - TEST/DEMO VSE JCL CONVERT (PROC CALLED BY JAR200)" k#023 logmsg1 " SORT SALES ITEMS BY PRODUCT#(MAJOR) & CUSTOMER#(MINOR)" k#024 exportfile SORTIN1 ar/sales.items k#025 exportfile SORTOUT $JTMP/%sales.sortfile k#026 exportfile SYSIN $JTMP/${JSTEP}_${PROGID} k#027 cat > $SYSIN <</*EOD k#028 SORT FIELDS=(31,6,A,1,6,A),FORMAT=CH,WORK=1 k#029 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85')) k#030 RECORD TYPE=F,LENGTH=64 k#031 INPFIL BLKSIZE=6400 k#032 OUTFIL BLKSIZE=6400 k#033 END k#034 /*EOD k#035 ## EXEC SORT,SIZE=100K k#036 #3---------------------------------------------------------------------- k#037 uvsort "fili1=$SORTIN1,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\ k#038 ,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85" k#039 #4---------------------------------------------------------------------- k#040 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto=""; k#041 if ((SCC != 0)) k#042 then logmsg2 "ERR: step $JSTEP SORT abterm $SCC" k#043 alias goto="<<S9900=A"; fi k#044 goto k#045 logmsg1 " STEP2 - LIST SALES ITEMS BY PRODUCT#" k#046 #1======================== begin step#S0020_CAR200 ========================= k#047 S0020=A k#048 JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; k#049 logmsg2 "Begin Step $JSTEP CAR200 (#$XSTEP)" k#050 stepctl51 # test oprtr jcpause/jcclear k#051 export PROGID=CAR200 k#052 export PARM="MARCH 11, 2005" k#053 logmsg1 "PARM=MARCH 11, 2005" k#054 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} k#055 exportfile SALEDTL $JTMP/%sales.sortfile k#056 exportfile CUSTMAS ar/customer.master.indexed k#057 ## ASSGN SYS035,F91 REPORT OUTPUT k#058 # $$ LST LST=F91,DISP=D,CLASS=E,DEST=(*,ARDEPT),JNM=SALESRPT k#059 exportfile SYS035 $RPTS/salesrpt_E_car200_${JSTEP}_01_$(date +%y%m%d%H%M%S) k#060 exportfile SYSIN $JTMP/${JSTEP}_${PROGID} k#061 cat > $SYSIN <</*EOD k#062 FISCALYEAR=2004 k#063 /*EOD k#064 ## EXEC PGM=CAR200,SIZE=AUTO,PARM='MARCH 11, 2005' k#065 #3---------------------------------------------------------------------- k#066 cobrun $ANIM $RLX/car200 k#067 #4----------------------------------------------------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#024 exportfile SORTIN1 ar/sales.items k#025 exportfile SORTOUT $JTMP/%sales.sortfile k#026 exportfile SYSIN $JTMP/${JSTEP}_${PROGID} k#027 cat > $SYSIN <</*EOD k#028 SORT FIELDS=(31,6,A,1,6,A),FORMAT=CH,WORK=1 k#029 OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85')) k#030 RECORD TYPE=F,LENGTH=64 k#031 INPFIL BLKSIZE=6400 k#032 OUTFIL BLKSIZE=6400 k#033 END k#034 /*EOD k#035 ## EXEC SORT,SIZE=100K k#036 #3---------------------------------------------------------------------- k#037 uvsort "fili1=$SORTIN1,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64\ k#038 ,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85" k#039 #4----------------------------------------------------------------------
The original SORT control cards are seen in the converted script since all control streams are redirected into a temporary file & brought ahead of the program execution. The SYSIN $JTMP(jobtmp) file is not required for uvsort since the converter has already inserted the SORT FIELDS & RECORD SIZE into the uvsort command string. But listing the control stream allows you to check the SORT/uvsort conversion without referring back to the input.
The uvsort I/O files are declared by keywords 'fili1=...' & 'filo1=...'. The converter will define these using the $SYMBOLS ($SORTIN1 & $SORTOUT).
exportfile SORTIN1 ar/sales.items exportfile SORTOUT $JTMP/%sales.sortfile ==================================================================== uvsort "fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64,\
Note that the SORT FIELD displacements were one relative for the mainframe, but are zero relative for uvsort.
SORT FIELDS=(31,6,A,1,6,A) OMIT COND=((11,2,CH,EQ,C'65'),OR,(COND=(11,2,CH,EQ,C'85')) ==================================================================== ,keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#001 // JOB JGL350 * TEST VSE JCL IDCAMS CONVERSION * j#002 * COPY GL.ACCOUNT.MASTER TO TAPE j#003 // DLBL DSFI,'GL.ACCOUNT.MASTER',,VSAM,CAT=USRCAT j#004 // TLBL DSFO,'GL.ACCOUNT.MASTER',0,,1,1,1 j#005 // PAUSE // ASSGN SYS005,8809 j#006 // EXEC PGM=IDCAMS,SIZE=AUTO j#007 REPRO INFILE(DSFI) OUTFILE(DSFO) RECORDSIZE(80) j#008 /* j#009 /&
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The front end 25 lines & the back end 8 lines are omitted since they are the same for all jobs (except for jobname & any JCL comments).
k#001 #!/bin/ksh k#002 ##JOB JGL350 * TEST VSE JCL IDCAMS CONVERSION *
- - - lines 3-11 removed (similar in all output scripts) - - -
k#014 #1======================== begin step#S0010_IDCAMS ========================= k#015 S0010=A k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; k#017 logmsg2 "Begin Step $JSTEP IDCAMS (#$XSTEP)" k#018 stepctl51 # test oprtr jcpause/jcclear k#019 export PROGID=IDCAMS k#020 export PARM=""; k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} k#022 logmsg1 " COPY GL.ACCOUNT.MASTER TO TAPE" k#023 exportfile DSFI gl/account.master k#024 exportgen1 DSFO $JGDG/tape/gl.account.master_ k#025 #exportgen1 assign to $JGDG/subdir/file, move to subdir/file at Normal EOJ k#026 logmsg1 "// ASSGN SYS005,8809" k#027 logmsg1 "enter to continue" k#028 if [[ "$PAUSE" != "NO" ]]; then read reply; fi k#029 exportfile SYS005 $DW/${JOBID2}_${PROGID}_SYS005 k#030 exportfile SYSIN $JTMP/${JSTEP}_${PROGID} k#031 cat > $SYSIN <</*EOD k#032 REPRO INFILE(DSFI) OUTFILE(DSFO) RECORDSIZE(80) k#033 /*EOD k#034 ## EXEC PGM=IDCAMS,SIZE=AUTO k#035 #3---------------------------------------------------------------------- k#036 uvcp "fili1=$DSFI,typ=RSF,rcs=80,filo1=$DSFO,typ=RSF,rcs=80" k#037 LCC=$?; ((SCC+=LCC)); k#038 #4---------------------------------------------------------------------- k#039 S0010C=$SCC; ((JCC+=SCC)); alias goto=""; k#040 if ((SCC != 0)) k#041 then logmsg2 "ERR: step $JSTEP IDCAMS abterm $SCC" k#042 alias goto="<<S9900=A"; fi k#043 goto
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#004 // TLBL DSFO,'GL.ACCOUNT.MASTER',0,,1,1,1 ===============================================
k#024 exportgen1 DSFO $JGDG/tape/gl.account.master_ ===================================================
TLBL files will be redirected to GDG generation files to reduce the extensive tape handling that was common on mainframes. If the copy to tape was simply a backup it may be unnecessary on unix due to superior backup frequency (every night automatically scheduled by 'cron').
Tape file outputs will automatically create a new generation of the file. Tape file inputs will automatically get the latest generation of the file. If you wanted a prior generation, you could temporarily modify the JCL/script to specify the desired generation#.
See GDG generation files documented in Part_5.
The default is to convert tape files to GDG generation files, but there is an option to convert to date/time stamped files in a disc directory.
The 'tape' subdir should exist within the $RUNDATA directory. jobset51 performs a 'cd $RUNDATA'.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
j#001 // JOB JGL360 * TEST VSE JCL IDCAMS CONVERSION * j#002 * CREATE VSAM INDEXED FILE j#003 // EXEC PGM=IDCAMS,SIZE=AUTO j#004 DELETE (GL.ACCOUNT.MASTER2) PURGE CLUSTER CATALOG (USERCAT5) j#005 DEFINE CLUSTER (NAME (GL.ACCOUNT.MASTER2) - j#006 INDEXED KEYS(6 0) RECORDSIZE(80) ) - j#007 DATA (NAME (GL.ACCOUNT.MASTER2.DATA) - j#008 INDEX (NAME (GL.ACCOUNT.MASTER2.INDEX) - j#009 CATALOG (USERCAT5) j#010 /* j#011 /&
See the 'uvcp' equivalent of IDCAMS listed on the next page --->
Most of the IDCAMS functions are not required for Micro Focus COBOL on Unix/Linux/Windows systems. For example 'DEFINE CLUSTER' was required by the mainframe to create a VSAM file, but Micro Focus COBOL can create VSAM files simply by 'OPEN OUTPUT'.
However the IDCAMS DEFINE CLUSTER is converted to 'uvcp' which will create an empty file, in case the IDCAMS step is followed by a COBOL program that expects to ADD/UPDATE records to an empty existing file. The uvcp will create the file with any indexed keys specified.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#001 #!/bin/ksh k#002 ##JOB JGL360 * TEST VSE JCL IDCAMS CONVERSION *
- - - lines 3-11 removed (similar in all output scripts) - - -
k#014 #1======================== begin step#S0010_IDCAMS ========================= k#015 S0010=A k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; k#017 logmsg2 "Begin Step $JSTEP IDCAMS (#$XSTEP)" k#018 stepctl51 # test oprtr jcpause/jcclear k#019 export PROGID=IDCAMS k#020 export PARM=""; k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} k#022 logmsg1 " CREATE VSAM INDEXED FILE" k#023 exportfile SYSIN $JTMP/${JSTEP}_${PROGID} k#024 cat > $SYSIN <</*EOD k#025 DELETE (GL.ACCOUNT.MASTER2) PURGE CLUSTER CATALOG (USERCAT5) k#026 DEFINE CLUSTER (NAME (GL.ACCOUNT.MASTER2) - k#027 INDEXED KEYS(6 0) RECORDSIZE(80) ) - k#028 DATA (NAME (GL.ACCOUNT.MASTER2.DATA) - k#029 INDEX (NAME (GL.ACCOUNT.MASTER2.INDEX) - k#030 CATALOG (USERCAT5) k#031 /*EOD k#032 ## EXEC PGM=IDCAMS,SIZE=AUTO k#033 #3---------------------------------------------------------------------- k#034 rm -f gl/account.master2 k#035 uvcp "fili1=wrk/nullfile,typ=RSF,rcs=80,filo1=gl/account.master2,typ=ISF,rcs=80\ k#036 ,isk1=0(6)" k#037 LCC=$?; ((SCC+=LCC)); k#038 #4---------------------------------------------------------------------- k#039 S0010C=$SCC; ((JCC+=SCC)); alias goto=""; k#040 if ((SCC != 0)) k#041 then logmsg2 "ERR: step $JSTEP IDCAMS abterm $SCC" k#042 alias goto="<<S9900=A"; fi k#043 goto
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The VSE mainframe did not have GDG files, but we have found them useful to supply tape generation handling for VSE conversions.
The Vancouver Utility GDG system was enhanced in May 2007, and some features now surpass the mainframe implementation. Please see the complete writeup for the VU GDG system in: 'Part_5' (duplicated here from MVSJCL.doc).
Here in VSEJCL.doc, we will illustrate just 1 JCL TAPE file conversion to GDG files. Later on, after setup & JCL/script conversions in '1P1' thru '1R4', you can run jgcl600.ksh as for other jobs in '1S1' thru '1S3'.
j#01 // JOB JGL600 j#02 /* test converting TLBLs to GDG exportgen0/exportgen1 j#03 /* VSE did not have GDGs, but JCL conversion will use for tape files j#04 /* - assumes exportgen1 for OUTput, unless IN or INPUT found as comment j#05 // TLBL GLTRANS,'GL.TRANS' IN j#06 // TLBL GLMSOLD,'GL.MASTER' IN j#07 // TLBL GLMSNEW,'GL.MASTER' OUT j#08 // EXEC CGL200 j#09 /*
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
k#001 #!/bin/ksh k#002 ##JOB JGL600 k#003 export JOBID2=JGL600; scriptpath="$0"; args="$*" k#004 if [[ -z "$JOBID1" ]]; then JOBID1=JGL600; fi; export JOBID1 k#005 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done k#006 integer JCC=0 SCC=0 LCC=0 # init step status return codes k#007 autoload jobset51 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 exportfile k#008 autoload exportgen0 exportgenall exportgenx exportgen1 k#010 jobset51 # call function to setup: directory equates, UPSI, etc k#011 #jobset51 stores any restart step# in alias 'goto' k#012 goto k#013 S0000=A k#014 #1======================== begin step#S0010_CGL200 ========================= k#015 S0010=A k#016 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; k#017 logmsg2 "Begin Step $JSTEP CGL200 (#$XSTEP)" k#018 stepctl51 # test oprtr jcpause/jcclear k#019 export PROGID=CGL200 k#020 export PARM=""; k#021 exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} k#022 # /* test converting TLBLs to GDG exportgen0/exportgen1 k#023 # /* VSE did not have GDGs, but JCL conversion will use for tape files k#024 # /* - assumes exportgen1 for OUTput, unless IN or INPUT found as comment k#025 exportgen0 GLTRANS tape/gl.acnt.trans_ k#026 exportgen0 GLMSOLD tape/gl.acnt.master_ k#027 exportgen1 GLMSNEW $JGDG/tape/gl.acnt.master_ k#028 #exportgen1 assign to $JGDG/subdir/file, move to subdir/file at Normal EOJ k#029 ## EXEC CGL200 k#030 #3---------------------------------------------------------------------- k#031 cobrun $ANIM $RLX/cgl200 k#032 #4---------------------------------------------------------------------- k#033 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto=""; k#034 if ((SCC != 0)) k#035 then logmsg2 "ERR: step $JSTEP CGL200 abterm $SCC" k#036 alias goto="<<S9900=A"; fi k#037 goto k#038 #8====================================================================== k#039 S9000=A k#040 jobend51 #move any GDG files from jobtmp/subdirs to RUNDATA/subdirs k#041 logmsg2 "EOJ Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP" k#042 exit 0 #UVSI jclunix41 ver: 20080930 options: d0e1j1l1p0r0s0t12u1y0 k#043 #9====================================================================== k#044 S9900=A k#045 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK k#046 jobabend51 #report GDGs NOT moved from jobtmp/JOBID/GDG to outdirs k#047 exit $JCC
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 https://www.kornshell.com if not supplied with your system or if it is the old 1988 version (vs 1993). We recommend 'bash' for interactive use, but 'ksh' is better for batch scripts. The JCLs are converted for the Korn shell (1st line #!/bin/ksh).
#3. Setup 'appsadm' & modify profiles as documented in Part 1 of ADMjobs.htm.
You must have installed the Vancouver Utilities, you must have the Korn shell, and we highly recommend setting up 'appsadm' & modifying the profiles, as instructed in ADMjobs.htm.
If desired you could delay setting up 'appsadm' & performing the actions in ADMjobs.htm, until you complete the test/demos here in Part 1 (of VSEJCL.doc), and are ready to begin your own conversions in Part_4.
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 vsetest <-- setup 'vsetest' for bash =======================================
#3a. useradd -m -g apps -s /bin/ksh vsetest <-- alternative for 'ksh' ======================================
#4. passwd vsetest <-- set password for vsetest ==============
#5. cp -p /home/uvadm/env/stub_profile /home/vsetest/.bash_profile ============================================================== - copy supplied 'stub' profile to vsetest homedir & rename for bash
#5a. cp -p /home/uvadm/env/stub_profile /home/vsetest/.profile ========================================================= - alternative if you are using 'ksh' (vs bash)
Note |
|
#6. vi /home/uvadm/common_profile <-- modify common_profile =============================
export COBDIR=/opt/microfocus/cobol <-- change COBDIR for your site =================================== export UVLPDEST="-dlp0" <-- change 'lp0' to your laser printer ======================= export UVLPDEST="-dLPT1" <-- for Windows SFU =======================
#7. Logout of Root & login as 'vsetest', on the next page --->
You should realize that the above are the minimum setups for vsetest & not the most efficient method if you later proceed to setup your own additional programmers & operators. Setting up 'appsadm' & modifying the profiles as described in Part 1 of ADMjobs.htm is more efficient because you would avoid duplication.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1. login: vsetest --> /home/vsetest ================================
#2. cp -r /home/uvadm/vsetest/* /home/vsetest ========================================= - copy supplied test/demo files from uvadm to vsetest home dir
/home/vsetest should now contain the subdirs & files listed on page '1A1'. The more relevant subdirs for the JCL conversions are: ctl, parm0, parms, proc0, procs, jcl0, jcl1, jcl2,& jcl3.
Note |
|
If you later want to create these subdirs for your own use (without demo files) you can use the the following scripts. You might set them up in your home dir or you might create another user (vsetest2, etc).
#1. Login as yourself or vsetest2, etc --> homedir
#2. vsetestdirs <-- create conversion superdirs (testlibs, testdata, cnvdata) ===========
#3a. cdl --> alias 'cd $RUNLIBS' --> $HOME/testlibs/
#3b. vselibsdirs <-- create empty set of testlibs (cbl0,cbl1,etc) ===========
#3c. vsetestlibsinit <-- clear testlibs subdirs for retesting =============== - cbl1,cbl2,cbls, jcl1,jcl2,jcl3,jcls, etc - not the '0' subdirs or ctl,sfun,etc
#4a. cdd --> alias 'cd $RUNDATA' --> $HOME/testdata/
#4b. vsedatadirs <-- create empty set of testdata subdirs (ar,gl,jobtmp,etc) ===========
#4c. testdatainit <-- clear testdata subdirs for retesting ============ - jobtmp, joblog, tmp, wrk, rpts, etc - not the master data in ar, gl, mstr, tape, etc
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
The previous pages setup userid 'vsetest' & copied the test/demo files to the vsetest homedir, in preparation for the JCL demo conversions documented on the following pages.
If you prefer or if there are multiple programmers at your site who wish to perform these demos, you can setup the 'testlibs' & 'testdata' subdirs in your own homedir & copy the supplied demo files to them.
If you do not already have a login, see ADMjobs.htm#Part_1 to setup your account & copy the supplied 'stub_profile' to your homedir.
The following assumes you already have a login, but it has not yet been updated with the 'stub_profile' required to perform the JCL conversions.
#1. Login as youself --> your homedir ================
#2. vi .bash_profile <-- edit your .bash_profile for Linux bash shell ================ - OR .profile for Unix Korn shell
#2a. G <-- Go to the end of your existing profile ===
#2b. :r /home/uvadm/env/stub_profile =============================== - read supplied stub_profile onto the end of your existing profile
#3. logout & log back in <-- to activate the new profile ====================
#4. mkdir testlibs testdata <-- make subdirs within your homedir ======================= to receive the supplied demo files
#5. cp -r /home/uvadm/vsetest/testlibs/* testlibs ============================================= - copy supplied demo libraries to testlibs/... in your homedir (JCL,COBOL,etc)
#6. cp -r /home/uvadm/vsetest/testdata/* testdata ============================================= - copy supplied demo data-files to testdata/... in your homedir
Note |
|
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.
'jcl2ksh41A' will perform all steps of the JCL conversion - the same as the 'step by step' procedures documented on pages 1Q2 thru 1Q5. The script is easier than the step by step method, but you might not gain as much understanding.
You should use the 'step by step' method the 1st time you convert your own JCL (as documented in Part_4), because you will be able to detect & fix problems that may occur in your JCL conversions (vs the proven test/demos here in Part 1).
proc0 ---------> procs sli0 ----------> slis parm0 ---------> parms cleanup cleanup cleanup
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls cleanup PROC/SLI expand convert to ksh manual copy
#1. jcl2ksh41A all <-- convert JCL thru all steps, as illustrated above ============= - reply null (take default) at all prompts - or reply 'y' for prompts that demand a y/n response
#2. cp jcl3/* jcls <-- copy JCL/scripts to jcls (in PATH) ============== - ONLY for the test/demos here in Part 1 - since they have already been tested & debugged
Note |
|
Note |
|
You must stay in the vsetest home directory. The scripts are designed to work with the various subdirs below you so they can copy between the subdirs. Examine your files by addressing thru 1 level of subdir (vi jcl1/xxx). Do not change into the subdirs, do 1 vi,& change back.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The next few pages document the 'step by step' procedures for JCL conversion (vs the jcl2ksh41A 'script' documented on the previous page).
It is much easier to use the jcl2ksh41A script than the step by step procedures, but you might not get as much understanding from it.
You should use the 'step by step' method the 1st time you convert your own JCL (as documented in Part_4), because you will be able to detect & fix problems that may occur in your JCL conversions (vs the proven test/demos in Part 1).
The 1st 3 procedures will cleanup the demo mainframe code, clearing cols 73-80, translating filenames to lower case,& assigning filename extensions (.jcl or .prc or nothing).
#1a. uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl <-- cleanup mainframe JCL ================================================ - strip any CR's, clear cols 73-80,& shorten back to last nonblank - ensure output filenames are translated to lower case - assign filename extension '.jcl'
#1b. uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.prc <-- cleanup PROCs =================================================== - strip any CR's, clear cols 73-80,& shorten back to last nonblank - ensure output filenames are translated to lower case - assign filename extension '.prc'
#1c. uvcopyx cleanup sli0 slis uop=q0i7g8n1,arg1=.sli <-- cleanup SLI code ================================================ - strip any CR's, clear cols 73-80,& shorten back to last nonblank - ensure output filenames are translated to lower case - assign filename extension '.sli'
#1d. uvcopyx cleanup parm0 parms uop=q0i7g8n1 <-- cleanup parms ======================================== - strip any CR's, clear cols 73-80,& shorten back to last nonblank - ensure output filenames are translated to lower case (n1) - do NOT assign extension on filenames in parms subdir
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#2. jclpx41 jcl1 jcl2 procs slis ============================ - copy all jcl from jcl1 to jcl2, - expanding procs from arg3 & SLIs from arg4
#2a. jclpx41 jcl1 jcl2 jcl1 jcl1 =========================== - use this command if JCL, PROCs,& SLIs are all in 1 library
#3. uvcopy jcldata41,fild1=jcl2,filo2=ctl/datafiles41 ================================================= - generate Data Info file (extracts filenames from all JCL)
#3a. uvcopy jcldata41 <-- easier alternative (files default as shown above) ================
#4a. >ctl/datafiles42 <-- create null file for datafile info overrides ================
#4b. sortload43I <-- create datafile info control file to supply =========== record sizes, keys, file types to JCL converter
'jcldata41' above reads all JCL & gathers datafile info for use by the JCL converter. Record sizes, indexed keys, etc are collected onto 1 entry per unique datafilename. See sample ctl/datafiles41 listed on page '3E3'.
The Datafile Info control file is vital to conversions of your JCL, but we can delay these considerations until Part_4 where we discuss conversions of 'YOUR' JCL versus the test/demo JCL conversions illustrated here in Part 1.
If desired you may edit ctl/datafiles42 to add to or override the info available in the existing JCL. Script 'sortload43I' (#4b above) will sort this override file with datafiles41 & indexed file ctl/datafiles43I for random lookup by the JCL converter.
For these test/demos in Part 1 just create a null file for datafiles42 & run the sortload43I script.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Before you run the actual JCL/script conversion (step #5 on the next page), you may need to modify the options in the control file ctl/jclunixop41. See the sample JCL options control file listed on page '3E1'.
You will not have to modify for these test/demos (here in Part 1), but you may need to modify options for your own JCL conversions (documented in Part 4).
If you are testing on windows SFU, Cygwin, or Uwin, you must change option 'r' in the control file (ctl/jclunixop41), before you run the JCL converter. See the control file listed on page '3E1' further ahead.
You must change option 'r0' to 'r1' on line 1 of ctl/jclunixop41. The control file is supplied with option 'r0' to generate 'cobrun' for Micro Focus COBOL Server Express on Unix/Linux systems. 'r1' will cause the converter to generate 'cobw' which is the equivalent for Micro Focus COBOL Net Express on Windows.
vi ctl/jclunixop41 <-- edit change only for Windows SFU/Cygwin/Uwin ==================
jclunixop41:d0e1r0t7u1 #<-- option defaults for JCL converter ================r1==== <-- change r0 to r1
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#5. jclxx41 jcl2 jcl3 - convert all JCL in jcl2 to scripts in jcl3 =================
'jclxx41' is a script that executes the 'jclunix4' conversion program for each file found in input subdir & copy results to output subdir. jclxx41 requires control files: ctl/jclunixop41, ctl/listcat3I,& ctl/datafiles43I.
#6. cp jcl3/* jcls - copy all converted JCL/scripts to subdir jcls ============== (since jcls is in the PATH, but not jcl3)
Note |
|
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 'jar100'.
#0. login: vsetest --> /home/vsetest
relevant subdirs --> proc0, procs, jcl0, jcl1, jcl2, jcl3, jcls.
#1a. uvcopy cleanup,fili1=jcl0/JAR100.jcl,filo1=jcl1/jar100.jcl,uop=g8n1,arg1=.jcl ========================================================================= - cleanup mainframe JCL - strip CR's, clear cols 73-80,& shorten back to last nonblank - output filenames are lower case & have extension '.jcl' added.
#1b. uvcopy cleanup,fili1=proc0/PAR100,filo1=procs/par100.prc,uop=g8n1 ================================================================== - cleanup PROCs - strip CR's, clear cols 73-80,& shorten back to last nonblank
#2. jclproc41 jcl1/jar100.jcl jcl2/jar100.jcl procs slis ==================================================== - expand procs as we copy jcl from subdir jcl1 to subdir jcl2 - arg3 is the PROC directory & we presume all PROCs are stored - arg4 is the SLI directory & we presume all SLI JCLs are stored (arg4 could be 'jcl1' the same directory as the input file)
#3. uvcopy jcldata41,fild1=jcl2,filo2=ctl/datafiles41 ================================================= - generate Data control file (extracts filenames & types form JCL) - may add record-size & indexed file keys to improve conversions - this job processes the entire directory (not just 1 jcl)
#4. jclunix4 jcl2/jar100.jcl jcl3/jar100.ksh <-- convert 1 JCL (jar100) ======================================== - using jar100 as an example of converting 1 jcl at a time:
#5. cp jcl3/jar100.ksh jcls <-- copy converted script to test/production lib ======================= before any changes, testing, debugging
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Script 'jcl2ksh41' is provided to convert 1 JCL at a time. 'jcl2ksh41' is listed on page '3F1', and performs the same functions (with 1 command) as the multiple separate steps documented on the previous page.
You would initially convert all JCLs as documented on pages 1Q1 thru 1Q6, but jcl2ksh41 is useful for JCL's subsequently transferred due to updates on the mainframe during the conversion & testing period.
'jcl2ksh41' assumes that all PROCs & SLI members are already present in procs & slis, and that ctl/datafiles41 includes all filenames used.
Here is an example using jcl2ksh41 to convert JCL JAR100.
jcl2ksh41 jcl0/JAR100.jcl <-- convert 1 JCL at a time =========================
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls cleanup PROC/SLI expand convert to ksh prompt & copy
The final destination is 'jcls' where JCL/scripts must be copied to be found by the search PATH. Before overwriting any existing JCL/script, you will be prompted to answer 'y' or 'n'.
If you had made substantial modifications to the existing script, you might want to answer NO. Then you could save modified parts of existing script (in tmp subdir), copy the new script from jcl3 to jcls, then edit the new script in jcls & read in modified parts of the previous script from the saved version (or vice versa if it were easier to read new parts into the existing).
Note |
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 VSECOBOL.htm, but in case you have skipped directly to this JCL conversion (VSEJCL.doc), we will briefly repeat the COBOL conversion & compile instructions here. You must of course have MicroFocus COBOL installed to compile & execute the COBOL programs, but if you do not, you can still do everything except the 'mfcblA' compiles (#5 on page '1R3'). You can even execute the 'jar200.ksh' demo job. The 1st step will work since it is a SORT.
'cnvMF41Ac' will perform all steps of the copybook conversion & 'cnvMF41A' will perform all steps of the COBOL program conversion - the same as the 'step by step' procedures documented on pages 1R2 thru 1R5. The script is easier than the step by step method, but you might not gain as much understanding.
You should use the 'step by step' method the 1st time you convert your own COBOL (as documented in Part_4), because you will be able to detect & fix problems that may occur in your COBOL conversions (vs the proven test/demos here in Part 1).
cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys cleanup convert copy(cp)
cbl0-------->cbl1-------->cbl2------->cbl3------->cbl4------->cbls-------->cblx cleanup convert sysin1 sysout1 copy compile |--------optional-------|
#1. cnvMF41Ac all <-- convert copybooks thru all steps, as illustrated above ============ - reply null (take defaults) or reply 'y' if y/n demanded
#2. cnvMF41A all <-- convert COBOL programs thru all steps, as illustrated above =========== - reply null (take defaults) or reply 'y' if y/n demanded - 1 exception, reply 'n' when asked to run 'cobfil55'
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
First we will convert the CopyBooks, then the COBOL Programs (on the next page). Our test/demo mainframe copybooks are stored in subdir 'cpy0'. The instructions in Part 3 of VSECOBOL.doc recommended the following procedure:
cpy0--------->cpy1---------->cpy2--------->cpys cleanup convert copy(cp)
#1. Cleanup copybooks from mainframe (may have extraneous CR's from FTP) - remove CR's, clear cols 1-6 & 73-80, translate to lower (not in quotes) - shorten text back to last non-blank, ensure output filenames in lowercase - cpy0 filenames UPPER case indicates mainframe, but all subsequent subdirs must have filenames in lowercase
#1. uvcopyx cleanup cpy0 cpy1 uop=q0i7c5e15g8j1k1l3n1s8t1,arg1=.cpy ===============================================================
Note |
|
#2. uvcopy cnvMF4,fild1=cpy1,fild2=cpy2,fili3=ctl/cnvcob4.tbl,uop=q0i7m2 ==================================================================== - convert COBOL CopyBooks for Unix/Linux Micro Focus compiler
#3. cp cpy2/* cpys - copy converted copybooks to standard library ==============
Note |
|
cp cpy1/* cpys <-- alternative to steps #2 & #3 above ==============
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
These instructions will convert & compile ALL programs in the directory. Three demo programs (CAP100, CAR100,& CGL100) are supplied in subdir cbl0. The conversions & compile progress thru several subdirs as follows:
cbl0------->cbl1-------->xref---------->cbl2-***---------->cbls-------->cblx #1.cleanup #2.Id OLS files #4.convert #5/6 #7.copy #8.compile
'***' represents optional conversions for sysin & sysout (see Notes below)
The COBOL converter (cnvMF4) provides option 'l1' to lookup an indexed file to identify printer files as 'ORGANIZATION LINE SEQUENTIAL' on 'select' stmnts. Option 'l1' identifies files as 'OLS' if they have 'advancing' on any 'write's, or if the record-size is 133 for outputs, or 80 for inputs. If disabled (l0) the converter would use a table of keywords commonly used in printer & card filenames (print,report,rpt,card,etc). See steps #2 & #3 on the next page (required for option 'l1')
'uvcopy cobfil45' scans all COBOL programs looking for OLS criteria and writes a file (xref/cobfil45a) to identify these files keyed by programname & filename. 'uvsort' is then used to sort & load these records into an indexed file (xref/cobfil45I) for lookup by 'uvcopy cnvMF4'.
Note |
|
MicroFocus COBOL has options INDD & OUTDD to cause 'ACCEPTs from SYSIN' & 'DISPLAYs upon SYSOUT' to use external files defined by exports for SYSIN & SYSOUT. Please see a test/demo program & JCL begining on page 2F1 of MVSCOBOL.htm#2F1 & the ctl/cobdirectives (options file) on page 5D1.
For customers that do not have MicroFocus COBOL, the Vancouver Utilities includes uvcopy utility jobs 'sysin1' & 'sysout1' which will insert file definitions into the COBOL source programs.
sysin1 will convert 'accepts from sysin' to 'reads' from a real file with external name SYSIN. sysout1 will convert 'displays upon sysout' to 'writes' to a real file with external name SYSOUT.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1. uvcopyx cleanup cbl0 cbl1 uop=q0i7c5e15g8j1k1l1n1s8t1,arg1=.cbl =============================================================== - cleanup mainframe code, remove CRs, clear cols 1-6 & 73-80, etc
#2. uvcopy cobfil45,fild1=cbl1,filo2=xref/cobfil45a,uop=q0i7,rop=r0 =============================================================== - scan all programs looking for 'write advancing's - create sequential file of file types keyed by program + filename
#3. uvsort "fili1=xref/cobfil45a,rcs=100,typ=LST,filo1=xref/cobfil45I,typ=ISF\ ,key1=0(44),isk1=0(44),del1=0(1):*" ========================================================================== - sort & load sequential file into indexed file for lookup by cnvMF4
#4. convert mainframe COBOL to Micro Focus COBOL
#4a. uvcopy cnvMF4,fild1=cbl1,fild2=cbl2,fili3=ctl/cnvcob4.tbl\ =========================================================== ,fili4=xref/cobfil45I,uop=q0i7m1l1 ==================================
#4b. uvcopy cnvMF4 <-- easy alternative (files & options default as above) =============
#5. uvcopyx sysin1 cbl2 cbl3 uop=q0i7 <-- optional, see NOTE below ================================= - convert ACCEPT's from control streams to READ's from a file
#6. uvcopyx sysout1 cbl3 cbl4 uop=q0i7 <-- optional, see NOTE below ================================== - convert DISPLAY's upon SYSOUT to WRITE's to a file
Optional steps #5 & #6 are not required for Micro Focus COBOL using options INDD & OUTDD. See the 'cobdirectives' file listed at VSECOBOL.htm#5D1.
#7. copy converted programs to subdir 'cbls' for compile script (mfcblA).
#7a. cp cbl2/* cbls - copy from cbl2 if SYSIN/SYSOUT replacements NOT required ============== #7b. cp cbl3/* cbls - copy from cbl3 if SYSIN required but not SYSOUT ============== #7c. cp cbl4/* cbls - copy from cbl4 if both SYSIN/SYSOUT replacements ARE required ==============
#8. mfcblA all - compile all programs for unix/linux ========== (input source from cbls & output .int/.idy to cblx)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is a sample console log from 'mfcblA' (compile all programs in directory).
#8. mfcblA all - compile all programs, input from subdir cbls, output to ========== subdir cblx: .int, .idy, .err,& .cbl (copy for animation)
mfcblA started 050317:1236 start compile of: car100.cbl
#compile #1 - car100.cbl start compile of: car120.cbl
#compile #2 - car120.cbl start compile of: car130.cbl
#compile #3 - car130.cbl start compile of: car200.cbl
#compile #4 - car200.cbl start compile of: car300.cbl
#compile #5 - car300.cbl start compile of: cgl100.cbl
#compile #6 - cgl100.cbl start compile of: cgl200.cbl
#compile #7 - cgl200.cbl start compile of: cpy100.cbl
#compile #8 - cpy100.cbl * 8-S***************************** ( 0)** ** Unknown COPY file paymas.cpy specified ** Unknown COPY file paymas.cpy specified * 256-S*********** ( 1)** ** Preceding record has zero length 18 fd nalist record contains 120 characters. * 205-S** ( 1)** ** RECORD missing or has zero size #compile #8 - cpy100.cbl - *FAILED* *** 1 compiles failed, of 8 attempts of 8 total *** programs compiled from cbls to cblx copylibs=/home/vsetest/cpys:/cpys:/cpys compile options file=/home/vsetest/ctl/cobdirectives mfcblA started 050317:1236, ended 050317:1236
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The 'mfcbl1' & 'mfcblA' compile scripts leave the .err reports in the 'cblx' output directory. You can use the 'uvlpd1p' script to print the first page of each .err file in the cblx subdir as follows:
#9. uvlpd1p cblx .err <-- print 1st page of all .err reports =================
There could be a lot of errors on the 1st mass compile after conversion. 'cblerrs1' & 'cblerrs2' are provided to extract only the 1st few lines from each .err file into 1 file & to create table summary counts of errors by failure reason.
but here is a brief summary of the operating instructions:
#10a. uvcopy cblerrs1 <-- extract 5 lines from each .err file =============== - write summary file to errs/cblerrs1.rpt
#10b. uvcopy cblerrs2 <-- sort by failure reason & create summary table ===============
#10c. uvlp12 errs/cblerrs2.tbl <-- print table summary counts by failure reason ========================
#10d. uvlp12 errs/cblerrs2.rpt <-- print report sorted by failure reason ========================
You must of course have MicroFocus COBOL installed to compile & execute the COBOL programs, but if you do not, you can still do everything except the 'mfcblA' compiles above.
For the 'mfcblA' COBOL compiles to work, you will probably have to modify the COBDIR definition in the profile, depending on where COBOL is installed at your site. The supplied profile (listed at ADMjobs.htm#1C2), defines COBDIR as follows:
export COBDIR=/home/cobadm/cobol ================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Now we are ready to execute the demo JCL/scripts. Note that RUNLIBS & RUNDATA (vital environmental variables in the profile) control which libraries are searched & which data directories will be accessed. The following illustrates only the subdirs that are actually required for the demo JCL/script execution and omits the various conversion subdirs illustrated previously.
export RUNLIBS=/home/vsetest
/home/vsetest :-----testlibs <-- $RUNLIBS : :-----cblx - compiled COBOL programs (.int's) : :-----jcls - copy here manually 1 by 1 during test/debug : :-----sfun - korn shell functions (jobset51,logmsg,etc)
export RUNDATA=/home/vsetest/testdata
/home/vsetest :-----testdata <-- $RUNDATA : :-----ap - Accounts Payable : :-----ar - Accounts Receivable : :-----gl - General Ledger : :-----jobtmp - temporary files for SYSIN instream data : :-----rpts - SYSOUT printer files : :-----tmp - tmp subdir for uvsort : :-----wrk - interstep temporary work files
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 |
|
jgl600.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, DLBLname1, COBOL info(above), DLBLname2
These will be explained in more detail in XREFjobs.htm with Operating Instructions to generate them using the test/demo files supplied. You will also need to have an organized way of housing them for easy access when required.
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 ==========
060206:094543:JAR100: Begin Job=JAR100 060206:094543:JAR100: RUNDATA=/home/vsetest/testdata RUNLIBS=/home/vsetest 060206:094543:JAR100: JTMP=jobtmp/JAR100 SYOT=sysout 060206:094543:JAR100: RUNDATE=20060206 060206:094543:JAR100: Begin Step S0010 car100 (#1) 060206:094543:JAR100: TEST/DEMO JCL/COBOL TO CREATE CUSTOMER NAME & ADDRESS LISTING 060206:094543:JAR100: file: CUSTMAS=ar/customer.master 060206:094543:JAR100: file: NALIST=ar/customer.nameadrs.list100 060206:094544:JAR100: Job Times: Begun=09:45:43 End=09:45:44 Elapsed=00:00:01 060206:094544:JAR100: Normal EOJ StepsExecuted/Last=1/S0010
jar200.ksh ==========
060206:094552:JAR200: Begin Job=JAR200 060206:094552:JAR200: RUNDATA=/home/vsetest/testdata RUNLIBS=/home/vsetest 060206:094552:JAR200: JTMP=jobtmp/JAR200 SYOT=sysout 060206:094552:JAR200: RUNDATE=20060206 060206:094552:JAR200: Begin Step S0010 sort (#1) 060206:094552:JAR200: PAR200 - TEST/DEMO VSE JCL CONVERT (PROC CALLED BY JAR200) 060206:094552:JAR200: SORT SALES ITEMS BY PRODUCT#(MAJOR) & CUSTOMER#(MINOR) 060206:094552:JAR200: file: SORTIN1=ar/sales.items 060206:094552:JAR200: file: SORTOUT=jobtmp/JAR200/%sales.sortfile 060206:094552:JAR200: file: SYSIN=jobtmp/JAR200/S0010_sort 060206:094552:JAR200: uvsort fili1=ar/sales.items,filo1=jobtmp/JAR200/%sales.sortfile 060206:094552:JAR200: EOF fili01 20 rds, 1280 size; ar/sales.items 060206:094552:JAR200: sort phase complete, used 64 megabytes, sort output begin 060206:094552:JAR200: EOF filo01 20 wrts, 1280 size; jobtmp/JAR200/%sales.sortfile 060206:094552:JAR200: STEP2 - LIST SALES ITEMS BY PRODUCT# 060206:094552:JAR200: Begin Step S0020 car200 (#2) 060206:094552:JAR200: PARM=MARCH 11, 2005 060206:094552:JAR200: file: SYSOUT=sysout/JAR200_S0020_car200 060206:094552:JAR200: file: SALEDTL=jobtmp/JAR200/%sales.sortfile 060206:094552:JAR200: file: CUSTMAS=ar/customer.master.indexed 060206:094552:JAR200: file: SYS035=rpts/salesrpt_E_car200_S0020_01_060206094552 060206:094552:JAR200: file: SYSIN=jobtmp/JAR200/S0020_car200 060206:094552:JAR200: Job Times: Begun=09:45:52 End=09:45:52 Elapsed=00:00:00 060206:094552:JAR200: Normal EOJ StepsExecuted/Last=2/S0020
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/vsetest :-----testdata <-- super directory for test libraries : :-----cblx - executable (compiled) COBOL programs : :-----jcls - JCLs converted to Korn shell scripts : :-----sfun - Korn shell common functions called by scripts :-----testdata <-- super directory for test/data subdirs & files : :-----ar : : :--I--customer.master : : :--O--customer.namelist <-- report created by jar100.ksh : : :--I--sales.items : :-----gl : : :--O--account.acntlist <-- report created by jgl100.ksh : : :--I--account.master_0001 : : :--I--account.master_0002 : : :--I--account.master_0003 : : :--O--account.master_0004 <-- updated master from jgl200.ksh : : :--O--account.master_0005 <-- new generation from jcl300.ksh : : :--O--account.master_0006 <-- new generation from jcl320.ksh : : :--I--account.trans : :-----jobtmp <-- temp files for SYSIN instream data : : :--O--JAR200_1_sort_SYSIN <-- instream data stored by jar200.ksh : : :--O--JGL200_1_sort_SYSIN <-- instream data stored by jgl200.ksh : :-----rpts : : :-----040429 <-- subdir for today's SYSOUT files : : : :-----SYSOUT.files... <-- no SYSOUTs created in these tests : :-----tmp <-- temp files for uvsort & misc use : :-----wrk : : :--O--JAR200_tempsls <-- sorted sales.items from jar200.ksh : : :--O--JGL200_tempglt <-- sorted GLtransctns from jgl200.ksh : : :--O--JGL300_tempglm <-- copy out backup from jgl300.ksh : : :--O--JGL320_tempglm <-- copy out backup from jgl320.ksh
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1. cd testdata <-- change into testdata super-directory ===========
#1a. cdd <-- shorter alias, very handy for production data === - usually in separate filesystem with long pathnames
#2. uvhd ar/customer.master r256 <-- investigate input to jar100.ksh ============================ - 1st record shown below - cant use uvhd due to packed & no LFs
10 20 30 40 50 60 r# 1 0123456789012345678901234567890123456789012345678901234567890123 0 130140 EVERGREEN MOTORS LTD. 1815 BOWEN ROAD NANA 3333332222454545444244545524542222233332445442544422222222224444 130140000056527255E0DF4F230C44E0000181502F75E02F140000000000E1E1 64 IMO BC V9S1H1 250-754-5531 LARRY WRENCH ..4V|... 4442222222222442535343222233323332333324455525544442222201357000 9DF00000000002306931810000250D754D55310C12290725E38000000246C000 128 .........W0....`........)X}..f3.....\.................4V}...f... 0000000005300016000000002570063100095000000000000000013570016000 0C0000C0270D0540C0000C0098D0263C0444C0000C0000C0000C0246D0056C00 192 ...............................f.....<........f.C 19950531 0000008900000000880000000018000680001300000000694233333333222222 00C0026C0000C0023C0000C0083C0056D0012C0000C0016D3019950531000000 rec#=1 rcount=32 rsize=256 fsize=8192 ar/customer.master null=next,r#=rec,s=search,u=update,p=print,i=iprint,w=write,t=tally,c=checkseq ,R#=Recsize,h1=char,h2=hex,q=quit,?=help --> q <-- quit program
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#3. vi ar/customer.nameadrs.list100 ===============================
CAR100: CUSTOMER NAME & ADDRESS LIST 080322
130140 EVERGREEN MOTORS LTD. 1815 BOWEN ROAD NANAIMO BC V9S1H1 132588 GEECOE GENERATOR SERVICESUNIT 170 - 2851 SIMPSON RICHMOND BC V6X2R2 139923 JOHNSTONE BOILER & TANKS 1250 EAST PENDER STREET VANCOUVER BC V5L1W1 142175 LILLY ELECTRIC (1973) LTD16809 - 24TH AVENUE SURREY BC V4B5E7 145264 D MAGRATH SUPPLIES LTD. 1939 KIRSCHNER ROAD KELOWNA BC V1Y4N7 147615 X O'CONNER R.V. CENTRE 44430 YALE ROAD WEST CHILLIWACK BC V2P6J1 149304 POINT GREY GOLF & COUNTRY3350 S.W. MARINE DRIVE VANCOUVER BC V6N3Y9 150825 RIGGERS INDUSTRIAL 960 - 6TH AVENUE HOPE BC 152355 SHAW, JOHN 477 CARIBOO CRES. PORT COQUITLAM BC V3M1X1 154688 TAURUS RESOURCES 1110 - 625 HOWE STREET VANCOUVER BC V6C2T6 157352 D WHYTE, W. 1150 LODGE ROAD NORTH VANCOUVER BC V7R1W8 173320 X ZENITH TRANSPORT 2381 ROGERS AVE COQUITLAM BC V3K5Y2 201120 ALLTYPE RENTAL LTD. BOX 1819 DRAYTON VALLEY AL T0E0M0 204700 CASE POWER EQUIPMENT 12611-100 ST GRANDE PRAIRIE AL T8V4H2 208060 E&L TRUCKING LAND & CATTLE LTD WARBURG AB T0C2T0 211140 D FORD NEW HOLLAND BOX 1, 440 ELLIS ROAD WINTERBURN AB T0E2N0 223240 X NICHOLSON CHEVROLET LTD. 7215 ARGYLL ROAD EDMONTON AL T6C4J2 224700 OTTO MOBILES WESTERN LTD.8441 CORONET ROAD EDMONTON AL T6E4N7 231550 SPARROW ELECTRIC CO. LTD.BOX 88 NISKU AL T0C2G0 234300 TERRITORIAL REWIND BPX 1648 YELLOWKNIFE NW X1A2P2 237286 WEBER, TOM BOX 5503 FORT MCMURRAY AL T9H3G5 301120 D ALBERTA GAS CHEMICALS LTD3RD. FLOOR, 11456 JASPER EDMONTON AL T5K0M1 306959 X 356582 ALBERTA LTD. DEVITT NURSERY CALGARY AL T2T5N1 308685 FOOTHILLS ELECTRIC 3932 - 3A ST. N.W. CALGARY AL T2E6R4 313720 MONITREX ENGINEERING LTD 7-2280-39 AVE, N.E. CALGARY AL T2E6P7 315512 PARTS PLUS BOX 510 MAIN ST THREE HILLS AB T0M2A0 318833 TOP NOTCH CONSTRUCTION BOX 308, STN J CALGARY AL T2A4X6 400002 ACKLANDS LTD 945 -2ND AVE PRINCE GEORGE BC V2L3A7 401210 COAST RANGE CONSTRUCTION 1103-207 W. HASTINGS ST VANCOUVER BC V6B1H7 402875 HULL, DON & SONS LTD. BOX 1297 PRINCE GEORGE BC V2L4V3 403887 D MILNER, LARRY BOX 28 RAU ROAD R.R.8 QUESNEL BC V2J5E6 406082 PRECAM RENTALS LTD: 10116-94TH AVE FORT ST. JOHN BC V1G5G6
We can use 'vi' to inspect the output report because the COBOL program defines report files as 'ORGANIZATION LINE SEQUENTIAL' which appends Carriage-Returns & Line-Feeds. The 'CRs' are displayed as '^M' by vi. ('LF's are not displayed since they are standard in unix/linux text files)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
'jar200' sorts ar/sales.items by product code & lists the detail records with final totals of quantity & amount.
Although there are no packed fields in this file, we still cannot use 'vi' (or more,page,lp,etc) because the records have no LineFeeds & the entire file looks like 1 long record to vi. Here is the 1st record shown by uvhd:
#1. uvhd ar/sales.items r64h2 <-- display 64 byte records in hexadecimal ========================= - 1st of 20 (all listed below by listrec2)
10 20 30 40 50 60 r# 1 0123456789012345678901234567890123456789012345678901234567890123 0 130140 21 940802 IN111001 HAM001 000020 0000001 000000020 3333332222332333333244333333224443332233333323333333233333333322 130140000021094080209E1110010081D0010000002000000001000000002000
We can use 'listrec2' (uvcopy pre-programmed job) to list files w/o LineFeeds
#2. uvcopy listrec2,fili1=ar/sales.items,uop=r64 <-- list file with no LineFeeds ============================================ ,filo1=tmp/sales.items.lst <-- output report default name
listrec2 - list (100 bytes/line) file=ar/sales.items 2004/04/29_18:18:26 1 2 3 4 5 6 0123456789012345678901234567890123456789012345678901234567890123
130140 2 21 940802 IN111001 HAM001 000020 0000001 000000020 130140 2 21 940802 IN111001 SCR012 000021 0001001 000021021 130140 2 21 940802 IN111001 CHR001 000022 0002001 000044022 139923 2 35 950802 IN111002 TAB013 000023 0003001 000069023 139923 2 35 950807 IN111002 TAB013 000024 0004001 000096024 150825 2 44 960804 IN1122 HAM001 000025 0005001 000125025 150825 2 44 960804 IN1122 HAX129 000026 0006001 000156026 201120 2 44 970807 CR5234 WHIP75 000027 0007001 000189027 223240 2 65 980816 CR955 HAM001 000028 0008001 000224028 223240 2 65 980816 IN441 BBQ001 000029 0009001 000261029 308685 2 21 990812 IN6605 SAW051 00001p 0000001 00000001p 308685 2 21 990812 IN6605 WHIP75 00001q 0001001 00001101q 308685 2 21 990812 CR8835 TAB013 00001r 0002001 00002401r 315512 2 44 000805 IN2251 HAM001 00001s 0003001 00003901s 315512 2 44 000805 IN2251 SAW051 00001t 0004001 00005601t 315512 2 44 000805 IN2255 WHIP75 00001u 0005001 00007501u 400002 2 85 010812 CR245 HAX129 00001v 0006001 00009601v 406082 2 35 020815 IN33001 BBQ001 00001w 0007001 00011901w 406082 2 35 020815 IN33001 TAB013 00001x 0008001 00014401x 406082 2 65 020816 IN441 HAM001 00001y 0009001 00017101y ============================================================== cust# slsmn date invoice product qty price amount
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#3. jar200.ksh <-- run job to sort, update,& execute COBOL car200.cbl ==========
#4. vi ar/sales.list <-- use vi to inspect report created by car200.cbl ================
406082 PRECAM RENTALS LTD: 35 020815 IN33001 BBQ001 17- 70.01 1,190.17- 130140 EVERGREEN MOTORS LTD. 21 940802 IN111001 CHR001 22 20.01 440.22 130140 EVERGREEN MOTORS LTD. 21 940802 IN111001 HAM001 20 .01 .20 150825 RIGGERS INDUSTRIAL 44 960804 IN1122 HAM001 25 50.01 1,250.25 315512 PARTS PLUS 44 000805 IN2251 HAM001 13- 30.01 390.13- 150825 RIGGERS INDUSTRIAL 44 960804 IN1122 HAX129 26 60.01 1,560.26 308685 FOOTHILLS ELECTRIC 21 990812 IN6605 SAW051 10- .01 .10- 315512 PARTS PLUS 44 000805 IN2251 SAW051 14- 40.01 560.14- 130140 EVERGREEN MOTORS LTD. 21 940802 IN111001 SCR012 21 10.01 210.21 139923 JOHNSTONE BOILER & TANK 35 950802 IN111002 TAB013 23 30.01 690.23 139923 JOHNSTONE BOILER & TANK 35 950807 IN111002 TAB013 24 40.01 960.24 308685 FOOTHILLS ELECTRIC 21 990812 CR8835 TAB013 12- 20.01 240.12- 406082 PRECAM RENTALS LTD: 35 020815 IN33001 TAB013 18- 80.01 1,440.18- 201120 ALLTYPE RENTAL LTD. 44 970807 CR5234 WHIP75 27 70.01 1,890.27 308685 FOOTHILLS ELECTRIC 21 990812 IN6605 WHIP75 11- 10.01 110.11- 315512 PARTS PLUS 44 000805 IN2255 WHIP75 15- 50.01 750.15- 78 2,320.78
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The gl/account.master_ is a GDG file with packed fields, so we must use 'uvhd':
#1. uvhd gl/account.master_000001 r128 <-- display 128 byte records in hex ==================================
10 20 30 40 50 60 r# 1 0123456789012345678901234567890123456789012345678901234567890123 0 11100 11100Royal Bank Lynn Valley ....b.20090131 2333332222222333335676624666247662566667222222220010683333333322 0111000000000111002F91C021EB0C9EE061CC590000000000972C2009013100 64 2222222222222222222222222222222222222222222222222222222222222222 0000000000000000000000000000000000000000000000000000000000000000 10 20 30 40 50 60 r# 2 0123456789012345678901234567890123456789012345678901234567890123 128 11200 11200VISA settlement .....\20090131 2333332222222333335454276776666672222222222222220000853333333322 011200000000011200693103544C5D5E400000000000000000197C2009013100 64 2222222222222222222222222222222222222222222222222222222222222222 0000000000000000000000000000000000000000000000000000000000000000 10 20 30 40 50 60 r# 3 0123456789012345678901234567890123456789012345678901234567890123 256 11500 11500Investments RBMF ..4.1.20090131 2333332222222333334676776667725444222222222222220039313333333322 0115000000000115009E6534D5E43022D60000000000000001421C2009013100 64 2222222222222222222222222222222222222222222222222222222222222222 0000000000000000000000000000000000000000000000000000000000000000
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#2. jgl100.ksh <-- run job to execute COBOL cgl100.cbl ==========
#3. vi 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 : :-----vsetest :------030925:080115 <-- sample logfile in progress : :-----log2 <-- log2 superdir for current month : :-----user1 : :-----user2 : :-----vsetest :------030921:102652 <-- logfiles for current month :------030922:130116 - date/time stamped YYMMDD:HHMMSS :------030923:074559 - processed from log1 on logoff/logon :------030924:074559 (screen control codes removed) : :-----log3 <-- prior month logfiles : :-----user1 - copied from log2 at end month (by cron) : :-----user2 (then log2 subdirs cleared out) : :-----vsetest
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
5a. jar100.ksh ==========
5b. jar200.ksh ==========
7a. logview <-- display list of date/time stamped logfiles in current month =======
-rw-rw-r-- 1 vsetest users 495823 Sep 21 13:01 030921:102652 -rw-rw-r-- 1 vsetest users 69075 Sep 22 07:11 030922:130116 -rw-rw-r-- 1 vsetest users 253990 Sep 23 09:02 030923:074559 -rw-rw-r-- 1 vsetest users 178428 Sep 24 10:26 030924:221341 enter 1,2,3,etc to vi logfile (counting backwards) q to quit - may follow file# with -dprinterdest to print
--> 1 <-- to see the latest logfile (uses vi editor)
--> 1 -dprinter1 <-- to print the latest logfile
Logview prompts for the file# desired (1 is the latest & usually what you want to see). You may follow the file# with a printer destination. Or you could login as appsadm & print the file from the 'log2/vsetest' subdir.
Please see the next page for the console log result of running the 2 demo jobs.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Script started on Mon 06 Feb 2006 09:53:35 AM PST
<@:vsetest:/home/vsetest> jar100.ksh 060206:095339:JAR100: Begin Job=JAR100 060206:095339:JAR100: Arguments: 060206:095339:JAR100: RUNDATA=/home/vsetest/testdata RUNLIBS=/home/vsetest 060206:095339:JAR100: JTMP=jobtmp/JAR100 SYOT=sysout 060206:095339:JAR100: RUNDATE=20060206 060206:095339:JAR100: Begin Step S0010 car100 (#1) 060206:095339:JAR100: file: SYSOUT=sysout/JAR100_S0010_car100 060206:095339:JAR100: TEST/DEMO JCL/COBOL TO CREATE CUSTOMER NAME & ADDRESS LISTING 060206:095339:JAR100: file: CUSTMAS=ar/customer.master 060206:095339:JAR100: file: NALIST=ar/customer.nameadrs.list100 060206:095339:JAR100: Job Times: Begun=09:53:39 End=09:53:39Elapsed=00:00:00 060206:095339:JAR100: Normal EOJ StepsExecuted/Last=1/S0010
<@:vsetest:/home/vsetest> jar200.ksh 060206:095345:JAR200: Begin Job=JAR200 060206:095345:JAR200: Arguments: 060206:095345:JAR200: RUNDATA=/home/vsetest/testdata RUNLIBS=/home/vsetest 060206:095345:JAR200: JTMP=jobtmp/JAR200 SYOT=sysout 060206:095345:JAR200: RUNDATE=20060206 060206:095345:JAR200: Begin Step S0010 sort (#1) 060206:095345:JAR200: file: SYSOUT=sysout/JAR200_S0010_sort 060206:095345:JAR200: PAR200 - TEST/DEMO VSE JCL CONVERT (PROC CALLED BY JAR200) 060206:095345:JAR200: SORT SALES ITEMS BY PRODUCT#(MAJOR) &CUSTOMER#(MINOR) 060206:095345:JAR200: file: SORTIN1=ar/sales.items 060206:095345:JAR200: file: SORTOUT=jobtmp/JAR200/%sales.sortfile 060206:095345:JAR200: file: SYSIN=jobtmp/JAR200/S0010_sort 060206:095345:JAR200: uvsort fili1=ar/sales.items,filo1=jobtmp/JAR200/%sales.sortfile 060206:095345:JAR200: EOF fili01 20 rds, 1280 size; ar/sales.items 060206:095345:JAR200: sort phase complete, used 64 megabytes, sort output begin 060206:095345:JAR200: EOF filo01 20 wrts, 1280 size; jobtmp/JAR200/%sales.sortfile 060206:095345:JAR200: STEP2 - LIST SALES ITEMS BY PRODUCT# 060206:095345:JAR200: Begin Step S0020 car200 (#2) 060206:095345:JAR200: PARM=MARCH 11, 2005 060206:095345:JAR200: file: SYSOUT=sysout/JAR200_S0020_car200 060206:095345:JAR200: file: SALEDTL=jobtmp/JAR200/%sales.sortfile 060206:095345:JAR200: file: CUSTMAS=ar/customer.master.indexed 060206:095345:JAR200: file: SYS035=rpts/salesrpt_E_car200_S0020_01_060206095345 060206:095345:JAR200: file: SYSIN=jobtmp/JAR200/S0020_car200 060206:095345:JAR200: Job Times: Begun=09:53:45 End=09:53:45Elapsed=00:00:00 060206:095345:JAR200: Normal EOJ StepsExecuted/Last=2/S0020
<@:vsetest:/home/vsetest> exit exit Script done on Mon 06 Feb 2006 09:53:47 AM PST
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Console logging is highly recommended (especially for production) since it captures everything that happens on the screen, including operator commands & replies to prompts.
But until you get console logging activates, you could use the joblog1 script (provided in /home/uvadm/sf/IBM/...).
These scripts capture the JCL/script screen displays into a file using the unix/linux 'tee' command. The log filename is created by dropping the '.ksh' extension from the jobname & then appending '.log'.
# joblog1 - run a JCL/script & capture a log file (via tee) # - names the log file by dropping the .ksh & appending .log # - writes the logfile into subdir 'joblog' (creates it if not present) # - prompts for command to view/print (vi,cat,more,uvlp12,etc) # &/or optionally (save) with a date/time stamp #Feb12/10 - reduce to 1 version (joblog1) # - writes to joblog/... wherever you are # This script intended only for test/debug when console logging not activated # - Console logging is better because it captures everything that happens, # including operator commands & replies to prompts. # - to activate console logging, see: www.uvsoftware.ca/admjobs.htm#Part_6 # sf="$1" # capture the script filename with extension (jclname.ksh) if [[ ! -f $RUNLIBS/jcls/$sf ]] then echo "usage: joblog1 jclname.ksh [args] <-- file not found $RUNLIBS/jcls/$sf" echo " =========================" exit; fi # # setup joblog directory pathname & make joblog subdir if not existing #Feb12/10 - use joblog/ wherever you are # ld=$RUNLIBS/joblog # setup joblog directory pathname ld=joblog # setup joblog directory pathname if [[ ! -d $ld ]]; then mkdir $ld; fi # # create logfilename by dropping .ksh & appending .log f=${sf%\.*} # drop extension .ksh from JCL/script filename lf=$f.log # add extension .log to create logfilename # $sf $2 2>&1 | tee $ld/$lf #======================== echo "enter command to view, print, and/or save logfile" echo "logfile: $ld/$lf" echo "--> vi,cat,more,uvlp12,etc, and/or 'save' to date/time stamp" read reply if [[ "$reply" == *save* ]]; then cp $ld/$lf $ld/${lf}_$(date +%y%m%d_%H%M%S); fi cmd=${reply%save*} if [[ -n "$cmd" ]]; then $cmd $ld/$lf; fi exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 - tblexts1
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
https://supportline.microfocus.com/Documentation/books/sx40sp1/smpubb.htm
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
CNVaids.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
3A0. | Vancouver Utilities 'uvadm' directories & contents |
3B0. | Profiles - profiles & related files in /home/uvadm/env/... |
3B1. | stub_profile - copied to homedirs, renamed as .bash_profile or .profile |
- defines RUNLIBS/RUNDATA as testlibs/prodlibs if programmer | |
or prodlibs/proddata if operator | |
common_profile - defines PATHs using RUNLIBS/RUNDATA | |
bashrc/kshrc - required if console logging to define aliases | |
3B3. | modifying stub_profiles for your site |
3C0. | Functions used in converted JCL/scripts |
- jobset51, jobend51, jobabend51, logmsg1, stepctl51, exportfile | |
- see listings in Part_5 pages '5K1' to '5K3' (GDG file systems) |
3D0. | Functions for cataloged Generation (GDG) files |
- exportgen0, exportgen1, exportgenall | |
- see listings in Part_5 pages '5J1' to '5J5' (GDG file systems) |
3E0. | Control Files |
3E1. | jclunixop41 - options for the JCL/script converter |
3E2. | - customizing the JCL converter options file for your site |
3E3. | datafiles41 - data file attributes (used by JCL converter) |
3E4. | - generating datafiles41 & loading indexed file for JCL converter |
3E5. | - modifying topnodes (converter makes topnode a sub-dir) |
There are several 'conversion support files' that you should be aware of and that you may possibly need to modify to obtain optimum conversions.
I have categorized them into the groups shown above (profiles, functions, GDG functions, control files, scripts, uvcopy jobs,& crontabs/backup scripts).
The next page illustrates the contents of the Vancouver Utilities distribution & identifies the subdirectories housing these groups.
There are certainly other important subdirs & file groups (such as src & bin, where the JCL converter is found), but you should not have to modify them.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/home/uvadm :-----batDOS :-----bin :-----cobs :-----ctl <-- control files used in JCL conversion :-----dat1 :-----doc :-----dochtml :-----env <-- environmental profiles :-----hdr :-----htmlcode :-----lib :-----pf <-- uvcopy jobs used by JCL conversion (& much more) : :-----adm : :-----demo : :-----IBM : :-----util :-----sf <-- scripts used by JCL conversion (& much more) : :-----adm : :-----demo : :-----IBM : :-----util :-----sfun <-- functions for JCL/scripts & GDG files :-----src :-----srcf :-----tf :-----tmp :-----vsetest : :-----testlibs : : :-----cbl0 : : :-----cpy0 : : :-----Csub : : :-----ctl : : :-----jcl0 : : :-----pf : : :-----proc0 : : :-----sf : : :-----sfun : : :-----tmp : : :-----xref : :-----testdata : : :-----ar, gl, : : :-----jobctl, joblog, jobtmp : : :-----rpts, sysout, tmp, wrk
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/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: https://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/...
See profile listings starting at ADMjobs.htm#1C1
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=/home/cobadm/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 |
|
Note |
|
jobset51 |
|
jobend51 |
|
jobabend51 |
|
logmsg1 |
|
stepctl51 |
|
exportfile |
|
exportgen_ functions to emulate GDG files on unix/linux exportgen0 - get the latest generation for input exportgen1 - get the next generation for output exportgenall - get all generations for input
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are some important notes re the proper use of Korn shell functions.
These functions reside in the 'sfun' sub-directory of $RUNLIBS. 'sfun' is defined to the Unix/Linux KORN shell by the 'FPATH' variable in your profile, for example:
export FPATH=$RUNLIBS/sfun ==========================
This is separate from the Unix/Linux KORN shell 'PATH' variable which is used to find normal scripts (in jcls & sf) for example:
export PATH=$PATH:$RUNLIBS/jcls:$RUNLIBS/sf ===========================================
'RUNLIBS' is defined in the profile prior to PATH or FPATH. For the 'vsetest' demos this was:
export RUNLIBS=/home/vsetest ============================
But for YOUR conversion & testing/production RUNLIBS might be:
export RUNLIBS=/p1/testlibs <-- for Your Testing =========================== export RUNLIBS=/p2/prodlibs <-- for Your Production ===========================
These functions must be defined as 'autoload' in the calling scripts. Note that the JCL converter inserts the following about line #10 of each converted JCL/script.
autoload jobset51 logmsg1 exportfile stepctl51 ==============================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
VSE did not support GDG files (as did MVS), but you might be able to use the unix GDG functions for new additions to your converted VSE JCL/scripts.
These functions reside in the 'sfun' sub-directory of $RUNLIBS. 'sfun' is defined to the Unix/Linux KORN shell by the 'FPATH' variable in your profile, for example:
export FPATH=$RUNLIBS/sfun ==========================
This is separate from the Unix/Linux KORN shell 'PATH' variable which is used to find normal scripts (in jcls & sf) for example:
export PATH=$PATH:$RUNLIBS/jcls:$RUNLIBS/sf ===========================================
'RUNLIBS' is defined in the profile prior to PATH or FPATH. For the 'vsetest' demos this was:
export RUNLIBS=/home/vsetest ============================
But for YOUR conversion & testing/production RUNLIBS might be:
export RUNLIBS=/p1/testlibs <-- for Your Testing =========================== export RUNLIBS=/p2/prodlibs <-- for Your Production ===========================
These functions must be defined as 'autoload' in the calling scripts. Note that the JCL converter inserts the following at line #8 of each converted JCL/script.
autoload jobset51 logmsg autoload exportgen0 exportgen1 exportgenx exportgenall exportfile =================================================================
exportgen0 |
|
exportgen1 |
|
exportgenx |
|
exportgenall |
|
exportfile |
|
lastgenr |
|
See these functions listed in Part_5 begining on page '5J0'.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
3E1. | ctl/jclunixop41 - JCL Conversion control file |
- options to control many aspects of JCL conversion | |
- includes tables for search/replace, #comment out, drop lines, etc |
3E2. | customizing the JCL Conversion control file |
- the supplied ctl/jclunixop41 is correct for the test/demo conversions | |
- But you may want to modify for your own JCL conversions. |
3E3. | ctl/datafiles41 - JCL conversion control file #2 - for data files |
- the JCL converter uses this file to determine file characteristics | |
- also used to override the default use of topnode as the subdir |
3E4. | Generating ctl/datafiles41 & loading Indexed file datafiles43I |
3E5. | Topnode (subdir) determination & modification |
3E7. | extfh.cfg - File Handler Configuration file for Micro Focus COBOL |
- IDXNAMETYPE=2 for '.dat' on data partition of indexed files |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
jclunixop41:d0e1g1j1l1p0q1r0s0t12u1y0 #<-- option dflts for VUdoc test/demos # d1 - debug, generate 'echo's for 'cobrun's # e1 - generate 'exportfile' function (vs export) # - to display filenames for console log # g0 - create new GDG's in $RUNDATA/subdir/gdgfile_ # g1 - new GDGs $JGDG relative move to subdir/ at EOJ # g2 - new GDGs $JGDG absolute $RUNDATA/jobtmp/... # j1 - insert jobset51 for RUNDATE=ccyymmdd (obsolete ?) # j2 - jobset52 RUNDATE=mm/dd/ccyy old, jobset52 now $JGDG/ # j4 - might need new optn j4 for RUNDATE=mm/dd/ccyy ? # l1 - generate logmsg1, show script msgs on screen only # l2 - generate logmsg2, appends to joblog/jobname.log # l4 - generate logmsg4 for Bgn/End Job (vs logmsg1/2) # p1 - on COBOL steps, generate printer files as follows: # - exportfile SYS010 $JTMP/$JOBID2_step_$PROGID # - exportfile SYS010L $RPTS/$JOBID2_step_$PROGID_$date # - uvcopy cnvrpt1,fili1=$SYS010,filo1=$SYS010L # q1 - apply TOPNODES table replace/verify 1st Qualifier # r0 - gen cobrun for unix/linux .ints (allow animation) # r1 - gen runw for .ints NetExpress/Windows/UWIN/CYGWIN # r2 - assume executables $DX/program either unix/windows # r16 - execute RPG programs, $RPX/program # s1 - #< comment out SYSIN instream data (for LAVAL) # - instream data extracted separate files jobparms/.. # - export SYS011 defines jobparms/.. file vs $JTMP/.. # t12 - TLBL options for exportgen0/1,tape/,date/time # (t1=date,t2=time,t4=subdir tape/,t8=exportgen0/1) # u1 - convert IEBGENER to uvcp (vs cp default) # u2 - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 files # y1 - customization for CUCBC (printer class changes) # ------------------------------------------------------------------------ # uvadm/ctl/jclunixop41 - control file for VSE JCL to ksh script converter # - must copy/modify to ctl/ subdir where jclunix converter executed # non-comment lines below will be inserted in jcl/scripts until :ENDINSERT # ** change history ** # Nov18/09 - change back jobset51/jobset52 to relative/absolute # Oct03/09 - change back jclunixop42 to jclunixop41 & jclunix42.c to jclunix41.c # - add option q1 to apply TOPNODES table # Sep29/09 - option g added g1/g2 inserts $JTMP/ on exportgen1 files (see below) # - jobset51/52 changed to jobset53/54 by option j4 (RUNDATE format) # Sep13/09 - jclunix41 copied to jclunix42 & TOPNODES table code added # - jclunixop41 copied to jclunixop42 & TOPNODES table added # Aug30/08 - jobset41,jobend41,jobabend41 changed to jobset51,etc # ------------------------------------------------------------------------ #!/bin/ksh export JOBID2=JOBIDX; scriptpath="$0"; args="$*" if [[ -z "$JOBID1" ]]; then JOBID1=JOBIDX; fi; export JOBID1 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done integer JCC=0 SCC=0 LCC=0 # init step status return codes autoload jobset51 jobset52 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 autoload exportfile exportgen0 exportgen1 jobset51 # call function for JCL/script initialization goto S0000=A :ENDINSERT: - above non #comment lines inserted at begin output scripts # jobset51 OR jobset52 function inserted at begin each script # - sets up job environment: export subdirs, setup printer subdir/date # - RUNDATA & RUNLIBS must have been exported (in .profile or in shell) # - .profile must "export FPATH=$RUNLIBS/sfun" to find functions # - autoload declares functions called by jcl/scripts # - stores any restart step# in alias 'goto' (last line inserted above) # jobset51 - option g0 omits $RUNDATA from exportfile/gen # - option g1 defines JTMP/JGDG without $RUNDATA (relative adrsng) # jobset52 - option g2 defines JTMP/JGDG with $RUNDATA (full path Essentis) # - option w2 inserts $RUNDATA on exportfile/gen # - g1/g2 same in jclunix51, dif is jobset51 or 52 here in jclunixop41 # OR use alt jclunixop42 with JTMP JGDG defined with $RUNDATA/... # --------------------------------------------------------------------- # VSE standard labels - could add here to insert at begining of all JCL/scripts # OR - insert std labels in jobset51/jobset52 (vs insert in all JCL/scripts) # - like VSE, 1 master set that may be changed w/o changing JCL/scripts # export STDLBL=vse.standard.label <-- use export for no display # exportfile STDLBL vse.standard.label <-- use exportfile to display filename # --------------------------------------------------------------------- :ENDINSERT: - above non #comment lines inserted at begin output scripts #----------------------- control table -------------------------------- # controls filename conversion depending on 1 or 2+ nodes ('.'s) # TOPDIRDFL1 - used if only 1 node & not typJM in ctl/datafiles43 # - 'wrk' since 1 node files usually 'SORTOUT's # - temp files, input to following steps, not needed after job ends # TOPDIRDFL2 - used if only 1 node & typJM on ctl/datafiles43 matching filename # - 'M' of typJM stored if ',CAT=' found on DLBL by jcldata41 # TOPDIRINS1 - if specified & no typJM, insert above top-node (retain all '.'s) # - used for all files with 2+ nodes (TOPDIRDFL1/2 used if only 1) # - if TOPDIRINS1/2 unspecified, topnode becomes a directory # TOPDIRINS2 - if specified & typJM, insert above top-node (retain all '.'s) # - OVERRIDDEN if datafiles43I has topr=... or topi=... :CTLTBL: TOPDIRDFL1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRDFL2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINS1~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINS2~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # #------------------------ TOPNODES table ------------------------------ # table of TOPNODES allowed & replacements (optional) # 01-30 - topnodes allowed # 31-60 - topnode replacements (if col 31 not '~') # - if 01-30 of last entry 'ALLOTHER', any others replaced by 31-60 # - use statmvsjcl1 to create summary table of topnodes used in all JCL # - see www.uvsoftware.ca/mvsjcl.htm#6A2 # - code in lower case since applied at output time(script) vs input(JCL) :TOPNODES: ar~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rpts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ work~~~~~~~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~ ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #Note1 - you must also code valid top-nodes in $RUNLIBS/ctl/GDGmkdirs # - called by jobset51 to setup subdirs for new generations of GDG files # - see listing at MVSJCL.htm#4E5 # #---------------------- search/replace tables ------------------------- # - entries must be tidle filled & table ended by a line of all tildes # 01-30=search pattern, 31-60=replace pattern, 61-80=qualifier pattern # :REPTBL1: search/replace table for input IBM JCL // PAUSE.~~~~~~~~~~~~~~~~~~~~~// PAUSE ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # :REPDSN: search/replace table for DSNs - see dsn2dxf() .CLUS.VSEPRD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .CLUS.VSEDEV~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .CLUS.PRDXFR~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .VSEPRD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # leaving replace pattern 31-60 tildes will remove search pattern # # comment lines in output script by search patterns & qualifiers # - inserts '# ' in cols 1 & 2 if search & qualifier patterns present :CMTTBL: cmtsearch~~~~~~~~~~~~~~~~~~~~~cmtqualifier~~~~~~~~~~~~~~~~~~ BLKSIZE=6300~~~~~~~~~~~~~~~~~~INPFIL~~~~~~~~~~~~~~~~~~~~~~~~ BLKSIZE=6500~~~~~~~~~~~~~~~~~~OUTFIL~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Table of STEP names to be #commented out # Feb13/07 - TDYNASN for Laval (also gens: exportfile BBBBBB $AAAAAA) :COMMENTSTEP: LISTLOG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ PRTLOG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ TDYNASN~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DYNUTIL~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ DYNOPEN~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ BSTTWAIT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ E173001C~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ VSECMD~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ IPCPBTCH~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SPOB766~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Table of symbols whose value is to be translated to lower case :LOWERCASE: XXXXX~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Sep25/05 - '*' now allowed by searchtbl3 :DROPDDN: drop DDnames on input //DDname DD SORTWK*~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # # Table of DSNnames to drop if pattern matched anywhere in filename :DROPDSN: USERCAT~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ CATALOG~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ SORTWK~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ==~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ .DBIMS~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #------------------------ end jclunixop41 ---------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The files listed above is correct for the 'vsetest' system & will not need any changes to convert & execute the demo scripts & programs provided. However you will need to modify for your own JCL conversions. You should 1st run the 'vsetest' conversions beginning on page '1Q1' (& verify the results match the listings in section 1C1), before modifying for your own JCL conversions.
This file (ctl/jclunixop41) controls various activities performed by the jclunix4 conversion program. Several options are specified on line 1:
jclunixop41:d0e1g1j1l1p0q1r0s0t12u1y0 #<-- option dflts for VUdoc test/demos # d1 - debug, generate 'echo's for 'cobrun's # e1 - generate 'exportfile' function (vs export) # - to display filenames for console log # g0 - create new GDG's in $RUNDATA/subdir/gdgfile_ # g1 - new GDGs $JGDG relative move to subdir/ at EOJ # g2 - new GDGs $JGDG absolute $RUNDATA/jobtmp/... # j1 - insert jobset51 for RUNDATE=ccyymmdd (obsolete ?) # j2 - jobset52 RUNDATE=mm/dd/ccyy old, jobset52 now $JGDG/ # j4 - might need new optn j4 for RUNDATE=mm/dd/ccyy ? # l1 - generate logmsg1, show script msgs on screen only # l2 - generate logmsg2, appends to joblog/jobname.log # l4 - generate logmsg4 for Bgn/End Job (vs logmsg1/2) # p1 - on COBOL steps, generate printer files as follows: # - exportfile SYS010 $JTMP/$JOBID2_step_$PROGID # - exportfile SYS010L $RPTS/$JOBID2_step_$PROGID_$date # - uvcopy cnvrpt1,fili1=$SYS010,filo1=$SYS010L # q1 - apply TOPNODES table replace/verify 1st Qualifier # r0 - gen cobrun for unix/linux .ints (allow animation) # r1 - gen runw for .ints NetExpress/Windows/UWIN/CYGWIN # r2 - assume executables $DX/program either unix/windows # r16 - execute RPG programs, $RPX/program # s1 - #< comment out SYSIN instream data (for LAVAL) # - instream data extracted separate files jobparms/.. # - export SYS011 defines jobparms/.. file vs $JTMP/.. # t12 - TLBL options for exportgen0/1,tape/,date/time # (t1=date,t2=time,t4=subdir tape/,t8=exportgen0/1) # u1 - convert IEBGENER to uvcp (vs cp default) # u2 - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 files # y1 - customization for CUCBC (printer class changes)
Option 'r' must be synchronized with the COBOL compile script you intend to use: mfcbl1, mfnxcbl1,or mfnxcbl2 (see VSECOBOL.htm#5E0).
The control file includes search/replace tables to modify conversion for site variances you can use REPTBL2 to modify the directory name taken from the HLQ (High Level Qualifier of DSN file-id).
You can use DROPDDN & DROPDSN tables to get rid of mainframe file definitions that have no relevance to unix/linux scripts (PROCLIB, STEPLIB, JOBLIB, etc).
See more discussion of options & TOPNODE/subdirs on pages '4E1' - '4E6'
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
listcat3I is created by transferring the mainframe LISTCAT report, processing (as shown on page '4H1' & '4I12'),& loading into an indexed file.
e2121653.mtaxe.piscines rca=00082 rcm=00082 key=000(020) typLMC=IDXf1 e2121656.itaxe.facturat rca=00083 rcm=00239 key=000(036) typLMC=IDXf8v e2121853.mtaxe.b8409d35 rca=00024 rcm=00024 key=000(011) typLW_=IDXf1 e2122683.itaxe.degrevem rca=00158 rcm=00265 key=000(037) typLMC=IDXf8v e2122941.mtaxe.permispn rca=00045 rcm=00045 key=000(022) typLMC=IDXf1 e2122942.mtaxe.droitmut rca=00030 rcm=00030 key=000(011) typLMC=IDXf1 e2123001.itaxe.banqtaxe rca=00126 rcm=00383 key=000(036) typLMC=IDXf8v e2123002.itaxe.taxation rca=00046 rcm=00383 key=000(035) typLMC=IDXf8v e2123003.itaxe.transdam rca=00464 rcm=00464 key=000(000) typLMC=RSR e2123004.itaxe.tranjour rca=00464 rcm=00464 key=000(000) typLW_=RSF e2123005.mtaxe.tpcalcul rca=00081 rcm=00081 key=000(029) typLMC=IDXf1 e2123086.itaxe.encapost rca=00080 rcm=00080 key=000(000) typLW_=RSF e2123691.itaxe.indexenc rca=00036 rcm=00036 key=000(036) typLMC=IDXf1 e2123692.itaxe.encaisse rca=00146 rcm=00426 key=000(022) typLMC=IDXf8v e2123693.itaxe.tranksds rca=00168 rcm=00453 key=000(017) typLMC=IDXf8v
e1133081.tfadm.b8306j02 rca=00464 rcm=00464 key=000(000) typJWV=RSF e2121653.mtaxe.piscines rca=_____ rcm=_____ key=000(000) typJWV=RSF e2121656.itaxe.facturat rca=00083 rcm=00239 key=000(036) typJWV=IDXf8v e2122680.ttaxe.b8401d30 rca=03180 rcm=03180 key=000(000) typJWV=RSF e2122683.itaxe.degrevem rca=00158 rcm=00265 key=000(037) typJWV=IDXf8v e2122951.mtaxe.matrenov rca=_____ rcm=_____ key=000(000) typJWV=RSF e2122958.ttaxe.b8409d36 rca=00236 rcm=00236 key=000(000) typJWV=RSF e2123001.itaxe.banqtaxe rca=00126 rcm=00383 key=000(036) typJWV=IDXf8v e2123002.itaxe.taxation rca=_____ rcm=_____ key=000(000) typJWV=RSF e2123003.itaxe.transdam rca=_____ rcm=_____ key=000(000) typJWD=RSF e2123004.itaxe.tranjour rca=00464 rcm=00464 key=000(000) typJWV=RSF e2123005.mtaxe.tpcalcul rca=00081 rcm=00081 key=000(029) typJWV=IDXf1 e2123010.ttaxe.sommtrie rca=00464 rcm=00464 key=000(000) typJWV=RSF e2123011.ttaxe.rembours rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v e2123013.ttaxe.c3001d31 rca=00360 rcm=00360 key=000(000) typJWV=RSF e2123013.ttaxe.rembtrie rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v tu.f01.e211801.adrpos rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f01.e212-no.eauctr rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f01.e212-no.trperm rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f02.bkfaver.90-m07 rca=_____ rcm=_____ key=000(000) typJWT=RSF
The JCL converter uses the 2 Indexed files above to get file characteristics. 'listcat3I' has priority over 'datafiles43I'. The 'M' in 'typLM...' assigns these files to mstr/..., else to wrk/..., but TLBL files to tape/...
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The JCL converter uses this file to determine the directory to be assigned to the various files. This may be extended in future to carry file types, record-sizes,& indexed keys.
This control file is generated by the 'jcldata41' uvcopy job, which must be run after the PROC expansion & before the JCL conversion. 'jcldata41' reads the jcl2 subdir of expanded JCLs, extracting all DSN filenames from all JCLs, & writes them into 1 file ctl/datafiles41.
Here is the uvcopy command line to generate this file, taken from the operating instructions presented earlier on page '1Q3'.
#4. uvcopy jcldata41,fild1=jcl2,filo2=ctl/datafiles41 =================================================
#4a. cp ctl/datafiles41 ctl/datafiles42 <-- create datafiles42 for edit ==================================
#4a. vi ctl/datafiles42 <-- edit datafiles42, drop most files ================== - retain only files for overrides - modify/add codes as desired
Here are a few lines extracted from the test/demo file created in Part 1
ar.customer.master rca=_____ rcm=_____ key=000(000) typJWV=RSF ar.sales.items rca=_____ rcm=_____ key=000(000) typJWV=RSF gl.account.master rca=_____ rcm=_____ key=000(000) typJWT=RSF gl.account.trans rca=_____ rcm=_____ key=000(000) typJWV=RSF
The JCL converter might convert these files as follows:
exportfile CUSTMAS ar/customer.master exportfile CUSTMAS ar/sales.items exportfile ACNTMAS gl/account.master exportfile GLTRANS gl/account.trans
Note that the topnode or HLQ (High Level Qualifier) is used for the directory & the filename is the remaining nodes. You can replace the directory by coding topr=... or insert a top level directory by coding topi=...
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
If you wanted most files to go into a 'mstr' directory retaining all existing nodes, you could code that directory in ctl/jclunixop41 on the TOPDIRINS2 line as shown below. You could then modify some files by coding 'topi=...' on desired filenames in ctl/datafiles42 which will override ctl/datafiles41.
:CTLTBL: TOPDIRDFL1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRDFL2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINS1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINS2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ar.customer.master rca=_____ rcm=_____ key=000(000) typJWV=RSF ar.sales.items rca=_____ rcm=_____ key=000(000) typJWV=RSF topi=trans gl.account.master rca=_____ rcm=_____ key=000(000) typJWT=RSF gl.account.trans rca=_____ rcm=_____ key=000(000) typJWV=RSF topi=trans
exportfile CUSTMAS mstr/ar.customer.master exportfile SALES trans/ar.sales.items exportfile ACNTMAS mstr/gl.account.master exportfile GLTRANS trans/gl.account.trans
Note |
|
See more discussion of options & TOPNODE/subdirs on pages '4E1' - '4E6'
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# extfh.cfg - File Handler Configuration file for Micro Focus COBOL # - see https://supportline.microfocus.com/Documentation/books/sx40sp/fh... # - see www.uvsoftware.ca/vsecobol.htm & www.uvsoftware.ca/mvscobol.htm # location of this file defined for COBOL by EXTFH, in profiles, for example: # export RUNLIBS=/home/vsetest # export EXTFH=$RUNLIBS/ctl/extfh.cfg # #--------------------------------------------------------------------------- # [XFH-DEFAULT] - following options apply to all files # - unless over-ridden by [INTERNAL:EXTNAME] (see below) # IDXNAMETYPE=2 - means data partitions have '.dat' extension # - index partitions always have '.idx' extension # - IDXFORMAT=8 files have only 1 partition # & it will have '.dat' extension if IDXNAMETYPE=2 # & does include the indexes (in spite of its name) # IDXFORMAT=1 - create all indexed files as IDX1 (fixed lth < 2 gig) # IDXFORMAT=8 - create all indexed files as IDX8 (allows > 2 gig) # default - IDXFORMAT unspecified would create fixed lth IDXFORMAT1, # & variable length as IDXFORMAT3 ? or IDXFORMAT8 ? # FILEPOINTERSIZE=8 - allow IDX8 files > 256 Terrabytes (don't need) # #--------------------------------------------------------------------------- # [INTERNAL:EXTNAME] - following options apply to a specific file ID by EXTNAME # on: 'select cobolFDname assign external EXTNAME' # - applies only to file defined by EXTNAME matching env-var # export EXTNAME=pathname (in JCL/script prior to cobrun) # - - - examples - - - # [INTERNAL:E212853] - example for file whose EXTNAME=E212853 (select external) # IDXFORMAT=1 - force IDXFORMAT1 vs any [XFH-DEFAULT] IDXFORMAT_ # [INTERNAL:E212002] - example for file whose EXTNAME=E212002 (select external) # IDXFORMAT=8 - force IDXFORMAT8 vs any [XFH-DEFAULT] IDXFORMAT_ # #--------------------------------------------------------------------------- [XFH-DEFAULT] IDXNAMETYPE=2 # IDXFORMAT=8 #---------------------------------------------------------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
4A1. | Introduction & Overview |
4B1. | Plan Your conversion (vs the 'test/demo' conversions in Part_1) |
- also see the 20 point preparation summary in uvprices.htm#G1. | |
- the Vancouver Utilities makes the conversions fast, | |
- but you must test all JCL/scripts & COBOL programs | |
- we suggest allowing 6 months to 1 year for the conversion project | |
- we suggest 4 to 8 weeks of UV Software onsite training | |
& conversion assistance | |
- install unix/linux O/S software (Red Hat, SUN, AIX, HP, etc) | |
- setup userid 'uvadm' for the Vancouver Utilities | |
- setup userid 'appsadm' (administrator for your applications) |
4B2. | Install the Vancouver Utilities |
4B3. | Setup the 'profiles' for uvadm, appsadm,& your conversion team members |
- stub_profiles in each user homedir (overwrite .profile or .bash_profile) | |
- common_profile, 'rc' files in /home/appsadm/env |
4C1. | Design/setup optimum directory structure for Your site |
- for conversion, testing,& production | |
- see several alternative designs at ADMjobs.htm#Part_2 |
4D1. | Copy Vancouver Utility supplied control files & functions |
- control files supplied in /home/uvadm/ctl, copy to your $TESTLIBS/ctl/... | |
(jclunixop41,cobdirectives,extfh.cfg,cnvcob5.tbl) | |
- functions supplied in /home/uvadm/sfun, copy to your $TESTLIBS/sfun/... | |
(jobset41 logmsg1 exportfile,exportgen0,exportgen1,exportgenall,etc) | |
4D2. | script to copy supplied control files & functions to your subdirs |
4E1. | JCL converter control file options - modify for your site |
4E2. | control file tables to modify TopNode/subdir assignments |
4E3. | TOPNODES table & relative-PATH vs full-PATH |
4E4. | Customize JCL conversion by modifying the control file ctl/jclunixop41 |
4E5. | Running 'statvsejcl1' to create a table summary of Top-Nodes in your JCL |
- modify the TOPNODES table to change &/or consolidate topnodes | |
(which are usually used as sub-directories for data files) | |
4E6. | ctl/GDGmkdirs - script to make topnode/subdirs for new generations of GDGs |
- must be updated with your TopNode/subdirs |
4F1. | Transfer JCL, COBOL,& DATA files from the mainframe for initial testing |
- suggest zipping all files of the same type | |
- transfer any PROC's, SLI's, INCLUDE's, Parms, etc | |
- run LISTCAT on mainframe & transfer to unix to assist datafile convert |
4G1. | Convert All COBOL copybooks & All COBOL programs |
- COBOL conversion is the easiest & it makes sense to do it first | |
- Initial conversion All programs must be performed as per VSECOBOL.htm | |
- script cnvMF41A provided for re-conversions during conversion period |
4G2. | Convert 1 COBOL copybook & 1 COBOL program at a time |
- scripts cnvMF41c & cnvMF41 |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
4H1. | Create the data conversion control file (ctl/ctlfile4) from LISTCAT |
- record sizes, indexed keys, file types | |
- need to manually edit the copybook corresponding to each data file |
4I1. | Convert Your DATA files (at least enough for some initial testing) |
- converting DATA before JCL makes sense because the LISTCAT info | |
is required 1st for DATA conversion & then for JCL conversion | |
- see complete details at VSEDATA.htm |
4I2. | $CNVDATA/ctl/ctlfile4 listed here in VSEJCL.doc for your convenience |
- used to generate the 'uvcopy jobs' that perform data conversion | |
- you must see VSEDATA.doc to generate the jobs & execute 1st time |
4I3. | Re-executing the jobs to convert all datafiles (refreshed from mainframe) |
- may need to do 2 or 3 times during 1 year conversion/test period |
4I5. | Convert 1 datafile at a time (in $CNVDATA) |
- sfload/scripts to copy datafile over to $TESTDATA/mstr |
4I10. | create the JCL conversion control file from LISTCAT |
- $CNVDATA/ctl/listcat2 (from 4H1) is converted to $TESTLIBS/ctl/listcat3I |
4J1. | Initial conversion of All Your JCL (directories involved) |
4J2. | Review preparations for conversion (4A1-4F1 above) |
4J3. | jcl2ksh41A (do everything script) vs step by step method below (4K1-4K4) |
4K1. | step by step conversion |
cleanup mainframe JCL, PROCs, Parms,& expand PROCs |
4K2. | create the JCL conversion data control file from up to 6 sources |
- info extracted from JCL, LISTCAT, spreadsheets,& edited info | |
- result loaded to Indexed file ctl/datactl53I accessed by JCL converter |
4K4. | final steps to convert JCL with expanded procs to Korn shell scripts |
- guided by data control file & JCL converter options file |
4L0. | Preparations Required Before you can begin testing/debugging your scripts |
Most of these jobs are 'OPTIONAL' depending on site preferences | |
- optional jobs are documented briefly here in Part 4 | |
- details & examples given in Part_6. |
4L1. | Create GDG control file (used to get no of generations for GDG files) |
- see complete details & examples in 'Part_5' (also in MVSJCL.doc Part 5). | |
- could initially create empty Indexed file so you test non-GDG jobs |
4L2. | Cross References for COBOL & JCL/scripts are a big help for test/debug. |
Generate & print the cross-references now before you begin test/debug. |
4L3. | Job-Flow reports are also a big help for test/debug. |
- show the datafile I/O from step to step | |
- generate all reports in subdir jobflow/... & print as needed |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
4L4. | Extract control cards from JCL to separate files |
- optional jobs to extract control cards from all JCLs so you can update | |
them separately form the JCL/scripts. | |
- control card files are date-stamped to allow updates for future dates. | |
- see complete details & examples begining on page '6A1'. |
4M1. | Test/Debug a few JCL/scripts & use this experience to fine tune the |
JCL/script conversion options & control files. |
4M2. | Aids to assist test/debug of JCL/scripts |
- testdatatinit, joblog1, llr |
4N1. | Reconvert 1 JCL at a time as you modify & test/debug the scripts |
- script 'jcl2ksh41' to reconvert 1 JCL |
4N2. | Reconvert All JCL to capture fine tuning benefits |
- script 'jcl2ksh41A' reconverts All jcl0->jcl1->jcl2->jcl3 | |
- JCL/scripts are copied 1 at a time from the converted subdir (jcl3) | |
to the active-PATH subdir (jcls) only when programmer ready to test/debug |
4N4. | Assign JCLs to various conversion team members for test/debug |
4O1. | Aids & Techniques to assist test/debug |
- set up testdata in your homedir to avoid conflicts with other programmers |
4O2. | using uvhd & uvhdcob to dislay your files with packed & binary fields |
- uvhd already documented | |
- uvhdcob displays COBOL copybook fieldnames beside data field contents |
4P1. | Determine conversion solutions for 3rd party software such as |
DITTO, EASYTRIEVE, etc. | |
The JCL converter does convert SORT, IDCAMS, IEBGENER, and some DITTOs. | |
An Easytrieve to uvcopy converter is provided for the simpler jobs. | |
You may have to write COBOL programs for with more complex Easytrieves. |
4Q1. | Setup Your backup scripts now to protect your programmers from 'oops' |
- see several backup scripts in ADMjobs.htm#Part_4 | |
- setup appsadm 'crontabs' to backup cnvdata, testdata,& testlibs | |
every night to both tape & disc (see ADMjobs.htm#Part_5 | |
- can have 1 or 2 days backups on disc for immediate recoveries |
4R1. | Setup console logging (essential for production) |
- programmers can use the 'joblog1' script for debugging | |
- good idea to setup on the test machine to try it out before production |
4S1. | Run parallels with mainframe when you have enough JCL/scripts debugged |
Re-transfer mainframe JCL,COBOL,& DATA a few times during conversion period | |
Setup the production machine & Go live (over a weekend usually) | |
Need to re-transfer all data files on the 'Go Live' weekend, but JCL & | |
COBOL programs should not need re-transfer/reconvert at this point |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Part 4 is intended to present a plan for you to follow in converting 'YOUR' JCL (vs the test/demo conversions illustrated in Part_1.
Your JCL conversion will be the primary focus in Part 4, but we will refer you to other parts of the documentation for the many other procedures required to make the entire conversion successful.
In fact this (Part 4 of VSEJCL.doc) is probably your best roadmap to follow when planning & executing your conversion.
Note that you must follow the step by step method for your 'first' conversion of all JCL, but for subsequent conversion you may use the handy scripts provided to convert all JCL with 1 command.
Part 4 also gives the operating instructions for the scripts to re-convert All COBOL,& DATA files, but you must use the step by step method for the 'first' conversions as documented in VSECOBOL.htm & VSEDATA.htm.
Part 4 was re-written in Feb 2007 & uses the 'City of Lynn Valley' as a sample customer for conversion.
Before you dig into this very detailed conversion plan, I recommend you review the very concise '20 point preparation plan' presented in uvprices.htm#G1.
Also review the 'optional conversions' described at uvprices.htm#K0.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Part 4 is intended to present a plan for you to follow in converting 'YOUR' JCL (vs the test/demo conversions illustrated in Part_1.
The Vancouver Utilities makes the conversions fast. But since you must test all JCL/scripts & COBOL programs, you should allow from 6 months to 1 year for the conversion project.
We recommend having UV Software personnel onsite for training & conversion assistance. We suggest an initial 4 weeks & perhaps another 3 or 4 weeks after 1 or 2 months later.
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 at ADMjobs.htm#3B1.
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 the profiles.
export TESTLIBS=/p1/testlibs export TESTDATA=/p1/testdata export PRODLIBS=/p2/prodlibs export PRODDATA=/p2/proddata export CNVDATA=/p4/cnvdata
RUNLIBS, RUNDATA,& CNVDATA are assigned in the .profile or .bash_profile of programmers & operators. see the stub_profile listed at ADMjobs.htm#1C1.
export RUNLIBS=/p1/testlibs <-- for programmers export RUNDATA=/p1/testdata export CNVDATA=/p1/cnvdata
export RUNLIBS=/p2/testlibs <-- for operators export RUNDATA=/p2/testdata
export RUNLIBS=$HOME/testlibs <-- for programmers, who wish to test export RUNDATA=$HOME/testdata in their homedir, only for education export CNVDATA=$HOME/cnvdata & exception testing (no development)
Note |
|
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 (vsetest) for convenience & simplicity.
/home :----user1 :----user2 :-----etc- :----vsetest : :----testlibs <-- $RUNLIBS for demo JCL conversions in Part_1 : : :----cbls : : :----jcls : : :-----etc- : :----testdata <-- $RUNDATA for demo JCL conversions in Part_1 : : :----ar : : :----gl : : :----etc
You should not use homedirs for your actual conversion, testing,& production for several reasons which will be explained below.
I recommend separate file systems for test-libraries, test-data, production-libraries, & production-data. This gives you a lot more flexibility for backups and any required restores. Separate file systems protects other file systems in case of runaway programs filling up the data file system. Other file systems are also protected against corruption in any 1 file system.
We have already explained how RUNLIBS & RUNDATA are defined in the profiles to control the locations of the active libraries (test or production) and the locations of the active data (test or production). From the following pages you can see that RUNLIBS & RUNDATA for programmers & production personnel might be:
export RUNLIBS=/p1/testlibs <-- testlibs/testdata for programmers
export RUNDATA=/p1/testdata
export RUNLIBS=/p2/prodlibs <-- prodlibs/proddata for operators
export RUNDATA=/p2/proddata
/p1, /p2, /p3, /p4 are file system mount points, which could be different on your system, but all our conversion scripts & generated JCL/scripts will work without change, since they all depend on RUNLIBS & RUNDATA, which are defined in the profiles of programmers & operators.
The next few pages will illustrate the details of testlibs/testdata & prodlibs/proddata, and also describe the uses of /p3 for backup/restore, and /p4 for data conversions.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/root /... <-- unix/linux O/S directories /... /home <-- home directories :----user1 :----user2 :----etc--- : /p1 <-- /p1 file system mount point :----testlibs - test-libraries & test-data :----testdata /p2 <-- /p2 file system mount point :----prodlibs - production-libraries & production-data :----proddata /p3 <-- /p3 file system mount point :----backup - backup & restore directories :----restore /p4 <-- /p4 file system mount point :----cnvdata - data conversion directories
Note that this file design is the first practical design that you would want to use for your development & production. The earlier test/demos used home directories (/home/vsetest) which should not be used for your development & production because:
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 :-----testlibs <-- RUNLIBS=$TESTLIBS=/p1/testlibs : :------Csub - C subroutines for COBOL programs : :--MF--cbl0 - your COBOL programs transferred from mainframe : :------cbl1 - cleaned up, cols 1-6 & 73-80 cleared, etc : :------cbl2 - cnvMF4 converts mainframe COBOL to Micro Focus COBOL : :------cbl3 - optional to convert accept sysin to read from a file : :------cbls - copy here (standard source library) before compiling : :------cblst - cobol source listings from compiles : :------cblx - compiled COBOL programs (.int's) : :--MF--cpy0 - for COBOL copybooks : :------cpy1 - cleaned up, cols 1-6 & 73-80 cleared, etc : :------cpy2 - cnvMF4 converts mainframe COBOL to Micro Focus COBOL : :------cpys - copy here (standard copybook library) : :------ditto0 - DITTO jobs from MainFrame : :------ditto1 - DITTO jobs cleaned up : :------dittos - DITTO jobs converted to uvcopy : :------ezt0 - EasyTrieve jobs from MainFrame : :------ezt1 - EasyTrieve jobs cleaned up : :------ezts - EasyTrieve jobs converted to uvcopy : :------ftp - subdir for FTP transfers : :--UV--ctl - conversion control files (jclunixop41, datafiles41) : :------include1 - optional (PROC expansion allows include files) : :--MF--jcl0 - your JCLs transferred from mainframe : :------jcl1 - intermediate conversion 73-80 cleared : :------jcl2 - PROCs expanded from procs : :------jcl3 - JCLs converted to Korn shell scripts : :------jcls - copy here manually 1 by 1 during test/debug : :------jobparmx1 - datacards extracted from JCL/scripts (date-stamped) : :------jobparmx2 - datacards extracted from JCL/scripts (no datestamps) : :------maps - 'cobmaps' record layouts generated from copybooks : :------pf - uvcopy jobs to replace utilities (easytrieve,etc) : :--MF--proc0 - your PROCs transferred from mainframe : :------procs - will be merged with jcl1, output to jcl2 : :------sf - for misc scripts you may wish to write : :--UV--sfun - korn shell functions (jobset51,logmsg,etc) : :------tmp - tmp subdir used by various conversions : :------xref - cross-references (see XREFjobs.htm)
vselibsdirs <-- script to create above subdirs ===========
copyvsectls <-- script to copy control files from /home/uvadm/ctl/ to ctl/... ===========
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p1 :-----testdata <-- RUNDATA=$TESTDATA=/p1/testdata : :-----ftp : :-----jobctl - optional, could use to pause jobs at spcfd steps : :-----joblog - joblog1 script stores .log files here : :-----jobparms1 - current datacards from $RUNLIBS/jobparmx1 at 6PM : :-----jobparms2 - datacards from $RUNLIBS/jobparmx2 at 6PM : :-----jobtmp - job temporary files : :-----mstr <-- master files : :-----pf - user written uvcopy jobs : :-----rpts <-- reports : :-----sf - user written Korn shell scripts : :-----sysout - COBOL DISPLAY upon SYSLST reports : :-----tape <-- tape files reassigned to disc by JCL converter : :-----tmp - misc temp files & sort work files : :-----wrk <-- work files (inter-step)
Note |
|
vsedatadirs <-- script to create above subdirs ===========
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Note |
|
/p1 :-----testdata <-- RUNDATA=$TESTDATA=/p1/testdata : :-----ftp : :-----jobctl : :-----joblog : :-----jobparms1 - current datacards from $RUNLIBS/jobparmx1 at 6PM : : :-----28401T04_S0050_E212540C : : :-----28401T04_S0080_E212540C : :-----jobparms2 - datacards from $RUNLIBS/jobparmx2 at 6PM : : :-----24502R01_S0010_E173001C : : : : :-----jobtmp - job temporary files : : :-----jobname - subdir by jobset51 function : : :-----28401T04 : : : :-----S0050_E212540C - cobol creates w/o LineFeeds : : : :-----S0080_E212540C - uvcopy cnvrpt1 copies to rpts/... : : : :-----S0080_E212540C - inserting LFs, add extnsn .lvl : : : : :-----mstr - master files : : :-----e2123002.itaxe.taxation - sample filenames : : :-----e2125504.mtaxe.paracomp : :-----pf : :-----rpts - reports : : :-----070218 - subdir for today's reports : : :-----070219 - created by function jobset51 on 1st run of day : : : :-----28401T04_S0050_E212540C_074648.lvl : : : :-----28401T04_S0080_E212540C_074648.lvl : :-----sf : :-----sysout : :-----tape - tape files reassigned to disc by JCL converter : : :-----070218 - subdir for today's tape file outputs : : :-----070219 : :-----tmp : :-----wrk - work files (inter-step) : : :-----e2125556.ttaxe.b8401j04 - sample filenames : : :-----e2125557.ttaxe.b8401j04
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p2 :-----prodlibs <-- RUNLIBS=$PRODLIBS=/p2/prodlibs : :-----cbls - end point for converted COBOL programs : :-----cblst - cobol source listings from compiles : :-----cblx - compiled COBOL programs (.int's) : :-----cpys - converted, ready for compiles : :-----jcl3 - JCLs converted to Korn shell scripts : :-----jcls - copy here manually 1 by 1 during test/debug : :-----jobparmx1 - datacards extracted from JCL/scripts (date-stamped) : :-----jobparmx2 - datacards extracted from JCL/scripts (no datestamps) : :-----pf - uvcopy jobs to replace utilities (easytrieve,etc) : :-----sf - for misc scripts you may wish to write : :-----sfun - korn shell functions (jobset51,logmsg,etc) : :-----tmp - tmp subdir used by various conversions
Please compare these production libraries to the conversion & testing libraries on the preceding page. Note that many original mainframe & intermediate conversion subdirs have been dropped, retaining only the fully converted subdirs of COBOL programs, copybooks,& JCL(now Korn shell scripts).
/p2 :-----proddata <-- RUNDATA=$PRODDATA=/p2/proddata : :-----ftp : :-----jobctl : :-----joblog : :-----jobparms1 - current datacards from $RUNLIBS/jobparmx1 at 6PM : :-----jobparms2 - datacards from $RUNLIBS/jobparmx2 at 6PM : :-----jobtmp - job temporary files : : :-----jobname1 - subdir with jobname created at job init : : :-----jobname2 by jobset51 function : :-----mstr - master files : : :-----e2123002.itaxe.taxation - sample filenames : : :-----e2125504.mtaxe.paracomp (files not shown by dtree script) : :-----pf : :-----rpts - reports : : :-----070218 - subdir for today's reports : : :-----070219 - created by function jobset51 on 1st run of day : :-----sf : :-----sysout : :-----tape - tape files reassigned to disc by JCL converter : : :-----070218 - subdir for today's tape file outputs : : :-----070219 : :-----tmp : :-----wrk - work files (inter-step) : : :-----e2125556.ttaxe.b8401j04 - sample filenames : : :-----e2125557.ttaxe.b8401j04 (files not shown by dtree script)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p3/backup :-----homedirs <-- $HOMEDIRS backup from last night : :-----appsadm - showing only 1 user to save lines : : :-----ctl & showing only a few subdirs in 1st user : : :-----env : : :-----logs : : :-----... :-----homedirs-1 <-- $HOMEDIRS backup from 2 nights ago : :-----...same as above... :-----proddata <-- $PRODDATA backup from last night : :-----ap : :-----ar : :-----gl : :-----rpts : :-----wrk :-----proddata-1 <-- $PRODDATA backup from 2 nights ago : :-----...same as above... :-----prodlibs <-- $PRODLIBS backups from last night : :-----cbls : :-----cpys : :-----ctl : :-----jcls : :-----parms :-----prodlibs-1 <-- $PRODLIBS backup from 2 nights ago : :-----...same as above... :-----zip <-- last nights backup (only) : :-----homedirs_070529_0301.zip : :-----proddata_070529_0302.zip <-- sample for May 29/2007 : :-----prodlibs_070529_0303.zip : :-----... :-----Day <-- Daily backups in .zip files for last 40 days : :-----homedirs_070419_0301.zip : :-----proddata_070419_0302.zip <-- 40 days ago = April 19/2007 : :-----prodlibs_070419_0303.zip : :-----...(39 sets not shown) :-----Month <-- Monthly backups in .zip files for last 15 months : :-----homedirs_060201_0301.zip : :-----proddata_060201_0302.zip <-- 15 months ago = Feb 1/2006 : :-----prodlibs_060201_0303.zip : :-----...(14 sets not shown) :-----Year <-- Yearly backups in .zip files for last 7 years : :-----homedirs_000501_0301.zip : :-----proddata_000501_0302.zip <-- 7 years ago = Jan 1/2000 : :-----prodlibs_000501_0303.zip : :-----...(6 sets not shown)
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p4 :-----cnvdata - $CNVDATA=/tax/cnvdata ($symbol for PATH independence) : :------archive - copy unwanted files here for later deletion : :--MF--cpys <-- COBOL copybooks : :--MF--ctl <-- control files (LISTCAT from the mainframe) : :--MF--d0 <-- data files FTP'd from mainframe (variable length) : :------d0ebc - filenames lower case, '.clus.vseprd' dropped : :------d1ebc - converted to fixed length for conversion : :------d2asc - converted to ASCII (packed/binary preserved) : :------d3ebc - possible convert back to EBCDIC to verify : :------errs - error reports from conversion utilities : :------maps - copybooks converted to record layouts : :------pf - misc uvcopy jobs : :------pfv1 - uvcopy jobs to convert varlth to fixlth : :------pfv2 - copied here for execution : :------pfx1 - uvcopy skeleton jobs generated from 'maps' : :------pfx1a - uvcopy instrns extracted from pfx1 jobs : :------pfx2 - uvcopy jobs completed, datafilenames (vs cpybknms) : :------pfx3 - uvcopy jobs copied here for modify/execute : :------pfx3.bak - backup before regens to recover modified R/T code : :------pfx4 - optional jobs to convert back to EBCDIC for verify : :------sf - misc scripts : :------sfload - scripts to copy/sort/load d2asc/... to $TESTDATA/mstr : :------sfloadalt - alternates (must be only 1 script per file in sfload) : :------stats - reports to assist multi record type file conversions : :------tmp - misc files here (keep working dir clean, rm daily) : :------tmp1 - misc files (remove weekly vs daily)
'--MF--' indicates subdirs receiving files from the mainframe
cnvdatadirs <-- script to create subdirs shown above ===========
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The preceding pages have discussed our file design, which might be summarized as follows:
/home <-- home directories :----prgmr1 :----prgmr2 :----oper1 :----oper2 : /p1 <---- /p1 file system mount point :-----testlibs <-- RUNLIBS=$TESTLIBS=/p1/testlibs : :-----cbls - COBOL programs : :-----jcls - JCL/scripts : :---etc--- - see other subdirs at ADMjobs.htm#2B1 :-----testdata <---- RUNDATA=$TESTDATA=/p1/testdata : :-----mstr - data files (or use topnodes as subdirs) : :-----jobtmp - job temporary files : :---etc--- - see other subdirs at ADMjobs.htm#2B2 : /p2 <---- /p2 file system mount point :-----prodlibs <-- RUNLIBS=$PRODLIBS=/p2/prodlibs : :-----cbls - COBOL programs (production) : :-----jcls - JCL/scripts (production) : :---etc--- :-----proddata : :-----mstr - data files (or use topnodes as subdirs) : :-----jobtmp - job temporary files : /p3 <---- /p3 file system mount point :-----backup - backup & restore directories :-----restore : /p4 <---- /p4 file system mount point :-----cnvdata - data conversion directories : :----d1ebc - EBCDIC data files from mainframe : :----d2asc - converted to ASCII (preserving packed)
export RUNLIBS=/p1/testlibs <-- stub_profile for programmers export RUNDATA=/p1/testdata
export RUNLIBS=/p2/prodlibs <-- stub_profile for operators export RUNDATA=/p2/proddata
alias cdl='cd $RUNLIBS' <-- /p1/testlibs(prgmrs) or /p2/prodlibs(oprtrs) alias cdd='cd $RUNDATA' <-- /p1/testdata(prgmrs) or /p2/proddata(oprtrs)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The preferred design has separate file systems for testlibs, testdata, prodlibs, proddata,& cnvdata. These file systems are mounted on the root file system at mount points /p1 /p2 /p3 /p4 as shown on the previous page.
/home <-- home directories :-----prgmr1 :-----prgmr2 :-----oper1 :-----oper2 /tax - Lynn Valley superdir for cnvdata, testdata,& testlibs :-----cnvdata <-- $CNVDATA=/tax/cnvdata ($symbol for PATH independence) : :-----d1ebc : :-----d2asc - see all cnvdata subdirs on page '4D7' : :-----.etc. :-----proddata <-- $PRODDATA : :-----mstr - see all proddata subdirs on page '4D5' : :-----tape - proddata will be on separate machine for production : :-----.etc. :-----prodlibs <-- $PRODLIBS : :-----cbls - see all prodlibs subdirs on page '4D5' : :-----jcls - prodlibs will be on separate machine for production : :-----.etc. :-----testdata <-- $TESTDATA : :-----mstr : :-----wrk - see all testdata subdirs on page '4D4' : :-----.etc. :-----testlibs <-- $TESTLIBS : :-----cbls : :-----jcls - see all testlibs subdirs on page '4D3' : :-----.etc. :-----backup <-- $BACKUP : :-----..... :-----restore <-- $RESTORE : :-----.....
As mentioned above, it is preferable to have multiple file systems, rather than only 1, but the above design is OK for the test phase, & will be improved for production.
From this point forward, we will use the symbols $CNVDATA, $TESTDATA, etc to make our documentation PATH independent.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
You must copy some control files & functions (supplied with Vancouver Utilities) over to your $TESTLIBS ctl & sfun subdirs.
Here is a cut-down version of the testlibs dtree shown on page '4D3'. We have omitted most subdirs & descriptions to highlight the 'ctl' & the 'sfun' subdirs.
/p1 :-----testlibs <-- RUNLIBS=$TESTLIBS=/p1/testlibs : :--mf--cbl0 : :------ : :--mf--cpy0 : :------ : :--UV--ctl <-- control files (jclunixop41, listcat3I, datafiles43I) : :------ : :--mf--jcl0 : :------ : :--UV--sfun <-- Korn shell functions (jobset51,logmsg,etc)
#1a. Login as appsadm ---> /home/appsadm #1b. cdl --> $TESTLIBS
#2. copy control files #2a. cp $UV/ctl/cnvcob4.tbl ctl # search/replace table for COBOL cnvrtr #2b. cp $UV/ctl/cobdirectives ctl # COBOL DIRECTIVES for compiler #2c. cp $UV/ctl/extfh.cfg ctl # COBOL file handler configuration #2d. cp $UV/ctl/jclunixop41 ctl # options file for JCL converter
#3. copy ksh functions #3a. cp $UV/sfun/jobset51 sfun # job init for insert at begin JCL/scripts #3b. cp $UV/sfun/logmsg1 sfun # console msg function (date/time stamp) #3c. cp $UV/sfun/exportfile sfun # exports Logicalname=Physicalname (non GDG) #3d. cp $UV/sfun/exportgen* sfun # exports Logicalname=Physicalname (GDG)
Note that exportgen* copies exportgen0, exportgen1, & exportgenall. See listings & descriptions on pages '5J0' to '5J5'.
The JCL converter converts DLBLs & TLBLs to exportfile or exportgen. Examples:
exportfile E212653 mstr/e2121653.mtaxe.piscines exportgen0 E212044 tape/tu.f01.e212-no.auxtxj_
When the JCL/scripts are executed, the export... functions will be called via the Korn shell 'FPATH' variable which is defined in the profile as $RUNLIBS/sfun.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# copyvsectls - copy Vancouver Utility control files & functions # required to convert mainframe JCL & COBOL # - by Owen Townsend, UV Software, Oct 04/2008 # # Run this script after creating testlibs/subdirs for JCL/COBOL conversion # # 1. cd $TESTLIBS - might be /home/userxx/testlibs, /p1/testlibs, or ?? # 2. vsetestdirs - setup subdirs required for JCL/COBOL conversion # 3. copyvsectls <-- copy control files & functions for conversion & execution # =========== # # copy control files cp $UV/ctl/cnvcob4.tbl ctl # search/replace table for COBOL cnvrtr cp $UV/ctl/cobdirectives ctl # COBOL DIRECTIVES for compiler cp $UV/ctl/extfh.cfg ctl # COBOL file handler configuration cp $UV/ctl/jclunixop41 ctl # options file for JCL converter cp $UV/ctl/gdgctl51 ctl # GDG control text file cp $UV/ctl/gdgctl51I* ctl # GDG control Indexed file (.dat & .idx) cp $UV/ctl/GDGmkdirs ctl # script to make subdirs for new GDG files cp $UV/ctl/gdgctl51* $TESTDATA/ctl # GDG control files moved to $RUNDATA cp $UV/ctl/GDGmkdirs $TESTDATA/ctl # make subdirs for new GDG files #Apr16/09 - GDG control files moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/... # to allow multiple $RUNDATA's to have different control files # # copy all ksh functions cp $UV/sfun/* sfun # copy all ksh functions used in JCL/scripts #============================ # - cp above copies all functions, here are their descriptions # jobset51 - job init for insert at begin JCL/scripts # jobend51 - job end copy new GDGs from jobtmp to subdirs # jobabend51 - job ABend, ERRmsg & warn new GDGs not updated # logcron1 - console msg for scripts run by cron (date/time stamped) # logmsg1 - console msg (date/time stamp) # logmsg2 - console msg (date/time stamp) reverse video # exportfile - exports Logicalname=Physicalname (non GDG) # exportgen0 - exports for GDG file for current generation # or prior generations, -1, -2, etc # exportgen1 - exports for next generation, +2, +3, etc # stepctl51 - step ctl function for jcpause exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are the 1st 30 lines from the JCL converter control file listed on '3E1'. The options are coded on the 1st line & described on the following 29 lines. You must review & modify these options appropriately for your site.
jclunixop41:d0e1g1i3j1l1p0q0r0s0t12u1y0 #<-- option dflts for VUdoc test/demos # d1 - debug, generate 'echo's for 'cobrun's # e1 - generate 'exportfile' function (vs export) # - to display filenames for console log # g0 - create new GDG's in $RUNDATA/subdir/gdgfile_ # g1 - new GDGs $JGDG relative move to subdir/ at EOJ # g2 - new GDGs $JGDG absolute $RUNDATA/jobtmp/... # i1 - lookup ctl/listcat3I for file info (rcsz,keys,etc) # i2 - lookup ctl/datafiles43I for file info (rcsz,keys) # j1 - insert jobset51 for RUNDATE=ccyymmdd (obsolete ?) # j2 - jobset52 RUNDATE=mm/dd/ccyy old, jobset52 now $JGDG # j4 - might need new optn j4 for RUNDATE=mm/dd/ccyy ? # l1 - generate logmsg1, show script msgs on screen only # l2 - generate logmsg2, appends to joblog/jobname.log # l4 - generate logmsg4 for Bgn/End Job (vs logmsg1/2) # p1 - on COBOL steps, generate printer files as follows: # - exportfile SYS010 $JTMP/$JOBID2_step_$PROGID # - exportfile SYS010L $RPTS/$JOBID2_step_$PROGID_$date # - uvcopy cnvrpt1,fili1=$SYS010,filo1=$SYS010L # q1 - apply TOPNODES table replace/verify 1st Qualifier # r0 - gen cobrun for unix/linux .ints (allow animation) # r1 - gen runw for .ints NetExpress/Windows/UWIN/CYGWIN # r2 - assume executables $DX/program either unix/windows # r16 - execute RPG programs, $RPX/program # s1 - #< comment out SYSIN instream data (for LAVAL) # - instream data extracted separate files jobparms/.. # - export SYS011 defines jobparms/.. file vs $JTMP/.. # t12 - TLBL options for exportgen0/1,tape/,date/time # (t1=date,t2=time,t4=subdir tape/,t8=exportgen0/1) # u1 - convert IEBGENER to uvcp (vs cp default) # u2 - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 files # y1 - customization for CUCBC (printer class changes)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are lines 77-115 from the JCL converter control file:
#----------------------- control table -------------------------------- # controls filename conversion depending on 1 or 2+ nodes ('.'s) # TOPDIRDFL1 - used if only 1 node & not typJM in ctl/datafiles43 # - 'wrk' since 1 node files usually 'SORTOUT's # - temp files, input to following steps, not needed after job ends # TOPDIRDFL2 - used if only 1 node & typJM on ctl/datafiles43 matching filename # - 'M' of typJM stored if ',CAT=' found on DLBL by jcldata41 # TOPDIRINS1 - if specified & no typJM, insert above top-node (retain all '.'s) # - used for all files with 2+ nodes (TOPDIRDFL1/2 used if only 1) # - if TOPDIRINS1/2 unspecified, topnode becomes a directory # TOPDIRINS2 - if specified & typJM, insert above top-node (retain all '.'s) # - OVERRIDDEN if datafiles43I has topr=... or topi=... :CTLTBL: TOPDIRDFL1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRDFL2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINS1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINS2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # #------------------------ TOPNODES table ------------------------------ # table of TOPNODES allowed & replacements (optional) # 01-30 - topnodes allowed # 31-60 - topnode replacements (if col 31 not '~') # - if 01-30 of last entry 'ALLOTHER', any others replaced by 31-60 # - use statmvsjcl1 to create summary table of topnodes used in all JCL # - see www.uvsoftware.ca/mvsjcl.htm#6A2 # - code in lower case since applied at output time(script) vs input(JCL) :TOPNODES: ar~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rpts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ work~~~~~~~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~ ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #Note1 - you must also code valid top-nodes in $RUNLIBS/ctl/GDGmkdirs # - called by jobset51 to setup subdirs for new generations of GDG files # - see listing at MVSJCL.htm#4E6
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
In September 2009, the TOPNODES table feature was added to the VSE JCL converter from similar code in the MVS JCL converter. The TOPNODES table (in the control file, ctl/jclunixop41), allows you to modify the TOPNODES (High Level Qualifiers) on all data filenames (DLBL's & TLBL's).
You might use the :TOPNODES: replace table if you want to use the 'HLQ's as sub-directories in the converted Korn shell scripts. You would also need option 'q1' in ctl/jclunixop41 to activate this feature.
Previously you could use the HLQs as subdirs using 'TOPDIRDFL1/2' in the :CTLTBL: (in ctl/jclunixop41), but this used whatever HLQ was coded on the mainframe filename without modification to a desired set of subdir names.
Note that all TLBL's are automatically converted to GDG files in subdir 'tape/'.
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
Before converting your JCL to Korn shell scripts, you must decide whether to store all your data-files in 1 directory (suggest mstr/...), or to use your top-nodes as subdirs within $RUNDATA.
We will illustrate 'customizing for your topnodes' using the demo files distributed in /home/uvadm/vsetest/testlibs/ctl/... If you performed the demos in Part_1, you would have setup user 'vsetest' & the demo files would now be in /home/vsetest/testlibs/ctl/... ($TESTLIBS/ctl/ & $RUNLIBS/ctl/).
For your own conversion, you would setup a new set of TESTLIBS as illustrated on page '4C3' & populated subdirs cbl0, cpy0, jcl0, proc0, etc with your own COBOL & JCL modules. Page '4C3' shows these subdirs at /p1/testlibs/..., but you can place them wherever desired (& define that path using $RUNLIBS).
Topnode validation & subdir assignment is controlled by the :CTLTBL: & :TOPNODES: tables within the JCL converter control file (ctl/jclunixop41).
The supplied tables reflect the test/demos in Part_1 (using top-node/subdirs ar, gl, py). You should modify the :TOPNODES: table for your valid top-nodes.
You should code your most common top-nodes in the :TOPNODES: (allowed) table & all other (low volume) will be combined into a 'misc' directory.
You must also code your valid topnodes in the '$RUNLIBS/ctl/GDGmkdirs' script, listed on the page '4E6'.
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
1a. Login --> your home directory =====
1b. cdl alias --> your TESTLIBS/RUNLIBS ===
1c. uvcopy statvsejcl1 <-- create summary tables for programs,procs,topnodes ================== - just the 'topnodes' table listed below (see programs & procs tables at CNVaids.htm#4B1)
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*
3a. vi ctl/jclunixop41 <-- edit the JCL conversion control field ================== - replace demo topnodes with your topnodes
4a. vi ctl/GDGmkdirs <-- edit supplied GDGmkdirs script ================ - replace demo topnode/subdirs with yours
See the GDGmkdirs script listed on the next page --->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
'GDGmkdirs' is a script to make the topnode/subdirs in the jobtmp/subdirs used to hold new generations of GDG files, until successful EOJ, when they are moved back to the intended $RUNDATA/subdirs. Here is the demo script distributed in $TESTLIBS/ctl/GDGmkdirs.
# GDGmkdirs - make subdirs for GDG files # - by Owen Townsend, UV Software, Aug 25/2008 # # script in $RUNLIBS/ctl/... called by jobset51 (called by all JCL/scripts) # exportgen1 creates new GDG files in $RUNDATA/$JGDG/subdirs/... # - where: JGDG=$RUNDATA/jobtmp/$JOBID2/GDG/ # - at normal EOJ, GDG files are moved to intended subdirs (NOT if Abterm) # # user must code names of his site's data file subdirs here # - matching the TOPNODEs table in $RUNLIBS/ctl/jclunixop41 # - following subdirs are for the demo JCL/scripts # (at www.uvsoftware.ca/mvsjcl.htm#Part_1) # if [[ ! -d $JTMP ]]; then echo "JTMP not defined or not in \$RUNDATA"; exit 81; fi # # make $JGDG/ for gdg subdirs # also make $GTMP/ for exportgen0/1 'ls' outputs to determine latest gen#s if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi # # You MUST modify following (ar,gl,etc) to the subdirs desired at your site #========================================================================== if [[ ! -d $JGDG/ar ]]; then mkdir $JGDG/ar; fi if [[ ! -d $JGDG/gl ]]; then mkdir $JGDG/gl; fi if [[ ! -d $JGDG/py ]]; then mkdir $JGDG/py; fi if [[ ! -d $JGDG/tape ]]; then mkdir $JGDG/tape; fi if [[ ! -d $JGDG/misc ]]; then mkdir $JGDG/misc; fi exit 0
Note |
|
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 '4D4' for the recommended directory design to receive the libraries onto the unix/linux system. By convention the directories receiving the mainframe modules have suffix '0', intermediate conversions have suffix 1,2,3,etc, and fully converted directories have suffix 's'. Only the '0' subdirs are shown here.
If possible create .zip files on the mainframe. You might name them cbl.zip, cpy.zip, jcl.zip, proc.zip, etc. FTP them into the appropriate subdirs. Then change into each subdir, unzip & remove the .zip file.
/p1 :-----testlibs - RUNLIBS=$TESTLIBS=/p1/testlibs : :------ : :--MF--cbl0 <-- your COBOL programs transferred from mainframe : :------ : :--MF--cpy0 <-- for COBOL copybooks : :------ : :--MF--jcl0 <-- your JCLs transferred from mainframe : :------ : :--MF--proc0 <-- your PROCs transferred from mainframe : :------ '--MF--' - 'MF' indicates subdirs receiving from 'MainFrame'
/p4 :-----cnvdata - $CNVDATA=/p4/cnvdata : :------ : :--MF--cpys <-- COBOL copybooks : :--MF--ctl <-- control files (LISTCAT) : :--MF--d0 <-- data files FTP'd from mainframe (variable length) : :------d0ebc - filenames lower case, '.clus.vseprd' dropped : :------d1ebc - converted to fixed length for conversion : :------d2asc - converted to ASCII (packed/binary preserved) : :------maps - copybooks converted to record layouts : :------pfx1 - uvcopy jobs generated from copybooks : :------.etc. - see other subdirs on page '4D7'
'd0' will hold the data files to be converted.
If possible, create LISTCAT reports on the mainframe & transfer to ctl/listcat0. We will extract record-sizes, indexed keys, etc to guide us in datafile & JCL conversions. See LISTCAT processing on page '4H1'.
The 'copybooks' are used to generate the 'uvcopy jobs' that perform the datafile conversions. Copybooks might be stored directly into $CNVDATA/cpys (to assist datafile conversion), but better if you 1st convert in $TESTLIBS (as instructed on page '4G1') & then copy from $TESTLIBS/cpys to $CNVDATA/cpys.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
COBOL conversion is covered here in the JCL conversion documentation to make this a complete review of all steps required for the several 'Re-Conversions' that may be performed during the mainframe conversion period.
But for your 1st COBOL conversions, you must follow the procedures documented in VSECOBOL.htm. Initial conversions & compiles usually encounter many errors that can be resolved by modifying the search/replace tables provided for reserved word differences & customer site coding peculiarities.
Here in VSEJCL.doc we are summarizing the COBOL re-conversions, that might be performed 2 or 3 times during the conversion/test/debug period, to capture updates that have been made on the mainframe.
cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys cleanup convert copy(cp)
#0a. Login as appsadm ---> /home/appsadm
#0b. cdl --> $TESTLIBS
#1. cnvMF41Ac all <-- convert ALL copybooks from cpy0 to cpy1 & cpy2 ============
#2. cp cpy2/* cpys <-- copy converted copybooks to cpys (used by compiler) ==============
#3. cp cpy2/* $CNVDATA/cpys <-- also copy to $CNVDATA for datafile conversion =======================
cbl0 -------> cbl1 -------> cbl2 --------> cbl3 ----------> cbls -------> cblx cleanup convert copy(cp) sysin cnvt compile
#1. cnvMF41A all <-- convert ALL programs from cbl0 to cbl1 & cbl2 ===========
#2. cp cbl3/* cbls <-- copy converted programs to cbls (used by compiler) ==============
#4. mfcblA all <-- recompile all cobol programs, cbls --> cblx ==========
#5. uvlpd1p cblx .err <-- print 1st page of all .err reports ================= - to guide programmers making corrections - should be very few on these reconversions
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are some handy scripts you can use to re-convert & re-compile 1 copybook or 1 COBOL program at a time (vs prior page ALL copybooks & ALL programs). The scripts are supplied in /home/uvadm/sf/IBM/... & are listed in VSECOBOL.htm#5C1.
cpy0 ---------> cpy1 ---------> cpy2 ----------> cpys cleanup convert copy(cp)
#0a. Login as appsadm or yourself
#0b. cdl --> $TESTLIBS
#1. cnvMF41c cpy0/copybknm.cpy - convert 1 copybook cpy0->cpy1->cpy2 ============================
#2. cp cpy2/copybknm.cpy cpys - copy converted copybook to cpys ========================= - above script prompts for this
#3. cp cpy2/copybknm.cpy $CNVDATA/cpys - also copy to $CNVDATA ================================== - for datafile conversion
cbl0 -------> cbl1 -------> cbl2 ------> cbl3 ------> cbls ------> cblx cleanup convert acpt cnv --- prompt for copy & compile --- copy(cp) compile
#1. cnvMF41 cbl0/progname.cbl - convert 1 program cbl0->cbl1->cbl2->cbl3 ========================= (prompts to copy cbl3->cbls)
#2. cp cbl3/progname.cbl cbls - copy cnvrtd program to cbls ========================= (if you replied`'n' above)
#3. mfcbl1 progname.cbl - recompile 1 cobol program cbls-->cblx ===================
#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. 'catgut41' will extract filenames, avg-recsize, max-recsize, indexed key start(lth) onto 1 line per file.
Initial data conversions must be performed as instructed in VSEDATA.htm. Here in VSEJCL.doc, we are covering 'Re-Conversion', because you might reconvert all JCL,COBOL,DATA 2 or 3 times during conversion period
You will not recreate the DATA conversion control file ($CNVDATA/ctl/ctlfile4), because it required manual editing to add copybook names.
But you might want to recreate the 'JCL conversion control file' ($TESTLIBS/ctl/listcat3I), because a newer LISTCAT from the mainframe might provide more accurate information on the datafiles for the JCL converter.
#1a. Login as appsadm ---> /home/appsadm
#1b. cdc --> $CNVDATA
#2. uvcopy catgut41,fili1=ctl/listcat0,filo1=ctl/listcat1 ===================================================== - extract data conversion info from mainframe LISTCAT report
#3. sort -o ctl/listcat2 ctl/listcat1 ================================= - sort by data file name, see sample listing on page '4I11' - see full listing at VSEDATA.htm#8B1.
#4. uvlp12 ctl/listcat2 <-- list the output file ===================
#5. vi ctl/listcat2 <-- edit the listcat extract =============== - drop unwanted files (not required for conversion) - add any missing files (not on disc when LISTCAT run)
#6. uvlp12 ctl/listcat2 <-- re-list the listcat extract report =================== - store in 3 ring binder for frequent reference during conversion
#7. cp ctl/listcat2 $TESTLIBS/ctl ============================ - copy listcat2 from $CNVDATA to $TESTLIBS for later use in JCL conversion - see JCL/script conversions using listcat2 on page '4I12'
Note |
|
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 VSEDATA.htm. VSEDATA.doc shows you how to generate the data conversion 'uvcopy jobs' from the COBOL copybooks. This can be completely automatic, unless you have files with multiple record types, in which case some manual coding is required.
For subsequent DATA file conversions, you can use the data conversion uvcopy jobs that were generated (& modified) during the initial conversion. You may need changes to some jobs if the mainframe copybooks change during the conversion period.
Here in VSEJCL.doc, we will briefly review how to re-convert datafiles, assuming the data conversion jobs have already been generated as documented in VSEDATA.htm#Part_4. You can use the data re-convert instructions when you re-transfer data files from the mainframe, which you might do several times during the testing period.
BUT, if you change any copybooks (from which data conversion jobs are generated) or the control file ctl/datacnv44I (which relates copybooks to datafilenames & provides file types & keys), then you must refer to VSEDATA.htm#PART_4 to re-generate the data conversion 'uvcopy jobs' in $CNVDATA/pfx3.
Note |
|
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p4/cnvdata/ <-- Data conversion superdir ($CNVDATA) :-----cpys - COBOL copybooks :-----ctl - conversion control files :-----maps - 'cobmaps' record layouts generated from copybooks :-----pfx1 - conversion jobs generated from COBOL copybooks by 'uvdata41' :-----pfx2 - conversion jobs with actual datafile names & indexed keys : - coded by utility 'uvdata52' using control file ctl/datacnv54I :-----pfx3 - uvcopy jobs copied from pfx2 & modified for various reasons : - for Multi Record Type files (insert code to test types) : - will execute the jobs from pfx3
cpys ---------> maps ---------> pfx1 ---------> pfx2 ----------> pfx3/... cobmap1 uvdata41 uvdata52 cp & vi (data cnvt jobs) (ctl file req'd)
The data conversion jobs are generated from the COBOL copybooks, but we also need a control file to relate the copybooks to the datafilenames, and also to supply file types, indexed keys, etc.
The mainframe 'LISTCAT' report is the best place to get this information. We can transfer the mainframe file & extract the information into a control file used in the conversion job generations. See procedures at VSEDATA.htm#4E1 thru page 4F6.
mainframe unix/linux LISTCAT -----> ctl/listcat0 ---------> ctl/datacat41 ----------> ctl/datacnv54I FTP catdata41 (many steps omitted)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/p4/cnvdata/ <-- Data conversion superdir ($CNVDATA) :-----cpys - COBOL copybooks :-----ctl - conversion control files :-----maps - 'cobmaps' record layouts generated from copybooks :-----pfx1 - conversion jobs generated from COBOL copybooks by 'uvdata41' :-----pfx2 - conversion jobs with actual datafile names & indexed keys :-----pfx3 - uvcopy jobs copied from pfx2 & modified for multi R/T files : - will execute the uvcopy jobs from pfx3
/p4/cnvdata/ <-- DATA files in same superdir as Generation subdirs :-----d0ebc <-- EBCDIC data files FTP'd from mainframe : :---AR.DATA.FILE1 - filenames UPPER case : :---GL.DATA.FILE1(0) - GDG file suffixes (0), G1234V00, etc : :---GL.DATA.FILE2.G1234V00 - GDG file suffixes (0), G1234V00, etc : :---...etc... :-----d1ebc <-- EBCDIC data filenames changed to unix stds : :---ar.data.file1 - filenames lower case : :---gl.data.file1_000001 - GDG file suffixes changed to VU conventions : :---gl.data.file2_000001 - GDG file suffixes changed to VU conventions : :---...etc... :-----d2asc <-- to receive ASCII conversions : :---ar.data.file1 - ASCII data files from most recent conversion : :---gl.data.file1_000001 - copy from here to refresh testdata subdirs : :---gl.data.file2_000001 - copy from here to refresh testdata subdirs : :---...etc...
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
$CNVDATA/ctl/ctlfile4 is a very imporatnt file used in generating the uvcopy jobs that perform the EBCDIC to ASCII data conversions.
ctlfile4 can be generated from the mainframe LISTCAT report as documented at VSEDATA.htm#1E2, but you must manually enter the copybook names into the slots provided.
If the LISTCAT report is not available you could construct ctlfile4 with the editor. The number of datafiles that need to be converted may be a lot less than the number of files shown on the LISTCAT report.
ctlfile4 is listed here in VSEJCL.doc to help you understand the entire conversion, but you MUST use the procedures documented on pages 1E1-1F1 of VSEDATA.htm#1E1 to GENERATE the conversion jobs.
But once the data conversion jobs have been generated, tested,& debugged you can easily EXECUTE them by following the procedures here in VSEJCL.doc.
During the conversion period you may want to refresh the data from the mainframe 2 or 3 times & of course on the 'go live' weekend.
e2121653.mtaxe.piscines cpy=e212159b rca=00082 rcm=00082 rcf=00128 key=000(020) e2121656.itaxe.facturat cpy=e212037b rca=00078 rcm=00245 rcf=00320 key=000(036) e2122683.itaxe.degrevem cpy=e212047b rca=00158 rcm=00265 rcf=00320 key=000(037) e2122941.mtaxe.permispn cpy=e212941b rca=00045 rcm=00045 rcf=00128 key=000(022) e2122942.mtaxe.droitmut cpy=e212942b rca=00030 rcm=00030 rcf=00128 key=000(011) e2122945.mtaxe.crtconst cpy=e212909b rca=00275 rcm=00275 rcf=00320 key=000(015) e2122951.mtaxe.matrenov cpy=e212910b rca=00050 rcm=00050 rcf=00128 key=000(022) e2122956.mtaxe.crtrenov cpy=e212912b rca=00270 rcm=00270 rcf=00320 key=000(026) e2123001.itaxe.banqtaxe cpy=e212001b rca=00066 rcm=00383 rcf=00448 key=000(036) e2123002.itaxe.taxation cpy=e212007b rca=00046 rcm=00383 rcf=00448 key=000(035) e2123003.itaxe.transdam cpy=e212024b rca=00464 rcm=00464 rcf=00512 typ=RSR e2123005.mtaxe.tpcalcul cpy=e212025b rca=00081 rcm=00081 rcf=00128 key=000(029) e2123691.itaxe.indexenc cpy=e212156b rca=00036 rcm=00036 rcf=00128 key=000(036) e2123692.itaxe.encaisse cpy=e212055b rca=00300 rcm=00426 rcf=00512 key=000(022) e2123693.itaxe.tranksds cpy=e212056b rca=00168 rcm=00453 rcf=00512 key=000(017) e2124696.itaxe.renovati cpy=e212061b rca=00036 rcm=00117 rcf=00192 key=000(036) e2125504.mtaxe.paracomp cpy=e212138b rca=00104 rcm=00307 rcf=00384 key=000(034) e2125520.mtaxe.indxpara cpy=e212136b rca=00066 rcm=00272 rcf=00320 key=000(034) e2126863.mtaxe.matadmis cpy=e212863b rca=00050 rcm=00050 rcf=00128 key=000(022) e2127546.mtaxe.donmarch cpy=e212142b rca=00152 rcm=00245 rcf=00320 key=000(020) e2146011.mtaxe.mapaqagr cpy=e214011b rca=00160 rcm=00160 rcf=00256 key=000(036) tu.f01.e211801.adrpos cpy=e212105b rca=00250 rcm=00307 rcf=00384 typ=IDXf8v tu.f01.e212-no.trperm cpy=e221004b rca=00080 rcm=00080 rcf=00128 typ=RSF tu.f01.e212-no.eauctr cpy=compteau rca=00606 rcm=00606 rcf=00640 typ=RSF
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
MF---->d0-------->d0ebc--------->d1ebc------------>d2asc-------->$TESTDATA/mstr #1 FTP #2 copy #3 var->fix #4 EBCDIC->ASCII #5 fix->var rename
#1a. Login as appsadm --> /home/appsadm
#1b. cdc ---> $CNVDATA ('cdc' is an alias in common_profile)
#2. cp d0/* d0ebc ============= - copy datafiles to alt subdir for filename changes
#3a. renameL d0ebc ============= - translate datafilenames to lower case (standard for unix/linux)
#3b. rename-X d0ebc .clus.vseprd =========================== - remove unwanted suffixes (.clus.vseprd, .clus.vsedev, etc) - do not apply to unix, do not need test/production indicators - test/prod provided by differences in profiles for prgrmrs/oprtrs with no need to have different filenames (or JCL/scripts)
#4. uvcopyxx 'pfv2/*' ================= - execute all uvcopy jobs to convert all datafiles from variable to fixed - copies all files from d0ebc/... to d1ebc/... - dropping the 2 byte binary prefix on varlth records - padding records with x'00's to a fixed length spcfd in the ctlfile - inserting recsize info string: <1=recsz<2=maxsz<3=fixsz<K=dsp(lth) in the space between record maxsz & fixsz spcfd in control file - files without 2 byte prefix are identified by 'typ=RSF' in the ctlfile which generated an fixlth version uvcopy job (vs varlth default)
#5. uvcopyxx 'pfx3/*' ================= - execute ALL uvcopy jobs in pfx3/... to convert all data files - copies all data files from d1ebc/... to d2asc/... - translating char fields from EBCDIC to ASCII - preserving any packed/binary fields (same as on mainframe)
#6. uvcopyxx 'pfy3/*' ================= - execute All uvcopy jobs in pfy3/... to restore original record sizes (original record sizes were saved at the end of extended records) - copies all data files from d2asc/... to d3asc/...
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
After data file conversion & before we can begin testing, we need to copy the converted data files from $CNVDATA/d2asc/... to $TESTDATA/mstr/...
#7a. rm -f $TESTDATA/mstr/* <-- remove old test data files ======================
#7b. cp $CNVDATA/d3asc/* $TESTDATA/mstr ================================== - copy all converted files to $RUNDATA for testing
You might repeat above 7a & 7b several times during testing to 'refresh' the test data files back to an initial known state.
Note |
|
Before the 'pfy3/*' uvcopy jobs were developed sizes, we used uxcp & uxsort scripts to to restore original record sizes. You should be able to use such scripts for special situations you may encounter.
Please see VSEDATA.htm#Part_4 for examples of uxcp/uxsort scripts to perform various data reformatting jobs:
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
As already stressed on page '4I1' you must already have generated the datafile conversion jobs using the procedures documented in VSEDATA.htm.
You may need to convert 1 data file if some files were missed during the initial conversion or you need to transfer & convert the current datafile from the mainframe.
MF---->d0-------->d0ebc--------->d1ebc------------>d2asc-------->$TESTDATA/mstr #1 FTP #2 copy #3 var->fix #4 EBCDIC->ASCII #5 fix->var rename
#1a. Login as appsadm or as yourself
#1b. cdc ---> $CNVDATA ('cdc' is an alias in common_profile)
#2. cp d0/datafilename d0ebc ======================== - copy the datafile to alt subdir for filename changes
#3a. renameL d0ebc ============= - translate datafilenames to lower case (standard for unix/linux) - renameL can be used for 1 file or all files in directory
#3b. rename-X d0ebc .clus.vseprd =========================== - remove unwanted suffixes (.clus.vseprd, .clus.vsedev, etc) - rename-X can be used for 1 file or all files in directory
#4. uvcopy pfv2/datafilename ======================== - execute 1 uvcopy jobs to convert 1 datafile from variable to fixed - copies the file from d0ebc/... to d1ebc/... - dropping the 2 byte binary prefix on varlth records - padding records with x'00's to a fixed length spcfd in the ctlfile - inserting recsize info string: <1=recsz<2=maxsz<3=fixsz<K=dsp(lth)
#5. uvcopy pfx3/datafilename ======================== - execute 1 uvcopy job to convert 1 datafile - copies the datafile from d1ebc/... to d2asc/... - translating char fields from EBCDIC to ASCII - preserving any packed/binary fields (same as on mainframe)
#6. uvcopy pfy3/datafilename ======================== - execute 1 uvcopy job to restore original record sizes - as we copy from d2asc/... to d3asc/...
#7. cp d3asc/datafilename $TESTDATA/mstr ==================================== - copy datafile over to $TESTDATA subdirs for testing
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Before the 'pfy3/*' uvcopy jobs were developed sizes, we used uxcp & uxsort scripts to to restore original record sizes. You should be able to use such scripts for special situations you may encounter.
Please see VSEDATA.htm#Part_4 for examples of uxcp/uxsort scripts to perform various data reformatting jobs:
The following examples are listed later in VSEDATA.htm#Part_4. You can use them as templates to help you create uxcp/uxsort scripts for loading other data files.
#1. sfload/copyRSF_tu.f01.e212-no.trperm ==================================== - copy sequential data (originally tape)
#2. sfload/sortIDXf1_e2121653.mtaxe.piscines ======================================== - copy/sort/load Fixed length Indexed file
#3. sfload/sortIDX8_e2123002.itaxe.taxation ======================================= - copy/sort/load Variable length Indexed file
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Most mainframe conversion sites choose to use the topnode as a sub-directory on the unix/linux target systems. UV software provides the 'copy2nodes' script to facilitate this.
#24. rm -rf $TESTDATA/* <-- remove all subdirs from testdata dir ==================
#25. vsedatadirs <-- recreate the basic subdirs required in testdata =========== - jobtmp, joblog, rpts, sysout, tmp, wrk
#26. copy2nodes d2asc $TESTDATA ========================== - copy all converted datafiles, creating subdirs from topnodes (subdir created when new topnode 1st encountered)
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We have already shown on page '4H1' how the mainframe LISTCAT is used to create the 'DATA conversion control file' ($CNVDATA/ctl/ctlfile4).
Here we will illustrate how to use the LISTCAT info to also create a 'JCL conversion control file' ($TESTLIBS/ctl/listcat3I). The JCL converter will still run without ctl/listcat3I, but the conversion will be improved if it is available.
Page '4H1' showed how record-sizes & indexed file key locations are extracted from the mainframe LISTCAT report into a control file (ctl/listcat2), which has 1 line per datafile with file info coded as keywords (rca=... rcm=... key=...).
For the initial conversion, you must use the step by step method documented on page '4K1'. For subsequent JCL conversions, you can use the 'jcl2ksh41A' script to perform all steps of JCL conversion with 1 command (see page '4N2'). But the ctl/listcat3I file should be prepared & loaded before you run jcl2ksh41A.
Note that step#3 in jcl2ksh41A is utility job 'jcldata41', which extracts all DLBLs/TLBLs from all JCL. These are sorted & duplicates dropped resulting in 1 line per unique datafilename found in all JCL. The output is written to $TESTLIBS/ctl/datafiles41.
The JCL converter uses the 2 Indexed files above to get file characteristics. 'listcat3I' has priority over 'datafiles43I'. The 'M' in 'typLM...' assigns these files to mstr/..., else to wrk/..., but TLBL files to tape/...
You can customize your conversion by modifying ctl/listcat3 & reloading the indexed file version ctl/listcat3I (using the 'loadcat3I' uvcopy job supplied).
You cannot customize datafiles41 since it is generated as part of the JCL conversion process, but you can create ctl/datafiles42 which is sorted with datafiles41 before loading ctl/datafiles43I used by the JCL converter.
To help you understand the process, the next page will show you a few lines of the control files before & after the jcldata42 updates.
If you are not already familiar with the subdirs in $CNVDATA & $TESTLIBS, please review them on pages '4D7' & '4D3'.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
listcat3I is created by transferring the mainframe LISTCAT report, processing (as shown on page '4H1' & '4I12'),& loading into an indexed file.
e2121653.mtaxe.piscines rca=00082 rcm=00082 key=000(020) typLMC=IDXf1 e2121656.itaxe.facturat rca=00083 rcm=00239 key=000(036) typLMC=IDXf8v e2121853.mtaxe.b8409d35 rca=00024 rcm=00024 key=000(011) typLW_=IDXf1 e2122683.itaxe.degrevem rca=00158 rcm=00265 key=000(037) typLMC=IDXf8v e2122941.mtaxe.permispn rca=00045 rcm=00045 key=000(022) typLMC=IDXf1 e2122942.mtaxe.droitmut rca=00030 rcm=00030 key=000(011) typLMC=IDXf1 e2123001.itaxe.banqtaxe rca=00126 rcm=00383 key=000(036) typLMC=IDXf8v e2123002.itaxe.taxation rca=00046 rcm=00383 key=000(035) typLMC=IDXf8v e2123003.itaxe.transdam rca=00464 rcm=00464 key=000(000) typLMC=RSR e2123004.itaxe.tranjour rca=00464 rcm=00464 key=000(000) typLW_=RSF e2123005.mtaxe.tpcalcul rca=00081 rcm=00081 key=000(029) typLMC=IDXf1 e2123086.itaxe.encapost rca=00080 rcm=00080 key=000(000) typLW_=RSF e2123691.itaxe.indexenc rca=00036 rcm=00036 key=000(036) typLMC=IDXf1 e2123692.itaxe.encaisse rca=00146 rcm=00426 key=000(022) typLMC=IDXf8v e2123693.itaxe.tranksds rca=00168 rcm=00453 key=000(017) typLMC=IDXf8v
e1133081.tfadm.b8306j02 rca=00464 rcm=00464 key=000(000) typJWV=RSF e2121653.mtaxe.piscines rca=_____ rcm=_____ key=000(000) typJWV=RSF e2121656.itaxe.facturat rca=00083 rcm=00239 key=000(036) typJWV=IDXf8v e2122680.ttaxe.b8401d30 rca=03180 rcm=03180 key=000(000) typJWV=RSF e2122683.itaxe.degrevem rca=00158 rcm=00265 key=000(037) typJWV=IDXf8v e2122951.mtaxe.matrenov rca=_____ rcm=_____ key=000(000) typJWV=RSF e2122958.ttaxe.b8409d36 rca=00236 rcm=00236 key=000(000) typJWV=RSF e2123001.itaxe.banqtaxe rca=00126 rcm=00383 key=000(036) typJWV=IDXf8v e2123002.itaxe.taxation rca=_____ rcm=_____ key=000(000) typJWV=RSF e2123003.itaxe.transdam rca=_____ rcm=_____ key=000(000) typJWD=RSF e2123004.itaxe.tranjour rca=00464 rcm=00464 key=000(000) typJWV=RSF e2123005.mtaxe.tpcalcul rca=00081 rcm=00081 key=000(029) typJWV=IDXf1 e2123010.ttaxe.sommtrie rca=00464 rcm=00464 key=000(000) typJWV=RSF e2123011.ttaxe.rembours rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v e2123013.ttaxe.c3001d31 rca=00360 rcm=00360 key=000(000) typJWV=RSF e2123013.ttaxe.rembtrie rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v tu.f01.e211801.adrpos rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f01.e212-no.eauctr rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f01.e212-no.trperm rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f02.bkfaver.90-m07 rca=_____ rcm=_____ key=000(000) typJWT=RSF
The JCL converter uses the 2 Indexed files above to get file characteristics. 'listcat3I' has priority over 'datafiles43I'. The 'M' in 'typLM...' assigns these files to mstr/..., else to wrk/..., but TLBL files to tape/...
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Most of these procedures are automatic, but we provide you an opportunity to enhance the JCL conversion by manually updating the listcat2/3/3I control file to add datafiles that are missing from LISTCAT or to update file characteristics that you want to change for unix/linux.
You might only need to transfer & extract file info from LISTCAT once at the begining of the conversion, but you might update listcat3 & reload listcat3I several times to improve the conversion results.
We assume here that you have completed the procedures shown on page '4H1' to extract file info from LISTCAT. Those procedures may have already transferred listcat2 from $CNVDATA/ctl/... to $TESTLIBS/ctl/..., but we will repeat that step again in the instructions below.
#1a. Login as yourself or appsadm
#1b. cdl ---> $TESTLIBS
#2. cp $CNVDATA/ctl/listcat2 ctl ============================ - copy LISTCAT info from data conversion superdir to JCL conversion dir
#3. cp ctl/listcat2 ctl/listcat3 ============================ - copy/rename to protect future edits in listcat3 - data convert procedures copy to listcat2, never to listcat3 - only these JCL procedures will copy listcat2 to listcat3 & edit as reqd
#4. vi ctl/listcat3 =============== - update LISTCAT info as desired - add files missing when LISTCAT created on mainframe - modify/append keyword info on existing files as desired
Note |
|
#5. uvcopy loadcat3I,fili1=ctl/listcat3,filo1=ctl/listcat3I ======================================================= - load LISTCAT info into Indexed file used by JCL converter
#5a. uvcopy loadcat3I <-- same but easier (files default as shown above) ================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
You should perform the initial conversion of All Your JCL, using the step by step method documented in this section. Then you should test/debug 1 or 2 JCL/scripts to verify the conversions.
From the testing & debugging 1 or 2 JCL/scripts you may find improvements that can be made to the JCL converter options file (ctl/jclunixop41) & to the data information file (ctl/datactl53I). After modifying these control files you can reconvert the 1 or 2 JCLs using the 'jcl2ksh41' script (page '4N1')
After you are satisfied with the conversion & testing of 1 or 2 JCL/scripts, you can the use the 'jcl2ksh41A' script to reconvert all JCL/scripts, to realize the improvements in all JCL/scripts.
This works well because automatic conversions stop at jcl3, & we copy JCL/scripts from jcl3 to jcls, only when we are ready to test/debug each JCL/script.
** directories involved in JCL conversion ** /p1 :-----testlibs - RUNLIBS=$TESTLIBS=/p1/testlibs : :----- : :--MF--ctl <-- control files : :------ - jclunixop41 specifies options for JCL conversion : :------ - listcat3I supplies file types,recsizes,indexed keys : :------ - datafiles41 (filenames) extracted from all JCL : :------ supplies file info for files missing from listcat3I : :------ (because work files scratched, not present for LISTCAT) : :------ - you can edit datafiles42 to override datafiles41 entries : :------ : :--MF--jcl0 <-- your JCLs transferred from mainframe : :------jcl1 - intermediate conversion 73-80 cleared : :------jcl2 - PROCs expanded from procs : :------jcl3 - JCLs converted to Korn shell scripts : :------jcls - copy here manually 1 by 1 during test/debug : :----- : :--MF--proc0 <-- your PROCs transferred from mainframe : :------ : :--MF--slis <-- SLI library may be included in JCLs : :------
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/testlibs ===========================
Note |
|
#5a. login appsadm --> /home/appsadm
#5b. cd $RUNLIBS <-- change to the conversion superdir '/p1/testlibs'
#5b. cdl <-- same as above but easier === alias cdl='cd $RUNLIBS' is defined in the profile
#5c. mvslibsdirs <-- setup 30 subdirs for JCL & COBOL conversions ===========
#6a. copyvsectls <-- script to copy control files from /home/uvadm/ctl =========== to $RUNLIBS/ctl/...
#7a. vi ctl/jclunixop41 <-- 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 (jcl2ksh41A), be prepared to revert to the step by step method if you have problems. Or you could activate 'console logging' to capture all screen messages, or you could login from a 'putty' terminal with a large windows history.
#1. Login as appsadm ---> /home/appsadm
#2a. cd $TESTIBS <-- change to the conversion superdir '/p1/testlibs' ===========
#2b. cdl <-- same as above but easier === alias cdl='cd $RUNLIBS' is defined in the profile
#2c. cd $TESTIBS <-- also same as above, since RUNLIBS=TESTLIBS at this point ===========
#3. jcl2ksh41A all <-- convert JCL thru all steps, as illustrated below ============= - reply null (take default) at all prompts - or reply 'y' for prompts that demand a y/n response - see jcl2ksh41A script listed on page '9A2'
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls cleanup PROC/SLI expand convert to ksh copy 1 at a time (before test/debug)
Note |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#0a. Login as yourself or appsadm
#0b. cdl ---> $TESTLIBS
#1. cleanup mainframe JCL, PROCs, SLIs,& PARMs (strip CR's, clear cols 73-80, & shorten to last nonblank).
#1a. uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl #<-- cleanup JCL ================================================ #1b. uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.prc #<-- cleanup PROCs =================================================== #1c. uvcopyx cleanup sli0 slis uop=q0i7g8n1,arg1=.sli #<-- cleanup SLIs ================================================ #1d. uvcopyx cleanup parm0 parms uop=q0i7g8n1 #<-- cleanup parms ========================================
#2. jclpx41 jcl1 jcl2 procs slis =========================== - expand procs as we copy JCL from subdir jcl1 to subdir jcl2
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
#3. uvcopy jcldata41,fild1=jcl2,filo2=ctl/datafiles41 ================================================= - generate data info file for JCL converter - extract DLBLs/TLBLs from all JCL, sort, drop dups
#3. uvcopy jcldata41 <-- same as above (files default as shown) ================
e2121656.itaxe.facturat rca=00083 rcm=00239 key=000(036) typJWV=IDXf8v e2122683.itaxe.degrevem rca=00158 rcm=00265 key=000(037) typJWV=IDXf8v e2123001.itaxe.banqtaxe rca=00126 rcm=00383 key=000(036) typJWV=IDXf8v e2123002.itaxe.taxation rca=_____ rcm=_____ key=000(000) typJWV=RSF e2123003.itaxe.transdam rca=_____ rcm=_____ key=000(000) typJWD=RSF e2123004.itaxe.tranjour rca=00464 rcm=00464 key=000(000) typJWV=RSF e2123005.mtaxe.tpcalcul rca=00081 rcm=00081 key=000(029) typJWV=IDXf1 e2123013.ttaxe.c3001d31 rca=00360 rcm=00360 key=000(000) typJWV=RSF e2123013.ttaxe.rembtrie rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v tu.f01.e211801.adrpos rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f01.e212-no.eauctr rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f01.e212-no.trperm rca=_____ rcm=_____ key=000(000) typJWT=RSF
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Note |
|
Note |
|
#4. vi ctl/datafiles42 <-- create ctl/datafiles42 to override file info ================== on matching filenames in ctl/datafiles41
#4a. >ctl/datafiles42 <-- OR --> create null file required for uvsort ================ - in sortload43I that sorts files together
#5. sortload43I <-- sort datafiles41 + datafiles42 & load datafiles43I ===========
#6. jclxx41 jcl2 jcl3 <-- convert expanded JCL to Korn shell scripts ================= - JCL converter called for each JCL found in jcl2 & ksh written to jcl3 - uses ctl/datafiles43I (loaded above)
Note |
|
Here is the alternative to the above 'step by step' conversion documented on the previous 4 pages. You were advised to use the 'step by step' method for your 1st conversion to better understand & detect errors sooner.
But, do use the 'jcl2ksh41A' script for your subsequent re-conversions after you have proven the conversions work OK at your site.
#1. jcl2ksh41A all <-- convert JCL thru all steps, as illustrated above ============= - reply null (take default) at all prompts - or reply 'y' for prompts that demand a y/n response - see jcl2ksh41A script listed on page '9A2'
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls cleanup PROC/SLI expand convert to ksh manual copy
Note |
|
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.
Optional jobs are documented very briefly in Part 4 with references to details & examples in Part_5 or Part_6.
4L1. | Create GDG control file (used to get no of generations for GDG files) |
- see complete details & examples in Part 5 | |
- could initially create empty Indexed file so you test non-GDG jobs | |
as shown here in Part 4 on page '4L1' below. |
4L2. | Cross References for COBOL & JCL/scripts are a big help for test/debug. |
Generate & print the cross-references now before you begin test/debug. | |
See XREFjobs.htm for illustrations & operating instructions |
4L3. | Job-Flow reports are also a big help for test/debug. |
- show the datafile I/O from step to step | |
- generate all reports in subdir jobflow/... & print as needed | |
See XREFjobs.htm#Part_5 for illustrations & operating instructions |
4L4. | Extract control cards from JCL to separate files |
- optional jobs to extract control cards from all JCLs so you can update | |
them separately form the JCL/scripts. | |
- control card files are date-stamped to allow updates for future dates. | |
- see complete details & examples begining on page '6A1'. |
The VSE mainframe did not have GDG files, but we have found them useful to supply tape generation handling for VSE conversions. The Vancouver Utility GDG system was enhanced in May 2007, and some features now surpass the MVS mainframe implementation.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Before you can execute any JCL/scripts, you must create the GDG control file. 'ctl/gdgctl51I' is an Indexed file that is accessed by GDG functions (exportgen0, exportgen1,& gdgupab1) to supply the number of generations for each datafile & also to record a history of the last 14 accesses or errors).
Please study 'Part_5' for complete details, but if you are anxious to run some jobs (that do not contain GDG files), here is the minimum instructions with a few explanations.
Utility job 'jcldata56' will read all JCL, extract all DSN's,& sort with data reduction to 1 line per unique filename. The output file is then reformatted into the gdgctl layout & loaded into the Indexed file by 'gdgload1'.
#1a. login vsetest,appsadm,or yourself --> /home/vsetest,appsadm,homedir
#1b. cdl --> $TESTLIBS (/home/vsetest, /p1/testlibs, ???) - see directories,profiles,$RUNLIBS,etc discussed page '1A1' +
#2. [ jcl2ksh41A all ] <-- we assume JCL conversion already completed ================= - left all converted scripts in jcl3/...
#3. uvcopy jcldata56,fild1=jcl3,filo2=ctl/datafiles56 =================================================
#3a. uvcopy jcldata56 <-- same as above (files default as shown) ================ - sample output shown below
gl/account.master_ gdg=99 gl/account.trans_ gdg=99 opt=c
These samples are based on the test/demo JCLs shown in Part_1 (but most lines removed for this illustration).
#4. cp ctl/datafiles56 $RUNDATA/ctl/gdgctl51 ======================================== - copy/rename for GDG control file
Note |
|
#5. cdd (alias cdd='cd $RUNDATA') --> /home/vsetest/testdata ===
#6. vi ctl/gdgctl51 <-- edit to modify no of generations as desired =============== - replace any $SYMBOLS with values
#7. uvcopy gdgload1,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I ====================================================== - load Indexed file to supply file info to JCL converter
#7a. uvcopy gdgload1 <-- same but easier (files default as shown above) ===============
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
'jobparmx1' will extract jobparms (control cards, dates,etc) from JCL/scripts into separate files that may be updated before JCL/scripts run.
Control files will have a date-stamp appended (current date at gen time) Run control administrators may duplicate the files & append future dates which will be selected when the current data reaches or passes file dates
Also see 'jobparms1' which will be run at 6PM (before batch shift) to copy $RUNLIBS/jobparmx1/* to $RUNDATA/jobparms1, selecting the appropriate control card from any multiple dates for any 1 jobname_step_program
Here is brief documentation for this optional job. Please see page '6A1' for complete details with examples.
#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 convert a new JCL, specify the JCL/script name via ',arg1=...' The instrns below will output directly to jobparmx1/jobparmx2.
You could use tmp1/tmp2 to ensure no overwriting files in jobparmx1/jobparmx2. 'arg1=...' may specify a prefix to extract control cards from all JCL/scripts matching the prefix specified.
#1. cd $RUNLIBS <-- change to libraries (where jcls area)
#2. uvcopy jobparmx1,fild1=jcls,fild2=jobparmx1,fild3=jobparmx2,arg1=jclprefix ========================================================================== - extract control cards from 1 JCL/script direct to jobparmx1/jobparmx2 - 'jcl2ksh41' (convert 1 JCL) uses arg1=jclname
'jcl2ksh41' script to convert 1 JCL prompts you to run the above command to extract the embedded control cards for the 1 job being converted.
This is brief documentation for this optional job. Please see page '6A1' for complete details with examples.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The previous section '4J1' - '4K3' documented the initial conversion of All JCL. Now you should test/debug 1 or 2 JCL/scripts to verify the conversions.
From the testing & debugging 1 or 2 JCL/scripts you may find improvements that can be made to the JCL converter options file (ctl/jclunixop41) & to the data information file (ctl/listcat3I). After modifying these control files you can reconvert the 1 or 2 JCLs using the 'jcl2ksh41' script (page '4N1')
After you are satisfied with the conversion & testing of 1 or 2 JCL/scripts, you can the use the 'jcl2ksh41A' script to reconvert all JCL/scripts, to realize the improvements in all JCL/scripts.
This works well because automatic conversions stop at jcl3, & we copy JCL/scripts from jcl3 to jcls, only when we are ready to test/debug each JCL/script.
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls cleanup PROC/SLI expand convert to ksh prompt & copy
We will present the operating instructions for jcl2ksh41 & jcl2ksh41A on page '4N1' & '4N2', but 1st we will remind you of a few aids to assist you in testing & debugging. These & many more aids were 1st presented in 'Part_2'.
2a. joblog1A - 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 ============
joblog1 28401d23.ksh <-- execute&capture log in $TESTLIBS/joblog/28401d23.log ====================
joblog1A 28401d23.ksh <-- execute&capture log in $TESTDATA/joblog/28401d23.log ===================== - the 'A' version also turns on COBOL Animation - saves having to 'export ANIM=+A' to animate
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
You can use the 'testdatainit' script before running your JCL/script tests, to clear out any old outputs & enable you to more easily examine the outputs of your current test runs.
You can run testdatainit anytime, if you have changed your profile to define TESTDATA as a subdir in your homedir, or if you know that no other programmers are currently testing & do not need to retain any existing outputs.
$TESTDATA : :-----ftp --- : :-----jobctl 0 <-- '0' marks subdirs cleared by testdatainit : :-----joblog 0 : :-----jobparms1 --- SYSIN data cards, originally embedded in JCL jobparmx1 utility extracts to $TESTLIBS/jobparmx1 dates appended to allow updates for future runs jobparms1 utility copies current cards each day from $TESTLIBS/jobparmx1 dropping date stamps : :-----jobparms2 --- SYSIN data cards that do not need updates : :-----jobtmp 0 : :-----mstr --- Master datafiles : :-----rpts 0 : :-----sysout 0 : :-----tape -?- Tape files (might clear if only outputs) : :-----tmp 0 : :-----wrk 0
#1. cdd <-- change to $TESTDATA superdir
#2. testdatainit <-- run the testdatainit script ============ <-- will prompt y/n to proceed or not --> y <-- to proceed or 'n' to cancel
#3. joblog1 28401d23.ksh <-- run JCL/script being test/debugged ====================
#4. llr rpts <-- display report files ========
#5. llr jobtmp <-- display temp/work/inter-step files ==========
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Console logging is highly recommended (especially for production) since it captures everything that happens on the screen, including operator commands & replies to prompts. See console logging activation on page '1U1'.
But until you get console logging activates, you could use the joblog1 script (provided in /home/uvadm/sf/IBM/...).
These scripts capture the JCL/script screen displays into a file using the unix/linux 'tee' command. The log filename is created by dropping the '.ksh' extension from the jobname & then appending '.log'.
28401d23.ksh <-- execute JCL/script (with no logging) ============
joblog1 28401d23.ksh <-- execute & capture log in $TESTLIBS/joblog/28401d23.log ====================
joblog1A 28401d23.ksh <-- execute & capture log in $TESTDATA/joblog/28401d23.log ===================== - the 'A' version also turns on COBOL Animation - saves having to 'export ANIM=+A' to animate
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
Pages '4J1' - '4K3' documented the initial conversion of All JCL. Then you should test/debug 1 or 2 JCL/scripts to verify the conversions.
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls cleanup PROC/SLI expand convert to ksh prompt & copy
As an example, we will convert 'JAR100', a demo JCL supplied with Vancouver Utilities in /home/uvadm/vsetest/jcl0/JAR100.jcl. You can see it listed on page '1C1' & the expected output script on page '1C2'.
#0a. Login as appsadm ---> /home/appsadm
#0b. cdl --> $TESTLIBS
#1. jcl2ksh41 jcl0/JAR100.jcl <-- convert 1 JCL at a time =========================
#1a. jcl2ksh41 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' | - '4K3' documented the initial conversion of all JCL. |
'4M1' suggested test/debug 1 or 2 JCL/scripts & modifying option/control files for optimum results.
We now suggest you reconvert all JCL/scripts, to realize the improvements in all JCL/scripts. You can do this quickly using the 'jcl2ksh41A' script (vs step by step method required on the initial conversion of All JCL).
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls cleanup PROC/SLI expand convert to ksh prompt & copy
#0a. Login as appsadm ---> /home/appsadm
#0b. cdl --> $TESTLIBS
#1. jcl2ksh41A jcl2 jcl3 =================== - convert all JCL from jcl0/... thru several steps to scripts in jcl3/... - jclunixop41 has options to use ctl/listcat3I &/or ctl/datafiles43I to supply file types, record sizes, Indexed keys, etc - the script prompts to ask if you wish to create ctl/datafiles42 overrides - see explanations on pages '4J3'
#3. cp jcl3/??? jcls ================ - team members will copy JCL/scripts 1 at a time to jcls/... (in PATH) just before they are ready to test/debug each script - this allows us to reconvert anytime to jcl3/... to improve conversions after updating listcat3 & reloading listcat3I (as shown above)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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. jclxx41 jcl2 jcl3 <-- reconvert all JCL in jcl2 to ksh in jcl3 =================
#5. alldiff2 jcl3.old jcl3 <-- run alldiff2 script ====================== - saves jcl3.dif in the tmp subdir
#6. uvlp12 tmp/jcl3.dif <-- print the jcl3.dif file =================== - or vi, more, etc
Here is a sample dif file resulting from updating ctl/listcat3. We added 'topi=tape2' onto the control file line for data file 'tu.f01.e212801.adrpos'. We then ran uvcopy loadcat3I to reload the indexed file & reconverted all JCL as shown above.
37c37 < exportgen0 E211801 tape/tu.f01.e211801.adrpos_ --- > exportgen0 E211801 tape2/tu.f01.e211801.adrpos_ diff file# 10 - jcl3.old/... vs jcl3/24599j04.ksh
97c97 < exportgen1 E212990 tape/tu.f01.e211801.adrpos_ --- > exportgen1 E212990 tape2/tu.f01.e211801.adrpos_ diff file# 78 - jcl3.old/... vs jcl3/28401j04.ksh
2 different of 280 files compared jcl3.old to jcl3
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
If you have multiple programmers, you might need to setup the testdata superdir in programmer homedirs to prevent update conflicts.
/p1 :-----testdata <-- RUNDATA=$TESTDATA=/p1/testdata : :-----joblog - joblog1 script stores .log files here : :-----jobparms1 - current datacards from $RUNLIBS/jobparmx1 at 6PM : :-----jobparms2 - datacards from $RUNLIBS/jobparmx2 at 6PM : :-----jobtmp - job temporary files : :-----mstr - master files : :-----pf - user written uvcopy jobs : :-----rpts - reports : :-----sf - user written Korn shell scripts : :-----sysout - COBOL DISPLAY upon SYSLST reports : :-----tape - tape files reassigned to disc by JCL converter : :-----tmp - misc temp files & sort work files : :-----wrk - work files (inter-step)
Here is how 'userx' might setup his own testdata superdir, copy all data files, & modify his profile to use the private version of testdata.
#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 rsz=256 totrecs=32 current=1 fsiz=8192 fptr=0 cobmapfile=maps/custmas1 today=199911291108 datalastmod=1999112910 rec# 1 fieldname occurs bgn end typ<------ data (hex if typ=p/b) -----> 001 cm-num 0 5 n 130140 002 cm-delete 6 9 003 cm-name 10 34 EVERGREEN MOTORS LTD. 004 cm-adrs 35 59 1815 BOWEN ROAD 005 cm-city 60 75 NANAIMO 006 filler001 76 76 007 cm-prov 77 78 BC 008 filler002 79 79 009 cm-postal 80 89 V9S1H1 010 cm-phone 90 101 604-754-5531 011 cm-contact 102 119 012 cm-thisyr-sales 012 120 124pns 001234567C 013 cm-lastyr-sales 012 180 184pns 001234567D 014 cm-thisyr-xft 240 244pns 4320202020 015 cm-lastyr-xft 245 249pns 2020202020 016 filler003 250 255 null=next,r#=rec,s=search,u=update,p=print,i=iprint,w=write,t=tally,c=checkseq ,e=exit to uvhd, q=quit, ?=help --> q
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#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/ctlfile4) & the 'uvhdc' script to save having to specify the copybook map & to enable running uvhdcob from any location & avoid having to code recsize for indexed files.
#2a. uvhdc mstr/e2121653/mtaxe.piscines ==================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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_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#3B1. You must also setup a subdir in /home/appsadm/log1,2,3 matching your userid.
Console logging should be mandatory for operators, but can be optional for programmers, who can use the 'joblog1' script during test/debug.
#1. vi .bash_profile <-- edit your profile ================ - uncomment following 4 lines near end
login1 || exit 2 # exit here if 2nd login logfixA # process log1 file to log2 (to allow read/print) echo 'console logging requires aliases to be stored in .bashrc or .kshrc' exec script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)
#2a. cd /home/appsadm <-- change to appsadm & make subdirs matching userid #2b. mkdir log1/userx <-- make subdir in log1 for current log collection #2c. mkdir log2/userx <-- make subdir in log2 for current month collection #2d. mkdir log3/userx <-- make subdir in log3 for last month history
#3a. exit <-- logoff #3b. Login <-- log back in to activate console logging
#4a. 28401d23.ksh <-- run some of your JCL/scripts ============ #4b. llr rpts <-- list some directories, etc ========
#5. logoff & back on to process console log (from /home/appsadm/log1/userx/... to log2/userx/...)
#6. logview <-- display your log files ======= --> 1 <-- enter 1 to view the latest
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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' in character mode. |
5C5. | Display the gdgctl Indexed file with 'uvhd' in vertical hexadecimal. |
5C6. | Updating the gdgctl Indexed file directly with 'uvhd'. |
5C7. | Updating the gdgctl Indexed file directly with 'vi' (dangerous). |
5D1. | Sample JCL/script jgl100.ksh using GDG files |
5D2. | GDG logic explained, how we prevent GDG# increments on failed runs |
5D3. | Test data files supplied to illustrate GDG processing |
5D4. | Op. Instrns. for jgl100.ksh to demo GDG processing - successful run |
5D5. | Console log & directory listings after new generation created |
- new generations (written to jobtmp) MOVED to $RUNDATA/subdirs at jobend | |
5D6. | Op. Instrns. for jgl100.ksh to demo GDG processing - on run FAILURE |
5D7. | Console log & directory listings after run failure |
- new generations (written to jobtmp) NOT moved to $RUNDATA/subdirs |
5E1. | Exception processing with GDG files |
- example of processing a series of GDG files already stored in subdir | |
without having to modify JCL/scripts or copy files | |
5E2. | Test files & JCL JGL220 to demo prior generation & range processing |
5E3. | Converted Korn shell script jgl220.ksh to demo prior gen & range prcsng |
5E4. | gdgctl51test2 control file to demo prior gen & range processing |
5E5. | Op. Instrns. for jgl220.ksh to demo prior gen/range prcsng - 1st run |
5E6. | Console log & directory listings after run #1 to demo range processing |
5E7. | Op. Instrns. for jgl220.ksh to demo prior gen/range prcsng - 2nd run |
5E8. | Console log & directory listings after run #2 to demo range processing |
5E9. | jgl220.ksh run#3 demo GDG range processing - Op. Instrns & console log |
5E10. | jgl220.ksh run#4 demo GDG range processing - Op. Instrns & console log |
5E11. | GDG control file (ctl/gdgctl51I.dat) after 4 test runs |
5E12. | Notes re generations selected for master & transaction files |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 copyvsectls to copy sample control files from /home/uvadm/ctl/ as on MVSJCL.htm#4D1.
#1. login mvstest --> /home/mvstest
#2. cd $RUNDATA --> /home/mvstest/testdata
#3. uvcopy gdgload1[,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I] ========================================================
#3a. uvcopy gdgload1 <-- same as above (files default as shown) ===============
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Normally exportgen0 defines the latest generation (file with highest 6 digit suffix). Consider the following data files & the 'exportgen0' example:
gl/account.master_000001 gl/account.master_000002 gl/account.master_000003 gl/account.master_000004 gl/account.master_000005
exportgen0 GLMSTR gl/account.master_ <-- JCL/script coding to define the file ==================================== for the following COBOL program
export GLMSTR=gl/account.master_000005 <-- effective result ======================================
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/testlibs, ???) - see directories,profiles,$RUNLIBS,etc discussed page '1A1' +
#2. [ jcl2ksh41A all ] <-- we assume JCL conversion already completed ================= - left all converted scripts in jcl3/...
#3. uvcopy jcldata56,fild1=jcl3,filo2=ctl/datafiles56,uop=c0f2g99h40j1 ================================================================== options: c0 = no filecounts, f2 = exportgen files only, g99 = default gens h40 = col# to insert gdg=..., j1 = remove $JTMP/
#3a. uvcopy jcldata56 <-- same as above (files default as shown) ================ - sample output shown below
gl/account.master_ gdg=31 gl/account.trans_ gdg=31 opt=c py/payroll.master_ gdg=31
These samples are based on the test/demo JCLs shown in Part_1 (but several lines removed for this illustration).
#4. cp ctl/datafiles56 $RUNDATA/ctl/gdgctl51 ======================================== - copy/rename for GDG control file
Note |
|
#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
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 ACCTMAS gl/account.master_ <--Note4 exportgen1 ACTLIST $JGDG/gl/account.acntlist_ <--Note5 #exportgen1 GDG subdir/file, option g1 move to outdir at Normal EOJ logmsg2 "Executing--> cobrun $ANIM $RLX/cgl100" #3---------------------------------------------------------------------- cobrun $ANIM $RLX/cgl100 #4---------------------------------------------------------------------- LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto=""; if ((S0010C != 0)) <--Note6 then logmsg2 "ERR: step#$JSTEP cgl100 abterm $SCC" alias goto="<<S9900=A"; fi goto #8====================================================================== S9000=A <--Note7 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP" exit 0 #jclunix51 ver:20090313 b2c0d1g1e0f1i1j0k3l20m4n3o0p0r0s0t1u1w0x0y1z0 #9====================================================================== S9900=A <--Note8 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs exit $JCC
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
export ACCTMAS=gl/account.master_000003 =======================================
exportgen1 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 joblog1 as below
#6a. joblog1 jgl100.ksh <-- alternative to capture console log file ================== - see listing on the next page
#7a. vi joblog/jgl100.log <-- view console log ====================
#7b. uvlp12 joblog/jgl100.log <-- OR, print console log ========================
#8a. ls -l gl <-- inspect contents of gl subdir ======== - see before above & after below on successful & failed runs
#8b. ls -l jobtmp/JGL100/GDG/gl <-- inspect contents of jobtmp/... ========================== - on good runs, files already moved out - on failure, new GDG files still there
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 modify jgl100.ksh to cause a run failure & rerun to illustrate that the new generations of GDG files are not stored in the $RUNDATA/subdirs if Abnormal termination occurs.
#1. cdl --> /home/mvstest/testlibs ('cdl' is an alias for 'cd $RUNLIBS') ===
#2. mv cblx/cgl100.int tmp ====================== - remove COBOL program from loadlib, to cause failure (saved in tmp/... for later restore)
#3. cdd (alias cdd='cd $RUNDATA') --> /home/mvstest/testdata ===
Note |
|
#6. jgl100.ksh <-- execute JCL/script to demo GDG files ========== - BETTER to use joblog1 as below
#6a. joblog1 jgl100.ksh <-- alternative to capture console log file ================== see listing on the next page -->
#7a. vi joblog/jgl100.log <-- view console log ====================
#7b. uvlp12 joblog/jgl100.log <-- OR, print console log ========================
#8a. ls -l gl <-- inspect contents of gl subdir ======== - see before above & after below on successful & failed runs
#8b. ls -l jobtmp/JGL100/GDG/gl <-- inspect contents of jobtmp/... ========================== - on good runs, files already moved out - on failure, new GDG files still there see listing on the next page -->
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
090314:080849:JGL100: WARN: files exist in jobtmp/GDG subdirs (from prior Abterm ERR?) 090314:080849:JGL100: ---- files in /home/mvstest/testdata/jobtmp/JGL100/GDG/*/* listed below: /home/mvstest/testdata/jobtmp/JGL100/GDG/gl/account.acntlist_000005 090314:080849:JGL100: jobtmp/GDG/subdir/files must be moved/removed before run starts 090314:080849:JGL100: y = move back to $RUNDATA/GDG/subdirs - restart from step# ? 090314:080849:JGL100: n = do NOT move back (will erase) - rerun from begining ? 090314:080849:JGL100: OR - may need to kill job & investigate ?
b n 090314:080853:JGL100: ******** Begin Step S0010 cgl100 (#1) ******** 090314:080853:JGL100: EOF fili01 rds=3 size=75: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010I_gl_account.master_ 090314:080853:JGL100: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I 090314:080853:JGL100: EOF filo02 wrts=1 size=51: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010G0_gl_account.master_ 090314:080853:JGL100: gen0: ACCTMAS=gl/account.master_000003insize=8720 090314:080853:JGL100: EOF fili01 rds=4 size=108: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010O_gl_account.acntlist_ 090314:080853:JGL100: EOF filr01 rds=1 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I 090314:080853:JGL100: EOF filo02 wrts=1 size=128: /home/mvstest/testdata/jobtmp/JGL100/gtmp/0010G1_gl_account.acntlist_ 090314:080853:JGL100: gen+1: ACTLIST=/home/mvstest/testdata/jobtmp/JGL100/GDG/gl/account.acntlist_000005 gens=8 090314:080853:JGL100: file: SYSOUT=/home/mvstest/testdata/sysout/JGL100/S0010_SYSOUT bytes= 090314:080853:JGL100: Executing--> cobrun -F /home/mvstest/testlibs/cblx/cgl100 090314:080853:JGL100: Job Times: Begun=08:08:53 End=08:08:53Elapsed=00:00:00 090314:080853:JGL100: moving /home/mvstest/testdata/jobtmp/JGL100/GDG/subdir/files back to $RUNDATA/subdirs/ `/home/mvstest/testdata/jobtmp/JGL100/GDG/gl/account.acntlist_000005' -> `gl/account.acntlist_000005' 090314:080853:JGL100: EOF filr01 rds=5 upds=1 size=10240: /home/mvstest/testlibs/ctl/gdgctl51I 090314:080853:JGL100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 exportfile autoload exportgen0 exportgen1 exportgenall exportgenx jobset51 # call function for JCL/script initialization #jobset51 stores any restart step# in alias 'goto' (must be last on line) goto S0000=A # * UPDATE GL ACCOUNT MASTER WITH GLTRANS # * demo exportgen0 input prior master generation (ignore newer gens) # * demo exportgen0 input a progression of prior gltrans files #1======================= begin step#S0010 CGL200 ======================== S0010=A JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto=""; logmsg2 "Begin Step $JSTEP cgl200 (#$XSTEP)" stepctl51 # test oprtr jcpause/jcclear ##STEP020 EXEC PGM=CGL200,COND=(4,LT,STEP010),PARM=&YEAREND export PROGID=cgl200 export PARM="$YEAREND" exportgen0 GLMSOLD gl/account.master_ exportgen0 GLTRANS gl/account.trans_ exportgen1 GLMSNEW $JGDG/gl/account.master_ #exportgen1 assign $JGDG/subdir/file, move to outdir at Normal EOJ #3---------------------------------------------------------------------- cobrun $ANIM $RLX/cgl200 #4---------------------------------------------------------------------- LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto=""; if ((S0010C != 0)) then logmsg2 "ERR: step#$JSTEP cgl200 abterm $SCC" alias goto="<<S9900=A"; fi goto #8====================================================================== S9000=A jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP" exit 0 #jclunix51 ver:20080902 b0c0d0g15e0f1i1j0k1l20m1n3o1p0o0r0s0t1u1w0x0y1z0 #9====================================================================== S9900=A logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsExec=$XSTEP,Last=$JSTEP" RV\ ACK jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs exit $JCC
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 joblog1 as below
#1a. joblog1 jgl220.ksh <-- alternative to capture console log file ==================
#2. vi joblog/jgl220.log <-- view console log ====================
#2b. uvlp12 joblog/jgl220.log <-- OR, print console log ======================== see listing on the next page -->
#3. ls -l gl <-- display gl/... subdir after 1st run ========
#3a. lslp gl <-- OR, print gl/... subdir after 1st run ======= see listing on the next page -->
#4. Please inspect the console logs & directory listings on the next page & observe the following:
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 joblog1 as below
#1a. joblog1 jgl220.ksh <-- alternative to capture console log file ==================
#2a. vi joblog/jgl220.log <-- view console log ====================
#2b. uvlp12 joblog/jgl220.log <-- OR, print console log ======================== see listing on the next page -->
#3. ls -l gl <-- display gl/... subdir after 2nd run ========
#3a. lslp gl <-- OR, print gl/... subdir after 2nd run ======= see listing on the next page -->
#4. Please inspect the console logs & directory listings on the next page & observe the following:
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. joblog1 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. joblog1 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 E212990 tape/tu.f01.e212-no.soldes_ exportgen1 E212991 $JTMP/tape/tu.f01.e212-no.soldav_
---------- lines omitted ----------- ....... SORT step ....... # cat > $SYS011 <</*EOD # SORT FIELDS=(18,6,A),FORMAT=BI,WORK=4 # OPTION FILNM=(E212084,E212990),SORTOUT=020,SORTIN=(014) # /*EOD exportfile SORTOUT $E212084 exportfile SORTIN1 $E212990 ## EXEC SORT #3---------------------------------------------------------------------- uxsort "fili1=$SORTIN1,typ=RSF,rcs=354,filo1=$SORTOUT,keys=(17,6,b,a)" #4----------------------------------------------------------------------
Note |
|
#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 SORTOUT $JTMP/gl/account.trans_ #<--Note1 #exportgen1 assign $JTMP/subdir/file, move to subdir/file at Normal EOJ #3---------------------------------------------------------------------- uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80\ ,keys=(0,8,c,a,68,12,c,a)" #4---------------------------------------------------------------------- exportgen1 GLTRANS $JTMP/gl/account.trans_ #<--Note2 #exportgen1 assign $JTMP/subdir/file, move to subdir/file at Normal EOJ # 2+ exportgen1's for this file in this JCL/script exportgen0 GLMSOLD gl/account.master_ exportgen1 GLMSNEW $JTMP/gl/account.master_ #exportgen1 assign $JTMP/subdir/file, move to subdir/file at Normal EOJ #3---------------------------------------------------------------------- cobrun $ANIM $RLX/cgl200 #4----------------------------------------------------------------------
The 'Note1' line above writes a new generation for the sorted file. The 'Note2' line above reads the new GDG back into the COBOL program. They were both codes with the '(+1)' suffix on the DSN's, and are now both coded on the 'exportgen1' function in the Korn shell script.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We noticed a problem when converting VSE JCL's with tape files to GDG's.
The VSE JCL carried a comment indication INPUT or OUTPUT, and we added an option to the JCL converter to use the I/O indicator to generate 'exportgen1' for OUTPUT & 'exportgen0' for INPUT. We also coded the tape files in a 'tape/...' subdir.
Using the example on the previous page the write & read back file definitions might be:
exportgen1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)
exportgen0 GLTRANS tape/account.trans_ #Note2 (readback on following step)
exportgen1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)
exportgen1 GLTRANS $JTMP/tape/account.trans_ #Note2 (readback on following step)
Correction method #1 is similar to the example on the previous page, resulting for the fact that the mainframe programmer would have coded both files with suffix '(+1)'.
exportgen1 SORTOUT $JTMP/tape/account.trans_ #Note1 (write)
exportgen0 GLTRANS $JTMP/tape/account.trans_ #Note2 (readback on following step)
Correction method #2 is to leave the function as 'exportgen0' & simply add the '$JTMP/' prefix onto the file.
Note that the '$JTMP/' directory is honoured by exportgen0, but is ignored by exportgen1 when determining the latest generation within a directory. Function 'exportgen1' will 1st remove any '$JTMP/' prefix before it determines the latest generation, but 'exportgen0' will not.
Note |
|
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 - determine current generation (highest generation#) # or prior generations (-1),(-2),(-3) # exportgen1 - determine next generations (+1),(+2),(+3) not yet existing # exportgenx - displays errmsg (if gen not 0,+1+2,+3,-1,-2,-3) # exportgenall - concatenates all existing generations # exportfile - non-GDG filenames, same as 'export', but displays filename # # ** uvcopy jobs used for GDG functions ** # # jcldata56 - creates gdgctl51 by extracting all exportgens from all scripts # gdgload1 - loads edited text file ctl/gdgctl51 to indexed file gdgctl51I # gdgget51 - gets records from indexed file by key, called by exportgen1c # gdgget52 - gets records from indexed file by key, called by exportgen0c # gdgupok1 - updates gdgctl file next=... reset =000000 or increment range # gdgupab1 - updates gdgctl file history, files NOT moved to RUNDATA/subdirs # # ** Change History ** # #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles #Oct18/08 - gdgget52 changed to return just gen# vs filename_gen# # - exportgen0 changed to concat filename_ + gen# # - remove $RUNDATA/ if present due to option e1 in jclunixop51 #Aug28/08 - name changes getgdg51->gdgget51,getgdg52->gdgget52, # gdgctlload1->gdgload1,gdgctlunload1->gdgunload1 # gdgctlupok1->gdgupok1,gdgctlupab1->gdgupab1 #Aug25/08 - $JTMP changed to $GTMP for 'ls' output matching filegens # GTMP=jobtmp/$JOBID2/gtmp <-- defined in jobset51 #Aug25/08 - $JTMP changed to $JGDG in exportgen1 new GDG (N/A in exportgen0) #Jun16/07 - allow 'opt=c' (confirm) in control file to prompt 'y' or alt gen# #May28/07 - new exportgen0c to access prior versions specified by indexed file #May28/07 - enhance exportgen1c to get next gen# from indexed control file #May25/07 - new exportgen1c to avoid GDG incrementing if job abends #Dec02/05 - generation# increased to 6 digits # # ** Alternate Versions of exportgen0 ** # #*exportgen0 - the *active version* called by the JCL/scripts # - copy desired version from 1 of below, renaming as 'exportgen0' # exportgen0a - original version, required ksh 1993 to load array of filenames # - more efficient, does not need to write a file & read back # exportgen0b - works with all versions of Korn shell (88 or 93) # - uses ls to write file & reads back to determine latest version #*exportgen0c - *recommended version* as of July 2008 (not expected to change) # - may specify next gen# or a range of gen#s by indexed file # - may specify an expiry date or auto reset at end of range # - uses uvcopy gdgget52 to read indexed file ctl/gdgctl51I # & determine gen# allowing for prior gen# overrides # # This is the 'c' (current version July2008) of exportgen0a,b,c # - all versions archived to /home/uvadm/archive/sfun/... # - if required, could copy other versions from archive to $RUNLIBS/sfun # - must rename as 'exportgen0' since that is called by the JCL/scripts # # ** sample usage illustrated ** # # gl/account.master_000001 # gl/account.master_000002 <-- assume $RUNDATA contains these files: # gl/account.master_000003 # #command: exportgen0 CUSTMAS gl/account.master_ # ===================================== # #result: export CUSTMAS=gl/account.master_000003 <-- gen0=highest onfile # ======================================= # # ** sample control file ** # # gl/account.master_ gdg=10 # gl/account.trans_ gdg=20 next=000003(000003:000003)_070531:235959 # py/payroll.master_ gdg=30 opt=c # py/time.cards_ gdg=52 next=000001(000001:000012)_000000:000000 # # ** Vital Requirements ** # # 1. export FPATH=$RUNLIBS/sfun #<-- must define FPATH in common_profile # ========================== - directory holding these ksh functions # # ** coding for function exportgen0 ** # function exportgen0 # function name here must match physical filename { if [[ -n "$1" && -n "$2" ]]; then : else logmsg2 "ERR: exportgen0 requires 2 args: LFD=$1, lbla=$2." exit 9; fi lfd=$1; lbla=$2 # capture args into named variables # #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles # - extract subdir/filename from $RUNDATA/subdir/filename lbl1=${lbla##*/} # drop large left to get filename lbl2=${lbla%/*} # drop small right to get $RUNDATA/subdir lbl3=${lbl2##*/} # drop large left to get subdir lbl4=$lbl3/$lbl1 # create subdir/filename (to match coding in gdgctl51I) lbld=$(echo $lbl4 | tr "/" "_") # convert any '/' to '_' in DSNname # # for filename to hold ls of gdg filenames # # verify that filename (arg2 on call) ends with '_' if [[ ! "$lbla" == *_ ]]; then logmsg2 "ERR: exportgen0 filenames should end with '_', continue?, need fix?" read reply; fi # # verify $GTMP subdir present, created by jobset51 if [[ ! -d $GTMP ]]; then logmsg2 "ERR: exportgen0 \$GTMP subdir not found GTMP=$GTMP"; exit 9; fi # # $GTMP subdir to hold output of 'ls' with all files matching filename_* # export GTMP=jobtmp/$JOBID2/gtmp <-- defined in jobset51 # used for ls output file create/readback to determine latest generation: # lslbls=$GTMP/${JSTEP}I_$lbld # lslbls=$RUNDATA/jobtmp/$JOBID2/gtmp/${JSTEP}I_$lbld # could use GTMP=jobtmp/${JOBID2}_$(date +%y%m%d%H%M%S)/gtmp # in alternative code version for time stamped jobtmp subdirs # # capture current step# (part of ls output filename) typeset -RZ4 step="$JSTEP" # capture step# from calling job if [[ -z "$step" ]]; then step=0000; fi # set 0000 if undefined # # capture all matching GDG filenames into a file for readback to get highest# # - 1st create filename for 'ls' write lslbls=jobtmp/$JOBID2/${JSTEP}I_$lbld # - with all filenames matching up to the trailing '_' lslbls=$GTMP/${step}I_$lbld # assign filename for ls write ls $lbla[0-9][0-9][0-9][0-9][0-9][0-9] >$lslbls 2>/tmp/junk # # if no existing files, define ..._000001 filename, warning msg,& early return if [[ ! -s $lslbls ]]; then # if NO existing files ? lblgena=${lbla}000001 # create filename for 1st generation export $lfd=$lblgena # export LFD=lbl of next generation logmsg2 "ERR: gen0: No existing file, gen_000001 exported, $lfd=$lblgena " logmsg2 "ERR: gen0: problem input by exportgen0 ?, may continue, need fix?" read reply; # June05/03 OT warning added return 0; fi # return 0 if no files existing # # call uvcopy job gdgget52 to select control file entry for matching filename # - from indexed file ctl/gdgctl51I using filename as key # - uvcopy job will write selected entry to a file for reading by this script lblxG=$GTMP/${step}G0_$lbld # create filename to be written by uvcopy # uvcopy gdgget52,fili1=$lslbls,filo2=$lblxG,arg1=$lfd,arg2=$lbl4,arg3=G0,rop=i63 #===============================================================*****G0=current # arg1 = DDN (ex: GLMSTR) # arg2 = DSN filename key for lookup gdgctl file (ex: gl/account.master_) # arg3 = $gn -2,-1,0,+1,+2, etc to identify calling function exportgen0/1 # (getgdg52 decrements gen# by 0,-1,-2,-3 depending on $gn) # fili1 = $lslbls ls of all matching filenames_* to underscore (+ 6 digits) # filo2 = $lblxG output file for gdgctl entry (possible override, prior gen#) # output file has 1 line with 4 fields as follows: # =============================== # gen# gdg=... next=... opt=... # 000004 gdg=15 # 000006 gdg=24 next=000006(000001:000012)070529:235959 opt=c # ============================================================ # field1 = gen# determined by gdgget52 (Oct18/08 changed from filename_gen#) # only field1 (genx) used below, others for debug audit trail # field2 = gdg=... no of generations maintained for this file # field3 = next=... in gdgctl file (not/used except for debug/audit) # field4 = opt=c from gdgctl file, causes prompt for confirm/change #Oct18/08 - gdgget52 changed to return just gen# vs filename_gen# # - exportgen0 changed to concat filename_ + gen# # # read the file written by uvcopy, 1 line with 4 fields (as above) exec 3< $lblxG # open the file read -u3 genx gens next opts # read 1st 4 fields (4th field options) exec 3<&- # close file lblgenx=$lbla$genx # concat filename_ + gen# # export $lfd=$lblgenx # export LFD=LBL for selected filename #=================== # # get filesize & display results for console log fsize=""; if [[ $lblgenx == /* ]]; then lblx=$lblgenx; else lblx=$RUNDATA/$lblgenx; fi if [[ -f $lblx ]]; then fsize=$(stat -c%s $lblx); fi # logmsg1 "gen0: $lfd=$lblgenx insize=$fsize" #========================================== # return no of generations existing gdgsbf=$(wc -l $lslbls); gdgsb=${gdgsbf% *}; gdgs=${gdgsb##* }; return $gdgs # return no of generations existing }
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# exportgen1 - function to export NEXT generation of a file (not yet existing) # - this version gets gdg=... values from indexed file # - replaces mainframe MVS JCL GDG functions # - used by Vancouver Utilities JCL to Korn shell converter # - these functions distributed in /home/uvadm/sfun/... # # ** summary of GDG functions supplied ** # # exportgen0 - determine current generation (highest generation#) # or prior generations (-1),(-2),(-3) # exportgen1 - determine next generation (+1) not yet existing # exportgenx - displays errmsg (if gen not 0,+1+2,+3,-1,-2,-3) # exportgenall - concatenates all existing generations # exportfile - non-GDG filenames, same as 'export', but displays filename # # ** uvcopy jobs used for GDG functions ** # # jcldata56 - creates gdgctl51 by extracting all exportgens from all scripts # gdgload1 - loads edited text file ctl/gdgctl51 to indexed file gdgctl51I # gdgget51 - gets records from indexed file by key, called by exportgen1c # gdgget52 - gets records from indexed file by key, called by exportgen0c # gdgupok1 - updates gdgctl file next=... reset =000000 or increment range # gdgupab1 - updates gdgctl file history, files NOT moved to RUNDATA/subdirs # # ** Change History ** # #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles #Oct18/08 - allow $RUNDATA/$JGDG/... for option e1 unikixvsam (Essentis) #Aug28/08 - name changes getgdg51->gdgget51,getgdg52->gdgget52, # gdgctlload1->gdgload1,gdgctlunload1->gdgunload1 # gdgctlupok1->gdgupok1,gdgctlupab1->gdgupab1 #Aug25/08 - $JTMP changed to $JGDG for new GDGs (JGDG=jobtmp/$JOBID2/GDG/) # - $JTMP changed to $GTMP for 'ls' output matching filegens # GTMP=jobtmp/$JOBID2/gtmp <-- defined in jobset51 #May25/07 - 'exportgen1c' enhanced to get gdg=... value from Indexed file #May23/07 - new version 'exportgen1c' added to preserve gen# on Abterm #May07/06 - $DJ changed to $JTMP #Dec02/05 - generation# increased to 6 digits # # ** Alternate Versions of this Function ** # #*exportgen1 - the *active version, called by the JCL/scripts # - copy desired version from 1 of below, renaming as 'exportgen1' # - when updating active version, also copy/rename to backup version # # exportgen1a - original version, required ksh 1993 to load array of filenames # - more efficient, does not need to write a file & read back # - will be obsoleted by exportgen1c that avoids gen# inc on abend # # exportgen1b - works with all versions of Korn shell (88 or 93) # - uses ls to capture filenames & readback to determine latest # - will be obsoleted by exportgen1c that avoids gen# inc on abend # #*exportgen1c - recommended version as of July 2008 (not expected to change) # - this version avoids GDG incrementing if job abends # - does not write new GDG files directly to $RUNDATA/subdirs # - JCL converter changed to write exportgen1 files to $JTMP # for move back to $RUNDATA/subdirs by jobend51 at Normal EOJ # - must modify jobset51 & jobend51 to create required subdirs # # - exportgen1c version to get gdg=... values from indexed file # - gdg priority: 1st = arg3 on exportgen1, 2nd = Indexed file # 3rd = default hard coded in this function (15 as of May 25/07) # - text file ctl/gdgctl51 created by uvcopy job 'jcldata56', edited to specify # gen#s by file & loaded to ctl/gdgctl51I indexed file by 'gdgload1' # - this function reads the indexed file using uvcopy job 'gdgget51', which # returns the no of generations for the sepecified filename # # This is the 'c' (current version July2008) of exportgen1a,b,c # - all versions archived to /home/uvadm/archive/sfun/... # - if required, could copy other versions from archive to $RUNLIBS/sfun # - must rename as 'exportgen1' since that is called by the JCL/scripts # # ** Vital Requirements ** # # 1. Directory holding these functions must be defined by FPATH (for Korn shell) # export FPATH=$RUNLIBS/sfun #<-- in common_profile # ========================== # # ** command format & sample usage ** # #format: exportgen1 DDname DSname [generations] [touch option] # ===================================================== # - arg#3 is generations to maintain (see default below if absent) # - arg#4 is option to touch (create new empty file) # #example: exportgen1 CUSTMAS $JGDG/gl/account.master_ [gdg=15] [touch] # ============================================================ # # ap/account.master_000001 # ap/account.master_000002 <-- assume $RUNDATA contains these files # ap/account.master_000003 # #result: export CUSTMAS=$JGDG/gl/account.master_000004 # ============================================= # [ touch $JGDG/gl/account.master_000004 ] # ====================================== # # ** coding for: function exportgen1 ** # function exportgen1 # function name here must match physical filename { typeset -RZ6 gen0; # define cur gen# 6 digits Right just, zero fill typeset -RZ6 gen1; # define next gen# 6 digits Right just, zero fill typeset integer gensdflt=15; # generations default 15 typeset integer gens=$gensdflt # init gens to gensdflt integer filecnt=0; integer excess=0; integer lblcnt=0; # clear counters # lfd=$1; lbla=$2; # capture args into named variables #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles # - extract subdir/filename from $RUNDATA/subdir/filename lbl1=${lbla##*/} # drop large left to get filename lbl2=${lbla%/*} # drop small right to get $RUNDATA/subdir lbl3=${lbl2##*/} # drop large left to get subdir lbl4=$lbl3/$lbl1 # create subdir/filename (to match coding in gdgctl51I) lbld=$(echo $lbl4 | tr "/" "_") # convert any '/' to '_' in DSNmame # # for filename to hold ls of gdg filenames # if [[ -n "$lfd" && -n "$lbla" ]]; then : else logmsg2 "ERR: exportgen1 requires 2 args: LFD=$1, lbl=$2"; exit 91; fi # # retrieve gdg=.., if specified on arg3 of command line if [[ "$3" == gdg=* ]]; then gens=${gdg#gdg=}; fi # # verify that filename (arg2 on call) ends with '_' if [[ ! "$lbla" == *_ ]]; then logmsg2 "ERR: gen filenames must end with '_', may continue, but need to fix" read reply; fi # # avoid problem when no matching files present # - by creating gen# filename_000000 as nullfile & removing later below if [[ ! -e ${lbla}000000 ]]; then touch ${lbla}000000; fi # # 1st create tmp filename for 'ls' output lslbls=jobtmp/$JOBID2/${JSTEP}O_$lbld # - use $GTMP for subdir, defined in function jobset51 # lslbls=$GTMP/${JSTEP}I_$lbld --> $RUNDATA/jobtmp/$JOBID2/${JSTEP}I_$lbld # - OR $RUNDATA/jobtmp/${JOBID2}_$(date +%y%m%d%H%M%S)/${JSTEP}I_$lbld # if alternative code activated for time stamped jobtmp subdirs if [[ ! -d $GTMP ]]; then logmsg2 "ERR: exportgen1 ERR GTMP subdir not found GTMP=$GTMP"; exit 9; fi # typeset -RZ4 step="$JSTEP" # capture step# from calling job if [[ -z "$step" ]]; then step=0000; fi # set 0000 if undefined lslbls=$GTMP/${step}O_$lbld # assign filename for ls write # use 'ls' to create tmp file of matching filenames ls $lbl4[0-9][0-9][0-9][0-9][0-9][0-9] >$lslbls 2>/tmp/junk # # read back file of filenames created by 'ls' above & use last name exec 3< $lslbls # open file of 'ls' names while read -u3 lblgenr # read lines of ls filenames do lblgenh=$lblgenr # save highest generation filename ((filecnt+=1)) # count files for excess delete done # exec 3<&- # close file # gen0=${lblgenh##*_} # drop filename, capture gen# of last filename gen1=$gen0 ((gen1+=1)) # calc next generation # let gen1=$gen0+1 # Sep28/09 changed to above (this got 000000) # #Sep28/09 - display for DEBUG # echo "DEBUG1: lbla=$lbla gen0=$gen0 gen1=$gen1" # echo "- if no existing file, mvstest returns 000000, vsetest returns 000001" # read reply # lblgenx=${lbla}${gen1} # create filename for next generation #===================== # export $lfd=$lblgenx # export LFD=lbl of next generation #=================== # for COBOL or utility program # # retrieve gdg=... from indexed file using filename key & uvcopy job gdgget51 lbldG=$GTMP/${step}G1_$lbld # create filename for outfile # uvcopy gdgget51,fili1=$lslbls,filo2=$lbldG,arg1=$lbl4,arg2=$gen1,arg3=G1,rop=i63 #================================================================*****G1=last+1 gens=$? # capture gdg=... value from return code # # verify generations min/max, if invalid set to default if (($gens<4)) || (($gens>249)); then gens=$gensdflt; fi # # delete files to maintain generations spcfd by arg#3 or default (see above) ((excess=$filecnt-$gens)) # calc number of files to delete # if excess, re-read file of filenames, deleting 1st few excess if ((excess > 0)); then exec 3< $lslbls # re-open file of 'ls' names while read -u3 lblgenr # read lines of ls filenames do ((lblcnt+=1)) # count files for excess delete if ((lblcnt <= excess)); then rm -f $lblgenr; fi done # exec 3<&- # close file fi # can now remove the _000000 nullfile if created above if [[ ! -s ${lbla}000000 ]]; then rm -f ${lbla}000000; fi # # touch (create new empty file) if arg4 = 'touch' if [[ "$4" == "touch" ]]; then touch $lblgenx; fi #Apr20/09 - change back to only if arg4=touch (problem of optn g0) # # display result for console log logmsg1 "gen+1: $lfd=$lblgenx gens=$gens"
#======================================== # return no of generations existing gdgsbf=$(wc -l $lslbls); gdgsb=${gdgsbf% *}; gdgs=${gdgsb##* }; return $gdgs # return no of generations existing }
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# exportgenall - function to export all of the existing generation of a filename # - by Mark Wedge, Armas Solutions, Aug 2002 # # All matching files with the 6 digit gen# are concatentated into 1 output file. # The output file will have the trailing '_' (ID for generation file) # but will have no 6 digit# (preventing any future inclusion as a member) # # ap/account.trans_000001 # ap/account.trans_000002 <-- sample input 3 files # ap/account.trans_000003 # # ap/account.trans_ <-- output 3 files combined into 1 # #command: exportgenall CUSTMAS ap/account.trans_ # ====================================== #result: export CUSTMAS=ap/account.trans_ # ================================ # # All files 'ap/account.trans_[0-9][0-9][0-9][0-9][0-9][0-9]' # will be concatenated in to the base name 'ap/account.trans_' # To remove all generations, the 'rm' comamnd will be generated as follows: # rm -f ${CUSTMAS}[0-9][0-9][0-9][0-9][0-9][0-9] # The concatenated file '_' will remain & might be a backup in case of error # function exportgenall { if [[ -n "$1" && -n "$2" ]]; then : else logmsg2 "ERR: exportgenall requires 2 args: LFD=$1, lbl=$2." exit 9; fi lfd=$1; lbl1=$2 # #Mar11/09 - change to allow option w2 $RUNDATA prefix on datafiles # - extract subdir/filename from $RUNDATA/subdir/filename lbl2=${lbl1##*/} # drop large left to get filename lbl3=${lbl1%/*} # drop small right to get $RUNDATA/subdir lbl4=${lbl3##*/} # drop large left to get subdir lbla=$lbl4/$lbl2 # create subdir/filename (to match coding in gdgctl51I) # #Jun05/03 - verify that filename (arg2 on call) ends with '_' if [[ ! "$lbla" == *_ ]]; then logmsg2 "ERR: gen filenames should end with '_', continue?, need fix?" read reply; fi # cat /dev/null > $lbla cat ${lbla}[0-9][0-9][0-9][0-9][0-9][0-9] > $lbla #================================================ export $lfd=$lbla #================ # # get filesize & display results for console log fsize=""; if [[ $lbla == /* ]]; then lblb=$lbla; else lblb=$RUNDATA/$lbla; fi if [[ -f $lblb ]]; then fsize=$(stat -c%s $lblb); fi logmsg1 "genall: $lfd=$lbla bytes=$fsize" #======================================= # #Aug29/08 - call gdgget52 to add exportgenall 'GA' entry to ctlfile history # capture all matching GDG filenames into a file for readback to get low#/high# # - 1st create filename for 'ls' write lslbls=jobtmp/$JOBID2/${JSTEP}I_$lbla # - with all filenames matching up to the trailing '_' lblc=$(echo $lbla | tr "/" "_") # convert any '/' to '_' in DSNname lslbls=$GTMP/${step}I_$lblc # assign filename for ls write ls $lbla[0-9][0-9][0-9][0-9][0-9][0-9] >$lslbls 2>/tmp/junk # # call uvcopy job gdgget52 to select control file entry for matching filename # - from indexed file ctl/gdgctl51I using filename as key lblxG=$GTMP/${step}GA_$lblc # create filename to be written by uvcopy #Oct18/08 - remove $RUNDATA/ if present due to option e1 in jclunixop51 lblr=${lbla#$RUNDATA/} # remove $RUNDATA/ for optn e1 jclunixop51 #Note - output file not required for exportgenall (simply adding history) # uvcopy gdgget52,fili1=$lslbls,filo2=$lblxG,arg1=$lfd,arg2=$lblr,arg3=GA,rop=i63 #===============================================================*****GA=All # arg1 = DDN (ex: GLMSTR) # arg2 = DSN filename key for lookup gdgctl file (ex: gl/account.master_) # arg3 = $gn -2,-1,0,+1,+2,etc identify calling function exportgen0/1 # fili1 = $lslbls ls of all matching filenames_* to underscore (+ 6 digits) # filo2 = $lblxG output file for gdgctl entry (NOT required for exportgenall) # return 0 }
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# exportgenx - function to report error in JCL to script conversion # - when generation on end of filename NOT as expected # - see GDG doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5 # valid exportgen_s as follows: # # exportgen0 - current generation (0) highest gen# # exportgen1 - next generation (+1) not yet existing # exportgenx - (this function) errmsg if original gen not 0,+1,+2,+3,-1,-2,-3 # exportgenall - concatenates all existing generations # # sample JCL/script conversions: # # //DDNAME DD DSN=filename(-4) --> 'exportgenx' report err if gen# < -3 # //DDNAME DD DSN=filename(0) --> 'exportgen0' current/latest generation # //FDNAME DD DSN=filename(+1) --> 'exportgen1' next generation # //DDNAME DD DSN=filename(+4) --> 'exportgenx' report err if gen# > +3 # # This 'exportgenx' reports an error if script run before manual correction # Or addition of more exportgen_ functions for -4,-5,etc or +4,+5,etc # (in $RUNLIBS/sfun/...) # function exportgenx { lfd=$1; lbl=$2 # capture args into named variables logmsg2 "ERR: exportgenx - ERR in JCL to UNIX script conversion" logmsg2 "- generation (-3),(-2),(-1),(0),(+1),(+2),(+3) NOT in allowed range" logmsg2 "- LFD=$lfd, LBL=$lbl." logmsg2 "- see GDG doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5" logmsg2 "- correct script $JOBID2 & rerun" logmsg2 "- enter=continue, or kill job by interrupt (del or ^C)" read reply # wait for operator to enter or kill return 9 }
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# exportfile - function to export DDname=DSName for Micro Focus external names # DDname (logical name in program) = DSName (physical filename) # # functions must be in directory defined by FPATH (export FPATH=$RUNLIBS/sfun) # This is: $RUNLIBS/sfun/exportfile to display non-GDG filenames on console # - also see $RUNLIBS/sfun/exportgen0 for current generation (0) highest gen# # - also see $RUNLIBS/sfun/exportgen1 for next generation (+1) # #function: exportfile CUSTMAS ap/customer.master # ===================================== # #result: export CUSTMAS=ap/customer.master # ================================= # #Note - main reason for using this function (vs coding export directly) # is to display the DDname & DSNname on the console log # function exportfile { # if [[ -n "$1" && -n "$2" ]]; then : else logmsg2 "ERR: exportfile requires 2 args: DDname=$1, DSName=$2." exit 9; fi # lfd=$1; lbl=$2 # capture args into named variables # export $lfd=$lbl # export LFD=lbl of highest gen existing #=============== # #Oct05/08 - init file if name ends with 'nullfile' if [[ $lbl == *nullfile ]]; then >$lbl; fi # # get filesize & display results for console log #Sep15/08 - allow for Indexed file by also testing for '.dat' suffix fsize=""; if [[ $lbl == /* ]]; then lblc=$lbl; lbld=$lbl.dat; else lblc=$RUNDATA/$lbl; lbld=$RUNDATA/$lbl.dat; fi if [[ -f $lblc ]]; then fsize=$(stat -c%s $lblc); elif [[ -f $lbld ]]; then fsize=$(stat -c%s $lbld); fi # logmsg1 "file: $lfd=$lbl bytes=$fsize" #===================================== return 0 # return 0 if file was found }
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# jobset51 - setup environment for UNIX scripts converted from MVS JCL # - this KORN shell function stored in $RUNLIBS/sfun # - see more doc at: www.uvsoftware.ca/mvsjcl.htm # function jobset51 { # jobset51 - called at the begining of each JCL/script # - inserted by JCL converter from the ctl/jclunixop51 # jobset51 uses $RUNLIBS & $RUNDATA (exported in prgmr/oprtr profiles) # to define Libraries & Data dirs for 'test' or 'prod'uction # # - - - sample RUNLIBS/RUNDATA for programer testing - - - # export RUNLIBS=/home/mvstest/testlibs #<-- test/demo Libraries # export RUNDATA=/home/mvstest/testdata #<-- test/demo Data superdir # # - - - sample RUNLIBS/RUNDATA for production operators - - - # export RUNLIBS=/p2/prodlibs #<-- production libraries # export RUNDATA=/p2/proddata #<-- production Data superdir # # - JCL/scripts are found via $RUNLIBS/jcls in the profile PATH # - COBOL program subdir defined here in jobset51 as '$RUNLIBS/cblx' # (this allows programs to have same names as JCL/scripts) # # ** change history ** # #Nov18/09 - jobset51/52 & g1/g2 changed back to relative/absolute #Sep29/09 - move code for JTMP,RPTS,SYOT together for alt jobset52 # - jobset51 (option g1) omits $RUNDATA for relative adrs # - jobset52 (option g2) prefixes with $RUNDATA for Essentis #Apr16/09 - GDGmkdirs moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/ # - to allow multiple $RUNDATA's to have different GDG controls #Aug26/08 - $GTMP defined for exportgen0,1,etc for 'ls' output files # of GDG matching filenames for readback determine latest gen# # export GTMP=jobtmp/$JOBID2/gtmp <-- defined here in jobset51 #Aug25/08 - simplify code GDG tmp subdirs in jobset51,jobend51,jobabend51 # - using script ctl/GDGmkdirs (user must define desired subdirs) # - allows removing hard-coded data subdirs in jobset51,etc #May23/07 - add code to support exportgen1 preserve gen#s if job abends # - create $JTMP/subdirs for exportgen1 new files til Normal EOJ # - at Normal EOJ, move $JTMP/subdir/files to $RUNDATA/subdirs # - see below where $JTMP/subdirs created (add your subdirs ?) # # ** begin code for function jobset51 ** # cd $RUNDATA #change to working dir for production (or test) cdstatus=$? # capture status of cd $RUNDATA if ((cdstatus)) # ERR if cdstatus not zero (OK) then logmsg2 "ERR: cd \$RUNDATA ($RUNDATA) failed in jobset51" logmsg2 "- investigate, RUNDATA definition in profiles" logmsg1 "- enter to exit"; read reply; exit 91; fi # # cd $RUNDATA means all files are referenced relative to $RUNDATA # - allows switching between production & test files by changing $RUNDATA # - JCL converter has converted HLQs of DSNs to subdirs within $RUNDATA # - High Level Qualifiers might be applications (ar,gl,mstr,tape,etc) # export RLX=$RUNLIBS/cblx # path for loading COBOL programs export RPX=$RUNLIBS/rpgx # path for loading RPG programs export RLJ=$RUNLIBS/java # path for loading JAVA programs export REXXLIB=$RUNLIBS/rexx # path for loading REXX programs export PRMS=$RUNLIBS/parms # control card library files (members) # - COBOL programs are found via $RLX/progname in JCL/scripts # - RPG programs are found via $RPX/progname in JCL/scripts # - JAVA programs are found via $RLX/progname in JCL/scripts # if [ -z "$ANIM" ]; then ANIM=-F; fi # 'ANIM=-F' inhibits non-numeric field checks (could change to +F ?) # - cobol programs are called via ---> cobrun $ANIM $RLX/progname <--- # # make subdirs for work files, instream data files,& GDG subdirs #Sep29/09 - JCL converter options insert jobset51/jobset52 & $JGDG/... # g0 - inserts jobset51 & omits $JGDG/ so new GDGs in same subdir as old # g1 - inserts jobset51 & $JGDG/ on exportgen1 & JGDG=jobtmp/GDG relative # g2 - inserts jobset52 & $JGDG/ on exportgen1 & JGDG=$RUNDATA/jobtmp/GDG # w2 - inserts $RUNDATA/ on exportfile & exportgen_ functions (Essentis) # # for jobset51 - define JTMP,RPTS,SYOT relative (w/o $RUNDATA) # for jobset52 - define JTMP,RPTS,SYOT with $RUNDATA (Essentis Mar09) # export JTMP=jobtmp/$JOBID2 export RPTS=rpts export SYOT=sysout/$JOBID2 #NOTE - this is ***jobset51***, so above un-comntd & folwng #comntd # export JTMP=$RUNDATA/jobtmp/$JOBID2 # export RPTS=$RUNDATA/rpts # export SYOT=$RUNDATA/sysout/$JOBID2 # # define jobtmp/subdirs for new GDG files umask 002 # ensure perms to create dirs/files 775/664 (group share) export JGDG=$JTMP/GDG export GTMP=$JTMP/gtmp if [[ ! -d $JTMP ]]; then mkdir $JTMP; fi if [[ ! -d $JGDG ]]; then mkdir $JGDG; fi if [[ ! -d $GTMP ]]; then mkdir $GTMP; fi # JTMP/... - for work files & instream data files # GTMP/... - for exportgen0,1,etc 'ls' output files # GDG matching filenames readback to determine latest gen# # JGDG/subdirs - store new GDGs for move back at Normal EOJ # - see $RUNDATA/ctl/GDGmkdirs called later in jobset51 #Mar14/09 - converter optn g1 inserts $JGDG/... on new GDGs exportgen1 # - new option 'g0' omits $GDG/ so new GDGs in same subdir as old # - code in jobset51, etc did not change, no files redirected to $JGDG/ # #Note - $JTMP subdir could be date/time stamped (or append process ID) # - if multiple copies of same job run at same time, for example: # export JTMP=jobtmp/${JOBID2}$(date +%y%m%d%H%M%S) #<-- date/time stamp # export JTMP=jobtmp/${JOBID2}$$ #<-- process ID # - If you do this, then 'rm -rf $RUNDATA/jobtmp/*' nightly by cron # - see crontab_appsadm1 & script cleantmps at ADMjobs.htm#5B1 # # define subdir that might be used for printer output # - some sites might sub-directory by date rpts/yymmdd/... # export RPTS=rpts/$(date +%y%m%d) # use this for subdirs by date if [[ ! -d $RPTS ]]; then mkdir $RPTS; fi # # make subdir for SYSOUT files (or any file w/o DSN=...) # $RUNDATA/$SYOT/step#_SYSOUT (where SYOT=sysout/JOBNAME) if [[ ! -d $SYOT ]]; then mkdir $SYOT; fi # # $JTMP & $SYOT are vital - ensure created successfully else exit if [[ -d $JTMP && -d $SYOT ]]; then : else logmsg2 "ERR: $JTMP &/or $SYOT failed creation (in jobset51)" logmsg2 "- investigate: permissions,JTMP,SYOT dirnames changed?" logmsg1 "- enter to exit"; read reply; exit 92; fi #Note - in code above we create $JTMP & $SYOT if not already existing # - we also want to clean out any prior run files if they do exist # - BUT not on a 'RESTART', see following line of code below (near end) # ---> else rm -f $JTMP/*; rm -f $SYOT/*; fi <--- see below # # define subdir for intersttep temp/work files & in IDCAMS conversions # ensure wrk/nullfile present & empty, for use on DD DUMMY >wrk/nullfile # ensure present & empty # could use /dev/null, but some unix variants had problems with that # # Begin code to preserve GDGs if jobs abort # - see doc at www.uvsoftware.ca/mvsjcl.htm#Part_5 #Aug25/08 - modified to make coding independent of GDG subdir names # - code TOPNODE table in $RUNLIBS/ctl/jclunixop51 for JCL conversion # - code script to make desired subdirs in $RUNDATA/ctl/GDGmkdirs # Ensure $JGDG/subdirs exist for exportgen1 new files til Normal EOJ # - at Normal EOJ, will move $JGDG/subdir/files back to $RUNDATA/subdirs # Call script to create $JGDG/subdir for topnodes on files in JCL/scripts # $RUNDATA/ctl/GDGmkdirs #<-- make GDG/subdirs for datafile topnodes #===================== - user must code his subdirs in GDGmkdirs # # Test for any files in $JGDG/subdirs at begin job # (prior run abend not moving GDG/subdir/files back to $RUNDATA/subdirs) # - will prompt operator to move back or not (rerun from begining) # lsgdgs=$(ls $JGDG/*/* 2>/dev/null); # capture filenames in GDG/subdirs if [[ -n "$lsgdgs" ]]; then logmsg2 "WARN: files in jobtmp/GDG subdirs (from prior Abterm ERR?)" logmsg2 "---- files in $JGDG/*/* listed below:" echo "$lsgdgs" reply=x until [[ "$reply" == "y" || "$reply" == "n" ]] do logmsg2 "jobtmp/GDG/subdir/files must move/remove before rerun" logmsg2 "y = move back to \$RUNDATA/GDG/subdirs, restart step# ?" logmsg2 "n = do NOT move back (will erase), rerun from begining ?" logmsg2 "OR - may need to kill job & investigate ?" tty -s || break # test for login terminal, break if run by cron read reply done # if reply y - move files back if [[ "$reply" == "y" ]]; then logmsg2 "moving $JGDG/subdir/files back to \$RUNDATA/subdirs/" for psd in $JGDG/* { lspsd=$(ls $psd) if [[ "$lspsd" ]]; then sd=${psd##*/} mv -iv $psd/* $sd/ #================= fi } fi fi # if [[ $STEP != S0000 ]]; then logmsg2 "WARN: **restarting** at STEP=$STEP"; else # ensure $JGDG/subdirs exist to hold exportgen1 files until Normal EOJ # Normal EOJ will move $JGDG/subdir/files back to $RUNDATA/GDG/subdirs #Note - create user set of subdirs in 2 places, above for file test # - and here after 'rm -fr $JTMP/*' for non-restart rm -fr $JTMP/*; rm -fr $SYOT/*; # $RUNDATA/ctl/GDGmkdirs #<-- make GDG/subdirs for datafile topnodes #===================== - user must code his subdirs in GDGmkdirs fi # Default RUNDATE to system date yyyymmdd, but allow cmd line override # --> jobname.ksh RUNDATE=20091120 <-- override system date for this job # See explanations at www.uvsoftware.ca/mvscobol.htm#2E1 - 2E9 # - COBOL converter inserts unixwork1.cpy, unixproc1.cpy,& perform unixproc1 # - unixproc1 reformats $RUNDATE into various date formats for COBOL use if [[ -z "$RUNDATE" ]]; then RUNDATE=$(date +%Y%m%d); fi; export RUNDATE export RUNDTTM=$(date +%y%m%d:%H%M%S) # # Display various information at begining of JCL/script execution # - for the console log, info may be useful to debug problems logmsg2 "Begin Job=$JOBID2" logmsg1 "$scriptpath"
logmsg1 "Arguments: $args" logmsg1 "RUNLIBS=$RUNLIBS" logmsg1 "RUNDATA=$RUNDATA" logmsg1 "JTMP=$JTMP SYOT=$SYOT" logmsg1 "RUNDATE=$RUNDATE" uvtime W1D0 $JTMP/jobbgn export JSTEP=S0000 XSTEP=0 integer JCC=0 SCC=0 LCC=0; # # Allow for RESTART at any step by step=... argument on command line: # --> jobname.ksh step=S0020 <-- restart at step 2 if [[ -n "$step" ]]; then STEP="$step"; fi if [[ -z "$STEP" ]]; then export STEP=S0000; fi if [[ $STEP != S[0-9][0-9][0-9][0-9] ]] then logmsg2 "ERR: STEP=$STEP invalid"; exit 91; fi alias goto="<<${STEP}=A" return 0 } #----------------------------- end jobset51 -----------------------------
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 # converted from MVS JCL by Vancouver Utilities # - by Owen Townsend, UV Software, May 23/2007 # - this KORN shell function stored in $RUNLIBS/sfun # - see more doc at: www.uvsoftware.ca/mvsjcl.htm# # May23/07 - new system to prevent gen# increments if job abends # - exportgen1 writes new GDG files into jobtmp/subdirs # - this function called at Normal EOJ # to move jobtmp/subdir/files to $RUNDATA/subdirs/... #Aug25/08 - modified to make coding independent of GDG subdir names # - must code TOPNODE table in $RUNLIBS/ctl/jclunixop51 for JCL conversion # - must code script to make desired subdirs in $RUNDATA/ctl/GDGmkdirs # #Sep29/09 - JCL converter options insert $JGDG/... on exportgen1 # g0 - omits $JGDG/ so new GDGs in same subdir as old (jobset52) # g1 - inserts $JGDG/ on exportgen1 & JGDG=jobtmp/GDG (jobset52) # g2 - inserts $JGDG/ on exportgen1 & JGDG=$RUNDATA/jobtmp/GDG (jobset51) # - jobend51,jobabend51 did not have to change ($JGDG defined in jobset51/52) # # ** coding for function jobend51 ** # function jobend51 { # report jobtime (July2008 moved into jobend51 to save line in all scripts) uvtime W1D4 $JTMP/jobend $JTMP/jobbgn $JTMP/jobtimes # jobtmp ($JTMP) vital - ensure present if [[ -d $JTMP ]]; then : else logmsg2 "ERR: jobtmp subdir for JCL/script missing ? \$JTMP=$JTMP" logmsg2 "- investigate permissions?, JTMP dirnames changed?" logmsg1 "- enter to exit"; read reply; exit 92; fi # # move any GDG files in jobtmp/GDG/subdirs back to $RUNDATA/subdirs lsgdgs=$(ls $JGDG/*/* 2>/dev/null); # capture filenames in GDG/subdirs/... if [[ -n "$lsgdgs" ]]; then logmsg2 "moving $JGDG/subdir/files back to \$RUNDATA/subdirs/" for psd in $JGDG/* { lspsd=$(ls $psd) if [[ "$lspsd" ]]; then sd=${psd##*/} mv -iv $psd/* $sd/ #================= fi } fi # call job to update the GDG control file for any prior gen# processing # - as indicated by exportgen0 functions within this job # - resets next gen# 000000 if indicated & expiry date:time past # - increments next gen# if processing range low to high & resets at end uvcopy gdgupok1 #============== return 0 }
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# jobabend51 - function called at Abnormal Termination of JCL/scripts # - by Owen Townsend, UV Software, June 18/2007 # - ksh function stored in $RUNLIBS/sfun # - see doc at: www.uvsoftware.ca/mvsjcl.htm#Part_5 # May2007 - new system to prevent gen# increments if job abends # - exportgen1c writes new GDG files into jobtmp/subdirs # - this function called at Abnormal Termination, to report # new gens NOT moved jobtmp/subdir/files to $RUNDATA/subdirs/... # - also updates the gdgctl file, inserting an AB warning in history entries #Aug25/08 - modified to make coding independent of GDG subdir names # - must code TOPNODE table in $RUNLIBS/ctl/jclunixop51 for JCL conversion # - must code script to make desired subdirs in $RUNDATA/ctl/GDGmkdirs #Sep29/09 - JCL converter options insert $JGDG/... on exportgen1 # g0 - omits $JGDG/ so new GDGs in same subdir as old (jobset52) # g1 - inserts $JGDG/ on exportgen1 & JGDG=jobtmp/GDG (jobset52) # g2 - inserts $JGDG/ on exportgen1 & JGDG=$RUNDATA/jobtmp/GDG (jobset51) # - jobend51,jobabend51 did not have to change ($JGDG defined in jobset51/52) function jobabend51 { # report jobtime (July2008 moved into jobabend51 to save line in all scripts) uvtime W1D4 $JTMP/jobend $JTMP/jobbgn $JTMP/jobtimes # jobtmp ($JGDG) vital - ensure present if [[ -d $JGDG ]]; then : else logmsg2 "ERR: \$RUNDATA/jobtmp/GDG/ subdir missing ? " logmsg2 "- investigate permissions?, dirnames changed?" logmsg1 "- enter to exit"; read reply; exit 92; fi # errmsg if any GDG files in jobtmp/subdirs/ (Aug2008 moved here save code) lsgdgs=$(ls $JGDG/*/* 2>/dev/null); # capture filenames in GDG/subdirs/... if [[ -n "$lsgdgs" ]]; then logmsg2 "ERR: GDG files NOT moved from jobtmp/subdirs to $RUNDATA/subdirs" RV logmsg2 "- can rerun OK, since GDGs not added to RUNDATA/subdirs" logmsg2 "- OR restart at abterm step & reply y to move prompt" fi # report any GDG files in jobtmp/subdirs NOT moved back to $RUNDATA/subdirs # - also call uvcopy job to update gdgctl file with err entry for psd in $JGDG/* { lspsd=$(ls $psd) if [[ "$lspsd" ]]; then sd=${psd##*/} logmsg2 "ERR: $JGDG/$sd/files NOT moved to \$RUNDATA/$sd/ listed below:" # echo "$lspsd" (#disable here, listed by gdgupab1) uvcopy gdgupab1,fild1=$psd,arg1=$sd #================================== fi } # ensure operator acknowledges GDG files not moved back if [[ -n "$lsgdgs" ]]; then logmsg2 "- reply y/n acknowledge GDG msg, but no auto action" RV ACK fi return 0 }
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 # #Apr16/09 - GDG control files moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/... # to allow multiple $RUNDATA's to have different control files #Aug26/08 - increase recsize to 2047+1=2048 (allows 30 history entries) #Aug28/08 - name changes getgdg51->gdgget51,getgdg52->gdgget52, # gdgctlload1->gdgload1,gdgctlunload1->gdgunload1 # gdgctlupok1->gdgupok1,gdgctlupab1->gdgupab1 # # 1. uvcopy jcldata56,fild1=jcls,filo1=ctl/gdgctl51 # ============================================== # - prior job to create initital gdgctl51 (text file) # # 2. cp ctl/datafiles56 ctl/gdgctl51 # =============================== # - copy/rename # # 3. vi ctl/gdgctl51 <-- optional editing before loading Indexed file # =============== - modify no of generations (see sample below) # - possibly setup exception next=... (samples below) # #*4. uvcopy gdgload1,fili1=ctl/gdgctl51,filo1=ctl/gdgctl51I # ====================================================== # - load Indexed file for use by exportgen1, exportgen0,& jobend51 # # The gdgctl file specifies the no of generations to be maintained by the # exportgen1 function which writes new generations & deletes oldest generations # # The gdgctl file also provides prior generation exception processing # in conjunction with the exportgen0 function (see next=... examples below) # # ** sample input text file ctl/gdgctl51 ** # # gl/account.acntlist_ gdg=08 # gl/account.master_ gdg=10 next=000002(000002:000002)000000:000000 # gl/account.trans_ gdg=20 opt=c next=000001(000001:000012)070531:235959 # py/payroll.master_ gdg=30 # # jcldat56 creates only filenames & gdg=... with a default no of generations # You would then edit the text file modifying generations as desired # # You would probably not setup any next=... at this time, but it is possible # next=gen###(lowgen:higen#)yymmdd:HHMMSS # next=000000(000000:000000)000000:000000 # - will be set all zeros by gdgload1 if not coded on input # - see field explanations & examples at www.uvsoftware.ca/mvsjcl.htm#Part_5 #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# ** control file record format ctl/gdgctl51I ** # # 000:049 - filename example--> gl/account.master_ <--trailing underscore # 051:056 - gdg=.. - generations for this file (default set in jcldata56) # 058:062 - opt=c - option for oprtr confirm y or enter alternate gen# # 064:102 - next=... any input verified & adjusted to bytes 064-103 # next=gen###(lowgen:higen#)yymmdd:HHMMSS # next=000000(000000:000000)000000:000000 # zeros template/place-holder generated if not coded # 104:113 - jobname of last JCL/script to access this file # - signal to jobend function to reset next=... as appropriate # (reset next=000000 &/or increment next=... from low to high) # 114:126 - date/time yymmdd:HHMMSS file created by exportgen1 # - used by gdgupok1 to '+' flag history entry last exportgen1 # # 128:191 - 1st entry of multiple action history entries # - yymmdd:HHMMSS:g0_123456(123456:123456)JOBNAME S1234 PROGRAM + # - stored by exportgen0, exportgen1, jobend51?, jobend52? # - action entries shifted down & latest action stored here # 190:190 - gdgupok1 '+' flag if moved back from jobtmp/subdir (exportgen1) # # 192:255 - update history#2 (shifted from 128-191 by jobend1) # 256:319 - update history#3 (shifted from 192-255) # 320:1983- --- entries #4-#29 --- #1984:2045- update history#30 #2046:2046- '.' period marking end of record data #2047:2047- x'0A' Indexed record status byte # - see explanations & examples at www.uvsoftware.ca/mvsjcl.htm#Part_5 # opr='load gdgctl text file to Indexed file, shifting keywords over for maxkey' was=c5000 fili1=?ctl/gdgctl51,rcs=256,typ=LST filo1=?ctl/gdgctl51I,rcs=2047,typ=ISF,isk1=0(50) # # load zeros entries for next gen# & exportgen0 update/history entries # 1 2 3 4 5 6 7 #1234567890123456789012345678901234567890123456789012345678901234567890 lodv3=k0(100) next=gen###(lowgen:higen#)yymmdd:HHMMSS <-- next gen# override next=000000(000000:000000)000000:000000 next=######(######:######)######:###### <-- verify user coding yymmdd:HHMMSS:G1_123456(123456:123456)jobname S1234 programid <-- history 000000:000000:___000000(000000:000000)_______ _____ _________ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #1234567890123456789012345678901234567890123456789012345678901234567890 # 1 2 3 4 5 6 7
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
@run opn all open I/O files sxo 128,'0(50)' open the sort # # begin loop to get records, reformat,& put to the sort # - if codes on right (gdg=..., etc) prior to col 51 # shift over to allow 50 bytes for the filename key man20 get fili1,a0(200) get ctlfile record skp> man40 cmc a0(1),'#' comment line ? skp= man20 yes - bypass, get next clr b0(200),' ' clear reformat area mvu b0(80),a0,' ' move filename until ending blank scnp a0(80),' &' scan to 1st nonblank folwng filename mvc b50(80),ax0 ensure 50 bytes allowed for filenames # # clear cnt=... cntr=... or cntf=... scn b0(150),' cnt' cnt?=... to be cleared skp! 1 clr bx0(9),' ' clear cnt=... # # test for next=... coded on input, ifso verify & shift to byte 64 # - else insert zeros entry at byte 64 man30 scn b0(80),' next=' skp! man36 mvc n0(40),bx1 isolate user's next=... entry clr bx0(40),' ' clear next=... from original position cmcp n0(40),k200(40) verify users coding with table pattern skp! err1 man34 mvc b64(40),n0 restore user entry to byte 64+ skp man38 # # - user next=... entry not coded, insert zeros entry at byte 64 man36 mvc b64(40),k100 store zeros entry at byte 64+ # # common point to put record to the sort man38 sxp b0(128) put to the sort skp man20 repeat loop get/put to sort #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# end of input - now execute the sort man40 sxs execute the sort # # begin loop to get sorted records & load to Indexed file man50 sxg c0(128) get record from the sort skp> man90 # # create zeros entries for exportgen0,1,jobend update/history slots # - create zero entry only for 1st or for all by move overlapping ?? man52 mvc c128(64),k400 create zeros action history entrie#1 mvc c192(1920),c128 move overlap to create all 30 entries mvc c2046(1),'>' mark last data byte of record put filo1,c0(2047) write record to output file skp man50 repeat loop get/put sorted recs # # end of sorted records - close files & eoj man90 cls all eoj #-------------------------------------------------------------------- # Err rtns err1 msg n0(40) show users next=... entry msg k0(40) show next=... valid format msgw 'ERR: next=... format invalid, should fix & reload' mvc b123(4),'err1' flag record in error skp man34 #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# gdgget51 - get gdg=... for any file in $RUNDATA/ctl/gdgctl51I # - called by exportgen1 function # - by Owen Townsend, UV Software, May 2007 # - see GDG doc at www.uvsoftware.ca/mvsjcl.htm#Part_5 # #Apr16/09 - GDG control files moved from $RUNLIBS/ctl/ to $RUNDATA/ctl/... # to allow multiple $RUNDATA's to have different control files #Oct25/08 - chg to manulock filr1 typ=ISFl4, redm5l4, updl4 #Sep03/08 - add autolock option l2 on filr1=ctl/gdgctl51I,typ=ISFl2 #Aug26/08 - increase recsize to 2047+1=2048 (allows 30 history entries) #Aug28/08 - name changes getgdg51->gdgget51,getgdg52->gdgget52, # gdgctlload1->gdgload1,gdgctlunload1->gdgunload1 # gdgctlupok1->gdgupok1,gdgctlupab1->gdgupab1 # # gdgget51 called by exportgen1 as follows: # # uvcopy gdgget51,fili1=$lslbls,filo2=$lblcG,arg1=$lblb,arg2=$gen2,arg3=$gn # ======================================================================== # - use arg1=... filename as key to read Indexed file & return gdg=... value # # gdg=$? <-- calling script can capture gdg=... from return code # ====== #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# ** gdgget5_ versions ** # #*gdgget51 - this version called by exportgen1 # - to lookup ctl/gdgctl51I to get no of generations for the file # gdgget52 - version called by exportgen0 # - allows for prior version selection via ctl/gdgctl51 # # ** control file record format ctl/gdgctl51I ** # # 000:049 - filename example--> gl/account.master_ <--trailing underscore # 051:056 - gdg=.. - generations for this file (default set in jcldata56) # 058:062 - opt=c - option for oprtr confirm y or enter alternate gen# # 064:102 - next=... any input verified & adjusted to bytes 064-103 # next=gen###(lowgen:higen#)yymmdd:HHMMSS # next=000000(000000:000000)000000:000000 # zeros template/place-holder generated if not coded # 104:113 - jobname of last JCL/script to access this file # - signal to jobend function to reset next=... as appropriate # (reset next=000000 &/or increment next=... from low to high) # 114:126 - date/time yymmdd:HHMMSS file created by exportgen1 # - used by gdgupok1 to '+' flag history entry last exportgen1 # # 128:191 - 1st entry of multiple action history entries # - yymmdd:HHMMSS:g0_123456(123456:123456)JOBNAME S1234 PROGRAM + # - stored by exportgen0, exportgen1, jobend51?, jobend52? # - action entries shifted down & latest action stored here # 190:190 - gdgupok1 '+' flag if moved back from jobtmp/subdir (exportgen1) # # 192:255 - update history#2 (shifted from 128-191 by jobend1) # 256:319 - update history#3 (shifted from 192-255) # 320:1983- --- entries #4-#29 --- #1984:2045- update history#30 #2046:2046- '.' period marking end of record data #2047:2047- x'0A' Indexed record status byte # - see explanations & examples at www.uvsoftware.ca/mvsjcl.htm#Part_5 #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
uop=i31 was=a2000c9000k2000 filr1=${RUNDATA}/ctl/gdgctl51I,typ=ISFl4s2,rcs=2047,isk1=0(50) fili1=?lslbls,rcs=128,typ=LST filo2=?gdgctl1,rcs=128,typ=LSTt # load zeros entries for next gen# & exportgen0 update/history entries # 1 2 3 4 5 6 7 #1234567890123456789012345678901234567890123456789012345678901234567890 lodv3=k0(100) next=gen###(lowgen:higen#)yymmdd:HHMMSS <-- next gen# override next=000000(000000:000000)000000:000000 next=######(######:######)######:###### <-- verify user coding yymmdd:HHMMSS:G0_123456(123456:123456)jobname S1234 programid <-- history 000000:000000:G1_000000(000000:000000)_______ _____ _________ ######:######: <-- verify history ents $date:$time <-- values inserted above ${JSTEP} ${JOBID2} ${PROGID} ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ #1234567890123456789012345678901234567890123456789012345678901234567890 # 1 2 3 4 5 6 7 # k000=next=gen#..., k100=next=000..., k200=next=###... # k300=yym..., k400=000..., k500=###... # k600=$date:$time, k700=${JSTEP}, k800=${JOBID2}, k900=${PROGID} # # uvcopy gdgget51,fili1=$lslbls,filo2=$lblcG,arg1=$lblb,arg2=$gen2,arg3=$gn # ========================================================================= # - use arg1=... filename as key to read Indexed file & return gdg=... value @run opn all open files mvn g0(6),$arg2(6) store gen# selected by exportgen1 mvc g30(2),$arg3 store G# code from exportgen1 cmc g30(1),'G' spcfd on call ? skp= 1 mvc g30(2),'G1' no - default to G1 mvc g50(30),$jobstamp retrieve yymmdd:HHMMSS:JOBID # # begin loop to read ls filenames to get low & high gen#s for history entry # - disregard gen _000000, created to avoid problems when no existing files man20 get fili1,a0(200) get next ls filename skp> man26 mvc a200(200),a0 save high entry before EOF cmn g10(6),0 low gen# already stored ? skp> man20 scnr a0(90),'_' scan back to '_' ID gdg# mvc g10(6),ax1 save low gen# for history skp man20 # # EOF - extract high gen# from saved last record before EOF man26 scnr a200(90),'_' scan back to '_' ID gdg# mvc g20(6),ax201 save high gen# for history #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# store filename key from arg1 & perform random read man30 mvf c0(2047),$arg1(50) store key from arg1 in I/O area redm5l4 filr1,c0(2047) perform random read by key = skp> err1 skp< nolock # # store $JOBID2,date/time so gdgupok1 can flag '+' entries from exportgen1 mvc c104(10),k800 JOBID mvc c114(13),g50 date:time stamp put filo2,c0(128) write output to $JTMP/... # output file not used (as of June2007), return code used to return gdg=... scn c0(80),' gdg=' scan record for gdg=... skp! err1 # # store gdg=... value for return code man40 mvn $ca1,cx5(3) store gdg for return code # # build history action entry for exportgen0 in w/s for later move to ctlrec man50 mvc k400(13),k602 date:time mvc k414(2),g30 arg3 G1,G2,G3 mvc k417(6),g0 gen# selected mvc k424(6),g10 low gen# mvc k431(6),g20 high gen# mvc k438(9),k800 JOBID mvc k447(5),k700 STEP# mvc k453(9),k900 PROGID # # shift history down & insert new entry & update GDG control record mvc c5000(1920),c128 save current history mvf c128(64),k400(64) store new entry mvc c192(1856),c5000 restore history shifted down mvc c2046(1),'>' restore EOR ID char updl4 filr1,c0(2047) update gdgctl rec for jobend51 skp! err2 # # common point to close file, cancel job,& return gdg value or 0 man90 cls all close files can ' ',$ca1 cancel with return code gdg or 0 # # redm5l4 returned < already locked - prompt oprtr to retry nolock msg c0(50) show filename locked msgw 'ctl/gdgctl51I record locked for filename above - enter to retry' skp man30 # #--------------------------------------------------------------------- # filename not found or no gdg=... value coded in gdgctl file err1 msg c0(80) show filename not found msg 'ERR: arg1 filename_ matches no filename_ in ctl/gdgctl51I' msgw '- may continue, will use gdg default coded in exportgen1' mvn $ca1,0 set return code 0 skp man50 go store history entry in gdgctl # err2 msg c0(80) show filename update err msgw 'ERR: updating gdgctl51I record for jobend action' can ' ',97 #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Part 6 documents optional jobs that might be desired at some sites. Part 4 (which documents the step by step conversion procedures) will refer you to Part 6 for these optional procedures.
Optional jobs are documented very briefly in Part 4 with references to details & examples here in Part 6.
6A1. | jobparmx1/jobparms1 (optional) can be used to extract control cards |
from all JCLs so you can update them separately form the JCL/scripts. | |
The control card files are date-stamped to allow updates for future dates. | |
- see details & examples begining on page '6A1'. |
6B1. | jclstrip1 - cleanup converted JCL/scripts |
- remove non-essential code & extraneous comments | |
- remove mainframe steps that do not apply to unix/linux | |
- remove commented original JCL stmnts that may have been | |
useful during conversion & testing |
6C0. | Changing data file-types & record-sizes AFTER conversion |
- advantages changing some fixed-length files to Text files | |
- can use unix/linux system utilities (vi,lp,more,etc) | |
- convenient for data input files, parameter files, date control files, etc | |
- not possible for files with packed &/or binary fields. |
6C1. | Change selected DATA-files (append a Line-Feed after last non-blank) |
- can do this with a simple 'uvcp' | |
6D1. | Change JCL/script references to file-types & record-sizes |
- uvsorts/uvcps converted from mainframe SORT,IDCAMS,IEBGENER, etc | |
6E1. | Change corresponding COBOL program SELECTs to ORGANIZATION LINE SEQUENTIAL |
The VSE mainframe did not have GDG files, but we have found them useful to supply tape generation handling for VSE conversions. The Vancouver Utility GDG system was enhanced in May 2007, and some features now surpass the MVS mainframe implementation.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Depending on your site, you may have some initial preparations that must be performed before you can begin testing & debugging your JCL/scripts.
As an example we will present the Operating Instructions required for the optional jobs 'jobparmx1' & 'jobparms1'.
'jobparmx1' will extract jobparms (control cards, dates,etc) from JCL/scripts into separate files that may be updated before JCL/scripts run.
Control files will have a date-stamp appended (current date at gen time) Run control administrators may duplicate the files & append future dates which will be selected when the current data reaches or passes file dates
Also see 'jobparms1' which will be run at 6PM (before batch shift) to copy $RUNLIBS/jobparmx1/* to $RUNDATA/jobparms1, selecting the appropriate control card from any multiple dates for any 1 jobname_step_program
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 instrns below will output directly to jobparmx1/jobparmx2.
You could use tmp1/tmp2 to ensure no overwriting files in jobparmx1/jobparmx2. 'arg1=...' may specify a prefix to extract control cards from all JCL/scripts matching the prefix specified.
#1. cd $RUNLIBS <-- change to libraries (where jcls area)
#2. uvcopy jobparmx1,fild1=jcls,fild2=jobparmx1,fild3=jobparmx2,arg1=jclprefix ========================================================================== - extract control cards from 1 JCL/script direct to jobparmx1/jobparmx2 - 'jcl2ksh41' (convert 1 JCL) uses arg1=jclname
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The JCL converter generate lines 2-5 as '#<' comments. The SYS011 logical name used by COBOL program is defined by the exportfile on line 1 above, reproduced below on line 1a & followed by lines 1b & 1c showing sample values for the $SYMBOLS.
#1a. exportfile SYS011 jobparms1/${JOBID2}_${JSTEP}_${PROGID} ========================================================
#1b. exportfile SYS011 jobparms1/30905d04_S0020_e212108c ===================================================
cd $RUNDATA <-- jobset51 (function called at begin all jcls) - changes directory to $RUNDATA - so effective pathname might be as follows:
#1c. exportfile SYS011 /tax/testdata/jobparms1/30905d04_S0020_e212108c =================================================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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
6B2. | lists 2 steps DYNUTIL & IDCAMS before jclstrip1 (54 lines) |
6B3. | 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 # test oprtr jcpause/jcclear export PROGID=DYNUTIL export PARM=""; exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} exportfile E212528 e2125528/ttaxe.b8401d03 exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID} #< cat > $SYS011 <</*EOD #< DELETE 'SORTWK1 ==',POOL=POLMU5 #< /*EOD ## EXEC DYNUTIL,SIZE=96K #3---------------------------------------------------------------------- # DYNUTIL - convert DELETES only (but not for SORTWK_) #4---------------------------------------------------------------------- : # dummy step set cc 0 for status tests LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); alias goto=""; if ((SCC != 0)) then logmsg1 "step $JSTEP DYNUTIL abterm $SCC" alias goto="<<S9900=A"; fi goto #1======================== begin step#S0020_IDCAMS ========================= S0020=A JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; logmsg1 "Begin Step $JSTEP IDCAMS (#$XSTEP)" stepctl51 # test oprtr jcpause/jcclear export PROGID=IDCAMS export PARM=""; exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID} #< cat > $SYS011 <</*EOD #< DEL E2125528.TTAXE.B8401D03 PURGE - #< CATALOG(VSAM.USERCAT.CATALOG.MU5585 UCAT1) #< DEF CL (NAME(E2125528.TTAXE.B8401D03) - #< VOL(PRD318 ) - #< RECSZ(546 546) - #< FILE(E212528) - #< CISZ(6144) - #< CYL(70 70) - #< CATALOG(VSAM.USERCAT.CATALOG.MU5585 UCAT1) #< /*EOD ## EXEC IDCAMS,SIZE=200K #3---------------------------------------------------------------------- rm -f e2125528/ttaxe.b8401d03 uxcp "fili1=wrk/nullfile,typ=RSF,rcs=546,filo1=e2125528/ttaxe.b8401d03,typ=RSF,rcs=546" LCC=$?; ((SCC+=LCC)); #4---------------------------------------------------------------------- S0020C=$SCC; ((JCC+=SCC)); alias goto=""; if ((SCC != 0)) then logmsg1 "step $JSTEP IDCAMS abterm $SCC" alias goto="<<S9900=A"; fi goto
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#1======================== begin step#S0010_DYNUTIL ========================= S0010=A JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)" stepctl51 # test oprtr jcpause/jcclear export PROGID=DYNUTIL export PARM=""; exportfile E212528 e2125528/ttaxe.b8401d03 #1======================== begin step#S0020_IDCAMS ========================= S0020=A JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; logmsg1 "Begin Step $JSTEP IDCAMS (#$XSTEP)" stepctl51 # test oprtr jcpause/jcclear export PROGID=IDCAMS export PARM=""; exportfile SYSOUT $SYOT/${JOBID2}_${JSTEP}_${PROGID} exportfile SYS011 jobparms2/${JOBID2}_${JSTEP}_${PROGID} ## EXEC IDCAMS,SIZE=200K #3---------------------------------------------------------------------- rm -f e2125528/ttaxe.b8401d03 uxcp "fili1=wrk/nullfile,typ=RSF,rcs=546,filo1=e2125528/ttaxe.b8401d03,typ=RSF,rcs=546" LCC=$?; ((SCC+=LCC)); #4---------------------------------------------------------------------- S0020C=$SCC; ((JCC+=SCC)); alias goto=""; if ((SCC != 0)) then logmsg1 "step $JSTEP IDCAMS abterm $SCC" alias goto="<<S9900=A"; fi goto
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# jclstrip1 - strip non-essential code from JCL/scripts # - for City of Laval, June 2008, by Owen Townsend, UV Software # # 1a. mv jcls jcls.old <-- rename current jcls directory # 1b. mkdir jcls <-- make new dir to receive stripped JCL/scripts # # 2. uvcopy jclstrip1 jcls.old jcls <-- strip all JCL/scripts # ============================== while copying jcls.old to jcls # opr='$jobname - strip non-essential steps in JCL/scripts' fild1=?indir,typ=DIR,rcs=80 #input directory fili1=xxxxxxxx,typ=LST,rcs=256 #current input file from directory fild2=?outdir,typ=DIR,rcs=80 #output directory filo2=xxxxxxxx,typ=LSTtp775,rcs=256 #current output file # # Table of STEP names to be stripped lod=k0(20) LISTLOG PRTLOG TDYNASN DYNUTIL DYNOPEN BSTTWAIT E173001C VSECMD IPCPBTCH SPOB766 ~~~~~~~~~~~~~~~~~~~~ #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
@run opn fild1 open input directory opn fild2 open output directory (must exist) msgwya1 '- did you: mv jcls jcls.old & mkdir jcls (new/empty) ?' cmc $arg1(1),'y' skp= man10 can 'cancelled - reply not "y"' # # begin outer loop to read directory for next filename man10 get fild1,a0(80) get next record (filename) in directory skp> man90 (cc set > at EOD) skp< man10 (cc set < on subdir vs file) # # create input filename by concat: indir/infile & open clr f0(300),' ' mvu f100(80),$fild1,x'00' move dirname until ending null cat f100(80),'/' concat the '/' cata8 f100(80),a0(80) concat current filename (a8 null terms) mvc $fili1,f100 store input filename before open opn fili1 open current input file # # create same filename in output subdir & open mvu f200(80),$fild2,x'00' move output dirname until null reached cat f200(80),'/' concat the '/' cata8 f200(80),a0(80) concat current filename (a8 null terms) mvc $filo2,f200 store output filename before open opn filo2 open current output file # # copy JCL/script to 1st step divider line man20 bal getr get next line into area 'b' skp> man80 cmc b0(5),'#1===' step divider line ? skp= man30 put filo2,b0 copy to output file skp man20 # # begin each step (step divider line found) # #1======================== begin step#S0020_DYNUTIL ======================== # extract step-name & match to table of steps to be stripped man30 mvn $ca0,0 clear step strip switch clr d0(200),' ' clear work area scn b0(80),'_' scan to '_' preceding stepname mvu d0(8),bx1,' ' isolate stepname lok k0(20),k0(8),d0(8) lookup table of steps to strip skp! 1 man32 mvn $ca0,1 set step strip switch skp man60 go copy step divider & get next #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# begin loop to copy until next step divider line # On all steps - drop the '#<' comment lines # - original SYSIN lines on IDCAMS, etc # On steps matching table above (strip switch set) # - drop all lines except for: # S0020=A # JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; # logmsg1 "Begin Step $JSTEP DYNUTIL (#$XSTEP)" # stepctl51 # test oprtr jcpause/jcclear # export PROGID=DYNUTIL # export PARM=""; # exportfile E212003 mstr/e2123003.itaxe.transdam <- drop SYSOUT/SYS011 # exportgen1 E212999 $JTMP/tape/tu.f01.e212-foncie_ # man40 cmc b0(5),'#1===' step divider line ? skp= man60 yes - go output & get next cmc b0(2),'#<' orig SYSIN IDCAMS, etc skp= man62 yes - bypass output & get next cmn $ca0,1 stripping this step ? skp< man60 no - go output & get next # # strip switch set - drop lines (except as described above) man42 cmcp b0(7),'S####=A' skp= man60 cmc b0(6),'JSTEP=' skp= man60 cmc b0(6),'logmsg' skp= man60 cmc b0(7),'stepctl' skp= man60 cmc b0(7),'export ' skp= man60 cmc b0(9),'exportgen' skp= man60 cmc b0(10),'exportfile' skp= man44 skp man62 drop, bypass output, get next # # exportfile (strip switch set) - drop if SYSOUT or SYS011 man44 cmc b10(3),' SYS' skp= man62 yes: drop, bypass output, get next skp man60 retain exportfiles except SYS... # # common point to copy current line & return to get next # - until end of current step man60 put filo2,b0(256) output record man62 bal getr get next line skp> man80 cmc b0(5),'#1===' step divider line ? skp= man30 skp man40 #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# EOF current file - output counts, close files,& return for next file pair man80 cls fili1 close current input file cls filo2 close current output file skp man10 # # end input directory - display stats, close all dirs & files, & eoj man90 cls all eoj # #---------------------------------------------------------------------- # getr - subrtn to get next line of JCL/script from current input file # - bypasses cmts, clrs 72-80, squeezes to 1 blank between words getr get fili1,b0 get next line of current JCL/script skp> getr9 (cc > at EOF) # # copy to area c & squeeze to 1 blank between words # - ##commented out, not required yet ? ## mvc c0(256),b0 ## sqzl1c1 c0(100),' ' squeeze to 1 blank between words (c1) # & leave 1 blank before 1st word (l1) # return with cc= (not EOF) or cc> (at EOF) getr8 ret= getr9 ret>
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
When converting mainframe JCL,COBOL,& DATA to run on Unix,Linux,or Windows, it is safer to make as few changes as possible until after parallel runs to prove the conversions correct.
You might then want to change some DATA files from Fixed-Length records to Text records (variable length records terminated by Linefeeds), because you can then take advantage of the Unix/Linux/Windows system utilities to view, print,& edit files on the new system.
This would be convenient for data input files, parameter files, date control files, etc. Note that this is not possible for files with packed &/or binary fields (often used in master/history files).
To change files from Fixed-Length to Text files (variable-length terminated by a LineFeed), there are 3 tasks to perform:
For example, we might change a sales transaction file from fixed to text using uvcp as follows:
uvcp "fili1=dat1/vendorpay2,typ=RSF,rcs=64,filo1=tmp/venpay2,typ=LSTt,rcs=80" =============================================================================
We increased rec-size as a saftey precaution. If somebody editing the file left extra trailing blanks, they could cause the record to be split into 2 records. For text records, we recommend a 25-50% saftey margin.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#0. Login uvadm --> /home/uvadm
#1. uvhd dat1/vendorpay1 r64h2 <-- uvhd Fixed-Length file (BEFORE conversion) ========================== - option 'r64' Fixed-length 64 byte records - option 'h2' vertical hexadecimal display
10 20 30 40 50 60 0123456789012345678901234567890123456789012345678901234567890123
DELL10 P 20100131 INV00010 000195000 Dell server 2900 4444332522333333332244533333223333333332466627677672333322222222 45CC10000020100131009E60001000000195000045CC03526520290000000000
HP0010 P 20100215 INV00020 000350000 HP XW9400 Workstation 4533332522333333332244533333223333333332452553333256767767666222 800010000020100215009E60002000000350000080087940007F2B34149FE000
HP0010 P 20100215 INV00020 000042500 HP LCD Monitor 4533332522333333332244533333223333333332452444246667672222222222 800010000020100215009E600020000000425000800C340DFE94F20000000000
Note |
|
#2. uvcp "fili1=dat1/vendorpay2,typ=RSF,rcs=64,filo1=tmp/vpay2,typ=LSTt,rcs=80" ===============================================================================
#3. uvhd dat1/vendorpay2 th2 <-- uvhd Text file (variable lth AFTER conversion) ======================== - option 't' for Text files - option 'h2' vertical hexadecimal display
10 20 30 40 50 60 0123456789012345678901234567890123456789012345678901234567890123
DELL10 P 20100131 INV00010 000195000 Dell server 2900 444433252233333333224453333322333333333246662767767233330 45CC10000020100131009E60001000000195000045CC035265202900A
HP0010 P 20100215 INV00020 000350000 HP XW9400 Workstation 45333325223333333322445333332233333333324525533332567677676660 800010000020100215009E60002000000350000080087940007F2B34149FEA
HP0010 P 20100215 INV00020 000042500 HP LCD Monitor 4533332522333333332244533333223333333332452444246667670 800010000020100215009E600020000000425000800C340DFE94F2A
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The Vancouver Utilities provide uvcopy jobs (jclmass1/2/3) to mass change file-types & record-sizes in all JCL/scripts, while copying them from 1 directory to a 2nd directory.
The only place file-types & record-sizes were coded in mainframe JCL is in utilities such as SORTs, IDCAMS, IEBGENERs, etc. The JCL converter has converted these to 'uvsort's & 'uvcp's. For example, here are relevant lines extracted from demo JCL/script 'jar200.ksh' (listed at VSEJCL.doc#1C2').
##JOB JAR220 export PROGID=SORT exportfile SORTIN1 ar/sales.items exportfile SORTOUT $JTMP/%srtext #3---------------------------------------------------------------------- uvsort "fili1=$SORTIN1,rcs=64,typ=RSF,filo1=$SORTOUT,rcs=64,typ=RSF\ ,keys=(30,6,c,a,0,6,c,a)" #4----------------------------------------------------------------------
If we wish to change the ar/sales.items file from fixed-length 64 byte records to text (variable-length records terminated by LineFeeds), the uvsort might be:
uvsort "fili1=$SORTIN1,rcs=80,typ=LST,filo1=$SORTOUT,rcs=80,typ=LSTt\ ===========================**=====***====================**=====****=
We have increased the record-size to 80 for saftey, in case somebody editing the sales file might leave trailing blanks that would cause record splitting if max length were left at 64. Option 't' on output file typ=LSTt will drop any trailing blanks by scanning back to last non-blank before inserting LineFeed.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is a plan to automatically change desired files from Fixed-Length to Text.
$JTMP/%sales.sortfile rcs=00064 typ=RSF cnt=0001 job=jar200 $JTMP/%srtext rcs=00064 typ=RSF cnt=0001 job=jar220 ar/sales.items rcs=00064 typ=RSF cnt=0003 job=jar220 gl/account.master rcs=00080 typ=RSF cnt=0001 job=jgl350 gl/account.master2 rcs=00080 typ=ISF cnt=0001 job=jgl360 gl/account.tran1 rcs=00064 typ=RSF cnt=0001 job=jgl200 gl/account.trans rcs=00080 typ=RSF cnt=0001 job=jgl410 gl/account.trans(+1) rcs=00064 typ=RSF cnt=0001 job=jgl200
$JTMP/%sales.sortfile rcs=00064 typ=RSF cnt=0001 job=jar200 $JTMP/%srtext rcs=00064 typ=RSF cnt=0001 job=jar220 ar/sales.items rcs=00064 typ=RSF cnt=0003 job=jar220 nrcs=80 ntyp=LSTt gl/account.master rcs=00080 typ=RSF cnt=0001 job=jgl350 gl/account.master2 rcs=00080 typ=ISF cnt=0001 job=jgl360 gl/account.tran1 rcs=00064 typ=RSF cnt=0001 job=jgl200 nrcs=80 ntyp=LSTt gl/account.trans rcs=00080 typ=RSF cnt=0001 job=jgl410 nrcs=128 ntyp=LSTt gl/account.trans(+1) rcs=00064 typ=RSF cnt=0001 job=jgl200 nrcs=80 ntyp=LSTt
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are the step by step procedures, using the demo set of JCL/scripts provided in /home/uvadm/vsetest/... This demo assumes you have setup user 'vsetest' & copied all demo files from /home/uvadm/vsetest/* to /home/vsetest/ as documented at VSEJCL.htm#1P2. This demo also assumes you have converted the supplied mainframe JCLs supplied in subdir jcl0/... to scripts in jcls/...
#0a. login vsetest --> /home/vsetest/ ============= #0b. cd testlibs --> /home/vsetest/testlibs/ ===========
#1. uvcopy jclmass1,fild1=jcls,filo2=ctl/ctlfile_jm1 ================================================ - 1st run jclmass1 to create control file of existing files/typ/rcs
#2. uvcopy jclmass2,fili1=ctl/ctlfile_jm1,filo1=ctl/ctlfile_jm2 =========================================================== - sort & data reduce to 1 line per 'filename rcs=... typ=...'
#3. cp ctl/ctlfile_jm2 ctl/ctlfile_jm3 ================================== - create copy for editing (so we can save original)
#4. vi ctl/ctlfile_jm3 <-- edit/append new ntyp=... & nrcs=... ================== - see samples below
#5. uvcopy loadctlI,fili1=ctl/ctlfile_jm3,filo1=ctl/ctlfile_jm3I ============================================================ - load control file to Indexed file for random lookup by filename
#6. uvcopy jclmass3,fild1=jcls,fild2=jcls.new,fili3=ctl/ctlfile_jm3 =============================================================== - run job to mass change uvsort/uvcp typ=.../rcs=... via ctlfile
#7a. alldiff2 jcls jcls.new <-- create differences report in tmp/... ====================== #7b. vi tmp/jcls.new.dif <-- verify changes ===================
#8a. mv jcls jcls.old <-- save old jcls/ ================ #8b. mv jcls.new jcls <-- change name of new to active dir ================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Use the 'alldiff2' script to compare all files in jcls/... & jcls.new/... and capture the 'diff' report in tmp/jcls.new.dif. alldiff2 uses the unix/linux 'diff' is a fantastic tool that shows you the changed lines (old identified by '<' & new identified by '>' markers).
#7a. alldiff2 jcls jcls.new <-- create differences report in tmp/... ====================== #7b. vi tmp/jcls.new.dif <-- verify changes ===================
36c36 < uvsort "fili1=$SORTIN1,rcs=64,typ=RSF,filo1=$SORTOUT,rcs=64,typ=RSF\ --- > uvsort "fili1=$SORTIN1,rcs=00080,typ=LSTt,filo1=$SORTOUT,rcs=64,typ=RSF\ diff file# 11 - jcls/... vs jcls.new/jar200.ksh
39c39 < uvsort "fili1=$SORTIN1,rcs=64,typ=RSF,filo1=$SORTOUT,rcs=64,typ=RSF\ --- > uvsort "fili1=$SORTIN1,rcs=00080,typ=LSTt,filo1=$SORTOUT,rcs=64,typ=RSF\ diff file# 12 - jcls/... vs jcls.new/jar220.ksh
37c37 < uvsort "fili1=$SORTIN1,rcs=64,typ=RSF,filo1=$SORTOUT,rcs=64,typ=RSF\ --- > uvsort "fili1=$SORTIN1,rcs=00080,typ=LSTt,filo1=$SORTOUT,rcs=00080,typ=LSTt\ diff file# 15 - jcls/... vs jcls.new/jgl200.ksh
38c38 < uvcp "fili1=$SORTIN1,rcs=64,typ=RSF,filo1=$SORTOF1,rcs=64,typ=RSF,filo2=$SORTOF2\ --- > uvcp "fili1=$SORTIN1,rcs=00080,typ=LSTt,filo1=$SORTOF1,rcs=64,typ=RSF,filo2=$SORTOF2\ diff file# 24 - jcls/... vs jcls.new/splitsl1.ksh
4 different of 26 files compared jcls to jcls.new
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The COBOL converter assumes fixed-length files (as on the mainframe) except for filenames that might indicate printer or card (SYSIN parameter) files. The converter matches the filenames in the SELECT stmnt to an internal table of keywords such as: printer, report, line, sysin, card, param, etc. Obviously not perfect & you may have to manually change after conversion.
We must change SELECT statements from default 'ORGANIZATION RECORD SEQUENTIAL' to 'ORGANIZATION LINE SEQUENTIAL' for all PRINTER files & all SYSIN parameter files for instream data in the JCL/scripts.
In addition, you may wish to change SELECTs to 'ORGANIZATION LINE SEQUENTIAL' for some other data files that you decide would be more convenient as Text files. Text files are more convenient on unix/linux systems, since they have the LineFeeds required by vi,lp,cat,more,etc.
select saledtl assign external saledtl organization RECORD sequential <-- Before access mode sequential.
select saledtl assign external saledtl organization LINE sequential <-- After access mode sequential.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The following procedure will copy all COBOL programs from 1 subdir to a 2nd subdir while changing file type from 'ORGANIZATION RECORD SEQUENTIAL' to 'ORGANIZATION LINE SEQUENTIAL' for desired files as indicated in a control file whose Indexed key is 'program-name + FDname' (external name in SELECT).
Before running these procedures on your COBOL programs, you can get familiar with these procedures using the sample COBOL programs provided. First see VSEJCL.htm#1P1 to setup userid /home/vsetest & copy supplied samples from /home/uvadm/vsetest.
#0a. Login vsetest --> /home/vsetest #0b. cd testlibs --> /home/vsetest/testlibs
#1. cblmass11,fild1=cbls,filo2=ctl/ctlfile_cm11 =========================================== - create ctl/ctlfile_cm11 (see sample report below)
#2. uvsort "fili1=ctl/ctlfile_cm11,rcs=128,typ=LSTt\ filo1=ctl/ctlfile_cm12,key1=0(22),del1=0(1):*" ====================================================== - sort on program name 0(14) & FDname 14(8) - drop report headings '*' in 1st byte (could also do with vi below)
#2a. sort -o ctl/ctlfile_cm11 ctl/ctlfile_cm12 ========================================= - Alternatively, could use Unix system sort & drop headings with vi
#3. vi ctl/ctlfile_cm12 <-- edit/code '=L' bytes 35-36 on desired lines =================== - see samples below
#4. uvcopy cblmass12,fili1=ctl/ctlfile_cm12,filo1=ctl/ctlfile_cm12I =============================================================== - load Indexed file for cblmass13
#5. uvcopy cblmass13,fild1=cbls,fild2=cbls.new,fili3=ctl/ctlfile_cm12I ================================================================== - run job to mass change to ORG LINE Seqntl via ctlfile
#6a. alldiff2 cbls cbls.new <-- saves diff file in tmp/cbls.new.dif ====================== #6b. vi tmp/cbls.new.dif <-- verify changes ===================
#7a. mv cbls cbls.old <-- save old cbls/ ================ #7b. mv cbls.new cbls <-- change name of new to active dir ================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
*cblmass11 COBOL File Info Dir=cbls 2010/06/21_14:30:28 *program-name FDname OAML=L IO rcsz copybook.cpy DDname Wrts Advs * 1 2 3 4 5 6 7 *12345678901234567890123456789012345678901234567890123456789012345678901234567 *============================================================================= car100.cbl custmas RS I 256 custmas.cpy custmas car100.cbl nalist L L O 120 nalist 2 2 car200.cbl custmas IR I 256 custmas.cpy custmas car200.cbl saledtl RS I 64 saledtl.cpy saledtl car200.cbl salelst R L O 120 sdline.cpy sys035 2 2 car300.cbl sysin1 R I 80 sysin cgl100.cbl acctmas RS I 128 acctmas cgl100.cbl actlist L L O 120 actlist 1 1 cgl200.cbl glmsnew RS O 128 glmsnew 1 * cgl200.cbl glmsold RS I 128 glmsold cgl200.cbl gltrans RS I 80 gltrans *Total programs=18, files=31, hits=22
Note |
|
car100.cbl custmas RS I 256 custmas.cpy custmas car100.cbl nalist L L O 120 nalist 2 2 car200.cbl custmas IR I 256 custmas.cpy custmas car200.cbl saledtl RS =L I 64 saledtl.cpy saledtl car200.cbl salelst R L=L O 120 sdline.cpy sys035 2 2 car300.cbl sysin1 R =L I 80 sysin cgl100.cbl acctmas RS I 128 acctmas cgl100.cbl actlist L L O 120 actlist 1 1 cgl200.cbl glmsnew RS O 128 glmsnew 1 * cgl200.cbl glmsold RS I 128 glmsold cgl200.cbl gltrans RS =L I 80 gltrans
car200.cbl saledtl code '=L' by choice (tran type files OLS convenient) car200.cbl salelst code '=L' should be, since printer file (wrts/advs counts) car300.cbl sysin1 code '=L' should be, since SYSIN in cnvMF4 table cgl200.cbl gltrans code '=L' by choice (tran type files OLS convenient)
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
000(14) - program-name 014(16) - FDname 031(01) - existing file organization (Record seqntl, Line seqntl, Indexed) - 'L' coded if ORG 'LINE' Seqntl on select 032(01) - file access (Seqntl, Random, Dynamic) 033(01) - file Mode 'V' Variable in FD, ' ' for Fixed 034(01) - file type (Line Seqntl by Advancing) - 'L' coded if 'ADVANCING' found on write record for this file 035(02) - '=L' coded manually to cause cblmass13 to change to OLS 038(02) - opened (Input, Output, IO) 040(01) - '*' if record contains size not= pic 01 size 041(04) - recsz 046(14) - copybook 060(09) - DDname 069(04) - count 'writes' for this file 074(04) - count 'advances' for this file
Why change the COBOL program file SELECTs ? - from ORGANIZATION RECORD SEQUENTIAL - to ORGANIZATION LINE SEQUENTIAL
After conversion from mainframe to unix/linux - some sites may want to change some Fixed-Length files to Text-files - text files are more user friendly on unix/linux - since they have the LineFeeds required by vi,lp,cat,more,etc
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We haved not yet automated the selection of the COBOL program files that need to be changed to 'ORGANIZATION LINE SEQUENTIAL' based on our earlier selection of the data files as on page '6D2' where we coded 'ntyp=LSTt' in the control file for files we want to change to Text (ORG Line Seqntl).
But the JCL Files report might will help you relate the data-file names to the COBOL program & DDnames. Run scripts 'cobfiles5A' & 'jobfiles5A' to generate xref/jclfil52a.
#0a. Login vsetest --> /home/vsetest #0b. cdl --> /home/vsetest/testlibs
#1. cobfiles5A cbls cpys maps =========================
#2. jobflow5A jcl3 ==============
#3. vi xref/jclfil52a =================
jclfil52 ** JCL report with COBOL info ** 2010/06/20_10:12:37 jobname.jcl #st progname.cbl DDname genf OAM open recsz copybook.cpy file ================================================================================
jar200.ksh 0010 sort sortin1 ar/sales.items jar200.ksh 0010 sort sortout $JTMP/%sales.sortfile jar200.ksh 0010 uvsort fili1=rcs=64,typ=RSF 64 $SORTIN1 jar200.ksh 0010 uvsort ar/sales.items jar200.ksh 0010 uvsort filo1=rcs=64,typ=RSF 64 $SORTOUT jar200.ksh 0010 uvsort $JTMP/%sales.sortfile jar200.ksh 0010 uvsort keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85" jar200.ksh 0020 car200.cbl saledtl SS_ I___ 64 saledtl.cpy $JTMP/%sales.sortfile jar200.ksh 0020 car200.cbl custmas IR_ I___ 256 custmas.cpy ar/customer.master.indexed jar200.ksh 0020 car200.cbl sys035 S__ O___ 120 sdline.cpy $RPTS/salesrptEcar200${JSTEP}_01
Note |
|
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 joblogs for programmer testing/review |
- captures console log for 1 job at a time for immediate review |
8F1. | capture all console I/O messages for entire login session |
- primarily for production run error checking | |
- cleanup console logs (remove screen control characters) |
8F2. | Viewing your 'cleaned up' console log files |
- processing console logs via nightly 'cron' jobs |
8G1. | capturing console logs from cron jobs by mail |
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 the '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
The profiles defines many environmental-variables. What is an environmental- variable ? Some important env-vars for mainframe conversions are TESTLIBS, TESTDATA, PRODLIBS, PRODDATA, RUNLIBS,& RUNDATA. The common_defines provided defines these as follows: (may be modified for your site depending on the file systems setup by your system administrator).
export TESTLIBS=/p1/testlibs <-- defs in /home/uvadm/env/common_defines export TESTDATA=/p1/testdata export PRODLIBS=/p2/prodlibs export PRODDATA=/p2/proddata
The 'stub_profile' defines 'RUNLIBS' & 'RUNDATA' as follows:
export RUNLIBS=/p1/testlibs <-- for programmers export RUNDATA=/p1/testdata - - - OR - - - export RUNLIBS=/p2/testlibs <-- for operators export RUNDATA=/p2/testdata
The 'common_profile' uses $RUNLIBS & $RUNDATA to define other items, example:
export PATH=$PATH:$RUNLIBS/jcls
#04. What are some other items defined using $RUNLIBS & $RUNDATA ? (You could use 'vi' to /search common_profile for /RUNLIBS & /RUNDATA)
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 ACCTMAS gl/account.master_ ===================================== exportgen1 ACTLIST $JGDG/gl/account.acntlist_ =============================================
As you can see our filenaming convention for GDG files is the trailing '_'. The generation# follows the '_' on the actual filenames in data directories. (see examples at '5B1')
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
common_defines suggests that TESTLIBS/TESTDATA or RUNLIBS/RUNDATA might be:
--- in common_defines --- export RUNLIBS=/p1/testlibs <-- directory design suggested export RUNDATA=/p1/testdata
--- in stub_profile --- export RUNLIBS=$HOME/testlibs <-- for programmer training export RUNDATA=$HOME/testdata
Note |
|
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/..., & change the source executions to:
. /home/appsadm/env/common_profile ==================================
Note that we do supply an alternate version called 'stub_profile_appsadm' for you to copy from /home/uvadm/env/ to /home/appsadm/env/. See listing at ADMjobs.htm#1C8. It has the changes shown above.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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#01 #!/bin/ksh k#02 ##JGL100 JOB 'LIST GL MASTER CHART OF ACCOUNTS' k#03 export JOBID2=JGL100; scriptpath="$0"; args="$*" k#04 if [[ -z "$JOBID1" ]]; then JOBID1=JGL100; fi; export JGL100 k#05 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done k#06 integer JCC=0 SCC=0 LCC=0 # init step status return codes k#07 autoload jobset51 jobset52 jobend51 jobabend51 logmsg1 logmsg2 stepctl51 k#08 autoload exportfile exportgen0 exportgen1 exportgenx exportgenall k#10 jobset51 # call function for JCL/script initialization k#11 goto k#12 S0000=A k#17 ##STEPA EXEC PGL100,HLQ=GL,YEAREND=2003 #<-- PROC1 exp k#18 HLQ="GL";YEAREND="2003"; k#20 #1======================= begin step#S0010 CGL100 ======================== k#21 S0010=A k#22 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto=""; k#23 logmsg2 "******** Begin Step $JSTEP cgl100 (#$XSTEP) ********" k#24 stepctl51 # test oprtr jcpause/jcclear k#25 ##STEP010 EXEC PGM=CGL100,REGION=1024K,PARM=&YEAREND k#26 export PROGID=cgl100 k#27 export PARM="$YEAREND" k#28 exportgen0 ACCTMAS gl/account.master_ k#29 exportgen1 ACTLIST $JGDG/gl/account.acntlist_ k#30 #exportgen1 $JGDG/subdir/temp-file, moved to outdir at Normal EOJ k#31 exportfile SYSOUT $SYOT/${JSTEP}_SYSOUT k#33 logmsg2 "Executing--> cobrun $ANIM $RLX/cgl100" k#34 #3---------------------------------------------------------------------- k#35 cobrun $ANIM $RLX/cgl100 k#36 #4---------------------------------------------------------------------- k#37 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto=""; k#38 if ((S0010C != 0)) k#39 then logmsg2 "ERR: step#$JSTEP cgl100 abterm $SCC" k#40 alias goto="<<S9900=A"; fi k#41 goto k#42 #8====================================================================== k#43 S9000=A k#44 jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs k#45 logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP" k#46 exit 0 #jclunix51 ver:20091118 b2c0d1e2f3g1i1j0k3l20m4n3o0p0r0s0t1u1w0x0y1 k#47 #9====================================================================== k#48 S9900=A k#49 logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK k#50 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs k#51 exit $JCC
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
On the mainframe, new generations were not updated until the job Terminated Normally, which meant you could just fix the problem & rerun the job, without having to remove the new generations.
Our converted JCL/scripts provide this functionality by writing new GDG's to a temporary subdir (see $JGDG/gl/account.acntlist_ above). At normal EOJ, function 'jobend51' will move the temp files to the appropriate output subdir. The code lines (in our sample job jgl100.ksh) involved in GDG file handling listed below. See more explanations at '5D1' & '5D2'.
k#10 jobset51 # call function for JCL/script initialization k#29 exportgen1 ACTLIST $JGDG/gl/account.acntlist_ k#44 jobend51 #move GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs k#50 jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs
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#02 ##JAR200 JOB 'TEST/DEMO MVS JCL CONVERT' k#03 export JOBID2=JAR200; scriptpath="$0"; args="$*" k#04 if [[ -z "$JOBID1" ]]; then JOBID1=JAR200; fi; export JAR200 k#05 for arg in $args; do if [[ "$arg" == *=* ]]; then export $arg; fi; done k#10 jobset51 # call function for JCL/script initialization k#11 goto <-- where does this goto ? k#12 S0000=A k#15 S0010=A - - - step 1 details - - - k#42 S0020=A - - - step 2 details - - - k#64 S9000=A - - - Normal Termination - - - k#69 S9900=A - - - Abnormal Termination - - -
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 script captures the logs into subdir joblog/... in your current working directory.
For example, you could run demo JCL/script jar100.ksh & capture the log into $RUNLIBS/joblog/jar100.log as follows:
#1. login as yourself --> your homedir #2. cdl --> alias cdl='cd $RUNLIBS' (might be /home/userxx/testlibs/.)o
#3. jar100.ksh <-- run directly, shows log on screen only ==========
#3a. joblog1 jar100.ksh <-- run via joblog1 script ================== - to capture log in a file $RUNLIBS/joblog/jar100.log
#4. more joblog/jar100.log <-- display the log file ======================
080827:155517:JAR100: Begin Job=JAR100 080827:155517:JAR100: /home/mvstest/testlibs/jcls/jar100.ksh 080827:155517:JAR100: RUNLIBS=/home/mvstest/testlibs 080827:155517:JAR100: RUNDATA=/home/mvstest/testdata 080827:155517:JAR100: Begin Step S0010 car100 (#1) 080827:155517:JAR100: file: CUSTMAS=ar/customer.master bytes=8192 080827:155517:JAR100: file: NALIST=ar/customer.nameadrs.list100 bytes=2858 080827:155517:JAR100: JobEnd=Normal, StepsExecuted=1, LastStep=S0010
#42a. vi $UV/sf/IBM/joblog1 <-- examine script to answer question above =====================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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_appsadm_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_appsadm_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 : :-----sfun <-- Korn shell common functions called by scripts :-----testdata <-- super directory for test/data subdirs & files : :-----gl <-- subdir for gl/... files : : :--O--account.acntlist_000001 <-- report created by jgl100.ksh : : :--I--account.master_000001 : : :--I--account.master_000002 : : :--I--account.master_000003 <-- latest generation of account.master
Required |
|
Here is line 29 of jgl100.ksh ('1E3') using function 'exportgen0' to determine the latest generation of the account.master_ GDG file.
exportgen0 ACCTMAS gl/account.master_ =====================================
One solution would replace this with the following:
gen=000000 until [[ "$gen" > 000000 ]] do echo "enter desired generation (6 digits) for gl/account.master_" read gen done exportfile ACCTMAS gl/account.master_$gen
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 SORTIN gl/account.trans_ exportgen1 SORTOUT gl/account.trans_ uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RST,keys=(0,8,c,a)" LCC=$? # capture uvsort return code status if ((LCC != 0)) then logmsg2 "ERR - Terminated Abnormally code=$LCC" jobabend51 # show new GDG files NOT moved to output subdir exit $LCC; fi jobend51 # show new GDG files MOVED to output subdir (Normal EOJ) logmsg1 "Terminated Normally" exit 0
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 SORTIN gl/account.trans_ exportgen1 SORTOUT gl/account.trans_ #3---------------------------------------------------------------------- uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RST,keys=(0,8,c,a)" #4---------------------------------------------------------------------- LCC=$?; ((SCC+=LCC)); ((JCC+=LCC)); alias goto=""; if ((SCC != 0)) then logmsg2 "ERR - Step Abterm code=$SCC" alias goto="<<S9900=A"; fi goto # S0020=A exportgen0 GLTRAN gl/account.trans_ exportfile GLSUM tmp/account.trans_sum #3---------------------------------------------------------------------- uvcopy addup1,fili1=$GLTRAN,filo1=$GLSUM,uop=q0b40c10 #4---------------------------------------------------------------------- LCC=$?; ((SCC+=LCC)); ((JCC+=LCC)); alias goto=""; if ((SCC != 0)) then logmsg2 "ERR - Step Abterm code=$SCC" alias goto="<<S9900=A"; fi goto #8====================================================================== S9000=A jobend51 #move any GDG files from jobtmp/GDG/subdirs to RUNDATA/subdirs logmsg2 "JobEnd=Normal, StepsExecuted=$XSTEP, LastStep=$JSTEP" exit 0 #9====================================================================== S9900=A logmsg2 "ERR: Terminated Abnormally,JCC=$JCC,StepsX/L=$XSTEP/$JSTEP" RV ACK jobabend51 #report GDGs NOT moved from jobtmp/GDG/subdirs to outdirs exit $JCC
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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/jcl2ksh41 <-- view script to convert 1 JCL to ksh ===============================
uvlp12 /home/uvadm/pf/IBM/procNF <-- print uvcopy to summarize missing PROCs ================================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is a list of some of the script names used for JCL conversion, followed by a detail listing of the most important scripts (those with links).
9A1. | jcl2ksh41 - convert 1 VSE JCL thru all stages |
- cleanup, PROC/INCLUDE expansion, JCL conversion, copy to jcls | |
- jcl0 ---> jcl1 ---> jcl2 ---> jcl3 ---> jcls |
9A2. | jcl2ksh41A - convert all JCL from jcl0 thru jcl3 |
9A3. | sortload43I - create JCL converter control file ctl/datafiles43I |
by sorting datafiles41 & datafiles42 together | |
& loading an Indexed file for lookup by the JCL converter |
9A4. | jclpx41 - expand PROCs & INCLUDEs while copying JCL from jcl1 to jcl2 |
9A5. | jclxx41 - convert all JCLs from jcl2 --> jcl3 |
9A6. | jcpause - pause a JCL/script at the next step or a specified step |
9A7. | jcclear - clear the pause condition |
cnvMF41 |
|
cnvMF41A |
|
mfcbl1 |
|
mfcblA |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh # jcl2ksh41 - convert 1 job at a time (by OT, UVSI, Aug2004) # - recommend converting all JCL's in directory (page 1Q1 VSEJCL.doc) # - might use this to convert new jobs brought over from mainframe # - see page 1Q9 MVSJCL.doc or www.uvsoftware.ca/mvsjcl.htm#1Q9 # - assumes input JCL has been stored in subdir 'jcl0' # - assumes any PROC's present in procs (cleaned up from proc0) # - assumes all DLBL's present in ctl/datafiles41 # - will convert JCL from jcl0 --> jcl1 --> jcl2 --> jcl3 # - you will then manually copy to subdir jcls for test/debug #Oct2009 - option q1 in ctl/jclunixop41 applies TOPNODES replace table # if [[ -d jcl1 && -d jcl2 && -d jcl3 && -f "$1" ]]; then : else echo "arg1 must be a file (in jcl0) & jcl1,jcl2,jcl3 must be present" echo "usage: jcl2ksh41 jcl0/JCLfilename" echo " ==========================" exit 1; fi typeset -l fn="$1" # convert filename to lower case fx=$(basename $fn) # strip off jcl0/ directory from left side f=${fx%.*} # strip off .extension from right side # uvcopy cleanup,fili1=$1,filo1=jcl1/$f.jcl,uop=q0i7g8n1 #===================================================== # - cleanup JCL, strip CR's, clear cols 73-80,& shorten to last nonblank # jclproc41 jcl1/$f.jcl jcl2/$f.jcl procs slis #=========================================== #Nov19/07 - corrected last arg above from 'jcl1' to 'slis' # - expand procs as we copy jcl from subdir jcl1 to subdir jcl2 # - will copy unchanged if no PROCs # jclunix41 jcl2/$f.jcl jcl3/$f.ksh #================================ # - convert expanded mainframe JCL to Korn shell script # reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]] do echo "OK to copy to jcls subdir (overwrite prior) y/n ?"; read reply; done if [[ "$reply" = "y" ]]; then cp jcl3/$f.ksh jcls # copy converted JCL/script to jcls (in PATH) #================== echo "jcl3/$f.ksh copied to jcls/... (overwriting any prior version)" else echo "reply=$reply, jcl3/$f.ksh NOT copied to jcls/..." fi reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]] do echo "extract control-cards to jobparmx1 y/n ?"; read reply; done if [[ "$reply" = "n" ]]; then echo "reply=$reply, exiting"; exit 2; fi # uvcopy jobparmx1,fild1=jcl3,fild2=jobparmx1,fild3=jobparmx2,arg1=$f.ksh #====================================================================== echo "above jobparmx1 extracted control cards from 1 job to $RUNLIBS/jobparmx1" echo "run jobparms1 to select all current control cards to $RUNDATA/jobparms1" echo "uvcopy jobparms1 <-- run manually before executing job"; read reply; exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh # jcl2ksh41A - convert All VSE JCL to Korn shell scripts # - see page 1Q1 VSEJCL.doc or www.uvsoftware.ca/vsejcl.htm#1Q1 # Oct2009 - option q1 in ctl/jclunixop41 applies TOPNODES replace table # if [[ -d jcl0 && -d jcl1 && -d jcl2 && -d jcl3 && -d proc0 && -d procs\ && -d parm0 && -d parms && -d sli0 && -d slis && "$1" = "all"\ && -f ctl/jclunixop41 && -f ctl/datafiles42 ]]; then : else echo "usage: jcl2ksh41A all" echo " =============" echo "subdirs reqd: jcl0,jcl1,jcl2,jcl3,proc0,procs,sli0,slis,parm0,parms" echo "control files reqd: ctl/jclunixop41 & ctl/datafiles42 (may be null)" exit 1; fi # echo "jcl2ksh41A to perform all steps of JCL conversion to Korn shell scripts" echo "jcl0--------->jcl1------------->jcl2----------->jcl3---------->jcls" echo " cleanup Pro/SLIcExpand convert manual " echo "- all steps reqd if you retransfer JCL, PROCs,or Parms" echo "- run 'jclxx41' to reconvert jcl2-->jcl3 after converter/option changes" echo "for 1st conversion - see step by step in 1Q1-1Q5 of MVSJCL.doc" echo "jcl2ksh41A can omit cleanup proc0-->procs & sli0-->slis" echo "- saves time if no new/modified PROCs, INCLUDEs, or control cards" echo "cleanup PROCs, INCLUDEs,& CTLCARDS y/n ? " reply=x; read reply until [[ "$reply" = "y" || "$reply" = "n" ]] do echo "cleanup PROCs, INCLUDEs,& CTLCARDS - y/n ?"; read reply; done if [[ "$reply" = "y" ]]; then # reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]] do echo "OK to remove all files from procs & SLIs ? y/n"; read reply; done if [[ "$reply" = "y" ]]; then rm -f procs/*; rm -f slis/*; fi # echo "clear cols 73-80 of slis y/n ?"; reply=x; g=g8; read reply until [[ "$reply" = "y" || "$reply" = "n" ]] do echo "clear cols 73-80 of slis y/n ?"; read reply; done if [[ "$reply" = "n" ]]; then g=g0; fi uvcopyx cleanup proc0 procs uop=q0i7g8n1,arg1=.prc #<-- cleanup PROCs #================================================== uvcopyx cleanup sli0 slis uop=q0i7n1$g,arg1=.sli #<-- cleanup SLIs #=============================================== #Aug03/06 - $g is g8 to clear 73-80 or g0 to NOT clear (set at prompt above) fi echo "will now cleanup jcl0--->jcl1 & expand PROCs jcl1--->jcl2" reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]] do echo "OK to remove all files from jcl1 & jcl2 ? y/n"; read reply; done if [[ "$reply" = "y" ]]; then rm -f jcl1/*; rm -f jcl2/*; fi # # 1. cleanup JCL, strip CR's, clear cols 73-80,& shorten to last nonblank uvcopyx cleanup jcl0 jcl1 uop=q0i7g8n1,arg1=.jcl #<-- cleanup JCL #=============================================== echo "cleanup complete, enter to perform PROC expansion"; read reply # # 2. expand procs as we copy JCL from subdir jcl1 to subdir jcl2 jclpx41 jcl1 jcl2 procs slis #=============================== echo "PROC expansion complete, enter to generate data control file"; read reply # # 3. generate data control file for JCL converter # uvcopy jcldata41,fild1=jcl2,filo2=ctl/datafiles41 #================================================ echo "jcldata41 has extracted datafilenames from all jcl2 DLBLs/TLBLs & IDCAMS" echo " - 1 line for each filename with recsizes, index keys, file type on right side" echo " - file names & info written into ctl/datafiles41" # # 4. explain control files & allow user to stop & create ctl/datafiles42 # echo " ** control files used by JCL converter **" echo "listcat3I - datafile info derived from the mainframe LISTCAT report" echo " - file types, record sizes,& indexed key location(lengths)" echo " - creation documented at VSEDATA.doc#1E2 & VSEJCL.doc#4J3 " echo " " echo "datafiles43I - datafile info extracted from all JCL to be converted" echo " - filenames from DLBLs, TLBLs,& IDCAMS" echo " - IDCAMS supplies file types, record sizes,& indexed keys " echo " - creation documented at VSEJCL.doc#4K2" echo " ** listcat3I - creation **" echo "listcat0 - mainframe LISTCAT transferred to \$CNVDATA/ctl/listcat0" echo "listcat1 - LISTCAT info extracted & summarized to 1 line per datafile" echo "lisctat2 - sorted by filename & copied to \$TESTLIBS/ctl/listcat2" echo "listcat3 - copied from listcat2 & possibly edited to add missing info" echo " - all listcat files presumed as Masters, may change some to Work" echo "listcat3I - listcat3 loaded into Indexed file for use by JCL converter" echo " - primary source, JCL converter uses this info if match found" echo " ** datafiles43I - creation **" echo "datafiles41 - datafile info automatically extracted from all JCL" echo " - from DLBLs,TLBLs,IDCAMS (file types,rec-sizes,indexed keys)" echo "datafiles42 - optional manual created file in same format as datafiles41" echo " - to add to or modify info in datafiles41" echo " - info on matching filenames here overrides datafiles41 info" echo " - must create a null file if no override info required" echo "datafiles43I - Indexed file used by JCL converter" echo " - created by sorting datafiles41 & datafiles42 together" echo " - dropping datafiles41 filenames matched by datafiles42" echo " - loading Indexed file keyed on datafilename" # reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]] do echo "enter 'y' - to continue using files described above " echo "enter 'n' - to stop & add info to ctl/datafiles42 " echo "- can create nullfile ctl/datafiles42 for 1st JCL conversion" read reply; done if [[ "$reply" != "y" ]]; then echo "job ended by request"; exit 91; fi # # 5. sort datafiles41 & datafiles42 (may be null), loads datafiles43I # sortload43I #<-- script sorts df41+df42, loads Indexed datafiles43I #========== if (($?)); then echo "sortload43I failed, did you make ctl/datafiles42 (nullfile OK)" exit 99; fi echo " " echo "- enter to convert JCL to ksh "; read reply # # 6. convert expanded JCL to Korn shell scripts (uses ctl/datafiles42) # jclxx41 jcl2 jcl3 #================ # # 7. copy scripts from jcl3 to jcls 1 by 1 as you test/debug echo "all JCLs converted from jcl0 -> jcl1 -> jcl2 -> jcl3 (Not to jcls)" echo "copy scripts from jcl3 to jcls (in PATH) 1 by 1 as you test/debug" echo " " # 8. Extract jobparms from JCL/scripts - optional echo "Extract jobparms from JCL/scripts - optional ?" echo "- see uvcopy jobparmx1 at: www.uvsoftware.ca/vsejcl.htm#4L1" # echo "uvlp12 errs/procNF.rpt <-- print summary report of PROCs Not Found" echo "uvlp12 errs/includeNF.rpt <-- print summary report INCLUDEs Not Found" echo "uvlp12 errs/sliNF.rpt <-- print summary report SLIs Not Found" echo "uvlp12 errs/parmNF.rpt <-- print summary report of PARMs Not Found" exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# sortload43I - sort/load ctl/datafiles43I from datafiles41 & datafiles42 # - by Owen Townsend at City of Laval, March 15/2007 # # ctl/datafiles41 - created by jcldata41 by extract all DLBL/TLBL/IDCAMS files # - filenames + rca=... rcm=... key=...(...) typJWV=IDXf8v # # ctl/datafiles42 - may be created by user to override datafiles41 file info # - else must create null file for sort to run # echo "sortload43I - sort/load ctl/datafiles43I from datafiles41 + datafiles42 " echo " - optional edit datafiles42 info to override auto extracted datafiles41 " echo " - must create nullfile ctl/datafiles42 if no edited ctl/datafiles42" reply=x; until [[ "$reply" == "y" || "$reply" == "n" ]] do echo " - sort/load ctl/datafiles43I from datafiles41 + datafiles42 OK y/n ?" read reply; done if [[ "$reply" == "n" ]]; then echo "reply=$reply, exiting"; exit 1; fi # uvsort "fili1=ctl/datafiles41,typ=LSTt,rcs=200,fili2=ctl/datafiles42\ ,filo1=ctl/datafiles43,rcs=128,key1u2=0(30)" #==================================================================== # # use loadcat3I to load into Indexed file shifting rca=... over to col46 # uvcopy loadcat3I,fili1=ctl/datafiles43,filo1=ctl/datafiles43I #============================================================ rc=$? # capture loadcat3I status for script return code exit $rc #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh # jclpx41 - Korn shell script from UVSI stored in: /home/uvadm/sf/IBM/ # jclpx41 - script to execute the jclproc41.c program # - to expand PROC's & SLI's in IBM VSE JCL # - see VSEJCL.doc, or www.uvsoftware.ca/vsejcl.htm # # usage: jclpx41 indir outdir PROCdir SLIdir [options] # ============================================= #example: jclpx41 jcl1 jcl2 procs jcl1 # ============================ # # indir - contains the JCL's with PROCs to be expanded # outdir - will receive the expanded JCL # - output filenames same as input, with .jcl ensured # PROCdir # SLIdir - may be same as indir # # jclproc41 infile outfile PROCdir SLIdir # ======================================= # echo "script to expand PROCs in VSE JCL" if [[ -d "$1" && -d "$2" && -d "$3" && -d "$4" ]]; then : else echo "USAGE: jclpx41 indir outdir PROCdir SLIdir" echo " ===================================" exit 1; fi # # jclproc41 appends to an error message file in errs subdir # - init now OR create subdir if not already present if [[ ! -d errs ]]; then mkdir errs; fi # make errs subdir if not existing >errs/jclproc41.err # init errmsg collection file x=0;y=0; for i in $1/* do a=${i##*/} typeset -l c=$a jclproc41 $i $2/$c $3 $4 #======================= if ((!$?)); then let y=y+1; fi let x=x+1 done echo "$x JCLs copied $1 to $2, expanding PROCs($3) & SLIs($4), $y outputs" echo "vi tmp/jclproc41.err <-- see errors collected in tmp/jclproc41.err" # # echo "call uvcopy jobs to report PROCs, INCLUDEs,& SLIs NOT FOUND" uvcopy procNF,fili1=errs/jclproc41.err,filo1=errs/procNF.rpt #=========================================================== uvcopy includeNF,fili1=errs/jclproc41.err,filo1=errs/includeNF.rpt #================================================================= uvcopy sliNF,fili1=errs/jclproc41.err,filo1=errs/sliNF.rpt #=========================================================== exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#!/bin/ksh # jclxx41 - Korn shell script from UVSI stored in: /home/uvadm/sf/IBM/ # jclxx41 - script to execute the jclunix41.c program # - to convert IBM mainframe MVS JCL to UNIX scripts # Oct2009 - option q1 in ctl/jclunixop41 applies TOPNODES replace table # # usage: jclxx41 indir outdir options # ============================= # # indir - contains the JCL's to be converted # - any file with no // in cols 1&2 of 1st line # will be bypassed # outdir - will receive the converted scripts # - files will be assigned the same names # as they had in the input directory # options - options for the jclunix program # (see elsewhere in documentation) # # jclunix41 appends to an error message file --> errs/jclunix41.err # - init or create errs subdir if not already present # if [[ ! -d errs ]]; then mkdir errs; fi # make errs subdir if not existing >errs/jclunix41.err # init errmsg collection file # echo "script to convert mainframe JCLs to UNIX scripts" if [ -d "$1" -a -d "$2" ]; then : else echo "usage: jclxx41 indir outdir [options]" echo " ==============================" exit 1; fi reply=x; until [[ "$reply" = "y" || "$reply" = "n" ]] do echo "OK to remove all files from JCL convert outdir $2 y/n ?"; read reply; done if [[ "$reply" = "y" ]]; then rm -f $2/*; fi # x=0; y=0; for i in $1/* do a=${i##*/} typeset -l c=$a jclunix41 $i $2/$c $3 #==================== if (($?)); then let yy=yy+1; fi let x=x+1 done echo "$x JCLs converted from $1 to Korn shell scripts in $2 ($y errors)" echo "vi tmp/jclunix41.err <-- see errors collected in tmp/jclunix41.err" # # echo "call 'parmNF' to report any control card library members not found" # uvcopy parmNF,fili1=errs/jclunix41.err,filo1=errs/parmNF #======================================================= exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# jcpause - write control record to pause specified JCL/script # - for UNIX scripts converted from IBM VSE JCL # - this KORN shell script stored at /home/uvadm/sf/IBM/jcpause # - see more doc at: www.uvsoftware.ca/vse2unix.htm # # JCL converter inserts a call to function 'stepctl51' at begining of each step # - to provide operators with a means to pause multi-step jobs # - at begining of the next step, or at a specified step# (programmer debug?) # # Operator would use scripts to pause or restart jobs ('jcpause' & 'jcclear') # # 1. jcpause jobname.ksh <-- pause specified job at begin next step # =================== # # 2. jcpause jobname.ksh S0050 <-- pause job at step S0050 (step 5, inc by 10) # ========================= - also be used by programmers debugging ? # # 3. jcclear jobname.ksh <-- clear control file, allow job to proceed # =================== # # Step Control files are written to $RUNDATA/jobctl/... # - named same as JCL/script but with extension '.ctl' (vs .ksh) # - jcpause writes 1 line in the control file with jobname.ksh & step# # - step# is the step# specified by oprtr as arg#2 on jcpause script command # - step# is S0000 if no step# spcfd on jcpause (indicates stop at next step) # jfn="$1" # capture jobfilename from arg1 if [[ -f $RUNLIBS/jcls/$jfn ]]; then : else echo "usage: jcpause jobname.ksh S#### jobname mandatory, step# optnl" echo " =========================" echo "- JCL/script $jfn not found in $RUNLIBS/jcls/..." exit 1; fi # # capture step# & verify or default to S0000 if not spcfd if [[ -n "$2" ]]; then step="$2"; else step="S0000"; fi stepl=${#step} # capture length of step# if [[ ($stepl -eq 5) && ($step == S*) ]]; then : else echo "usage: jcpause jobname.ksh S#### jobname mandatory, step# optnl" echo " =========================" echo "- step# must be 'S' followed by 4 digits" exit 2; fi # # create control file name jbn=${jfn%.*} # strip .ksh extension cfn=$jbn.ctl # append .ctl convention # # format control record contents & write ctlrec="$jfn $step $(date +%y%m%d_%H%M%S)" #========================================= echo "$ctlrec" >$RUNDATA/jobctl/$cfn #=================================== exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# jcclear - write control record to pause specified JCL/script # - for UNIX scripts converted from IBM VSE JCL # - this KORN shell script stored at /home/uvadm/sf/IBM/jcclear # - see more doc at: www.uvsoftware.ca/vse2unix.htm # # JCL converter inserts a call to function 'stepctl51' at begining of each step # - to provide operators with a means to pause multi-step jobs # - at begining of the next step, or at a specified step# (programmer debug?) # # Operator would use scripts to pause or restart jobs ('jcpause' & 'jcclear') # # 1. jcpause jobname.ksh <-- pause specified job at begin next step # =================== # # 2. jcpause jobname.ksh S0050 <-- pause job at step S0050 (step 5, inc by 10) # ========================= - also be used by programmers debugging ? # # 3. jcclear jobname.ksh <-- clear control file, allow job to proceed # =================== # # Step Control files are written to $RUNDATA/jobctl/... # - named same as JCL/script but with extension '.ctl' (vs .ksh) # - jcpause writes 1 line in the control file with jobname.ksh & step# # - step# is the step# specified by oprtr as arg#2 on jcpause script command # - step# is S0000 if no step# spcfd on jcpause (indicates stop at next step) # jfn="$1" # capture jobfilename from arg1 if [[ -f $RUNLIBS/jcls/$jfn ]]; then : else echo "usage: jcclear jobname.ksh S#### jobname mandatory, step# optnl" echo " =========================" echo "- JCL/script $jfn not found in $RUNLIBS/jcls/..." exit 1; fi # # create control file name jbn=${jfn%.*} # strip .ksh extension cfn=$jbn.ctl # append .ctl convention # # remove control file for specified job rm -f $RUNDATA/jobctl/$cfn #========================= # exit 0
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
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 tblexts1 |
|
uvcopy cleanup |
|
uvcopy jcldata41 |
|
uvcopy cnvMF4 |
|
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 'jclpx41' # - jclpx41 is the script that performs PROC expansion # by calling the 'jclproc41' C program for all files in the directory # - jclproc41 collects errmsgs into errs/jclproc41.err # - this job will search for 'PROC1 NOT FOUND' or PROC2 NOT FOUND errmsgs # then extract the PROC name & create table summary report with counts # - if desired, you could run this standalone (after jclpx41) as follows: # # uvcopy procNF,fili1=errs/jclproc41.err,filo1=errs/procNF.rpt # ============================================================== # # ** sample report ** # # procNF 2005/08/15_10:19:56 summary table of PROCs NOT FOUND # tbl#001 pg#001 -argument- # line# count % PROCname not found # 1 780 14 &WRTPROC # 2 7 0 ARCHIVE # - - - many lines omitted - - - # 272 1 0 TCKRBDCI # 273 101 1 WRTPROC # 5,420*100 *TOTAL* # fili1=errs/jclproc41.err,rcs=128,typ=LST filo1=errs/procNF.rpt,rcs=128,typ=LSTt @run opn all # # begin loop to get lines from errmsg file until EOF reached man20 get fili1,a0(128) get next line from errfile skp> eof (cc set > at EOF) # # select only lines with 'PROC1 NOT FOUND' or PROC2 NOT FOUND # extract the procname following EXEC # & build summary table of procnames with counts clr b0(32),' ' clear work area for procname extract sqzc1 a0(128),' ' squeeze input to 1 blank btwn words scn a0(120),'PROC1 NOT FOUND' skp= man30 scn a0(120),'PROC2 NOT FOUND' skp= man30 skp man20 # man30 scn a0(80),' EXEC ' set rgstr 'x' to ' EXEC ' mvum b0(32),ax6,' ,' move until blank or comma at end procname rep b0(32),'PROC=','' remove any 'PROC='procname rep b0(32),'PGM=','' cnvrtr may chg PROC= to PGM= tblt1f4 b0(32),'PROCname not found' skp man20 repeat loop until EOF #
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# EOF - write out table to a file for viewing & printing eof tbpt1s1 filo1,'summary table of PROCs NOT FOUND' cls all msgv1 'vi $filo1 <-- to view report of PROCs not found' msgv1 'uvlp12 $filo1 <-- to print report of PROCs not found' eoj
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
10A1. | Pilot Project Introduction & Considerations |
10B1. | Setup Userid & Profiles for pilot project |
10B2. | listing of stub_profile to replace .bash_profile or .profile |
10B3. | Modify RUNLIBS/RUNDATA/CNVDATA to define pilot project directories |
10C1. | Setup Directories for pilot project |
10C2. | cnvdata - superdir to convert EBCDIC to ASCII |
testdata - superdir for data files accessed by JCL/scripts | |
10C3. | testlibs - superdir for JCL/COBOL libraries for conversion & execution |
10C4. | control files & functions for conversion & execution |
10C5. | JCL converter options file ctl/jclunixop41 |
10C6. | JCL converter control file - CTLTBL & TOPNODE table |
10D1. | Select JCLs desired for Pilot Project |
use JCL cross-refs to determine data-files, program,& copybooks required | |
10D2. | Determine DATA-FILES required from JCL/Files crossref |
select (copy/FTP) the data-files for the pilot project | |
copy/FTP mainframe LISTCAT report to supply info to data file converter | |
10D3. | Determine COBOL PROGRAMS required from JCL/Programs crossref |
10D4. | Determine COPYBOOKs required from program/copybook cross-ref |
10E1. | Converting All COBOL copybooks using script 'cnvMF41Ac' |
10E2. | Converting All COBOL programs using script 'cnvMF41A' |
10E3. | Compiling All COBOL programs using script 'mfcblA' |
10F1. | Create Data Conversion Control File from LISTCAT |
10F2. | Editing ctl/ctlfile4 with copybook names |
10G1. | Pre-Requisites for Geneating jobs to convert DATA files |
10G2. | Generating All jobs to convert Data Files |
10G3. | Generating 1 job at a time (script gencnv42) |
10H1. | Illustrated example of data conversion job generation |
10H2. | skeleton uvcopy job generated from copybook |
10H3. | completed uvcopy job with Record Type tests added manually |
10I1. | Pre-requisites for Executing DATA conversion jobs |
10I2. | Executing jobs to convert DATA files |
10I3. | Copying converted DATA files to test directories |
10J1. | Create JCL Data File Info from LISTCAT |
10J2. | ctl/listcat3I - info file #1 for JCL converter |
ctl/datafiles43I - info file #2 for JCL converter | |
10J3. | Creating Indexed info file (listcat3I) for JCL converter |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
10K1. | Directories required for JCL conversion |
10K2. | Convert All JCL using script 'jcl2ksh41A' (multi-step script) |
10L1. | xrefall - generate All COBOL & JCL cross-references after covndersion |
10L2. | cobfiles5A - create COBOL files report & load Indexed files for jobflow |
10L3. | jobfiles5A - generate jobflow reports from JCL/scripts & COBOL file info |
- tracks data file usage for each step of JCL/scripts | |
- big help if you are unfamiliar with the applications |
10M1. | Execute pilot project JCL/scripts |
10M2. | Investigate outputs (reports, new files, SYSOUT errors ?) |
10M3. | Rerun in $TESTDATA & capture logs in subdir joblog/... |
10N1. Converting ASCII files back to EBCDIC (for All files in directoy) - uvcopy job 'uvdata55'
10N3. | Comparing all re-converted files to original EBCDIC files |
- to verify conversions, or to return files to the mainframe | |
(if all applications can not be migrated at same time) |
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Before attempting to convert/test/debug high volumes of JCL, COBOL,& DATA, we recommend you perform a 'Pilot Project' with a few JCLs and the required COBOL programs/copybooks & datafiles.
After selecting a few JCLs, you can determine the required COBOL programs, copybooks,& data files by running the appropriate cross-references (documented at CNVaids.htm#Part_3)
xvseprog2 |
|
xcobcopy2 |
|
xvsefile2 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We recommend you setup a separate userid & create the required conversion directories in its home directory. For this presentation we will use 'pilot1', similar to 'vsetest' in 'Part_1' to demo JCL conversion with supplied testfiles.
#1. login as 'root'
#2. groupadd apps <-- setup group 'apps', if not already setup ============= (when uvadm was setup in install.htm)
#3. useradd -m -g apps -s /bin/bash pilot1 <-- setup 'pilot1' for bash ======================================
#3a. useradd -m -g apps -s /bin/ksh pilot1 <-- alternative for 'ksh' =====================================
#4. passwd pilot1 <-- set password for pilot1 =============
#5. cp -p /home/uvadm/env/stub_profile /home/pilot1/.bash_profile ============================================================= - copy supplied 'stub' profile to pilot1 homedir & rename for bash - see listing on the next page
#5a. cp -p /home/uvadm/env/stub_profile /home/pilot1/.profile ======================================================== - alternative if you are using 'ksh' (vs bash)
Note |
|
#6. vi /home/uvadm/common_profile <-- modify common_profile ============================= export COBDIR=/opt/microfocus/cobol <-- change COBDIR for your site export UVLPDEST="-dlp0" <-- change 'lp0' to your laser printer
#8. Logout of Root & login as 'pilot1', on the next page --->
Please see ADMjobs.htm#Part_1 for complete details on setting up profiles for the Vancouver utilities & mainframe conversions.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
# stub_profile - to be copied to user homedirs and renamed as # '.profile' for Korn shell or '.bash_profile' for bash (Linux) # - stub_profile calls 'common_profile' # - by Owen Townsend, March 4/2010 # # stub_profile - for users of Vancouver Utilities # - defines $RUNLIBS & $RUNDATA for common_profile, which uses them # to define PATHs to libraries & data (test or production) # common_profile & stub_profile - distributed in $UV/env/... # - do not modify profiles in $UV because new versions of uvadm would overwrite # - copy to $APPSADM/env/... (/home/appsadm/env/...) & modify for your site # - then programmers can copy stub_profile to end of their .profile # cat $APPSADM/env/stub_profile >>.profile # # Define RUNLIBS/RUNDATA & call common_profile to setup search PATHs, etc export RUNLIBS=$HOME/testlibs export RUNDATA=$HOME/testdata export CNVDATA=$HOME/cnvdata . /home/uvadm/env/common_profile #<-- distributed calling from 'uvadm' # . /home/appsadm/env/common_profile #<-- should copy to & call from 'appsadm' #=============================== # # insert user preferences here (aliases, TERM, UVLPDEST, etc) # - may override defaults in common_profile # export RUNLIBSDATA=T1 # inhibit RUNLIBS/RUNDATA redefs in .ini files # .ini files called at begin JCL/scripts to redefine libs/data for each script # - for sites that need different LIBS/DATA for different systems # - might be used for JCL/scripts run under schedulers (cron,control-M,etc) # - RUNLIBSDATA=T1 allows programmers to test JCL/scripts using definitions # in common_profile (inhibits redefines in .ini file at begin JCL/scritps) # # ** Console Logging - optional ** # - uncomment 7 '##' lines below to activate console logging # - must setup subdirs matching $LOGNAME in $APPSADM/log1/...,log2/...,log3/... # - subdirs log1,log2,log3 hold logfiles for: current file, month, lastmonth # - see details at www.uvsoftware.ca/admjobs.htm#Part_6 # - console logging for production operators to capture entire logon session # - programmers can use the 'joblog1' script to capture log for 1 job at a time ## login1 || exit 2 # exit here if 2nd login ## logfixA $LOGNAME # process log1 file to log2 (to allow read/print) ## echo "console logging requires aliases to be stored in .bashrc or .kshrc" ## echo "--> . aliases <-- 'dot' execute aliases NOW, if not in .bashrc/.kshrc" ## echo "--> logview <-- execute logview script to see prior console logs" ## echo "script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S)" ## exec script $APPSADM/log1/$LOGNAME/$(date +%y%m%d_%H%M%S) # - 'exec script' must be the last non-comment line in the profile # - 'script' disables 'aliases', put in '.bashrc' or '.kshrc' to be effective # - you should also setup .kshrc to preserve your aliases & umode if logging # cp $APPSADM/env/kshrc .kshrc # copy to your homedir restoring correct name
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
This design allows you to have multiple sets of libraries & data for testing and/or production without having to change any JCL/scripts. Key to this are the definitions of environmental variables 'RUNLIBS' & 'RUNDATA' which are defined at end of your profile prior to calling 'common_profile'.
This section suggests setting up user 'pilot1' to run a pilot project. Programmers could modify their RUNLIBS/RUNDATA/CNVDATA defs as follows if they wanted to work on a common set of JCL/COBOL/DATA.
export RUNLIBS=/home/pilot1/testlibs export RUNDATA=/home/pilot1/testdata export CNVDATA=/home/pilot1/cnvdata . /home/appsadm/env/common_profile
But if the pilot project is not too big, then it might be better if each (for initial training) programmer could work on his own set of libraries & data in his homedir (to avoid conflicts with other programmers).
export RUNLIBS=$HOME/testlibs export RUNDATA=$HOME/testdata export CNVDATA=$HOME/cnvdata . /home/appsadm/env/common_profile
When ready to begin the real conversion, the team members will change their defs to point to the actual libraries & data to be converted. For example:
export RUNLIBS=/p1/testlibs export RUNDATA=/p1/testdata export CNVDATA=/p1/cnvdata . /home/appsadm/env/common_profile
Note that the profiles define convenient aliases cdl, cdd,& cdc to quickly change to testlibs, testdata, or cnvdata from anywhere, with just 3 keystrokes.
#1. cdl alias cdl='cd $RUNLIBS' --> /home/pilot1/testlibs ===
#2. cdd alias cdl='cd $RUNDATA' --> /home/pilot1/testdata ===
#3. cdc alias cdl='cd $CNVDATA' --> /home/pilot1/cnvdata ===
See listings of the profiles starting at ADMjobs.htm#1C1, followed by more detailed explanations.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Various Directory setups are discussed on pages '4C1' - '4D2' of Part 4. We will setup the directories within the 'pilot1' home directory (like '4C1'). For high volume conversions, you might use pages '4C2' thru '4C9', where the conversion directories are setup in separate file systems from the homedirs.
We provide scripts to setup the various directories required. Assuming you have setup user 'pilot1' (as on page '1P2'), proceed as follows:
#1. login as 'pilot1' --> /home/pilot1
#2. testdatadirs <-- setup the conversion superdirs ============ - testlibs, testdata, cnvdata (see below)
/home :----pilot1 : :----testlibs <-- $TESTLIBS/$RUNLIBS for pilot project : : :---- - see subdirs created by script 'vselibsdirs' : : :---- : :----testdata <-- $TESTDATA/$RUNDATA for pilot project : : :---- - see subdirs created by script 'vsedatadirs' : : :---- : :----cnvdata <-- $CNVDATA for pilot project : : :---- - see subdirs created by script 'cnvdatadirs' : : :----
#3a. cd testlibs <-- change into /home/pilot1/testlibs/ =========== #3b. vselibsdirs <-- setup various subdirs for JCL & COBOL conversions =========== #3c. cd .. <-- change back up to home dir =====
#4a. cd testdata <-- change into /home/pilot1/testdata/ =========== #4b. vsedatadirs <-- setup various subdirs for test data files =========== #4c. cd .. <-- change back up to home dir =====
#5a. cd cnvdata <-- change into /home/pilot1/cnvdata =========== #5b. cnvdatadirs <-- setup various subdirs to convert data files =========== #5c. cd .. <-- change back up to home dir =====
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here are the 3 conversion superdirs (cnvdata, testlibs, testdata) used in the pilot project to convert the DATA, JCL/COBOL, and hold the DATA accessed when the JCL/scripts are executed.
/home/pilot1 :-----cnvdata <-- DATA conversion superdir : :--MF--cpys <-- COBOL copybooks : :--MF--ctl <-- control files (LISTCAT from the mainframe) : :--MF--d0ebc <-- data files FTP'd from mainframe (variable length) : :------d1ebc - filenames lower case, '.clus.vseprd' dropped : :------d2asc - converted to ASCII (packed/binary preserved) : :------maps - copybooks converted to record layouts : :------pf - misc uvcopy jobs : :------pfx1 - uvcopy skeleton jobs generated from 'maps' : :------pfx2 - uvcopy jobs completed, datafilenames (vs cpybknms) : :------pfx3 - uvcopy jobs copied here for modify/execute : :------sf - misc scripts : :------tmp - misc files here (keep working dir clean, rm daily)
'--MF--' indicates subdirs receiving files from the mainframe
cnvdatadirs <-- script to create subdirs shown above ===========
/home/pilot1 :-----testdata <-- RUNDATA=$TESTDATA=/p1/testdata : :-----ftp : :-----jobctl - optional, could use to pause jobs at spcfd steps : :-----joblog - joblog1 script stores .log files here : :-----jobtmp - job temporary files : :-----mstr <-- master files : :-----pf - user written uvcopy jobs : :-----rpts <-- reports : :-----sf - user written Korn shell scripts : :-----sysout - COBOL DISPLAY upon SYSLST reports : :-----tape <-- tape files reassigned to disc by JCL converter : :-----tmp - misc temp files & sort work files : :-----wrk <-- work files (inter-step)
Note |
|
vsedatadirs <-- script to create above subdirs ===========
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
/home/pilot1 :-----testlibs <-- RUNLIBS=$TESTLIBS=/p1/testlibs : :--MF--cbl0 - your COBOL programs transferred from mainframe : :------cbl1 - cleaned up, cols 1-6 & 73-80 cleared, etc : :------cbl2 - cnvMF4 converts mainframe COBOL to Micro Focus COBOL : :------cbls - copy here (standard source library) before compiling : :------cblst - cobol source listings from compiles : :------cblx - compiled COBOL programs (.int's) : :--MF--cpy0 - for COBOL copybooks : :------cpy1 - cleaned up, cols 1-6 & 73-80 cleared, etc : :------cpy2 - cnvMF4 converts mainframe COBOL to Micro Focus COBOL : :------cpys - copy here (standard copybook library) : :--UV--ctl - conversion control files (jclunixop41, listcat3I) : :--MF--jcl0 - your JCLs transferred from mainframe : :------jcl1 - intermediate conversion 73-80 cleared : :------jcl2 - PROCs expanded from procs : :------jcl3 - JCLs converted to Korn shell scripts : :------jcls - copy here manually 1 by 1 during test/debug : :------maps - 'cobmaps' record layouts generated from copybooks : :------pf - uvcopy jobs to replace utilities (easytrieve,etc) : :--MF--proc0 - your PROCs transferred from mainframe : :------procs - will be merged with jcl1, output to jcl2 : :------sf - for misc scripts you may wish to write : :--UV--sfun - korn shell functions (jobset51,logmsg,etc) : :------tmp - tmp subdir used by various conversions : :------xref - cross-references, see CNVaids.htm#Part_3
'--MF--' - marks subdirs transferred from your MainFrame for conversion '--UV--' - marks control files & functions supplied by UV Software - copied from /home/uvadm/... by script 'copyvsectls'
vselibsdirs <-- script to create above subdirs ===========
copyvsectls <-- script to copy control files from /home/uvadm/ctl & sfun ===========
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Some control files & functions are required for JCL,COBOL,& DATA conversion, COBOL compiling,& JCL script execution. See more details on '4D1' & '4D2' of Part 4.
Script 'copyvsectls' is provided to copy the required files from /home/uvadm/... to the appropriate subdirs in your conversion superdirs.
#0a. Login pilot1 --> /home/pilot1 =========== #0b. cdl --> alias 'cd $RUNLIBS' --> /home/pilot1/testlibs ===
#1. copyvsectls <-- execute script to copy required control files & functions =========== - script listed below
# copyvsectls - copy Vancouver Utility control files & functions # required to convert mainframe JCL & COBOL cp $UV/ctl/cnvcob4.tbl ctl # search/replace table for COBOL cnvrtr cp $UV/ctl/cobdirectives ctl # COBOL DIRECTIVES for compiler cp $UV/ctl/extfh.cfg ctl # COBOL file handler configuration cp $UV/ctl/jclunixop41 ctl # options file for JCL converter cp $UV/ctl/gdgctl51 ctl # GDG control text file cp $UV/ctl/gdgctl51I* ctl # GDG control Indexed file (.dat & .idx) cp $UV/ctl/GDGmkdirs ctl # script to make subdirs for new GDG files cp $UV/ctl/gdgctl51* $TESTDATA/ctl # GDG control files moved to $RUNDATA cp $UV/ctl/GDGmkdirs $TESTDATA/ctl # make subdirs for new GDG files cp $UV/sfun/* sfun # copy all ksh functions used in JCL/scripts exit 0
You will need the LISTCAT report from the mainframe to supply data file info (recsize, file type, indexed keys, etc) for data file conversion. If it has not already been FTP'd to Unix, do now, OK to use FTP text to translate to ASCII. Store as ctl/listcat0, will be input to 'catgut41' on page '10F1'.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
To get desired results, you may need to modify the options & control tables in the JCL converter options file 'ctl/jclunixop41'.
We will not worry about this for the 'Pilot Project', but you should know the possibilities & you can see more details on pages '4E1' - '4E6' of Part 4.
Here are the options coded on line 1 & explained on lines 2 - 32.
jclunixop41:d0e1g1i3j1l1p0q0r0s0t12u1y0 #<-- option dflts for VUdoc test/demos # d1 - debug, generate 'echo's for 'cobrun's # e1 - generate 'exportfile' function (vs export) # - to display filenames for console log # g0 - create new GDG's in $RUNDATA/subdir/gdgfile_ # g1 - new GDGs $JGDG relative move to subdir/ at EOJ # g2 - new GDGs $JGDG absolute $RUNDATA/jobtmp/... # i1 - lookup ctl/listcat3I for file info (rcsz,keys,etc) # i2 - lookup ctl/datafiles43I for file info (rcsz,keys) # j1 - insert jobset51 for RUNDATE=ccyymmdd (obsolete ?) # j2 - jobset52 RUNDATE=mm/dd/ccyy old, jobset52 now $JGDG # j4 - might need new optn j4 for RUNDATE=mm/dd/ccyy ? # l1 - generate logmsg1, show script msgs on screen only # l2 - generate logmsg2, appends to joblog/jobname.log # l4 - generate logmsg4 for Bgn/End Job (vs logmsg1/2) # p1 - on COBOL steps, generate printer files as follows: # - exportfile SYS010 $JTMP/$JOBID2_step_$PROGID # - exportfile SYS010L $RPTS/$JOBID2_step_$PROGID_$date # - uvcopy cnvrpt1,fili1=$SYS010,filo1=$SYS010L # q1 - apply TOPNODES table replace/verify 1st Qualifier # r0 - gen cobrun for unix/linux .ints (allow animation) # r1 - gen runw for .ints NetExpress/Windows/UWIN/CYGWIN # r2 - assume executables $DX/program either unix/windows # r16 - execute RPG programs, $RPX/program # s1 - #< comment out SYSIN instream data (for LAVAL) # - instream data extracted separate files jobparms/.. # - export SYS011 defines jobparms/.. file vs $JTMP/.. # t12 - TLBL options for exportgen0/1,tape/,date/time # (t1=date,t2=time,t4=subdir tape/,t8=exportgen0/1) # u1 - convert IEBGENER to uvcp (vs cp default) # u2 - use uxcp/uxsort (vs uvcp/uvsort) for IDX3/8 files # y1 - customization for CUCBC (printer class changes)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will not change the JCL converter control file for the 'Pilot Project', but we want you to be aware of the more important elements that you may want to modify for your high volume conversions. Here are lines 80-116 of ctl/jclunixop41:
#----------------------- control table -------------------------------- # controls filename conversion depending on 1 or 2+ nodes ('.'s) # TOPDIRDFL1 - used if only 1 node & not typJM in ctl/datafiles43 # - 'wrk' since 1 node files usually 'SORTOUT's # - temp files, input to following steps, not needed after job ends # TOPDIRDFL2 - used if only 1 node & typJM on ctl/datafiles43 matching filename # - 'M' of typJM stored if ',CAT=' found on DLBL by jcldata41 # TOPDIRINS1 - if specified & no typJM, insert above top-node (retain all '.'s) # - used for all files with 2+ nodes (TOPDIRDFL1/2 used if only 1) # - if TOPDIRINS1/2 unspecified, topnode becomes a directory # TOPDIRINS2 - if specified & typJM, insert above top-node (retain all '.'s) # - OVERRIDDEN if datafiles43I has topr=... or topi=... :CTLTBL: TOPDIRDFL1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRDFL2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINS1~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~ TOPDIRINS2~~~~~~~~~~~~~~~~~~~~mstr~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # #------------------------ TOPNODES table ------------------------------ # table of TOPNODES allowed & replacements (optional) # 01-30 - topnodes allowed # 31-60 - topnode replacements (if col 31 not '~') # - if 01-30 of last entry 'ALLOTHER', any others replaced by 31-60 # - use statmvsjcl1 to create summary table of topnodes used in all JCL # - see www.uvsoftware.ca/mvsjcl.htm#6A2 # - code in lower case since applied at output time(script) vs input(JCL) :TOPNODES: ar~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ gl~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ rpts~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ tape~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ work~~~~~~~~~~~~~~~~~~~~~~~~~~wrk~~~~~~~~~~~~~~~~~~~~~~~~~~~ ALLOTHERS~~~~~~~~~~~~~~~~~~~~~misc~~~~~~~~~~~~~~~~~~~~~~~~~~ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ # - you must also code valid top-nodes in $RUNLIBS/ctl/GDGmkdirs # - called by jobset51 to setup subdirs for new generations of GDG files # - see listing at MVSJCL.htm#4E6
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will select 2 JCLs for our pilot project. We had already transferred all the JCL, COBOL,& DATA files from the mainframe to the unix system & stored in file systems /p1 & /p4 as suggested on pages '4C3' - '4C8' of Part 4. So we can just select (copy) the desired files to our pilot project subdirs.
#0a. Login pilot1 --> /home/pilot1 =========== #0b. cdl --> alias 'cd $RUNLIBS' --> /home/pilot1/testlibs ===
#1a. cp /p1/testlibs/jcl0/28401a03.jcl jcl0 ======================================
#1b. cp /p1/testlibs/jcl0/28401a04.jcl jcl0 ======================================
We can run cross-references on the selected JCLs to determine the programs, copybooks,& data-files required. You can see all cross-references provided at CNVaids.htm#Part_3. We will use the following:
xvsefile2 |
|
xvseprog2 |
|
xcobcopy2 |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#2. xvsefile2 jcl0 <-- cross-ref JCL to get data-files required ==============
xvsefile2 ** crossref show all JOBnames using each DLBL/TLBL datafile ** Keyword=DLBL:TLBL Exclude=% Include=~~ Skip= page# 1 Directory=/home3/laval4/testlibs/tmp1 Options=q1a16b16c4e0d0j0l0s2w1a40b16c3j2w2 =======================================================2010/01/19_05:43:10
E2123002.ITAXE.TAXATION 28401a04.jcl E2123003.ITAXE.TRANSDAM_2 28401a03.jcl 28401a04.jcl E2125504.MTAXE.PARACOMP_3 28401a03.jcl_2 28401a04.jcl TU.F01.E212656.FACTUR 28401a04.jcl_2
#3. cdc --> alias 'cd $CNVDATA' --> /home/pilot1/cnvdata ===
#4a. cp /p4/cnvdata/d0ebc/E2123002.ITAXE.TAXATION d0ebc/ #4b. cp /p4/cnvdata/d0ebc/E2123003.ITAXE.TRANSDAM d0ebc/ #4c. cp /p4/cnvdata/d0ebc/E2125504.MTAXE.PARACOMP d0ebc/ #4d. cp /p4/cnvdata/d0ebc/TU.F01.E212656.FACTUR d0ebc/
The above assumes the data files have already been FTP'd to Unix & stored in /p4/cnvdata/d0ebc. If not, you could FTP direct from the mainframe to /home/pilot1/cnvdata/d0ebc. Make sure you FTP with BINARY option.
Note |
|
#5a. xref2cpA xref/xvsefile2 \$MFDATA d0ebc ====================================== - reads xref/xvsefile2 report & writes sf/xvsefile2cp - we specify a $SYMBOL for datafile source directory, since we might not know it yet & it might be very long
#5b. vi sf/xvsefile2cp <-- examine generated script ================= - modify if necessary
# xvsefile2cp - script generated by xref2copy1 uvcopy job or xref2cpA script # - to generate script to select items for pilot projects # - City of Laval 2010/02/01_18:43:15 cp $MFDATA/e2123002.itaxe.taxation d0ebc cp $MFDATA/e2123003.itaxe.transdam d0ebc cp $MFDATA/e2125504.mtaxe.paracomp d0ebc cp $MFDATA/tu.f01.e212656.factur d0ebc
#5c. export MFDATA=/u/aaa/bbb/ccc ============================
#5d. ksh sf/xvsefile2cp <-- execute generated script ==================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#6. cdl --> alias 'cd $RUNLIBS' --> /home/pilot1/testlibs ===
#7. xvseprog2 jcl0 <-- cross-ref JCL to get PROGRAMS executed ==============
xvseprog2 ** crossref all VSE JOBnames for each EXEC/PGM name ** Keyword=PGM:EXEC Exclude=~~ Include=~~ Skip= page# 1 Directory=/home3/laval4/testlibs/tmp1 Options=q1a16b16c4s2w1a16b16c4j2w1 =======================================================2010/01/19_05:23:46
E173001C.cbl_2 28401a03.jcl 28401a04.jcl E212109C.cbl 28401a04.jcl E212152C.cbl 28401a03.jcl E212543C.cbl 28401a03.jcl *IDCAMS_17 28401a03.jcl_5 28401a04.jcl_12 *PROC_4 28401a03.jcl_2 28401a04.jcl_2 *SORT_6 28401a03.jcl_2 28401a04.jcl_4
#8a. cp /p1/testlibs/cbl0/E173001C.cbl cbl0 #8b. cp /p1/testlibs/cbl0/E212109C.cbl cbl0 #8c. cp /p1/testlibs/cbl0/E212152C.cbl cbl0 #8d. cp /p1/testlibs/cbl0/E212543C.cbl cbl0
Note |
|
#9a. xref2cpA xref/xvseprog2 \$MFCBL cbl0 ===================================== - reads xref/xvseprog2 report & writes sf/xvseprog2cp
#9b. vi sf/xvseprog2cp <-- examine generated script ================= - modify if necessary
# xvseprog2cp - script generated by xref2copy1 uvcopy job or xref2cpA script # - to generate script to select items for pilot projects # - City of Laval 2010/02/01_18:44:03 cp $MFCBL/e173001c.cbl cbl0 cp $MFCBL/e212109c.cbl cbl0 cp $MFCBL/e212152c.cbl cbl0 cp $MFCBL/e212543c.cbl cbl0
#9c. export MFCBL=/u/uvadm/vsetest/lroman/jose/0.8.6.1-Cobol =======================================================
#9d. ksh sf/xvseprog2cp <-- execute generated script ==================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#9a. cleanupcbl cbl0 cbl1 <-- must run cleanupcbl before xcobcopy2 ====================
#9b. xcobcopy2 cbl1 <-- cross-ref COBOL programs to get COPYBOOKS used ==============
xcobcopy2 ** crossref all PROGRAMS using each COPYBOOK ** Keyword=copy:include Exclude=unix Include=.cpy Skip= page# 1 Directory=/home3/laval4/testlibs/tmp1 Options=q1a16b16c4e0s2w1a16b16c4e3l1 =======================================================2010/01/19_07:55:00
cgetdatb.cpy e212109c.cbl e212152c.cbl e212543c.cbl e212648c.cbl _____________5 e212649c.cbl e212007b.cpy_2 e212648c.cbl e212649c.cbl e212024b.cpy e212648c.cbl e212037b.cpy_3 e212109c.cbl e212648c.cbl e212649c.cbl jul2000b.cpy e212109c.cbl e212152c.cbl e212543c.cbl e212648c.cbl _____________5 e212649c.cbl
#10a. cp /p1/testlibs/cpy0/cgetdatb.cpy cpy0 #10b. cp /p1/testlibs/cpy0/e212007b.cpy cpy0 #10c. cp /p1/testlibs/cpy0/e212024b.cpy cpy0 #10d. cp /p1/testlibs/cpy0/e212037b.cpy cpy0 #10e. cp /p1/testlibs/cpy0/jul2000b.cpy cpy0
#11a. xref2cpA xref/xcobcopy2 \$MFCBL cpy0 <-- generate script ==================================== - reads xref/xcobcopy2 report & writes sf/xcobcopy2cp
#11b. vi sf/xcobcopy2cp <-- examine generated script ================= - modify if necessary
# xcobcopy2cp - script generated by xref2copy1 uvcopy job or xref2cpA script # - to generate script to select items for pilot projects # - City of Laval 2010/02/01_19:03:05 cp $MFCBL/cgetdatb.cpy cpy0 cp $MFCBL/e212007b.cpy cpy0 cp $MFCBL/e212024b.cpy cpy0 cp $MFCBL/e212037b.cpy cpy0 cp $MFCBL/jul2000b.cpy cpy0
#11c. export MFCBL=/u/uvadm/vsetest/lroman/jose/0.8.6.1-Cobol =======================================================
#11d. ksh sf/xcobcopy2cp <-- execute generated script ==================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#12. xcobcall2 cbl1 <-- cross-ref COBOL programs to get CALLed programs ==============
e212036b e212649c.cbl
e212037b_3 e212109c.cbl e212648c.cbl e212649c.cbl
e212038b_2 e212109c.cbl e212648c.cbl
e212912b e212648c.cbl
#13a. cp /p1/testlibs/cpy0/e212036b cpy0 #13b. cp /p1/testlibs/cpy0/e212037b cpy0 #13c. cp /p1/testlibs/cpy0/e212038b cpy0 #13d. cp /p1/testlibs/cpy0/e212912b cpy0
#14a. xref2cpA xref/xcobcall2 \$MFCBL cbl0 <-- generate script ==================================== - reads xref/xcobcall2 report & writes sf/xcobcall2cp
#14b. vi sf/xcobcall2cp <-- examine generated script ================= - modify if necessary
# xcobcall2cp - script generated by xref2copy1 uvcopy job or xref2cpA script # - to generate script to select items for pilot projects # - City of Laval 2010/02/01_19:03:05 cp $MFCBL/e212036b cbl0 cp $MFCBL/e212037b cbl0 cp $MFCBL/e212038b cbl0 cp $MFCBL/e212912b cbl0
#14c. ksh sf/xcobcall2cp <-- execute generated script ==================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
cbl0 -------> cbl1 -------> cbl2 --------> cbl3 ----------> cbls -------> cblx cleanup convert copy(cp) sysin cnvt compile
#1. cnvMF41A all <-- convert ALL programs from cbl0 to cbl1 & cbl2 =========== - see 'cnvMF41A' script listed at VSECOBOL.htm#5C3
'cnvMF41A' has many option prompts. For initial conversion I suggest you take all defaults exceept 2:
#1a. Do you want to generate Index of files to be ORGANIZATION LINE SEQUENTIAL ? --> n <-- reply No initially, may rerun later with YES (after study)
#1b. Do you want to convert 'accept from instream' to 'read's from SYSIN ? --> n <-- reply No initially, may rerun later with YES (after study)
cnvMF41 cbl0/programname ========================
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#2a. cp cbl2/* cbls <-- copy converted programs to cbls (used by compiler) ==============
#2b. cp cbl3/* cbls <-- use this if you replied 'y' to #1b above ==============
#3. mfcblA all <-- recompile ALL cobol programs, cbls --> cblx ========== - see 'mfcblA' script listed at at VSECOBOL.htm#5E2
#4. uvlpd1p cblx .err <-- print 1st page of all .err reports ================= - to guide programmers making corrections - should be very few on these reconversions
For our pilot project, we got all clean compiles here, because we had already spent considerable time enhancing the compiles for the high volume libraries.
Our 1st mass compile had a 30% error rate, but we reduced this to 7% by modifying search/replace tables for reserved word differences (mainframe compiler vs Micro Focus compiler). We also modified the converter itself to automatically correct for a lot of missing periods that the mainframe allowed (but not Micro Focus).
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Note |
|
Note |
listcat0--------->listcat1-------->listcat2---------->ctlfile3-------->ctlfile4 catgut41 sort ctlfile41 cp/edit
#0a. Login as pilot1 --> /home/pilot1
#0b. cdc ---> $CNVDATA ('cdc' is an alias in common_profile)
#1. Create data conversion control file from mainframe LISTCAT report - LISTCAT report must have been stored in $CNVDATA/ctl/listcat0 - see sample listing on page VSEDATA.htm#8A1 - will extract filenames, avg-recsize, max-recsize, indexed key start(lth)
#2. uvcopy catgut41,fili1=ctl/listcat0,filo1=ctl/listcat1 ===================================================== - extract data conversion info from mainframe LISTCAT report
#2a. uvcopy catgut41 <-- same as above (files default as shown above) ===============
#3. sort -o ctl/listcat2 ctl/listcat1 ================================= - sort by data file name - see sample listing on page VSEDATA.htm#8B1 of the full scale data conversion guide.
#4. uvlp12 ctl/listcat2 <-- list the output file =================== - a few records are shown below
e2121653.mtaxe.piscines rca=00082 rcm=00082 key=000(020) typLM_=IDXf1 cntr=00033321 e2121656.itaxe.facturat rca=00083 rcm=00245 key=000(036) typLM_=IDXf8v cntr=15946788 e2123004.itaxe.tranjour rca=00464 rcm=00464 key=000(000) typLM_=RSF cntr=00003905
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#5. uvcopy ctlfile41,fili1=ctl/listcat2,filo1=ctl/ctlfile3 ===================================================== - convert listcat report into data conversion control file format - inserts cpy=________, rcf=fixsz, drops cnt=... - see sample listing below.
#5a. uvcopy ctlfile41 <-- same as above (files default as shown) ================
ctlfile3 was created above with 'cpy=________' slots into which, you must edit the copybooknames corresponding to the datafilenames.
Before we edit the control file, we will copy/rename as ctlfile4, to protect our edited version, in case ctlfile41 is rerun (would overwrite ctlfile3).
If this is the 1st creation, you can simply copy ctl/ctlfile3 to ctl/ctlfile4, and then edit ctlfile4.
Note |
|
#6. cp ctl/ctlfile3 ctl/ctlfile4 ============================ - copy/rename control file before editing - protects edited file from overwrite if ctlfile41 rerun
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#7. vi ctl/ctlfile4 <-- edit data conversion control file =============== - insert copybook names into the slot provided by cpy=________ - add any missing files (not on disc when LISTCAT run) - could drop unwanted files not required for pilot project but not necessary (might use same file for later full conversion) - store in 3 ring binder for frequent reference during conversion
e2121653.mtaxe.piscines cpy=e212159b rca=00082 rcm=00082 rcf=00128 key=000(020) e2121656.itaxe.facturat cpy=e212037b rca=00083 rcm=00245 rcf=00320 key=000(036) e2123004.itaxe.tranjour cpy=e212142b rca=00464 rcm=00464 rcf=00512 key=000(000) tu.f01.e212-no.trperm cpy=e221004b rca=00080 rcm=00080 rcf=00128 key=000(000)
Note |
|
#8. uvlp12 ctl/ctlfile4 <-- list the edited data conversion control file =================== - file in 3 ring binder for reference
#9. uvcopy loadctlI,fili1=ctl/ctlfile4,filo1=ctl/ctlfile4I ====================================================== - load control file to an Indexed file for various future jobs - such as 'uvhdc2' to display datafiles with COBOL fieldnames
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Note |
|
Note |
|
We generated in pfx1, add data filenames in pfx2, copy to pfx3 for execution
Main----->cpys------->maps-------->pfx1-------->pfx2------->pfx3---------> frame FTP cobmap1 uvdata42 uvdata46 copy/edit execute
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
mainframe----->cpys------->maps-------->pfx1-------->pfx2------->pfx3---------> FTP cobmap1 uvdata42 uvdata46 copy/edit execute from pfx3 #0a. Login as pilot1 --> /home/pilot1 #0b. cdc ---> $CNVDATA ('cdc' is an alias in profile)
#1. cp $RUNLIBS/cpys/* cpys/ <-- copy copybooks from $RUNLIBS to $CNVDATA ========================
#2. uvcopyx cobmap1 cpys maps uop=q0i7p0 ==================================== - convert all copybooks to record layouts (cobmaps)
#3. rmzf maps <-- remove any zero files ========= - caused by procedure copybooks vs data copybooks
#4. uvcopyx uvdata42 maps pfx1 uop=q0i7 =================================== - generate skeleton uvcopy jobs from cobmaps - skeleton jobs have the same filenames as copybooks - skeleton jobs use copybooknames for datafilenames on fili1=... & filo1=...
#5. uvcopy uvdata46,fili1=ctl/ctlfile4,fild2=pfx1,fild3=pfx2,uop=q0i7 ================================================================= - complete the uvcopy jobs with actual datafilenames & indexed file keys - 1 uvcopy job for each line in control-file using specified copybook/map - completed jobs named same as datafilenames (vs copybooknames used in pfx1) - completed jobs change fili1=... & filo1=... to datafilenames
#5a. uvcopy uvdata46 <-- same as above (files default as shown) ===============
#6. cp pfx2/* pfx3 <-- do ONLY on initial generation or if no packed/signed ============== - to avoid overwriting jobs edited with multi R/T code
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The procedures above generate all jobs to convert all data files. You can use script 'gencnv42' to generate 1 job to convert 1 data file. You need this when you need to add a datafile after the initial generation of all jobs you thought were needed.
mainframe----->cpys------->maps-------->pfx1-------->pfx2------->pfx3---------> FTP cobmap1 uvdata42 uvdata46 copy/edit execute from pfx3 #0a. Login as pilot1 --> /home/pilot1
#0b. cdc ---> $CNVDATA ('cdc' is an alias in profile)
#1. gencnv42 datafile copybook <-- script arguments ==========================
#1a. gencnv42 e2122183.itaxe.degrevm e212047b <-- example ========================================
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Here is an example given in more detail at VSEDATA.htm#2E2. The instructions here generate 1 job at a time vs prior instructions which generated conversion jobs for all copybooks in the directory.
#3. uvcopy cobmap1,fili1=cpys/e221004b,filo1=maps/e221004b ====================================================== - convert the specified copybook to a record layout (cobmap)
cobmap1 start-end bytes for cobol record fields 200702170943 pg# 0001 cpys/e221004b mt-travaux-perman RCSZ=00080 bgn end lth typ
* fichier travaux permanents 01 mt-travaux-permanents. 05 mt-cd-dos pic 9. 0000 0000 001 n 1 05 mt-exq. 10 mt-exv pic 99. 0001 0002 002 n 2 10 mt-anq pic x. 0003 0003 001 * * r/t 1 - identified by '1' in 1st byte (mt-cd-dos) 05 mt-rec-1. 10 mt-cd-imp. 15 mt-regl pic x(6). 0004 0009 006 15 mt-serv pic xx. 0010 0011 002 10 mt-division pic 9. 0012 0012 001 n 1 10 mt-terme pic 9999. 0013 0016 004 n 4 10 mt-perio pic 99. 0017 0018 002 n 2 10 mt-mes-cont pic 9(10)v999 comp-3. 0019 0025 007pn 13 10 mt-taux pic 9(4)v9(5) comp-3. 0026 0030 005pn 9 10 filler001 pic x(8). 0031 0038 008 10 mt-cd-anc pic 9. 0039 0039 001 n 1 10 filler002 pic x(40). 0040 0079 040 * * r/t 2 - identified by '2' in 1st byte (mt-cd-dos) 05 mt-rec-2 redefines mt-rec-1. 10 mt-cd-imp-2. 15 mt-regl-2 pic x(6). 0004 0009 006 15 mt-serv-2 pic xx. 0010 0011 002 10 mt-mod-2 pic x. 0012 0012 001 10 mt-rol-2. 15 mt-ex2 pic 99. 0013 0014 002 n 2 15 filler003 pic x. 0015 0015 001 15 mt-qt2 pic x. 0016 0016 001 15 filler004 pic x(13). 0017 0029 013 10 mt-matricu-2 pic x(17). 0030 0046 017 10 mt-mesur-2 pic 9(8)v999 comp-3. 0047 0052 006pn 11 10 filler005 pic x(27). 0053 0079 027 ***************** end of e221004b.cpy ********************** *RCSZ=00080
Note |
|
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#4. uvcopy uvdata42,fili1=maps/e221004b,filo1=pfx1/e221004b ======================================================= - generate uvcopy job to convert 1 data file from EBCDIC to ASCII - generates a skeleton uvcopy job from the record layout (cobmap)
# e221004b - uvcopy EBCDIC to ASCII, preserve packed, fix signs opr='e221004b - uvcopy job generated from copybook: E221004B ' was=a33000b33000 fili1=?d1ebc/e221004b,rcs=00080,typ=RSF filo1=?d2asc/e221004b,rcs=00080,typ=RSF @run opn all loop get fili1,a0 skp> eof mvc b0(00080),a0 move rec to outarea before field prcsng tra b0(00080) translate entire outarea to ASCII # --- <-- insert R/T tests here for redefined records typ___ mvc b19(12),a19 pn mt-mes-cont:mt-taux skp put1 # --- typ___ mvc b47(6),a47 pn mt-mesur-2 put1 put filo1,b0 skp loop eof cls all eoj
typ___ mvc b19(12),a19 <-- preserves packed fields for R/T '1'
typ___ mvc b47(6),a47 <-- preserves packed fields for R/T '2'
typ___ mvc b19(12),a19 <-- preserves 2 adjacent packed fields
typ___ mvc b19(7),a19 <-- same as above (without combining) mvc b26(5),a19
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#5. uvcopy uvdata46,fili1=ctl/ctlfile4,fild2=pfx1,fild3=pfx2,arg1=tu.f01.e212-no.trperm ====================================================================== - complete the uvcopy job with actual datafilenames & indexed file keys - jobs generated for control file lines matching arg1 datafilename/prefix - jobs in pfx2 named for datafiles in control file (vs copybooks in pfx1)
#6. cp pfx2/tu.f01.e212-no.trperm pfx3 <-- copy uvcopy job to execution dir ================================== - uvcopy jobnames same as datafilenames
#7. vi pfx3/tu.f01.e212-no.trperm <-- edit job as required ============================= - changes required if file contains multiple record types - test record types & skip to instructions generated for redefined records - may need to read instructions for record types not redefined - read from pfx1a (instructions only extracted from generated jobs)
# tu.f01.e212-no.trperm - uvcopy EBCDIC to ASCII, preserve packed, fix signs opr='tu.f01.e212-no.trperm - uvcopy job generated from copybook: E221004B ' #ctlfile: tu.f01.e212-no.trperm cpy=e221004b rca=00080 rcm=00080 rcf=00128 typ=RSF was=a33000b33000 fili1=?d1ebc/tu.f01.e212-no.trperm,rcs=00128,typ=RSF filo1=?d2asc/tu.f01.e212-no.trperm,rcs=00128,typ=RSF @run opn all loop get fili1,a0 skp> eof mvc b0(00128),a0 move rec to outarea before field prcsng tra b0(00128) translate entire outarea to ASCII # --- <-- insert R/T tests here for redefined records #Feb06/07 - R/T tests added by Owen Townsend <--*-- cmc b0(1),'1' <--*-- skp= typ1 <--*-- cmc b0(1),'2' <--*-- skp= typ2 <--*-- msg b0(80) <--*-- msgw 'R/T col1 not 1/2 - enter to trnslt only' <--*-- skp put1 <--*-- # typ1 mvc b19(12),a19 pn mt-mes-cont:mt-taux skp put1 # --- typ2 mvc b47(6),a47 pn mt-mesur-2 <--*-- # put1 put filo1,b0 skp loop eof cls all eoj
Note |
|
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
MF----->$CNVDATA/d0ebc-------->d1ebc-------------->d2asc------>$TESTDATA/mstr #1 FTP #2 copy #3 EBCDIC->ASCII #4 copy rename uvdata42/uvdata46 if required pfx3/...
#0a. Login as pilot1 --> /home/pilot1
#0b. cdc ---> $CNVDATA ('cdc' is an alias in common_profile)
#1. cp d0ebc/* d1ebc ================ - copy datafiles to alt subdir for filename changes
#2a. renameL d1ebc ============= - translate datafilenames to lower case (standard for unix/linux) - usually already translated to lower case earlier in conversion
#2b. rename-X d0ebc .clus.vseprd =========================== - remove unwanted suffixes (.clus.vseprd, .clus.vsedev, etc) - do not apply to unix, do not need test/production indicators - test/prod provided by differences in profiles for prgrmrs/oprtrs with no need to have different filenames (or JCL/scripts)
#2c. rename-X d0ebc .dat <-- NOT recommended, ONLY if necessary =================== - old versions of Micro Focus COBOL may not respect IDXNAMETYPE=2 option in extfh.cfg (see listing at VSECOBOL.htm#5D2)
#3. uvcopyxx 'pfx3/*' ================= - execute ALL uvcopy jobs in pfx3/... to convert all data files - copies all data files from d1ebc/... to d2asc/... - translating char fields from EBCDIC to ASCII - preserving any packed/binary fields (same as on mainframe)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
After data file conversion & before we can begin testing, we need to copy the converted data files from $CNVDATA/d2asc/... to $TESTDATA/mstr/...
This procedure can be repeated any time that testing has destroyed the integrity of the set of co-ordinated data files.
#6a. rm -f $TESTDATA/mstr/* ====================== - remove old files & any extra files generated thru testing
#6b. cp -f d2asc/* $TESTDATA/mstr ============================ - copy all converted files for the next round of testing
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We have already shown on page '10F1' - '10F2' how the mainframe LISTCAT is used to create the 'DATA conversion control file' ($CNVDATA/ctl/ctlfile4).
Here we will illustrate how to use the LISTCAT info to also create a 'JCL conversion control file' ($TESTLIBS/ctl/listcat3I). The JCL converter will still run without ctl/listcat3I, but the conversion will be improved if it is available.
Pages '10F1' - '10F2' showed how record-sizes & indexed file key locations are extracted from the mainframe LISTCAT report into a control file (ctl/listcat2), which has 1 line per datafile with file info coded as keywords (rca=... rcm=... key=...).
You can use the 'jcl2ksh41A' script to perform all steps of JCL conversion with 1 command (see page '4N2' & script listing on page '9A2'). Note that step#3 in jcl2ksh41A is utility job 'jcldata41', which extracts all DLBLs/TLBLs from all JCL. These are sorted & duplicates dropped resulting in 1 line per unique datafilename found in all JCL. The output is written to $TESTLIBS/ctl/datafiles41.
The JCL converter uses the 2 Indexed files above to get file characteristics. 'listcat3I' has priority over 'datafiles43I'. The 'M' in 'typLM...' assigns these files to mstr/..., else to wrk/..., but TLBL files to tape/...
You can customize your conversion by modifying ctl/listcat3 & reloading the indexed file version ctl/listcat3I (using the 'loadcat3I' uvcopy job supplied).
You cannot customize datafiles41 since it is generated as part of the JCL conversion process, but you can create ctl/datafiles42 which is sorted with datafiles41 before loading ctl/datafiles43I used by the JCL converter.
To help you understand the process, the next page will show you a few lines of the 2 control files.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
listcat3I is created by transferring the mainframe LISTCAT report, processing (as shown on page '4H1' & '4I12'),& loading into an indexed file.
e2121653.mtaxe.piscines rca=00082 rcm=00082 key=000(020) typLMC=IDXf1 e2121656.itaxe.facturat rca=00083 rcm=00239 key=000(036) typLMC=IDXf8v e2121853.mtaxe.b8409d35 rca=00024 rcm=00024 key=000(011) typLW_=IDXf1 e2122683.itaxe.degrevem rca=00158 rcm=00265 key=000(037) typLMC=IDXf8v e2122941.mtaxe.permispn rca=00045 rcm=00045 key=000(022) typLMC=IDXf1 e2122942.mtaxe.droitmut rca=00030 rcm=00030 key=000(011) typLMC=IDXf1 e2123001.itaxe.banqtaxe rca=00126 rcm=00383 key=000(036) typLMC=IDXf8v e2123002.itaxe.taxation rca=00046 rcm=00383 key=000(035) typLMC=IDXf8v e2123003.itaxe.transdam rca=00464 rcm=00464 key=000(000) typLMC=RSR e2123004.itaxe.tranjour rca=00464 rcm=00464 key=000(000) typLW_=RSF e2123005.mtaxe.tpcalcul rca=00081 rcm=00081 key=000(029) typLMC=IDXf1 e2123086.itaxe.encapost rca=00080 rcm=00080 key=000(000) typLW_=RSF e2123691.itaxe.indexenc rca=00036 rcm=00036 key=000(036) typLMC=IDXf1 e2123692.itaxe.encaisse rca=00146 rcm=00426 key=000(022) typLMC=IDXf8v e2123693.itaxe.tranksds rca=00168 rcm=00453 key=000(017) typLMC=IDXf8v
e1133081.tfadm.b8306j02 rca=00464 rcm=00464 key=000(000) typJWV=RSF e2121653.mtaxe.piscines rca=_____ rcm=_____ key=000(000) typJWV=RSF e2121656.itaxe.facturat rca=00083 rcm=00239 key=000(036) typJWV=IDXf8v e2122680.ttaxe.b8401d30 rca=03180 rcm=03180 key=000(000) typJWV=RSF e2122683.itaxe.degrevem rca=00158 rcm=00265 key=000(037) typJWV=IDXf8v e2122951.mtaxe.matrenov rca=_____ rcm=_____ key=000(000) typJWV=RSF e2122958.ttaxe.b8409d36 rca=00236 rcm=00236 key=000(000) typJWV=RSF e2123001.itaxe.banqtaxe rca=00126 rcm=00383 key=000(036) typJWV=IDXf8v e2123002.itaxe.taxation rca=_____ rcm=_____ key=000(000) typJWV=RSF e2123003.itaxe.transdam rca=_____ rcm=_____ key=000(000) typJWD=RSF e2123004.itaxe.tranjour rca=00464 rcm=00464 key=000(000) typJWV=RSF e2123005.mtaxe.tpcalcul rca=00081 rcm=00081 key=000(029) typJWV=IDXf1 e2123010.ttaxe.sommtrie rca=00464 rcm=00464 key=000(000) typJWV=RSF e2123011.ttaxe.rembours rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v e2123013.ttaxe.c3001d31 rca=00360 rcm=00360 key=000(000) typJWV=RSF e2123013.ttaxe.rembtrie rca=00198 rcm=00360 key=000(000) typJWV=IDXf8v tu.f01.e211801.adrpos rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f01.e212-no.eauctr rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f01.e212-no.trperm rca=_____ rcm=_____ key=000(000) typJWT=RSF tu.f02.bkfaver.90-m07 rca=_____ rcm=_____ key=000(000) typJWT=RSF
The JCL converter uses the 2 Indexed files above to get file characteristics. 'listcat3I' has priority over 'datafiles43I'. The 'M' in 'typLM...' assigns these files to mstr/..., else to wrk/..., but TLBL files to tape/...
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Most of these procedures are automatic, but we provide you an opportunity to enhance the JCL conversion by manually updating the listcat2/3/3I control file to add datafiles that are missing from LISTCAT or to update file characteristics that you want to change for unix/linux.
You might only need to transfer & extract file info from LISTCAT once at the begining of the conversion, but you might update listcat3 & reload listcat3I several times to improve the conversion results.
We assume here that you have completed the procedures shown on page '10F1' to extract file info from LISTCAT. Those procedures may have already transferred listcat2 from $CNVDATA/ctl/... to $TESTLIBS/ctl/..., but we will repeat that step again in the instructions below.
#1a. Login as yourself or pilot1
#1b. cdl ---> $TESTLIBS
#2. cp $CNVDATA/ctl/listcat2 ctl ============================ - copy LISTCAT info from data conversion superdir to JCL conversion dir
#3. cp ctl/listcat2 ctl/listcat3 ============================ - copy/rename to protect future edits in listcat3 - data convert procedures copy to listcat2, never to listcat3 - only these JCL procedures will copy listcat2 to listcat3 & edit as reqd
#4. vi ctl/listcat3 =============== - update LISTCAT info as desired - add files missing when LISTCAT created on mainframe - modify/append keyword info on existing files as desired
Note |
|
#5. uvcopy loadcat3I,fili1=ctl/listcat3,filo1=ctl/listcat3I ======================================================= - load LISTCAT info into Indexed file used by JCL converter
#5a. uvcopy loadcat3I <-- same but easier (files default as shown above) ================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
** directories involved in JCL conversion ** /p1 :-----testlibs - RUNLIBS=$TESTLIBS=/p1/testlibs : :----- : :--MF--ctl <-- control files : :------ - jclunixop41 specifies options for JCL conversion : :------ - listcat3I supplies file types,recsizes,indexed keys : :------ - datafiles41 (filenames) extracted from all JCL : :------ supplies file info for files missing from listcat3I : :------ (because work files scratched, not present for LISTCAT) : :------ - you can edit datafiles42 to override datafiles41 entries : :------ : :--MF--jcl0 <-- your JCLs transferred from mainframe : :------jcl1 - intermediate conversion 73-80 cleared : :------jcl2 - PROCs expanded from procs : :------jcl3 - JCLs converted to Korn shell scripts : :------jcls - copy here manually 1 by 1 during test/debug : :----- : :--MF--proc0 <-- your PROCs transferred from mainframe : :------ : :--MF--slis <-- SLI library may be included in JCLs : :------
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
For your initial conversion we recommend you use the 'step by step' method (starting on page '4K1'), because you can more easily notice any errors.
But for our pilot project we used the 'do everything' script 'jcl2ksh41A' because we had already run it on all JCL in the high volume directories, and were confident using it for our pilot project.
#1. Login as pilot1 ---> /home/pilot1
#2a. cd $TESTLIBS <-- change to the conversion superdir '/p1/testlibs' ============
#2b. cdl <-- same as above but easier === alias cdl='cd $RUNLIBS' is defined in the profile
#3. jcl2ksh41A all <-- convert JCL thru all steps, as illustrated below ============= - reply null (take default) at all prompts - or reply 'y' for prompts that demand a y/n response - see jcl2ksh41A script listed on page '9A2'
jcl0 -------> jcl1 --------------> jcl2 -------------> jcl3 ------------> jcls cleanup PROC/SLI expand convert to ksh copy 1 at a time (before test/debug)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Cross-references are essential both for conversion and ongoing maintenance at any site running applications based on COBOL & JCL (now Korn shell scripts). Vancouver Utilities provides the following cross-references, which can all be quickly regenerated with 1 command (xrefall) any time the JCL/scripts & COBOL programs are substantially modified.
xrefall cbls jcl3 ksh <-- generate All COBOL & JCL cross-references =====================
xcobcall1 - list of all CALLED-PROGRAMs in each PROGRAM xcobcall2 - crossref all PROGRAMS calling any 1 CALLED-PROGRAM xcobcopy1 - list all COPYBOOKS in any 1 PROGRAM xcobcopy2 - crossref all PROGRAMS copying any 1 COPYBOOK
xkshfile1 - list all DATAFILES used in any 1 ksh SCRIPT xkshfile2 - crossref show all ksh SCRIPTs using any 1 DATAFILE xkshprog1 - list all PROGRAMs executed in any 1 ksh SCRIPT xkshprog2 - crossref show all ksh SCRIPTS executing any 1 PROGRAM
xcobcopy2 ** crossref all PROGRAMS using each COPYBOOK ** Keyword=copy:include Exclude=unix Include=.cpy page# 1 Directory=/home/mvstest/testlibs/cbls Options=q1a16b16c4e0d0j0l0s2w1a16b16c4e3l1q0i7 =======================================================2008/04/05_11:46:21
custmas.cpy car100.cbl car120.cbl car130.cbl car140.cbl ____________6 car150.cbl car200.cbl
*paymas.cpy cpy100.cbl
saledtl.cpy_2 car150.cbl car200.cbl
sdline.cpy car200.cbl
stline.cpy car200.cbl
Note |
|
See all cross references at www.uvsoftware.ca/cnvaids.htm#Part_3
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
For each file used in each program, this report shows:
See sample report on the next page --->
All programmers should have a copy of this report before they begin testing & debugging. It supplies instant answers to questions about file inputs & outputs, access methods, record sizes, copybooks, etc.
#1. cobfiles5A cbls <-- generate xref/cobfil51a & load xref/cobfil51I ===============
#2. uvlp12 xref/cobfiles.rpt <-- list the COBOL files report ======================== see sample report on the next page -->
The jobflow reports (see further below) require Indexed files loaded by cobfiles5A to merge COBOL file info with the JCL/script info. 'cobfiles5A' is a handy script to both generate the cobfiles report & load the Indexed file that will be required by jobflow51 & jobflow5A. See the 'cobfiles5A' script listed at XREFjobs.htm#3X1
cobfil51 ** COBOL Files Report ** Dir=cbls 2009/08/30_17:47:40 progname.cbl DDname OAM open recsz copybook.cpy FDname / Key lines ============================================se=in=up=de=========================
car100.cbl custmas SS I 256 custmas.cpy custmas car100.cbl nalist L O 120 nalist 52 car120.cbl custmas SS I 256 custmas.cpy custmas car120.cbl nalist L O 90 nalist 71 car200.cbl saledtl SS I 64 saledtl.cpy saledtl car200.cbl custmas IR I 256 custmas.cpy custmas car200.cbl key-> cm-cust car200.cbl salelst L O 120 sdline.cpy salelst 65 cgl200.cbl glmsold SS I 80 glmsold cgl200.cbl glmsnew SS O 80 glmsnew cgl200.cbl gltrans SS I 80 gltrans 61 Total programs = 14, total files = 25
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
The 'JobFlow' reports are your guide to testing & debugging. They show you the programs & datafiles used in each step of each JCL/script. I recommend you print these out before you start your testing & debugging.
The JObFlow reports extract the essential info about each datafile in each step. The file info from the COBOL program is inserted onto the matching info from the JCL. The following items are shown for each file in each step.
jclfil53 ** JobFlow Report I/O files info ** 20100329 page#0001 stp# progname.cbl DDname genf OAM open recsz copybook.cpy data-file-name ============================================================================== jar200.ksh
0010 sort.cbl sortin ar/sales.items sortout $JTMP/__tempsls
0010 uvsort fili1=typ=RSF,rcs=64, 64 $SORTIN ar/sales.items filo1=typ=RSF,rcs=64, 64 $SORTOUT $JTMP/__tempsls keys=(30,6,c,a,0,6,c,a),del1=10(2c):65,del1=10(2c):85"
0020 car200.cbl sysout $SYOT/${JOBID2}_${JSTEP}_${PROGID} saledtl SS_ I___ 64 saledtl.cpy $JTMP/%sales.sortfile custmas IR_ I___ 256 custmas.cpy ar/customer.master.indexed sys035 S__ O___ 120 sdline.cpy $RPTS/salesrpt_E_car200_${JSTEP}_01 sysin $JTMP/${JSTEP}_${PROGID}
JCL/script 'jar200.ksh' is a 2 step job with a SORT & a COBOL program with 4 data files. See jar200.ksh listed at MVSJCL.htm#1D2.
The JobFlow reports are listed by 'uvlp12L' which allow for 120 characters wide on 8 1/2 x 11 Landscape. We have removed the JCL/script name from the left & scrunched up to fit this documentation.
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Script 'jobflow5A' generates ALL jobflow reports. You must have run 'cobfiles5A' to load an Indexed file for lookup by jobflow5A to include COBOL file information on the jobflow report. You would not print ALL job flow reports because of high volume & subject to change as you test/debug.
I recommend you use 'jobflow51' to generate & print the jobflow report for any 1 JCL/script. Regen & reprint any time you make significant changes to during testing & debugging.
Note |
|
#1. cobfiles5A cbls cpys maps <-- generate xref/cobfil51a & load xref/cobfil51I ========================= - run now if not already run on page '5C1'
#2. jobflow5A jcl3 <-- generate All JobFlow Reports ============== - recommend alternative jobflow51 (1 at a time)
#3. uvlpd12L jobflow <-- would print ALL reports in subdir jobflow/... ================ - Do *NOT* print ALL JobFlow reports
You probably do NOT want to print all jobflow reports, since the reports would be very long & many could go out of date before you use them. It is better to print the individual jobflow report just before you intend to start test/debug for each JCL/script.
You can re-generate the report for any 1 JCL/script using script 'jobflow51' (regenerate when ever you substantially modify the JCL/script).
#1. jobflow51 jcls/jar200.ksh <-- generate JobFlow report for 1 job only =========================
#2. uvlp12L jobflow/jar200.io <-- print jobflow report for 1 JCL only ========================= (120 chars wide 8 1/2 x 11 Landscape)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Our pilot project converted only 2 JCLs jcl0/28401A03.jcl & jcl0/28401A04.jcl, which have now been converted to Korn shell scripts in jcl3/28401a03.ksh & jcl3/28401a04.ksh. Script jcl2ksh41A converts all JCLs in jcl0/... thru jcl1/..., jcl2/... to jcl3/...
JCL/scripts must be copied from jcl3/... to jcls/... for execution because only jcl3 is in the profile PATH. We recommend you copy the scripts from jcl3 to jcls ONE at a time, just before you are ready to test/debug. But for our pilot project, we will simply copy them.
#0a. Login pilot1 --> /home/pilot1 =========== #0b. cdl --> alias 'cd $RUNLIBS' --> /home/pilot1/testlibs ===
#1. cp jcl3/* jcls <-- copy converted scripts to jcls (execution subdir) ==============
#2a. 28401a03.ksh <-- execute pilot project job #1 ============
#2b. 28401a04.ksh <-- execute pilot project job #2 ============
#3a. joblog1 28401a03.ksh <-- rerun, capturing console displays ==================== into joblog/28401a03.log
#3b. vi joblog/28401a03.ksh <-- investigate log` ======================
The joblog1 script are intended for programmers to capture 1 log at a time while testing/debugging. Production operators should turn on 'console logging' by uncommenting the 7 '##' lines at the end of their profile (originally from 'stub_profile').
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
Note |
|
#1. cdd --> alias 'cd $RUNDATA' --> /home/pilot1/testdata ===
#2. testdatainit <-- remove temporary files from prior runs ============ (jobtmp/*, wrk/*, sysout/*, rpts/*, tmp/*)
#2a. joblog1 28401a03.ksh <-- execute job #1 & capture log in joblog/... ====================
#2b. joblog1 28401a04.ksh <-- execute job #2 & capture log in joblog/... ====================
#3a. vi joblog/28401a03.log <-- inspect joblog from job #1 ======================
#3b. vi joblog/28401a03.log <-- inspect joblog from job #2 ======================
#4. l mstr <-- list permanent files in mstr/ see if any new files created ======
#5. l wrk <-- list temporary files in wrk/ see if any new files created =====
#6. llr rpts <-- list files in rpts/ to see if any reports created ======== - use 'llr' to list all files in all subdirs - since each day's reports will be in a separate subdir (subdir named as yymmdd)
#7. llr sysout <-- list SYSOUTs for all jobs ========== - sysout/ sub-directoried by jobname
#8. llr jobtmp <-- list all files in all subdirs within jobtmp/... ` ========== - temporary files (SYSINs, %.files, GDGs, etc) - only used for debugging
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#9. uvlp13LS rpts/yymmdd/xxx <-- print a report on laser Landscape Simplex ======================== - script fits 132 cols x 66 lines on 8 1/2 x 11 - or use 'uvlp13LD' for Landscape Duplex
#10a. uvlpd12 sysout/28401A03 <-- print ALL sysouts from 28401a03.ksh ======================= - print all files found in directory - at 12 cpi Portrait (SYSOUTs usually 80 cols) - jobname directory may have multiple reports (could be 1 from each COBOL program)
#10b. listall sysout/28401A03 <-- print ALL sysouts from 28401a03.ksh ======================= - prints all files on 1 report - does not start a new page for each file (since SYSOUTs often small)
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
We will now show you how to generate & execute jobs to convert the ASCII files back to EBCDIC (& then compare the reconverted files to the original mainframe files).
You might do this to verify your conversions &/or you might need the ASCII to EBCDIC conversions to return some files to the maifnrame if you can not switch all applications over to unix/linux at the same time.
We could generate the ASCII to EBCDIC jobs using 'uvdata31' the opposite of 'uvdata51' that we used to generate EBCDIC to ASCII, but it is much better to use 'uvdata55' to convert our already generated EBCDIC-->ASCII jobs to ASCII-->EBCDIC jobs.
Besides saving steps, the big advantage is that this method saves having to duplicate any manual coding required for files with multiple Record Types. With the addition of uvdata55, pfx4,& uvcmp1all, our flow charts will then be:
cpys -------> maps --------> pfx1 --------> pfx2 ---------> pfx3 -------> pfx4 cobmap1 uvdata51 uvdata52 copy/edit uvdata55
Main -----> d1ebc ----------> d2asc ----------> d3ebc --------> rptcmp frame FTP uvcopyxx 'pfx3/*' uvcopyxx 'pfx4/*' uvcmp1all mismatch rpts
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
#0a. Login as pilot1 --> /home/pilot1 =============== #0b. cdc alias cdc='cd $CNVDATA' --> /home/pilot1/cnvdata ===
#1. mkdir pfx4 <-- make subdir for ASCII-->EBCDIC jobs ========== (if not already existing)
#2. uvcopyx uvdata55 pfx3 pfx4 uop=q0i7 <-- generate ALL jobs ===================================
#3. uvcopyxx 'pfx4/*' <-- execute ALL jobs =================
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page
You might want to compare all re-converted files to original EBCDIC files to verify conversions, or to return files to the mainframe, if all applications can not be migrated at the same time.
#0a. Login as pilot1 --> /home/pilot1 =============== #0b. cdc alias cdc='cd $CNVDATA' --> /home/pilot1/cnvdata ===
#1. mkdir rptcmp <-- make subdir for mismatch reprots ============
#2. uvcmp1all d1ebc d3ebc <-- compare all original files to reconverted files =====================
#3a. vi rptcmp/* <-- inspect all mismatch reports ===========
#3b. uvlpd12 rptcmp <-- print all mismatch reports ==============
Goto: Begin this doc , End this doc , Index this doc , Contents this library , UVSI Home-Page