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

Note
  • In Jan 2017 this documentation was replaced with the following 3 documents:
 jclcnv1demo.htm - listings of demo JCLs & converted shell scripts
                   - operating instructions for JCL & COBOL conversions
                   - logs of conversions & executions of demo JCL/scripts
 jclcnv2real.htm - more concise instructions for JCL & COBOL conversions
                   - addressing more of the real world complexities
 jclcnv3aids.htm - conversion aids: cross-references of JCL,COBOL,& copybooks
                   - determining essential data files that need to be transferred
                   - test/debug tips & techniques

MVSJCL.doc & MVSJCL2.doc (outdated)

Note
  • In Jan 2008, MVSJCL.doc was split into 2 documents (books)
  • Parts 6,7,8,9 were moved to a separate book MVSJCL2.doc
  • Parts 6,7,8,9 names changed to Parts 26,27,28,29 to avoid any confusion
  • on the 2 pages below we will summarize th contents for both books

MVSJCL.doc (NOT this book)

MVSJCL.htm#Part_0 - Introduction & Summary of Major Benefits

 MVSJCL.htm#Part_1 - Demo conversion using supplied Test files
                      (JCL, COBOL,& DATA files)
        - do these first & ensure your results match those listed
        - helps you to understand these tools & ensure they work at your site
        - use Part 4 to convert your own JCL (vs these supplied test/demo files)
        - scripts to reconvert JCL - 1 at a time or all in directory
        - scripts to reconvert COBOL copybooks & programs - 1 or all in dir
 MVSJCL.htm#Part_2 - Testing & Debugging Aids
        - Cross-References, Jobflow reports, job logging, etc
        - several of these can be run using the supplied test files
 MVSJCL.htm#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
 MVSJCL.htm#Part_4 - Converting 'YOUR' JCL
          (vs the test/demo conversions illustrated in Part_1)
        - Part 4 is a good roadmap for planning & executing the entire conversion
        - Must use the step by step method for your '1st' conversion of all JCL
          (for re-conversions, a script to convert All JCL with 1 command)
        - Part 4 also gives instrns for scripts to re-convert All COBOL & DATA
        - but you must use the step by step methods for the '1st' conversions
          as documented in MVSCOBOL.htm & MVSDATA.htm.
 MVSJCL.htm#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#
 MVSJCL.htm#Part_6 - NEW part as of January 2008
        - optional conversions (referenced from Part 4 as needed)
        - extra control files for site without VSAM LISTCAT reports
        - extract control cards (for dates, etc) from JCL to separate files
          (easier to update, without danger of modifying JCL unintentionally)

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

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

Note
  • Following Parts were moved from MVSJCL.doc to MVSJCL2.doc in Jan 2008.

MVSJCL2.doc (THIS BOOK)


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

Part_27 - Scanning for Problems & Mass-Change Fix-ups
- grep, sed, uvcopy scan1d, scan2d, rep1d, rep2d, etc

Part_28 - Special Considerations, Problems & Solutions
- CONDition tests
- Run a JCL/script when an input file is detected (ftriger51)
- detect FTP'd files & move/rename to a 2nd subdir to prevent overwrite
- Convert mainframe JCL containing Cybermatics ESP scheduler coding
- Process scripts converted from mainframe JCL containing BMC Control-M
  to allow testing on unix before unix version of control-M installed.
Note
  • Part 9 (Cross-References) was moved from original MVSJCL.doc
    to a separate book XREFjobs.doc.
 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

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

Mainframe Conversion Documentation Summary

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


MVSJCL.htm - MVS JCL Conversion to Korn shell scripts <-- Main document

MVSJCL2.htm - MVS JCL Conversion - Overflow <-- This Document

MvsJclPerl.htm - MVS JCL Conversion to Perl scripts


VSEJCL.htm - VSE JCL Conversion

MVSCOBOL.htm - VSE COBOL Conversion

VSECOBOL.htm - MVS COBOL Conversion

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

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

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

Copyright UV Software Inc. 1993-2008

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

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

mailto:owen@uvsoftware.ca

http://www.uvsoftware.ca

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

Part_26 special conversions SORT/SYNCSORT, FTP, etc

special conversions SORT, FTP, etc

'uvsort' has all the powerful capabilities of SYNCSORT, but some of the more complex conversions may require manual correction.

We will try to tell you of some things to 'watch out for' based on past conversions. The JCL converter is not perfect for some complex situations such as SORT or SYNCSORT with complex AND/OR for INCLUDEs/OMITs. But we can tell you how to make manual changes to achieve the desired results. We have not yet found a situation that we cant handle, since uvsort & uvcopy have more powerful data manipulation capabilities than the mainframe utilities.

 26A1. Complete example of a SORT conversion to uvsort.
      - as a 1 step job including the essential JCL file definitions
      - subsequent examples will illustrate just the SORT specifications
 26B1. SYNCSORT with record selection 'INCLUDE COND'itions
      - this example is converted correctly, no manual changes required
      - subsequent examples will require manual corrections
 26C1. SYNCSORT with INCLUDEs that do require manual correction
      - uvsort does provides just as powerful AND/OR logic, but the converter
        does not recognize complex AND/OR conditions in parenthesis.
 26D1. another SYNCSORT with more complex AND/OR INCLUDE AND/OR conditions
      - manual corrections are illustrated
 26E1. SYNCSORT OMITs & INCLUDEs in same SORT require manual changes
      - selects & deletes are mutually exclusive (& unnecessary)
      - simply change deletes to selects & reverse the condition test
 26F1. SYNCSORT with EDIT & SIGNS
      - the converter does not process these seldom used features
      - uvsort does have equivalent capabilities, but manual changes required
 26G1. SORT with 56 SUM fields
      - converted with no manual changes required
 26H1. SORT with multiple OUTFILs & complex INCLUDE AND/OR conditions
      - converts to uvsort, with no manual changes required
      - but we will illustrate alternative solutions, writing a replacement
        'uvcopy' job which includes uvsort capabilities plus unlimited data
        manipulation, tables, etc.

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

Part 26 special conversions SORT/SYNCSORT, FTP, etc

 26I1. ALTERNATE Solutions to SORT with multiple INCLUDEs/OMITs
      - converted to uvcopy using table lookups
      - simplifies coding & maintenance
      - see alternate solutions using uvcopy & table lookups
 26J1. SORTs with too many OMIT/INCLUDE patterns
      - may exceed the converter limits (SORT specs max 1600 bytes)
      - will display excess (lost) lines & insert errmgs in output script
      - and allow you to continue
 26K1. Example #3 of SORT/SyncSort with too many OMIT/INCLUDEs for JCL converter
      - more recent example, shorter & more powerful
      - original mainframe SORT had 2000 * 14 byte part#s INCLUDEs in SYSIN
      - this solution strips INCLUDE CONDitions from SYSIN control file
        for easier maintenance or could read a datafile of part#s directly
 26L1. Merge SyncSort parameters form SyncSort converter into VU JCL/scripts.
      - SyncSort converter converts the Mainframe params to unix equivalents
      - VU JCL converter option 's1' in ctl/jclunixop5 creates null syncsorts
      - uvcopy job 'ssmerge1' reads the 2 files merging SS params into scripts

26O1. FTP sample conversion for 'put'
26O2. FTP sample conversion for 'get'

26P1. FTP sample conversion for 'put' from a GDG file
26P2. FTP sample conversion for 'get' to a GDG file

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

26A1. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT example - JCL before conversion

 //ORDR190S JOB (RZOPSP,ORDR,BN23),'ORDR',REGION=20M
 //ORDRST01 EXEC PGM=SORT,REGION=2048K
 //SORTIN   DD DSN=ORDR.ORDR340F.BILLING.EXTRACT,DISP=SHR
 //SORTOUT  DD DSN=&&TEMP,DISP=(NEW,PASS),
 //            DCB=(LRECL=80,BLKSIZE=800,RECFM=FB),
 //            SPACE=(TRK,(50,50),RLSE),UNIT=DISK
 //SYSIN    DD DSN=ORDR.CTLCDLIB(ORDR190S),DISP=SHR

See the complete equivalent Korn shell script on the next page --->

essential code extracted from script

 exportgenall SORTIN cpop/cpop340f.billing.extract_
 exportfile SORTOUT $DW/${JOBID}_temp
 exportfile SYSIN cpop/ctlcdlib/cpop190s
 #2-------------------------- parms/cpop190s ---------------------------
 #  SORT FIELDS=(21,6,CH,A,27,13,CH,A,1,3,CH,A)
 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80,\
 keys=(20,6,c,a,26,13,c,a,0,3,c,a)"
 #4----------------------------------------------------------------------

Note that most MVS SORT FIELDS are contained as a member in a control card library (because PROCs are not allowed to contain instream data). The JCL converter expects you to have stored the SORT FIELD members in the 'parms' subdir. It does not matter what the SYSIN path directories are, the converter extracts the member-name & expects it to be in 'parms/member-name'.

For brevity & convenience we will show future SORT FIELDS in this part as if they were coded as instream data as follows:

//SYSIN DD * SORT FIELDS=(21,6,CH,A,27,13,CH,A,1,3,CH,A) /*

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

26A2. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT conversion - script output

 #!/bin/ksh
 ##CPOP190S JOB (RZOPSP,CPOP,BN23),"CPOP",REGION=20M
 if [ -n "$1" ]; then export $*; fi
 if [ -z "$JOBID" ]; then JOBID=CPOP190S; fi; export JOBID
 echo "$JOBID:$(date +%y%m%d:%H%M%S:) JOB begun=$JOBID"
 if [ -n "$1" ]; then echo $*; fi
 autoload jobset5 logmsg exportgen0 exportgen1 exportgenp exportgenx
 autoload exportgenall exportfile
 jobset5          # call function to setup: directory equates, UPSI, etc
 logmsg "RUNDATA=$RUNDATA RUNLIBS=$RUNLIBS"
 logmsg "DW=$DW,DP=$DP"
 JOBSTEP=0; export JOBSTEP
 integer JCC=0
 if [[ "$STEP" == "" ]]; then export STEP=S0000
 else logmsg "*** restarting *** at STEP=$STEP"; fi
 alias goto="<<${STEP}=A"
 goto
 S0000=A
 #1========================== begin step 1 sort ===========================
 S0010=A
 ((JOBSTEP++))
 logmsg "begin step# $JOBSTEP/1 sort"
 ##CPOPST01 EXEC PGM=SORT,REGION=2048K
 export PROGID=sort
 export STEPID=CPOPST01
 exportgenall SORTIN cpop/cpop340f.billing.extract_
 exportfile SORTOUT $DW/${JOBID}_temp
 exportfile SYSIN cpop/ctlcdlib/cpop190s
 #2-------------------------- parms/cpop190s ---------------------------
 #  SORT FIELDS=(21,6,CH,A,27,13,CH,A,1,3,CH,A)
 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80,\
 keys=(20,6,c,a,26,13,c,a,0,3,c,a)"
 #4----------------------------------------------------------------------
 S0010C=$?; ((JCC+=S0010C)); S0010R=1; alias goto="";
 if ((S0010C != 0))
    then logmsg "step# $JOBSTEP sort abterm $S0010C"
    alias goto="<<S9900=A"; fi
 goto
 #8======================================================================
 S9000=A
 logmsg "JOB=$JOBID2 Terminated Normally"
 exit 0  #UVSI jclunix51 version: 030922  options: c0d0g10n0p0u1
 #9======================================================================
 S9900=A
 # ............ ABTERM COND=EVEN steps moved here ............
 logmsg "JOB=$JOBID2 Terminated Abnormally"
 exit 999

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

26B1. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SYNCSORT with INCLUDE 'OR' CONDitions

 //SYSIN    DD *
  SORT FIELDS=(4,12,A,1,3,A),FORMAT=CH
  INCLUDE COND=(1,3,EQ,C'B01',OR,
                1,3,EQ,C'B03',OR,
                1,3,EQ,C'B04'),FORMAT=CH
 /*
                ** uvsort equivalent - select 'OR' CONDitions **

 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80,\
 keys=(3,12,c,a,0,3,c,a),sel1=0(3c):B01,sel1=0(3c):B03,sel1=0(3c):B04"
 #4----------------------------------------------------------------------

SYNCSORT - with INCLUDE AND/OR CONDitions

 //SYSIN    DD *
  SORT FIELDS=(4,12,A,1,3,A),FORMAT=CH
  INCLUDE COND=(1,3,EQ,C'B01',AND,20,1,LT,'5',OR,
                1,3,EQ,C'B01',AND,20,1,GT,'4'),FORMAT=CH
 /*

uvsort equivalent - select AND/OR CONDitions


 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=80,filo1=$SORTOUT,typ=RSF,rcs=80,\
 keys=(3,12,c,a,0,3,c,a),\
 sel1=0(3c):B01,sel2=19(1c)<5,sel1=0(3c):B01,sel2=19(1c)>4"
 #4----------------------------------------------------------------------
  1. SYNCSORT 'INCLUDE' is converted to uvsort 'sel' (select). (SYNCSORT 'OMIT' is converted to uvsort 'del' (delete))

  2. 'AND' conditions indicated by increasing digit: sel1,sel2,...,sel8 (max)

  3. 'OR' conditions indicated by digit reverting to 1: sel1=...sel2=..,sel1=..

  4. uvsort condition codes are ':' for 'EQ', '<' for 'LT', '>' for 'GT'

  5. Up to this point the SORT conversion did not require manual corrections. The following pages will illustrate 'SYNCSORT's that do require corrections.

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

26C1. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT - 'INCLUDE's requiring MANUAL Corrections

 //SYSIN    DD *
   SORT FIELDS=(01,05,A,06,03,A),FORMAT=CH
   INCLUDE COND=((1,3,CH,EQ,C'400',OR,1,3,CH,EQ,C'410'),AND,(20,1,CH,EQ,C'P'))
 /*

uvsort equivalent


 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=15,filo1=$SORTOUT,typ=RSF,rcs=15,\
 keys=(0,5,c,a,5,3,c,a),\
 sel1=0(3c):400,sel1=0(3c):410,sel2=19(1c):P"
 #4----------------------------------------------------------------------
  1. Note that I have re-split the generated code (keys,sels,mvc,sum,nmvco) to make it easier to compare to the input SYNCSORT code. The original generated code would fill the lines to about 75 bytes.

  2. Most INCLUDE/OMITs will be converted correctly with no manual changes required, but this sort illustrates a situation that does require change.
   INCLUDE COND=((1,3,CH,EQ,C'400',OR,1,3,CH,EQ,C'410'),AND,(20,1,CH,EQ,C'P'))
   ,sel1=0(3c):400,sel1=0(3c):410,sel2=19(1c):P            <-- converter output
   ,sel1=0(3c):400,sel2=19(1c):P,sel1=0(3c):410,sel2=19(1c):P  <-- fixed up
                  ^^^^^^^^^^^^^^
                 (manual insert)
  1. The fixup is required because the converter does not respect the parenthesis ((....OR....),AND,(...) <-- embedded parenthesis ignored (sel1,OR,sel1,AND,sel2) <-- OR's convert to sel1, AND's to sel2,sel3,etc

The parenthesis indicate that the 'AND' applies to both the preceding 'OR' conditions, not just the immediately preceding condition, so you must manually duplicate the AND/sel2 condition after the 1st sel1 condition.

You should not correct the UNIX scripts in subdir jcl3. You should first copy indicated scripts to subdir jcls & make corrections there (in case of reconversion's which would destroy any corrections in jcl3).

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

26D1. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT - complex INCLUDE manual changes

 //SYSIN    DD *
 SORT FIELDS=COPY
 INCLUDE COND=((162,2,CH,EQ,C'22',OR,162,2,CH,EQ,C'25'),AND,
 (116,3,CH,EQ,C'004',OR,116,3,CH,EQ,C'010',OR,
 116,3,CH,EQ,C'013',OR,116,3,CH,EQ,C'014'))
 /*

uvsort equivalent


 #3----------------------------------------------------------------------
 uvcp "fili1=$SORTIN,typ=RSF,rcs=200,filo1=$SORTOUT,typ=RSF,rcs=200,\
 sel1=161(2c):22,\
 sel1=161(2c):25,sel2=115(3c):004,\
 sel1=115(3c):010,\
 sel1=115(3c):013,\
 sel1=115(3c):014"
 #4----------------------------------------------------------------------

uvsort equivalent - after manual corrections

 uvcp "fili1=$SORTIN,typ=RSF,rcs=200,filo1=$SORTOUT,typ=RSF,rcs=200,\
 sel1=161(2c):22,SEL2=115(3c):004,\
 SEL1=161(2c):22,sel2=115(3c):010,\   <-- inserted SELects coded in UPPER case
 SEL1=161(2c):22,sel2=115(3c):013,\
 SEL1=161(2c):22,sel2=115(3c):014,\
 sel1=161(2c):25,sel2=115(3c):004,\   <-- 2nd set of ANDs for 2nd OR condition
 SEL1=161(2c):25,SEL2=115(3c):010,\
 SEL1=161(2c):25,SEL2=115(3c):013,\
 SEL1=161(2c):25,SEL2=115(3c):014"
  1. This example #4 is similar to example #3 - INCLUDE conversions to sel/del that need manual correction due to complex AND/OR's. Note that I have re-split the generated (before correction) sel1/sel2 to better illustrate the AND/OR conditions & what needs to be corrected.

  2. These fixups are required because the converter ignored the parenthesis of complex AND/ORs: ((...,OR,...),AND,(...,OR,...,OR,...,OR,...))

  3. I have emphasized the 'SEL1/SEL2's that had to be inserted manually by coding them in UPPER case.

  4. Each of the 1st 2 'OR' conditions (162,2 = 22 OR 25) must be qualified by all of the 4 'AND' conditions (116,3 = 004,010,013,014). This requires a duplication of the 4 AND conditions to 8 sets of sel1/sel2.

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

26E1. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT - OMITs & INCLUDEs in same step not allowed

 //SYSIN    DD *
 SORT FIELDS=(1,11,A),FORMAT=CH
 OMIT COND=(1,4,CH,EQ,C'FHDR',OR,1,4,CH,EQ,C'TRLR')
 OUTFIL FILES=1,
 INCLUDE=(1,2,CH,EQ,C'00')
 OUTFIL FILES=2,
 OMIT=(1,2,CH,EQ,C'00',OR,1,2,CH,EQ,C'99')
 /*

converted script - BEFORE manual changes


 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=48,filo1=$SORTOF1,typ=RSF,rcs=48,\
 filo2=$SORTOF2,\
 keys=(0,11,c,a),del1=0(4c):FHDR,del1=0(4c):TRLR,sel1o1=0(2c):00,\
 del1o2=0(2c):00,del1o2=0(2c):99"
 #4----------------------------------------------------------------------

converted script - AFTER manual changes


 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=48,filo1=$SORTOF1,typ=RSF,rcs=48,\
 filo2=$SORTOF2,\
 keys=(0,11,c,a),del1=0(4c):FHDR,del1=0(4c):TRLR,del1o1=0(2c)!00,\
 del1o2=0(2c):00,del1o2=0(2c):99"                ^^^         ^     <--Note ^
 #4----------------------------------------------------------------------
  1. This job contains 4 OMIT conditions & 1 INCLUDE condition. OMIT is converted to 'del' & INCLUDE is converted to 'sel', but for uvsort rules, these are mutually exclusive.

  2. This is a minor problem, just change the 1 'sel' to 'del' & reverse the condition comparison code.

  3. So 'sel1o1=0(2c):00' becomes 'del1o1=0(2c)!00'.

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

26F1. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT - OUTREC EDIT/SIGNS require manual changes

 //SYSIN    DD *
 SORT FIELDS=(1,25,A),FORMAT=CH
 SUM FIELDS=(26,5,ZD)
 OUTREC FIELDS=(1,5,C',',6,10,C',',16,10,C',',
 26,5,ZD,EDIT=(STTTTT),SIGNS=(,-,,),LENGTH=6)
 /*

converted script - BEFORE manual changes


 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=34,filo1=$SORTOUT,typ=RSF,rcs=34,\
 keys=(0,25,c,a),sum1=25(5z),\
 mvco=0(5)0,mvco=5(1):0x2C,mvco=6(10)5,mvco=16(1):0x2C,mvco=17(10)15,\
 mvco=27(1):0x2C,mvco=28(5)25,mvco=33(0)-1"
 #4----------------------------------------------------------------------

converted script - AFTER manual changes

 uvsort "fili1=$SORTIN,typ=RSF,rcs=48,filo1=$SORTOUT,typ=RSF,rcs=34,\
 keys=(0,25,c,a),sum1=25(5z),\
 mvco=0(5)0,mvco=5(1):0x2C,mvco=6(10)5,mvco=16(1):0x2C,mvco=17(10)15,\
 mvco=27(1):0x2C,mvno=28(-6z)25(5z)"
  1. Note that OUTREC FIELDS is creating an edited output record as follows:
    (1,5,C',',6,10,C',',16,10,C',',26,5,ZD,EDIT=(STTTTT),SIGNS=(,-,,),LENGTH=6)
    1234567890123456789012345678901234567890  <-- column scale
    aaaaa,bbbbbbbbbb,cccccccccc,-ddddd        <-- edited output fields a,b,c,d
  1. The converter does not process the EDIT/SIGNS/LENGTH, so you must change
    ,mvco=28(5)25,mvco=33(0)-1"  <-- generated by 26,5,ZD,EDIT=(STTTTT), etc
    ,mvno=28(-6z)25(5z)"         <-- change 'mvc' to 'mvn' to EDIT SIGN
                                 <-- insert '-' of (-6z) for leading sign

Remove the 'mvco=33(0)-1' garbage caused by the unexpected EDIT/SIGN specs.

  1. Note that OUTREC instructions are generated with the 'o' option (mvco=...) which cause them to be executed at SORT output time (vs input time default). Note that the 'sum1=25(5z)' instruction is performed at SORT output time prior to the 'mvco' instructions. Thus the sum field 25(5z) is the input for the EDIT SIGN instruction 'mvno=28(-6z)25(5z)'.

  2. Note that 'mvco=5(1):0x2C' inserts a ','. The comma is coded in hex (x'2C') since the syntax of uvsort/uvcp does not allow character commas.

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

26G1. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT - multiple SUM fields

 //SYSIN    DD *
 SORT FIELDS=(1,8,CH,A)
 SUM FIELDS=(9,6,15,6,21,6,27,6,33,6,39,6,45,6,51,6,
 57,6,63,6,69,6,75,6,81,6,87,6,93,6,99,6,105,6,111,6,117,6,123,6,
 129,6,135,6,141,6,147,6,153,6,159,6,165,6,171,6,177,6,183,6,189,6,
 195,6,201,6,207,6,213,6,219,6,225,6,231,6,237,6,243,6,249,6,255,6,
 261,6,267,6,273,6,279,6,285,6,291,6,297,6,303,6,309,6,315,6,321,6,
 327,6,333,6,339,6),FORMAT=PD
 OMIT COND=(1,4,CH,EQ,C'FHDR',OR,1,4,CH,EQ,C'TRLR')
 /*

converted UNIX script (relevant code only)


 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=346,filo1=$SORTOUT,typ=RSF,rcs=346,\
 keys=(0,8,c,a),del1=0(4c):FHDR,del1=0(4c):TRLR,sum1=8(6p),sum2=14(6p),\
 sum3=20(6p),sum4=26(6p),sum5=32(6p),sum6=38(6p),sum7=44(6p),sum8=50(6p),\
 sum9=56(6p),sum10=62(6p),sum11=68(6p),sum12=74(6p),sum13=80(6p),\
 sum14=86(6p),sum15=92(6p),sum16=98(6p),sum17=104(6p),sum18=110(6p),\
 sum19=116(6p),sum20=122(6p),sum21=128(6p),sum22=134(6p),sum23=140(6p),\
 sum24=146(6p),sum25=152(6p),sum26=158(6p),sum27=164(6p),sum28=170(6p),\
 sum29=176(6p),sum30=182(6p),sum31=188(6p),sum32=194(6p),sum33=200(6p),\
 sum34=206(6p),sum35=212(6p),sum36=218(6p),sum37=224(6p),sum38=230(6p),\
 sum39=236(6p),sum40=242(6p),sum41=248(6p),sum42=254(6p),sum43=260(6p),\
 sum44=266(6p),sum45=272(6p),sum46=278(6p),sum47=284(6p),sum48=290(6p),\
 sum49=296(6p),sum50=302(6p),sum51=308(6p),sum52=314(6p),sum53=320(6p),\
 sum54=326(6p),sum55=332(6p),sum56=338(6p)"
 #4----------------------------------------------------------------------

This example was included to prove that the JCL converter can handle up to 56 sum fields (max is 64 & could be increased if required).

alternate solution possible with uvsort


 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=346,filo1=$SORTOUT,typ=RSF,rcs=346,\
 keys=(0,8,c,a),del1=0(4c):FHDR,del1=0(4c):TRLR,sum1x56=8(6p)"
 #4----------------------------------------------------------------------

The 'x' option provided by uvsort allows us to use 1 instruction to perform the same work as the SYNCSORT job using 56 separate sum instructions.

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

26G2. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

creating a test file - with 56 SUM fields

It was interesting to prove that 'uvsort' could correctly process the 56 SUM fields. First I had to create a test file of 346 byte records with the 56 packed fields. The uvcopy utility makes it easy to do this.

  1. Use the editor to create a file with the record keys desired. From the above you can see the key is the 1st 8 bytes, so I created 8 records of 8 bytes + Linefeed
    FHDR0000,00000001,00000002,00000002,00000003,00000003,00000003,TRLR0000

I duplicated some keys so I could easily prove the SUM feature was working.

  1. Write a simple uvcopy job to read the text file of record keys & generate fixed length 346 byte records with 56 packed 6 byte fields from 9 to 344. Execute the uvcopy job to create the test file.

  2. Run the uvsort step extracted from the c9je3@01.ksh script above using the generated test file as input.

  3. verify the summarized output file using uvhd to view the packed fields.

Please see the details on page '27K1'.

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

26H1. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT - complex multiple 'OUTFIL's

 //SPLITSL1 JOB
 //* SPLIT SALES ITEMS to 2 GROUPS DEPENDING ON PRODUCT CODE
 //SPLITSL1 EXEC PGM=SORT
 //SORTIN   DD DSN=AR.SALES.ITEMS,DISP=SHR
 //SORTOF1  DD DSN=WORK.SALES.GROUP1,DISP=(NEW,PASS),...
 //SORTOF2  DD DSN=WORK.SALES.GROUP2,DISP=(NEW,PASS),...
 //SORTWK01 DD UNIT=SYSDA,SPACE=(CYL,(90,15),RLSE)
 //SYSIN    DD *
      SORT FIELDS=COPY
      RECORD TYPE=F,LENGTH=64
      INPFIL BLKSIZE=6400
      OUTFIL BLKSIZE=6400
      OUTFIL FILES=1,INCLUDE=(31,6,CH,EQ,C'HAM001',OR,31,6,CH,EQ,C'HAX129',
      OR,31,6,CH,EQ,C'WHIP75',OR,31,6,CH,EQ,C'SAW051')
      OUTFIL FILES=2,INCLUDE=(31,6,CH,EQ,C'CHR001',OR,31,6,CH,EQ,C'TAB013',
      OR,31,6,CH,EQ,C'BBQ001')
 /*

converted UNIX script

 k#013 #1======================= begin step#S0010 SORT ========================
 k#014 S0010=A
 k#015 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#016 logmsg1 "Begin Step $JSTEP sort (#$XSTEP)"
 k#017 ##SPLITSL1 EXEC PGM=SORT
 k#018 export PROGID=sort
 k#019 export PARM=""
 k#020 exportfile SORTIN ar/sales.items
 k#021 exportfile SORTOF1 work/sales.group1
 k#022 exportfile SORTOF2 work/sales.group2
 k#023 SYSIN=$JTMP/${JSTEP}_${PROGID}_SYSIN
 k#024 cat > $SYSIN <</*
 k#025 SORT FIELDS=COPY
 k#026 RECORD TYPE=F,LENGTH=64
 k#027 # INPFIL BLKSIZE=6300
 k#028 # OUTFIL BLKSIZE=6500
 k#029 OUTFIL FILES=1,INCLUDE=(31,6,CH,EQ,C'HAM001',OR,31,6,CH,EQ,C'HAX129',
 k#030 OR,31,6,CH,EQ,C'WHIP75',OR,31,6,CH,EQ,C'SAW051')
 k#031 OUTFIL FILES=2,INCLUDE=(31,6,CH,EQ,C'CHR001',OR,31,6,CH,EQ,C'TAB013',
 k#032 OR,31,6,CH,EQ,C'BBQ001')
 k#033 /*
 k#034 exportfile SYSIN $SYSIN
 k#035 #3----------------------------------------------------------------------
 k#036 uvcp "fili1=$SORTIN,typ=RSF,rcs=64,filo1=$SORTOF1,typ=RSF,rcs=64,filo2=$SORTOF2\
 k#037 ,sel1o1=30(6c):HAM001,sel1o1=30(6c):HAX129,sel1o1=30(6c):WHIP75\
 k#038 ,sel1o1=30(6c):SAW051,sel1o2=30(6c):CHR001,sel1o2=30(6c):TAB013\
 k#039 ,sel1o2=30(6c):BBQ001"
 k#040 #4----------------------------------------------------------------------

The 'SORT FIELDS=COPY' indicates that no SORT is required, so we execute 'uvcp' (vs 'uvsort'). We are just COPYing the file & selecting records to 2 output files. No manual changes are required.

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

26H2. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

Running splitsl1 demo SORT file split

You can run the 'splitsl1' demo sort (see above) & check the input & 2 output files as follows:


 #1. cd testdata             - change to the testdata directory
     ===========

 #2. splitsl1.ksh            - execute the demo sort (file copy/split)
     ============

 #3a. uvcp "fili1=ar/sales.items,rcs=64,typ=RSF,filo1=tmp/xxx,typ=LSTt"
      =================================================================

 #3b. cat tmp/xxx            - display the input file
      ===========

ar/sales.items - test file for demo sort splitsl1

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

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

26H3. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

list the output files from splitsl1

We could list the output files in the same manner as for the input file (uvcp to insert LineFeeds, then vi/cat/more/etc), BUT we will demonstrate a uvcopy job to list typ=RSF files (Record Seqntl Fixed, no LineFeeds).

'listrec2' will also create page headers with filename, date/time, & a record scale. Records longer than 100 byte will be listed in 100 byte segments. You must specify the record size as user option 'r' (uop=r64 for example).

'listrec2' creates the output report in the 'tmp' subdir, using the same input filename with '.lst' suffix. Then you are prompted for disposition (vi,cat,more,uvlp12,etc).


 #4. uvcopy listrec2,fili1=work/sales.group1,uop=r64  <-- list 1st split file
     ===============================================
     enter vi/cat/more/uvlp12/etc ---> cat  <--
 listrec2 - list file=work/sales.group1 2004/04/08_09:39:11
           1         2         3         4         5         6
 0123456789012345678901234567890123456789012345678901234567890123
 130140    21 940802 IN111001  HAM001  00002{ 0000001 00000002{
 150825    44 960804 IN1122    HAM001  00002E 0005001 00012502E
 201120    44 970807 CR5234    WHIP75  00002G 0007001 00018902G
 223240    65 980816 CR955     HAM001  00002H 0008001 00022402H
 315512    44 000805 IN2251    HAM001  00001L 0003001 00003901L
 315512    44 000805 IN2251    SAW051  00001M 0004001 00005601M
 400002    85 010812 CR245     HAX129  00001O 0006001 00009601O
 406082    65 020816 IN441     HAM001  00001R 0009001 00017101R

 #5. uvcopy listrec2,fili1=work/sales.group2,uop=r64  <-- list 2nd split file
     ===============================================
     enter vi/cat/more/uvlp12/etc ---> cat  <--
 listrec2 - list file=work/sales.group2 2004/04/08_09:53:59
           1         2         3         4         5         6
 0123456789012345678901234567890123456789012345678901234567890123
 139923    35 950802 IN111002  CHR001  00002B 0002001 00004402B
 139923    35 950802 IN111002  TAB013  00002C 0003001 00006902C
 139923    35 950807 CR5421    TAB013  00002D 0004001 00009602D
 308685    21 990812 CR8835    TAB013  00001K 0002001 00002401K
 406082    35 020815 IN33001   BBQ001  00001P 0007001 00011901P
 406089    35 020815 IN33001   TAB013  00001Q 0008001 00014401Q

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

26I1. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

Alternative 'uvcopy job' replacements

For complex file splits, it might be better to convert the uvsort (or uvcp if SORT FIELDS=COPY) to a 'uvcopy job', which allows more powerful selections & up to 40 output files.

Note that the uvcopy job is a separate file which is called from the UNIX script as shown below. This allows us to replace the multi-line 'uvsort' or 'uvcp' in the script with a 1 line call to 'uvcopy' which in turn calls a separate instruction file, see the next page --->


 #3----------------------------------------------------------------------
 uvcp "fili1=$SORTIN1,typ=RSF,rcs=64,filo1=$SORTOF1,typ=RSF,rcs=64,\
 filo2=$SORTOF2,sel1o1=30(6c):HAM001,sel1o1=30(6c):HAX129,\
 sel1o1=30(6c):WHIP75,sel1o1=30(6c):SAW051,sel1o2=30(6c):CHR001,\
 sel1o2=30(6c):TAB013,sel1o2=30(6c):BBQ001"
 #4----------------------------------------------------------------------
Note
  • remove the above 4 lines from the script (shown on previous page)
  • replace with the following 1 line (calling a uvcopy job).
 #----------------------------------------------------------------
 uvcopy splitsl2,fili1=$SORTIN1,filo1=$SORTOF1,filo2=$SORTOF2
 #----------------------------------------------------------------

'uvcopy' searches for the jobname in $PFPATH (exported PFPATH in profile). By convention uvcopy jobs are stored in subdirectory named 'pf', for example:

      export PFPATH=$UV/pf/adm:$UV/pf/demo:$UV/pf/util:$UV/pf/IBM
      export PFPATH=$RUNLIBS/pf:$APPSADM/pf:$HOME/pf:$PFPATH

The next few pages will list 4 uvcopy job alternatives to splitsl1 (splitsl2, splitsl3, splitsl4, splitsl5). These are supplied in /home/uvadm/pf/demo & you can run them from the command prompt as follows:


 #2. uvcopy splitsl2,fili1=ar/sales.items,filo1=work/sales.group1,filo2=work/sales.group2
    =====================================================================================
 #3. uvcopy splitsl3,fili1=ar/sales.items,filo1=work/sales.group1,filo2=work/sales.group2
     =====================================================================================
 #4. uvcopy splitsl4,fili1=ar/sales.items,filo1=work/sales.group1,filo2=work/sales.group2
     =====================================================================================
 #5. uvcopy splitsl5,fili1=ar/sales.items,filo1=work/sales.group1,filo2=work/sales.group2
     =====================================================================================

After each run, you should verify that you get the same records selected to the 2 output files.

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

26I2. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT uvcopy alternative solution#2

 # splitsl2 - uvcopy job to replace SORT with multi file split
 #
 # uvcopy splitsl2,fili1=ar/sales.items,filo1=work/sales.group1,filo2=work/sales.group2
 # ====================================================================================
 #
 fili1=?in,typ=RSF,rcs=64        # filenames specified on uvcopy call line
 filo1=?out1,typ=RSF,rcs=64
 filo2=?out2,typ=RSF,rcs=64
 @run
        opn    all
 #
 # begin loop to get each record, test codes & write to selected output file
 man20  get    fili1,a0               get next record
        skp>   eof
 #
 # test product code & write to output file#1 or #2 depending on code
        cmc    a30(6),'HAM001'
        skp=   man30
        cmc    a30(6),'HAX129'
        skp=   man30
        cmc    a30(6),'WHIP75'
        skp=   man30
        cmc    a30(6),'SAW051'
        skp=   man30
        cmc    a30(6),'CHR001'
        skp=   man40
        cmc    a30(6),'TAB013'
        skp=   man40
        cmc    a30(6),'BBQ001'
        skp=   man40
        skp    man20                 none of above, return to get next
 #
 man30  put    filo1,a0              write to outfile 1
        skp    man20
 #
 man40  put    filo2,a0              write to outfile 2
        skp    man20
 #
 eof    cls    all
        eoj

NOTES

Please see the 'INCLUDE' conditions listed on the previous page. Do you agree that the code above performs the required selection & file split ?

Please see another alternate solution on the next page --->

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

26I3. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT uvcopy alternative solution#3

 # splitsl3 - uvcopy job to replace SORT with multi file split
 #          - ALTERNATE solution using a LOOK-UP table
 #
 # uvcopy splitsl3,fili1=ar/sales.items,filo1=work/sales.group1,filo2=work/sales.group2
 # ====================================================================================
 #
 fili1=?in,typ=RSF,rcs=64        # filenames specified on uvcopy call line
 filo1=?out1,typ=RSF,rcs=64
 filo2=?out2,typ=RSF,rcs=64
 #
 # load table of product#s for output file #1
 lod=j0(20)
 HAM001
 HAX129
 WHIP75
 SAW051
 ~~~~~~~~~~~~~~~~~~~~
 # load table of product#s for output file #2
 lod=k0(20)
 CHR001
 TAB013
 BBQ001
 ~~~~~~~~~~~~~~~~~~~~
 @run
        opn    all
 #
 # begin loop to get each record, test codes & write to selected output file
 man20  get    fili1,a0               get next record
        skp>   eof
        lok    j0(20),j0(6),a30(6)    lookup table#1 for match to prod#
        skp=   man30                  if match go write to outfile1
        lok    k0(20),k0(6),a30(6)    lookup table#2 for match to prod#
        skp=   man40                  if match go write to outfile#2
        skp    man20                  neither, return to get next
 man30  put    filo1,a0              write to outfile 1
        skp    man20
 man40  put    filo2,a0              write to outfile 2
        skp    man20
 #
 eof    cls    all
        eoj

The 'lod' (load) table & 'lok' (lookup table) technique becomes more useful as the number of codes to be compared increases.

 lod=j0(20)             <-- we specify 20 byte entries (but we only need 6)
 HAM001                   - right side might be used for codes (see ahead)
 ...etc...
 ~~~~~~~~~~~~~~~~~~~~   <-- table ended by tildes
        ...
        lok    j0(20),j0(6),a30(6)    lookup table#1 for match to prod#
        skp=   man30                  condition code set '=' on match

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

26I4. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT uvcopy alternative solution#4

 # splitsl4 - uvcopy job to replace SORT with multi file split
 #          - 2nd ALTERNATE solution using 1 LOOK-UP table vs 2
 #          - with output file code 1/2 on right side of table entries
 #
 # uvcopy splitsl4,fili1=ar/sales.items,filo1=work/sales.group1,filo2=work/sales.group2
 # ====================================================================================
 #
 fili1=?in,typ=RSF,rcs=64        # filenames specified on uvcopy call line
 filo1=?out1,typ=RSF,rcs=64
 filo2=?out2,typ=RSF,rcs=64
 #
 # load table of product#s for output file #1 or #2
 # - code outfile desired with a 1 or 2 in col 8 (0 rel byte 7) of each entry
 # - see below--> cmc jx7(1),'2'  <-- tests code offset 7 from rgstr 'x' (jx7)
 # - rgstr 'x' holds dsplcmnt of matched entry from table lookup (0,20,40,etc)
 lod=j0(20)
 HAM001 1
 HAX129 1
 WHIP75 1
 SAW051 1
 CHR001 2
 TAB013 2
 BBQ001 2
 ~~~~~~~~~~~~~~~~~~~~
 @run
        opn    all
 # begin loop to get each record, test codes & write to selected output file
 man20  get    fili1,a0               get next record
        skp>   eof
        lok    j0(20),j0(6),a30(6)    lookup table for match to prod#
        skp!   man20                  if nomatch, return to get next
        cmc    jx7(1),'2'             write to outfile#2 ?
        skp=   man40
 man30  put    filo1,a0              write to outfile 1
        skp    man20
 man40  put    filo2,a0              write to outfile 2
        skp    man20
 eof    cls    all
        eoj

This might be an obvious improvement, as long as you understand index registers. Here we have only 1 table & 1 lookup.

If the lookup finds no match (cc !), we return to get the next record. If we find a match (cc =), we test the code in col 8 (byte 7) of each entry. If '2' we go write to file2, if '1' (not 2), we write to file 1.

Note that on a match, the 'lok' stores the displacement of the matching table entry in index register 'x' (0,20,40,60,etc). So 'jx7(1)' will address 7 bytes higher than rgstr x (within area j).

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

26I5. MVSJCL2: Converting SORT & SYNCSORT to 'uvsort'

SORT uvcopy alternative solution#5

 # splitsl5 - uvcopy job to replace SORT with multi file split
 #          - 4th ALTERNATE solution using LOOK-UP tables
 #          - illustrating the SORT in uvcopy
 #
 # uvcopy splitsl5,fili1=ar/sales.items,filo1=work/sales.group1,filo2=work/sales.group2
 # ====================================================================================
 #
 fili1=?in,typ=RSF,rcs=64        # filenames specified on uvcopy call line
 filo1=?out1,typ=RSF,rcs=64
 filo2=?out2,typ=RSF,rcs=64
 #
 # load table of product#s for output file #1 or #2
 # - code outfile desired with a 1 or 2 in col 8 (0 rel byte 7) of each entry
 lod=j0(20)
 HAM001 1
 HAX129 1
 WHIP75 1
 SAW051 1
 CHR001 2
 TAB013 2
 BBQ001 2
 ~~~~~~~~~~~~~~~~~~~~
 @run
        opn    all                    open uvcopy I/O files
        sxo    '30(6),0(6)'           specify sort fields to uvcopy sort
 #
 # begin loop to get records from input file & put to the sort
 man20  get    fili1,a0(64)           get next record from infile
        skp>   man30                  if EOF (cc >), go execute the sort
        sxp    a0(64)                 put record to the sort
        skp    man20                  return to get next record
 #
 # EOF input, now execute the sort
 man30  sxs                           execute the uvcopy built in sort
 #
 # begin loop to get each record, test codes & write to selected output file
 man40  get    fili1,a0               get next record
        skp>   man80
        lok    j0(20),j0(6),a30(6)    lookup table for match to prod#
        skp!   man20                  if nomatch, return to get next
        cmc    jx7(1),'2'             write to outfile#2 ?
        skp=   man52
 man50  put    filo1,a0              write to outfile 1
        skp    man20
 man52  put    filo2,a0              write to outfile 2
        skp    man20
 #
 man80  cls    all
        eoj

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

26J1. MVSJCL2: SORT Conversion Problems & Solutions

SORTs with too many OMIT/INCLUDE patterns

SORTs with many long OMIT/INCLUDE patterns may exceed the converter limits. The combined length of the SORT specs cannot exceed 1600 bytes. The converter will display the excess (lost) lines & insert error messages in the output script (& allow you to continue).

We might convert such steps into a uvcopy job with an embedded uvsort. In this example we reduced the SORT step to just sort into 1 output temp file & moved the 47 * 30 byte INCLUDE OR patterns & the 3 way file split into a separate following uvcopy job step.

We will illustrate the solution by listing the following 4 files on the following pages:

  1. gpzjdlog1.jcl - the problem SORT extracted from gpzjdlog (step6) - made into a separate JCL for explaining the solution

  2. mmzip006 - the SYSIN control card module containing the SORT file split INCLUDE OR conditions (47*30 byte patterns)

  3. gpzjdlog1.ksh - the output ksh script from converting gpzjdlog1.jcl - after modifications to overcome excess patterns - the 'uvsort' step now just sorts the 2 input files on the specified SORT FIELDS & outputs a temporary file for input to an added 'uvcopy' step, that performs the record selections to the 3 output files using a table load & lookup for the 47*30 patterns

  4. gpzjdlog6A - the uvcopy job 'parameter file' - a separate file specified on the 1 line 'uvcopy' command added into gpzjdlog1.ksh following the 'uvsort' - it loads a table with the 47 * 30 byte patterns & looks up as part of the logic to split the output from the SORT to 3 files - note that it is easier to maintain these patterns in a table than when embedded on 1 long uvsort command - if desired these could be in a separate file read in at uvcopy init - note the many #comments made thruout the script & uvcopy job to explain how it works, also the alternatives at the end of the uvcopy job coding

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

26J2. MVSJCL2: SORT Conversion Problems & Solutions

SORT with too many OMIT/INCLUDE patterns

 //GPZJDLOG JOB (ZSPCVP),'GPS SYSTEM'
 //*NOTE - this sort had too many long 'INCLUDE's for the converter
 //* - the SYSIN SORT control card module (MMZIP006) had 47*30 byte patterns
 //* - solution was to move the 47 INCLUDEs & file split into a following uvcopy
 //* - reducing this step to just SORT to a temp file for input to the uvcopy
 //* - the problem was in step 6 of a long job & it was isolated into this
 //*   2 step job to verify the suggested solution
 //PS020    EXEC PGM=SORT
 //SORTIN    DD DSN=PGPCS.GPNJW.Z.TEMP.LOGSEQ,
 //             DISP=(SHR,KEEP,KEEP)
 //          DD DSN=PGPCS.GPNAT.MFP.LOGFILE(0),
 //             DISP=(SHR,KEEP,KEEP)
 //SORTOF1   DD DSN=PGPCS.GPNJW.Z.TEMP.MMLOGSQ,
 //             DISP=(NEW,CATLG,DELETE),
 //             MGMTCLAS=MI004802,
 //             UNIT=&PERMDA,
 //             SPACE=(&SPACE3),
 //             DCB=(SYS3.DSCB,RECFM=FB,LRECL=290,DSORG=PS,BLKSIZE=0)
 //SORTOF2   DD DSN=PGPCS.GPNJW.Z.MMLOGSQR,
 //             DISP=(MOD,KEEP,KEEP)
 //SORTOF3   DD DSN=PGPCS.GPNJW.Z.MMLOGSQF,
 //             DISP=(MOD,KEEP,KEEP)
 //SYSIN     DD DSN=PBSDN.WLMCM.PROD.ACQR.GPS.SYSIN(MMZIP006),
 //             DISP=(SHR,KEEP,KEEP)
NOTE
  • the SYSIN SORT control card module (MMZIP006) had too many INCLUDEs
  • see listing on the next page ----->

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

26J3. MVSJCL2: SORT with too many OMIT/INCLUDE patterns

SYSIN SORT control card module (MMZIP006)

 *  PARAMETER: MMZIP006                                               *
 *  SORT ON-LINE LOG FILE AND SPLIT INTO A REGULAR AND REJECT FILE    *
    SORT   FIELDS=(1,16,CH,A,29,52,CH,A,17,2,Y2C,A,19,4,CH,A,23,6,CH,A)
    OUTFIL FILES=1,INCLUDE=(12,3,CH,NE,C'RBH',AND,12,3,CH,NE,C'RBI')
    OUTFIL FILES=2,INCLUDE=(12,3,CH,EQ,C'RBH',OR,12,3,CH,EQ,C'RBI')
    OUTFIL FILES=3,INCLUDE=(12,3,CH,EQ,C'QAS',OR,12,3,CH,EQ,C'QSL',OR,
    89,30,CH,EQ,C' MCC                          ',OR,
    89,30,CH,EQ,C' FRAUD DEFAULT FLAG           ',OR,
    89,30,CH,EQ,C' FRAUD EXCLUDE FLAG           ',OR,
 - - - 41*30 byte INCLUDE OR patterns removed (leaving 1st 3 & last 3) - - -
    89,30,CH,EQ,C' AUTH FORCED PCT              ',OR,
    89,30,CH,EQ,C' AUTH DUP CARD PCT            ',OR,
    89,30,CH,EQ,C' AUTH DECLINED PCT            ')
    RECORD TYPE=F
    END

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

26J4. MVSJCL2: SORT with too many OMIT/INCLUDE patterns

converted JCL/script with workaround solution

 #!/bin/ksh
 ##GPZJDLOG JOB (ZSPCVP),'GPS SYSTEM',
 # CLASS=H;REGION=7M;MSGCLASS=R;USER=ACQUIREP
 if [ -n "$1" ]; then export $*; fi
 if [ -z "$JOBID" ]; then JOBID=GPZJDLOG; fi; export JOBID
 echo "$JOBID:$(date +%y%m%d:%H%M%S:) JOB begun=$JOBID"
 if [ -n "$1" ]; then echo $*; fi
 autoload jobset5 logmsg exportgen0 exportgen1 exportgenp exportgenx
 autoload exportgenall exportfile
 jobset5          # call function to setup: directory equates, UPSI, etc
 logmsg "RUNDATA=$RUNDATA"
 logmsg "RUNLIBS=$RUNLIBS"
 logmsg "DJ=$DJ"
 logmsg "DS=$DS"
 typeset -RZ3 JSTEP=0; export JSTEP
 integer JCC=0
 if [[ -n "$step" ]]; then STEP="$step"; fi
 if [[ -z "$STEP" ]]; then export STEP=S0000
 else logmsg "*** restarting *** at STEP=$STEP"; fi
 alias goto="<<${STEP}=A"
 goto
 S0000=A
 ##NOTE - special job 'gpzjdlog1.ksh' created from 'gpzjdlog.ksh'
 ##     - to test the changes made to step 6 uvsort & uvcopy inserted as 6A
 ##     - 1st 5 steps removed, step 6A (uvcopy) inserted, steps 7-16 removed
 #1======================= begin step 6 sort ========================
 S0060=A
 ((JSTEP++)); alias goto="";
 logmsg "begin step# $JSTEP/6 sort"
 ##PS020    EXEC PGM=SORT
 export PROGID=sort
 export PARM=""
 exportfile SORTIN01 pgpcs/gpnjw.z.temp.logseq
 exportgen0 SORTIN02 pgpcs/gpnat.mfp.logfile_
 cat $SORTIN01 $SORTIN02 \
     >$DJ/pgpcs.gpnjw.z.temp.logseq02
 exportfile SORTIN $DJ/pgpcs.gpnjw.z.temp.logseq02
 ##---------------------------------------------------------------------
 ##Aug09/05 - manual changes because JCL converter does not allow for
 ##           the large no of INCLUDE OR conditions in SYSIN MMZIP006
 ## - remove the INCLUDEs & output file splits (SORTOF1,2,3) for 'uvsort'
 ##   (will insert a following 'uvcopy' step with INCLUDEs & file splits)
 ## - original SORTOF1,2,3 moved to uvcopy step 006A
 ## - output uvsort to new temp file $DJ/pgpcs.gpnjw.z.temp.logseq02_sorted
 ##   (which will be input to the uvcopy job following the uvsort)
 ##
 exportfile SORTOUT $DJ/pgpcs.gpnjw.z.temp.logseq02_sorted
 #========================================================
 ## NOTE - the converter inserted the original SYSIN module 'mmzip006' here
 ##        as #comments & relevant info was used in the 'uvsort' command
 ##      - we will retain only a few of the original INCLUDEs as #cmts here
 ##        but the complete list is coded as lookup tables in the uvcopy job
 ##      - of course the SORT FIELDS are used on the uvsort command below
 ## exportfile SORTOF1 pgpcs/gpnjw.z.temp.mmlogsq
 ## exportfile SORTOF2 pgpcs/gpnjw.z.mmlogsqr
 ## exportfile SORTOF3 pgpcs/gpnjw.z.mmlogsqf
 ## exportfile SYSIN pbsdn/wlmcm.prod.acqr.gps.sysin/mmzip006
 #2-------------------------- parms/mmzip006 ---------------------------
 # * PARAMETER: MMZIP006 *
 #  SORT FIELDS=(1,16,CH,A,29,52,CH,A,17,2,Y2C,A,19,4,CH,A,23,6,CH,A)
 ## OUTFIL FILES=1,INCLUDE=(12,3,CH,NE,C'RBH',AND,12,3,CH,NE,C'RBI')
 ## OUTFIL FILES=2,INCLUDE=(12,3,CH,EQ,C'RBH',OR,12,3,CH,EQ,C'RBI')
 ## OUTFIL FILES=3,INCLUDE=(12,3,CH,EQ,C'QAS',OR,12,3,CH,EQ,C'QSL',OR,
 ## 89,30,CH,EQ,C' MCC                          ',OR,
 ## 89,30,CH,EQ,C' FRAUD DEFAULT FLAG           ',OR,
 ## 89,30,CH,EQ,C' FRAUD EXCLUDE FLAG           ',OR,
 ## - - - 42 lines deleted (see lookup tables in uvcopy job below) - - -
 ## 89,30,CH,EQ,C' AUTH DECLINED PCT            ')
 ##
 ##NOTE - original errmsg lines removed except for 1st
 ##ERR: comma continuation ignored, max lth 1800 would be exceeded
 ##ERR+  89,30,CH,EQ,C' CHGBCK RATIO AMT PCT         ',OR,
 ##ERR@ in#246 out#367 file: gpzjdlog.jcl
 ##ERR: adding this select/delete would exceed max lth 1600
 ##ERR+ sel1o3=88(30c):0x2041564720544958204254204849474820414D5420202020202020202020
 ##ERR@ in#246 out#403 file: gpzjdlog.jcl
 #3----------------------------------------------------------------------
 ## uvsort "fili1=$SORTIN,typ=RSF,rcs=290,filo1=$SORTOF1,typ=RSF,rcs=290,\
 ## filo2=$SORTOF2,filo3=$SORTOF3,\
 ## keys=(0,16,c,a,28,52,c,a,16,2,y,a,18,4,c,a,22,6,c,a),sel1o1=11(3c)!RBH,\
 ## sel2o1=11(3c)!RBI,sel1o2=11(3c):RBH,sel1o2=11(3c):RBI,sel1o3=11(3c):QAS,\
 ## sel1o3=11(3c):QSL,\
 ## sel1o3=88(30c):0x204D43432020202020202020202020202020202020202020202020202020,\
 ## sel1o3=88(30c):0x2046524155442044454641554C5420464C41472020202020202020202020,\
 ## sel1o3=88(30c):0x204156472054495820564
 ##NOTE - original uvsort lines ##commented out & uvsort recoded as below:
 ##     - removing the INCLUDEs/selects & file splits (SORTOF1,SORTOF2,SORTOF3)
 ##       which are now coded in the uvcopy job inserted following uvsort
 ## - another problem is that the 'uvsort' rules does not allow embedded blanks
 ##   so the 30 byte constants are converted to 60 bytes hex by the JCL converter
 ## - I plan to remove this restriction in future, but for now it is another
 ##   reason to add the 2nd step uvcopy to perform the selctions
 ##   via the table load & lookup method
 #---------------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=290,filo1=$SORTOUT,typ=RSF,rcs=290,\
 keys=(0,16,c,a,28,52,c,a,16,2,y,a,18,4,c,a,22,6,c,a)"
 #4----------------------------------------------------------------------
 S0060C=$?; ((JCC+=S0060C)); S0060R=1; alias goto="";
 if ((S0060C != 0))
    then logmsg "step# $JSTEP sort abterm $S0060C"
    alias goto="<<S9900=A"; fi
 goto
 ##======================== begin step 006A uvcopy =========================
 ## begin step 6A uvcopy (inserted for INCLUDEs removed from uvsort)
 S006A=A
 logmsg "begin step# $JSTEP/6A uvcopy (for INCLUDEs removed from uvsort above)"
 exportfile SORTOUT $DJ/pgpcs.gpnjw.z.temp.logseq02_sorted
 exportfile SORTOF1 pgpcs/gpnjw.z.temp.mmlogsq
 exportfile SORTOF2 pgpcs/gpnjw.z.mmlogsqr
 exportfile SORTOF3 pgpcs/gpnjw.z.mmlogsqf
 #----------------------------------------------------------------------------
 uvcopy gpzjdlog6A,fili1=$SORTOUT,filo1=$SORTOF1,filo2=$SORTOF2,filo3=$SORTOF3
 #----------------------------------------------------------------------------
 S006AC=$?; ((JCC+=S006AC)); alias goto="";
 if ((S006AC != 0))
    then logmsg "step# $JSTEP sort abterm $S006AC"
    alias goto="<<S9900=A"; fi
 goto
 ##Note - 'gpzjdlog6A' is the uvcopy 'parameter file'
 ## - containing a lookup table for the 47 * 30 byte INCLUDE constants
 ## - uvcopy searches $PFPATH for this module, defined in profile as:
 ##   export PFPATH=$RUNLIBS/pf
 ##
 #1======================= begin step 7 sort ========================
 ## remaining steps removed (to test only uvsort & uvcopy above)
 #8======================================================================
 S9000=A
 logmsg "JOB=$JOBID2 Terminated Normally"
 exit 0  #UVSI jclunix51 version: 20050803  options: d0g15j1n0p0r0u1x0y0
 #9======================================================================
 S9900=A
 # ............ ABTERM COND=EVEN steps moved here ............
 logmsg "JOB=$JOBID2 Terminated Abnormally"
 exit 99

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

26J5. MVSJCL2: SORT with too many OMIT/INCLUDE patterns

uvcopy parameter file (called following the uvsort

 # gpzjdlog6A - uvcopy job to split SORTOUT file from step 6 of gpzjdlog.ksh
 #            - to perform record INCLUDE/selects remvoed from step 6 SORT
 #            - because JCL converter could not handle the 47 * 30 byte OR's
 #            - see table load & lookup below
 #
 #Note - this uvcopy 'parameter file' is called by step 6A uvcopy as follows:
 #
 # uvcopy gpzjdlog6A,fili1=$SORTOUT,filo1=$SORTOF1,filo2=$SORTOF2,filo3=$SORTOF3
 # =============================================================================
 #
 fili1=?input,typ=RSF,rcs=290
 filo1=?output1,typ=RSF,rcs=290
 filo2=?output2,typ=RSF,rcs=290
 filo3=?output3,typ=RSF,rcs=290
 #
 # load a table with 47 30 byte constants to select records for output file#3
 lod=d0(30)              # load table in area d with 30 byte entries
  MCC
  FRAUD DEFAULT FLAG
  FRAUD EXCLUDE FLAG
 - - - 41*30 byte INCLUDE OR patterns removed (leaving 1st 3 & last 3) - - -
  AUTH FORCED PCT
  AUTH DUP CARD PCT
  AUTH DECLINED PCT
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   # all tildes entry marks end of table
 @run
        opn    all                open all files
 #
 # begin loop to get records & select to 3 output files
 man20  get    fili1,a0           get next record into area 'a'
        skp>   eof                (cc set > at EOF)
 #
 # select for file#1 - records WITHOUT 'RBH' or 'RBI' in columns 12-14
        cmc    11(3),'RBH'
        skp=   man30
        cmc    11(3),'RBI'
        skp=   man30
        put    filo1,a0           write record to outfile#1
 #
 # select for file#2 - records WITH 'RBH' or 'RBI' in columns 12-14
 man30  cmc    11(3),'RBH'
        skp=   man30
        cmc    11(3),'RBI'
        skp=   man30
        skp    man40              file#2 conditions not met - go test file#3
 man34  put    filo2,a0           write record to outfile#2
 #
 # select for file#3 - records WITH 'QAS' or 'QSL' in columns 12-14
 # - or match in columns 89-118 to any entry in the table loaded in area 'd'
 man40  cmc    11(3),'QAS'
        skp=   man50
        cmc    11(3),'QSL'
        skp=   man50
        lok    d0(30),d0(30),a88(30)
        skp=   man50
        skp    man20              file#3 conditions not met - return to get next
 man50  put    filo3,a0           write record to outfile#3
        skp    man20              return to get next record (repeat loop)
 #
 # EOF - close files & end job
 eof    cls    all
        eoj

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

26J6. MVSJCL2: SORT with too many OMIT/INCLUDE patterns

Notes re alternative methods

 # This job loads a table of 30 byte patterns & then looks up the table
 # for any match to the record field in columns 89-118
 #
 #   lok   d0(30),d0(30),a88(30)   lookup table for any match to cols 89-118
 #   skp=  man50                   if match found (cc =), go write to file#3
 #
 # This uvcopy table load & lookup method is easier to maintain than having
 # the 47 * 30 byte constants embedded on 1 long 'uvsort' command.
 # Also note that in some cases, the powerful uvcopy instruction set could
 # dramatically reduce the code required.
 #
 # ex#1 - suppose records should be selected if a specified pattern
 #        occurred anywhere in columns 89-118 (using 'TIX' for example)
 #
 #   scn   a88(30),'TIX'           scan for 'TIX' anywhere in 89-118
 #   skp=  man50
 #
 # ex#2 - suppose we are using the same table of 47 * 30 byte patterns (as above)
 #      - but suppose the search field is 80 bytes long & we should select
 #        if we get a match to the 30 max patterns anywhere in the 80 byte field
 #
 #   sct   a89(80),d0(30),d0(30)   scan anywhere in 89-168 for any match in table
 #   skp=  man50
 #
 # - we would tilde fill the table entries to indicate end of pattern
 # - we would code 1 blank before & after the words to be matched
 # - illustrating with only the 1st 3 entries:
 #
 # lod=d0(30)              # load table in area d with 30 byte entries
 #  MCC ~~~~~~~~~~~~~~~~~~~~~~~~
 #  FRAUD DEFAULT FLAG ~~~~~~~~~
 #  FRAUD EXCLUDE FLAG ~~~~~~~~~
 # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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

26K1. MVSJCL2: SORT with too many OMIT/INCLUDE patterns

SORTs with too many OMIT/INCLUDEs ex# 3

Here is a 3rd (shorter, but more powerful) example of a mainframe SORT with too many INCLUDEs for the Vancouver Utility JCL converter, which has a limit of 4000 bytes for all INCLUDE conditions in any 1 step.

This extreme example had 2000 * 14 byte INCLUDEs in a SYSIN control card module. I suggest that such large lists of INCLUDEs are better handled by the uvcopy solution given here.

We will strip off the SORT CONDition coding leaving only the 2000 * 14 byte numbers in the control card module. This makes it much easier to maintain the list of numbers to be INCLUDEd.

In fact, if the 14 byte numbers were available in a data file, we could lookup the data file directly, eliminating the table file & the likleyhood that the control file might not get updated to reflect the current data file, which is probably updated by some regular processing cycle.

We will illustrate this solution below with the following samples:

  1. Mainframe JCL SORT calling the SYSIN module (with 2000 numbers)

  2. SYSIN control card module (2000 * 14 byte SORT INCLUDE CONDitions)

  3. control card module with SORT CONDitions stripped out (numbers only)

  4. original JCL/script, output from VU JCL/converter

  5. modified JCL/script, calling 'uvcopy job' to lookup control file

  6. 'uvcopy job' called by converted JCL/script to lookup control cards

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

26K2. MVSJCL2: SORT with too many OMIT/INCLUDE patterns

1. Mainframe SORT calling SYSIN module

 //STR1140V JOB 'test SORT with too many INCLUDEs'
 //* note - SYSIN module (STR1140B) has 2000 INCLUDEs
 //SORT0001 EXEC  PGM=SYNCSORT,PARM='MINCORE=5000K'
 //SORTIN   DD  DSN=THUP.SMR.STR1140.EXTREEM2.INPUT01,DISP=OLD
 //SORTOUT  DD  DSN=THUP.SMR.STR1140.DAMAGED.A2,DISP=(,CATLG),
 //             UNIT=(SYSDA,10),SPACE=(CYL,(51,105),RLSE),
 //             DCB=*.SORTIN
 //SYSOUT   DD  SYSOUT=*
 //SYSIN    DD  DSN=THUSCLM.PROD.PARM(STR1140B),DISP=SHR

2. SYSIN module - 2000 * 14 byte INCLUDE CONDitions

   SORT FIELDS=COPY
     INCLUDE COND=(9069,14,CH,EQ,C'15283049244922',OR,
                   9069,14,CH,EQ,C'49734853139937',OR,
                   9069,14,CH,EQ,C'15577700020000',OR,
       - - - - - - - - about 2000 lines removed - - - - - - - -
                   9069,14,CH,EQ,C'15191598399815',OR,
                   9069,14,CH,EQ,C'15276503400308',OR,
                   9069,14,CH,EQ,C'15238620552028')
   END

3. numbers only control cards - SORT CONDitions stripped out

 # str1140b.tbl - control card module for str1140v uvcopy job
 #              - used by str1140v.ksh JCL/script
 #              - to lookup this file of 2000 * 14 byte numbers
 #              - & include data records with any match
 15283049244922
 49734853139937
 15577700020000
 - - - 2000 numbers omitted - - -
 15191598399815
 15276503400308
 15238620552028

The Vancouver Utilities make it easy to strip off the INCLUDE CONDitions leaving only the 14 byte numbers (for easier maintenance):


 uvcp "fili1=parms,rcs=80,typ=LSTt,filo1=ctl/str1140b.tbl\
 =========================================================
 ,clr=0(80):0x20,mvc=0(14)34"
 ============================
Note
  • file 'typ=LSTt' creates a Line Sequential file
  • option 't' inserts the LineFeed after the last nonblank
  • so output records will actually be 15 bytes each

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

26K3. MVSJCL2: SORT with too many OMIT/INCLUDE patterns

4. original JCL/script, output from VU JCL/converter


 #1======================= begin step#S0010 SYNCSORT ========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg1 "Begin Step $JSTEP SYNCSORT (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 ##SORT0001 EXEC  PGM=SYNCSORT,PARM='MINCORE=5000K'
 export PROGID=SYNCSORT
 export PARM="MINCORE=5000K"
 exportfile SORTIN THUP/SMR.STR1140.EXTREEM2.INPUT01
 exportfile SORTOUT THUP/SMR.STR1140.DAMAGED.A2
 exportfile SYSOUT $DS/${JSTEP}_SYSOUT
 exportfile SYSIN THUSCLM/PROD.PARM/STR1140B
 exportfile SYSIN $RUNLIBS/parms/str1140b
 #2-------------------------- parms/str1140b ---------------------------
 #  SORT FIELDS=COPY
 #  INCLUDE COND=(9069,14,CH,EQ,C'15283049244922',OR,
 #  9069,14,CH,EQ,C'49734853139937',OR,
 #  9069,14,CH,EQ,C'15577700020000',OR,
  - - - - - about 2000 lines removed - - - - -
 #  9069,14,CH,EQ,C'15276503400308',OR,
 #  9069,14,CH,EQ,C'15238620552028')
 #  END
 ERR! comma continuation ignored, max lth 4000 would be exceeded
 #ERR+  9069,14,CH,EQ,C'15351247724770',OR,
 #ERR@ in#12 out#2047 file: str1140v.jcl
 ERR! step# S0010, only 1st such err reported in any 1 step
 ERR! SORT continuation area overflows 17 of 1977 sysin lines
 #ERR@ in#12 out#2051 file: str1140v.jcl
 #3----------------------------------------------------------------------
 uxcp "fili1=$SORTIN,typ=RSF,rcs=9085,filo1=$SORTOUT,typ=RSF,rcs=9085,\
 sel1=9068(14c):15283049244922,sel1=9068(14c):49734853139937,\
 sel1=9068(14c):15577700020000,sel1=9068(14c):15570813611350,\
        - - - - - about 50 lines removed - - - - -
 sel1=9068(14c):15391329492947,sel1=9068(14c):15380721052072,\
 sel1=9068(14c):15347369226897,sel1=-1(0)?0x"
 #4----------------------------------------------------------------------
 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 if ((S0010C != 0))
    then logmsg1 "step#$JSTEP SYNCSORT abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
Note
  • this is the original converted JCL/script
  • before changes to call a 'uvcopy job'
  • to lookup the control file of 2000 * 14 byte numbers
  • see revised JCL/script below with uvcopy inserted

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

26K4. MVSJCL2: SORT with too many OMIT/INCLUDE patterns

5. modified JCL/script, calling 'uvcopy' to lookup control file


 #1======================= begin step#S0010 SYNCSORT ========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg1 "Begin Step $JSTEP SYNCSORT (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 ##SORT0001 EXEC  PGM=SYNCSORT,PARM='MINCORE=5000K'
 export PROGID=SYNCSORT
 export PARM="MINCORE=5000K"
 exportfile SORTIN THUP/SMR.STR1140.EXTREEM2.INPUT01
 exportfile SORTOUT THUP/SMR.STR1140.DAMAGED.A2
 exportfile SYSOUT $DS/${JSTEP}_SYSOUT
 exportfile SYSIN THUSCLM/PROD.PARM/STR1140B
 exportfile SYSIN $RUNLIBS/parms/str1140b
 #2-------------------------- parms/str1140b ---------------------------
 #  SORT FIELDS=COPY
 #  INCLUDE COND=(9069,14,CH,EQ,C'15283049244922',OR,
 #  9069,14,CH,EQ,C'49734853139937',OR,
 # - - - - - about 2000 lines removed - - - - -
 #  9069,14,CH,EQ,C'15577700020000',OR,
 #3----------------------------------------------------------------------
 # uxcp "fili1=$SORTIN,typ=RSF,rcs=9085,filo1=$SORTOUT,typ=RSF,rcs=9085,\
 # sel1=9068(14c):15283049244922,sel1=9068(14c):49734853139937,\
 #        - - - - - about 50 lines removed - - - - -
 # sel1=9068(14c):15347369226897,sel1=-1(0)?0x"
 #4----------------------------------------------------------------------
 #Note - original SORT INCLUDE coding above removed (and #commented out)
 #     - replaced by 'uvcopy job' (called below) to lookup control file
 uvcopy str1140v,fili1=$SORTIN,filo1=$SORTOUT,fili2=$RUNLIBS/ctl/str1140b.tbl
 #===========================================================================
 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 if ((S0010C != 0))
    then logmsg1 "step#$JSTEP SYNCSORT abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
Note
  • this is the revised JCL/script with uvcopy inserted
  • to lookup the control file of 2000 * 14 byte numbers
  • see the 'uvcopy job' on the next page

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

26K5. MVSJCL2: SORT with too many OMIT/INCLUDE patterns

5. uvcopy job to lookup control card file for matches

 # str1140v - uvcopy job called by JCL/script str1140v.ksh
 #          - replaces SORT with 2000 INCLUDE conditions (in SYSIN module)
 #          - Demo by Owen Townsend, April 16/2006
 #
 # - original JCL SORT used a SYSIN module with 2000 * 14 byte INCLUDEs
 # - exceeded VU JCL converter limits
 # - this uvcopy job is a suggested solution & offers easier maintanance
 # - control file of 2000 * 14 byte numbers have INCLUDE conditions stripped
 # - this job tables the control file, then reads the input file
 # - looking up the table & outputting records with lookup matches
 # - see doc & illustrations at www.uvsoftware.ca/mvsjcl.htm#26K1
 # - see uvcopy documented at www.uvsoftware.ca/uvcopy1.htm (+ uvcopy2, uvcopy3)
 #
 was=a140000b9085  #increase area 'a' to 140,000 (allow 10,000 * 14 byte numbers)
 #                 #increase area 'b' from default 1024 to 9085 for data records
 fili1=${SORTIN},typ=RSF,rcs=9085
 fili2=${RUNLIBS}/ctl/str1140b.tbl,typ=LST,rcs=80
 filo1=${SORTOUT},typ=RSF,rcs=9085
 @run
        opn    all                  open all files declared above
        rtbc   fili2,a0(20),a0(14)  read control file into memory
 #note - each entry will be 20 bytes, 14 byte number + 6 blanks
 #     - in case you want to add some code or comment beside numbers
 #     - option 'c' on 'rtbc' allows you to code '# ' comments in the file
 #
 # begin loop to get input, lookup/select,& write output - until EOF
 man20  get    fili1,b0(9085)           get next record
        skp>   man90                    (cc set > at EOF)
        lok    a0(20),a0(14),b9068(14)  lookup table control file, match ?
        skp=   man30                    if match - goto write out
        skp    man20                    nomatch - return to get next record
 #
 # lookup table match - write current record to output
 man30  put    filo1,b0(9085)           write current record to outfile
        skp    man20                    return to get next
 #
 # EOF - close files & end job
 man90  cls    all                      close all open files
        eoj                             end job
 #

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

26L1. MVSJCL2: ssmerge1 - merge SyncSort params into VU JCL/scripts

ssmerge1 - merge SyncSort params into VU JCL/scripts

The Vancouver Utilities JCL converter default is to convert SORT & SyncSort steps to 'uvsort', but option 's1' in the control file ctl/jclunixop5 causes the JCL converter (jclunix51) to create a dummy/null syncsort step.

Customers that do have the unix version of SyncSort can then merge in the syncsort parameters into the VU JCL/scripts. Syncsort does provide a converter which converts the mainframe SyncSort parameters to the unix syncsort params, but it does not convert the JCL as does the VU JCL converter.

uvcopy job 'ssmerge1' reads both the VU converted script & the SyncSort converted JCL & merges the SyncSort params from the Syncsort JCL into the VU script using the 'syncsort' markers inserted by option 's1' in jclunixop5.

We can use script 'uvcopyx2' with the uvcopy ssmerge1 job to repeat ssmerge1 for all files in 2 input directories, outputting to a 3rd directory.

directories used

  1. jcl3 - JCL/scripts converted by Vancouver Utilities
  2. jclmfss - mainframe JCL with SyncSort params
  3. jcl4 - output JCL/scripts with syncsort params transferred

    Op Instrns - 1 JCL at a time (testing)


 uvcopy ssmerge1,fili1=jcl3/rfc1.ksh,fili2=jclmfss/rfc1.jcl,filo1=jcl4/rfc1.ksh
 ==============================================================================

Op Instrns - all JCLs in directories


 uvcopyx2 ssmerge1 jcl3 jclmfss jcl4 uop=q0i7
 ============================================

samples to illustrate merging SyncSort params

The next 3 pages will illustrate SyncSort param merging as follows:

  1. sample Mainframe JCL BEFORE conversions

  2. sample JCL converted by the SyncSort converter

  3. sample JCL converted by the VU converter (with null syncsorts)

  4. sample output with SyncSort params inserted into VU JCL/script

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

26L2. MVSJCL2: ssmerge1 - merge SyncSort params into VU JCL/scripts

sample Mainframe JCL BEFORE conversions

 //STEP0020 EXEC PGM=SORT
 //SORTIN   DD DSN=THUP.FIN.RFC1234.NAMEADD1,DISP=SHR
 //         DD DSN=THUP.FIN.RFC1234.NAMEADD2,DISP=SHR
 //         DD DSN=THUP.FIN.RFC1234.NAMEADD3,DISP=SHR
 //SORTOUT  DD DSN=THUP.FIN.RFC1234.NAMEADDR.SORTED,
 //         DISP=(NEW,CATLG,CATLG),
 //         DCB=(RECFM=FB,LRECL=460,BLKSIZE=0),
 //         UNIT=(SYSDA,30),SPACE=(CYL,(5,5),RLSE)
 //SYSOUT   DD SYSOUT=*
 //SYSIN    DD  *
     SORT   FIELDS=(339,2,CH,A,329,6,CH,A)
 /*

sample JCL converted by the SyncSort converter

 Line 122 //STEP0020 EXEC PGM=SORT
 Line 123 //SORTIN   DD DSN=THUP.FIN.RFC1234.NAMEADD1,DISP=SHR
 Line 125 //         DD DSN=THUP.FIN.RFC1234.NAMEADD2,DISP=SHR
 Line 127 //         DD DSN=THUP.FIN.RFC1234.NAMEADD3,DISP=SHR
 Line 129 //SORTOUT  DD DSN=THUP.FIN.RFC1234.NAMEADDR.SORTED,
 Line 130 //         DISP=(NEW,CATLG,CATLG),
 Line 131 //         DCB=(RECFM=FB,LRECL=460,BLKSIZE=0),
 Line 132 //         UNIT=(SYSDA,30),SPACE=(CYL,(5,5),RLSE)
 Line 139 //SYSIN    DD  *
 Line 140     SORT   FIELDS=(339,2,CH,A,329,6,CH,A)
 syncsort '
 /infile             THUP.FIN.RFC1234.NAMEADD1 fixed 460
 /infile             THUP.FIN.RFC1234.NAMEADD2 fixed 460
 /infile             THUP.FIN.RFC1234.NAMEADD3 fixed 460
 /datasize           2000000 records
 /fields             f1 329 6 character,
                     f2 339 2 character
 /keys               f2,
                     f1
 /outfile            THUP.FIN.RFC1234.NAMEADDR.SORTED fixed 460
 /statistics
 /end
 '
 //

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

26L3. MVSJCL2: ssmerge1 - merge SyncSort params into VU JCL/scripts

sample JCL converted by VU, with null syncsorts


 #1======================= begin step#S0010 SORT ========================
 S0080=A
 JSTEP=S0080; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg1 "Begin Step $JSTEP SORT (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 ##STEP0020 EXEC PGM=SORT
 export PROGID=SORT
 export PARM=""
 exportfile SORTIN01 THUP/FIN.RFC1234.NAMEADD1
 exportfile SORTIN02 THUP/FIN.RFC1234.NAMEADD2
 exportfile SORTIN03 THUP/FIN.RFC1234.NAMEADD3
 cat $SORTIN01 $SORTIN02 $SORTIN03 \
     >$DJ/THUP.FIN.RFC1234.NAMEADD103
 exportfile SORTIN $DJ/THUP.FIN.RFC1234.NAMEADD103
 exportfile SORTOUT THUP/FIN.RFC1234.NAMEADDR.SORTED
 export SYSIN=$DJ/${JSTEP}_${PROGID}_SYSIN
 cat > $SYSIN <</*
     SORT   FIELDS=(339,2,CH,A,329,6,CH,A)
 /*
 #3----------------------------------------------------------------------
 syncsort
 #4----------------------------------------------------------------------
 LCC=$?; S0080C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0080R=1; alias goto="";
 if ((S0080C != 0))
    then logmsg1 "step#$JSTEP SORT abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
Note
  • this is just the SyncSort step extracted from the JCL/script
  • a complete VU JCL/script has 30 'front-end' lines & 10 back-end lines.

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

26L4. MVSJCL2: ssmerge1 - merge SyncSort params into VU JCL/scripts

sample output with SyncSort params inserted into VU script


 #1======================= begin step#S0010 SORT ========================
 S0080=A
 JSTEP=S0080; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg1 "Begin Step $JSTEP SORT (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 ##STEP0020 EXEC PGM=SORT
 export PROGID=SORT
 export PARM=""
 exportfile SORTIN01 THUP/FIN.RFC1234.NAMEADD1
 exportfile SORTIN02 THUP/FIN.RFC1234.NAMEADD2
 exportfile SORTIN03 THUP/FIN.RFC1234.NAMEADD3
 cat $SORTIN01 $SORTIN02 $SORTIN03 \
     >$DJ/THUP.FIN.RFC1234.NAMEADD103
 exportfile SORTIN $DJ/THUP.FIN.RFC1234.NAMEADD103
 exportfile SORTOUT THUP/FIN.RFC1234.NAMEADDR.SORTED
 export SYSIN=$DJ/${JSTEP}_${PROGID}_SYSIN
 cat > $SYSIN <</*
     SORT   FIELDS=(339,2,CH,A,329,6,CH,A)
 /*
 #3----------------------------------------------------------------------
 syncsort '
 /infile             THUP/FIN.RFC1234.NAMEADD1 fixed 460
 /infile             THUP/FIN.RFC1234.NAMEADD2 fixed 460
 /infile             THUP/FIN.RFC1234.NAMEADD3 fixed 460
 /datasize           2000000 records
 /fields             f1 329 6 character,
                     f2 339 2 character
 /keys               f2,
                     f1
 /outfile            THUP/FIN.RFC1234.NAMEADDR.SORTED fixed 460
 /statistics
 /end
 '
 #4----------------------------------------------------------------------
 LCC=$?; S0080C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0080R=1; alias goto="";
 if ((S0080C != 0))
    then logmsg1 "step#$JSTEP SORT abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto

Logic

  1. copy UV JCL/script until 'syncsort' detected (or EOF)
  2. read/bypass MFSS/JCL until 'syncsort' detected
  3. copy syncsort params until ending quote detected
  4. return to #1 & repeat until EOF reached

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

26O1. MVSJCL2: FTP Demo Conversions

FTP 'put' Demo Conversion - Mainframe JCL

//FTPDEMO1 JOB 'test FTP conversion' //FTPSTEP1 EXEC PGM=FTP,PARM='192.168.0.3' //INPUT DD * ftpcentral ftpcentral00 put AR.SALES.ITEMS /home/ftpcentral/ar/sales.items get /home/ftpcentral/gl/account.trans GL.ACCOUNT.TRANS quit /*

FTP 'put' demo - converted script

 k#012 #1======================= begin step#S0010 FTP ========================
 k#013 S0010=A
 k#014 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#015 logmsg1 "Begin Step $JSTEP ftp (#$XSTEP)"
 k#016 ##FTPSTEP1 EXEC PGM=FTP,PARM='192.168.0.3'
 k#017 export PROGID=ftp
 k#018 export PARM="192.168.0.3"
 k#019 INPUT1=$JTMP/${JSTEP}_${PROGID}_INPUT1
 k#020 cat > $INPUT1 <</*
 k#021 ftpcentral ftpcentral00
 k#022 put AR.SALES.ITEMS /home/ftpcentral/ar/sales.items
 k#023 get /home/ftpcentral/gl/account.trans GL.ACCOUNT.TRANS
 k#024 quit
 k#025 /*
 k#026 exportfile INPUT1 $INPUT1
 k#027 exportfile INPUT1 $JTMP/${JSTEP}_${PROGID}_INPUT1
 k#028 cat > $INPUT1 <</*FTPUNIX
 k#029 open 192.168.0.3
 k#030 user ftpcentral ftpcentral00
 k#031 put ar/sales.items /home/ftpcentral/ar/sales.items
 k#032 get /home/ftpcentral/gl/account.trans gl/account.trans
 k#033 quit
 k#034 /*FTPUNIX
 k#035 #3----------------------------------------------------------------------
 k#036 ftp -i -n -v <$INPUT1
 k#037 #4----------------------------------------------------------------------
 k#038 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 k#039 if ((S0010C != 0))
 k#040    then logmsg1 "step#$JSTEP ftp abterm $SCC"
 k#041    alias goto="<<S9900=A"; fi
 k#042 goto

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

26O2. MVSJCL2: FTP Demo Conversions

FTP 'get' Demo Conversion - Mainframe JCL

//FTPDEMO2 JOB 'test FTP conversion' //FTPSTEP1 EXEC PGM=FTP,PARM='192.168.0.3' //INPUT DD * ftpcentral ftpcentral00 put AR.SALES.ITEMS /home/ftpcentral/ar/sales.items get /home/ftpcentral/gl/account.trans GL.ACCOUNT.TRANS quit /*

FTP 'get' demo - converted script

 k#012 #1======================= begin step#S0010 FTP ========================
 k#013 S0010=A
 k#014 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#015 logmsg1 "Begin Step $JSTEP ftp (#$XSTEP)"
 k#016 ##FTPSTEP1 EXEC PGM=FTP,PARM='192.168.0.3'
 k#017 export PROGID=ftp
 k#018 export PARM="192.168.0.3"
 k#019 INPUT1=$JTMP/${JSTEP}_${PROGID}_INPUT1
 k#020 cat > $INPUT1 <</*
 k#021 ftpcentral ftpcentral00
 k#022 put AR.SALES.ITEMS /home/ftpcentral/ar/sales.items
 k#023 get /home/ftpcentral/gl/account.trans GL.ACCOUNT.TRANS
 k#024 quit
 k#025 /*
 k#026 exportfile INPUT1 $INPUT1
 k#027 exportfile INPUT1 $JTMP/${JSTEP}_${PROGID}_INPUT1
 k#028 cat > $INPUT1 <</*FTPUNIX
 k#029 open 192.168.0.3
 k#030 user ftpcentral ftpcentral00
 k#031 put ar/sales.items /home/ftpcentral/ar/sales.items
 k#032 get /home/ftpcentral/gl/account.trans gl/account.trans
 k#033 quit
 k#034 /*FTPUNIX
 k#035 #3----------------------------------------------------------------------
 k#036 ftp -i -n -v <$INPUT1
 k#037 #4----------------------------------------------------------------------
 k#038 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 k#039 if ((S0010C != 0))
 k#040    then logmsg1 "step#$JSTEP ftp abterm $SCC"
 k#041    alias goto="<<S9900=A"; fi
 k#042 goto

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

26P1. MVSJCL2: FTP Demo Conversions

FTP PUT Demo Conversion for GDG file

 //FTPPUT   JOB (1234),'FTP PUT DEMO SKELETON'
 //ORDRST14 EXEC PGM=IEBGENER
 //SYSUT1   DD DSN=ORDR.ORDR400F.B18416.WEEKLY(0),DISP=SHR
 //SYSUT2   DD DSN=ORDR.ORDR400F.FTP.WEEKLY,
 //            DISP=(NEW,CATLG,DELETE),
 //            UNIT=DISK,SPACE=(CYL,(5,3),RLSE),
 //            DCB=(MODEL.DSCB,RECFM=FBA,LRECL=133,BLKSIZE=6118)
 //ORDRST15 EXEC PGM=FTP,PARM=192.11.208.44
 //INPUT    DD *
 xenix xenix
 put 'ORDR.ORDR400F.FTP.WEEKLY' /disk2/ordr/ordr400f.weekly.doc
 quit
 /*

Notes re FTP PUT conversion

  1. See the converted script on the next page --->

  2. Lines 3 to 28 of the converted script have been omitted, since these are the same for any job. See the jar100.jcl conversion on page '1C3' if you wish to see these lines.

  3. This is a demo job, stripped to the bare essentials.

  4. The IEBGENER step is necessary since FTP can not handle the GDG files. IEBGENER is converted to 'uvcp' & the essential lines are as follows:
    exportgen0 SYSUT1 ordr/ordr400f.b18416.weekly_
    exportfile SYSUT2 ordr/ordr400f.ftp.weekly
    #3----------------------------------------------------------------------
    uvcp "fili1=$SYSUT1,typ=RSF,rcs=133,filo1=$SYSUT2,typ=RSF,rcs=133"
    #4----------------------------------------------------------------------

'exportgen0' retrieves the latest generation of the GDG file & copies it to a simple file for FTP. IEBGENER is converted to 'uvcp' since uvcp supplies record counts, but the JCL converter has an option to convert to 'cp', in which case the uvcp above would be as follows:

    #3----------------
    cp $SYSUT1,$SYSUT2
    #4----------------

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

26P1a. FTP Demo Conversions

FTP PUT Demo Converted script

 k#012 #1======================= begin step#S0010 IEBGENER ========================
 k#013 S0010=A
 k#014 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#015 logmsg1 "Begin Step $JSTEP iebgener (#$XSTEP)"
 k#016 ##ORDRST14 EXEC PGM=IEBGENER
 k#017 export PROGID=iebgener
 k#018 export PARM=""
 k#019 exportgen0 SYSUT1 ordr/ordr400f.b18416.weekly_ gdg=15
 k#020 exportfile SYSUT2 ordr/ordr400f.ftp.weekly
 k#021 #3----------------------------------------------------------------------
 k#022 cp $SYSUT1 $SYSUT2
 k#023 LCC=$?; ((SCC+=LCC));
 k#024 logmsg1 "cp $SYSUT1 $SYSUT2"; ls -l $SYSUT2
 k#025 #4----------------------------------------------------------------------
 k#026 S0010C=$SCC; ((JCC+=SCC)); S0010R=1; alias goto="";
 k#027 if ((S0010C != 0))
 k#028    then logmsg1 "step#$JSTEP iebgener abterm $SCC"
 k#029    alias goto="<<S9900=A"; fi
 k#030 goto
 k#031 #1======================= begin step#S0020 FTP ========================
 k#032 S0020=A
 k#033 JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#034 logmsg1 "Begin Step $JSTEP ftp (#$XSTEP)"
 k#035 ##ORDRST15 EXEC PGM=FTP,PARM=192.11.208.44
 k#036 export PROGID=ftp
 k#037 export PARM="192.11.208.44"
 k#038 INPUT1=$JTMP/${JSTEP}_${PROGID}_INPUT1
 k#039 cat > $INPUT1 <</*
 k#040 xenix xenix
 k#041 put 'ORDR.ORDR400F.FTP.WEEKLY' /disk2/ordr/ordr400f.weekly.doc
 k#042 quit
 k#043 /*
 k#044 exportfile INPUT1 $INPUT1
 k#045 exportfile INPUT1 $JTMP/${JSTEP}_${PROGID}_INPUT1
 k#046 cat > $INPUT1 <</*FTPUNIX
 k#047 open 192.11.208.44
 k#048 user xenix xenix
 k#049 put ordr/ordr400f.ftp.weekly /disk2/ordr/ordr400f.weekly.doc
 k#050 quit
 k#051 /*FTPUNIX
 k#052 #3----------------------------------------------------------------------
 k#053 ftp -i -n -v <$INPUT1
 k#054 #4----------------------------------------------------------------------
 k#055 LCC=$?; S0020C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0020R=1; alias goto="";
 k#056 if ((S0020C != 0))
 k#057    then logmsg1 "step#$JSTEP ftp abterm $SCC"
 k#058    alias goto="<<S9900=A"; fi
 k#059 goto

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

26P2. MVSJCL2: FTP Demo Conversions

FTP GET Demo Conversion for GDG file

 //FTPGET   JOB (1234),'FTP GET DEMO SKELETON'
 //ORDRST15 EXEC PGM=FTP,PARM=192.11.208.44
 //INPUT    DD *
 xenix xenix
 get /disk2/ordr/ordr400f.weekly.doc 'ORDR.ORDR400F.FTP.WEEKLY'
 quit
 /*
 //ORDRST14 EXEC PGM=IEBGENER,COND=(0,NE,ORDRST15)
 //SYSUT1   DD DSN=ORDR.ORDR400F.FTP.WEEKLY,DISP=SHR
 //SYSUT2   DD DSN=ORDR.ORDR400F.B18416.WEEKLY(+1),
 //            DISP=(NEW,CATLG,DELETE),
 //            UNIT=DISK,SPACE=(CYL,(5,3),RLSE),
 //            DCB=(MODEL.DSCB,RECFM=FBA,LRECL=133,BLKSIZE=6118)

Notes re FTP GET conversion

  1. See the converted script on the next page --->

  2. This FTP is the reverse of the previous shown (GET vs PUT)

  3. The IEBGENER step is necessary since FTP can not handle the GDG files.

  4. The IEBGENER step now follows the FTP/GET (vs preceding the FTP/PUT) to copy the received file to create a new generation of the GDG file. The converted script uses the 'exportgen1' function to achieve this.

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

26P2a. FTP Demo Conversions

FTP GET Demo Converted script

 k#012 #1======================= begin step#S0010 FTP ========================
 k#013 S0010=A
 k#014 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#015 logmsg1 "Begin Step $JSTEP ftp (#$XSTEP)"
 k#016 ##ORDRST15 EXEC PGM=FTP,PARM=192.11.208.44
 k#017 export PROGID=ftp
 k#018 export PARM="192.11.208.44"
 k#019 INPUT1=$JTMP/${JSTEP}_${PROGID}_INPUT1
 k#020 cat > $INPUT1 <</*
 k#021 xenix xenix
 k#022 get /disk2/ordr/ordr400f.weekly.doc 'ORDR.ORDR400F.FTP.WEEKLY'
 k#023 quit
 k#024 /*
 k#025 exportfile INPUT1 $INPUT1
 k#026 exportfile INPUT1 $JTMP/${JSTEP}_${PROGID}_INPUT1
 k#027 cat > $INPUT1 <</*FTPUNIX
 k#028 open 192.11.208.44
 k#029 user xenix xenix
 k#030 get /disk2/ordr/ordr400f.weekly.doc ordr/ordr400f.ftp.weekly
 k#031 quit
 k#032 /*FTPUNIX
 k#033 #3----------------------------------------------------------------------
 k#034 ftp -i -n -v <$INPUT1
 k#035 #4----------------------------------------------------------------------
 k#036 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 k#037 if ((S0010C != 0))   # modified by COND step S0020
 k#038    then logmsg1 "step#$JSTEP ftp abterm $SCC"
 k#039    alias goto="<<S9900=A"; fi
 k#040 goto
 k#041 #1======================= begin step#S0020 IEBGENER ========================
 k#042 S0020=A
 k#043 JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#044 if ((S0010C == 0)); then   # COND=(0,NE,ORDRST15)
 k#045 logmsg1 "Begin Step $JSTEP iebgener (#$XSTEP)"
 k#046 ##ORDRST14 EXEC PGM=IEBGENER,COND=(0,NE,ORDRST15)
 k#047 export PROGID=iebgener
 k#048 export PARM=""
 k#049 exportfile SYSUT1 ordr/ordr400f.ftp.weekly
 k#050 exportgen1 SYSUT2 ordr/ordr400f.b18416.weekly_ gdg=15
 k#051 #3----------------------------------------------------------------------
 k#052 cp $SYSUT1 $SYSUT2
 k#053 LCC=$?; ((SCC+=LCC));
 k#054 logmsg1 "cp $SYSUT1 $SYSUT2"; ls -l $SYSUT2
 k#055 #4----------------------------------------------------------------------
 k#056 S0020C=$SCC; ((JCC+=SCC)); S0020R=1; alias goto="";
 k#057 fi   #endof: COND=(0,NE,ORDRST15)
 k#058 if ((S0020C != 0))
 k#059    then logmsg1 "step#$JSTEP iebgener abterm $SCC"
 k#060    alias goto="<<S9900=A"; fi
 k#061 goto

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

Part_27 Scanning for Problems & Mass-Change Fix-ups

Part 27 - Scanning for Problems & Mass-Change Fix-ups

 27A1. Introduction
      - scanning for unique patterns to identify problems for manual correction
      - using mass change jobs for higher volume problems

27B1. 'grep' - unix/linux utility to scan for patterns
- example based on changing HLQ/subdirs

27C1. 'scan1d' - Vancouver Utility (uvcopy job) to scan for 1 pattern
- not as fast as grep, but allows qualifiers (present or absent)
- creates a nicer report (for use as a guide for manual changes)

27D1. 'scan2d' - uvcopy job to scan for multiple patterns
- based on a pre-edited table file of patterns & qualifiers

27E1. 'sed' - unix/linux utility for mass change
- example based on changing HLQ/subdirs

27F1. 'rep1d' - uvcopy job for to replace any 1 pattern with an alternate in
all files in 1 directory while copying to a 2nd directory.

27G1. 'rep2d' - uvcopy job for table-driven mass changes
- based on pre-editied table of patterns, replacements,& qualifiers

27H1. 'scan3d' - uvcopy job to report all lines between 2 specified patterns
- vs prior scans that report just lines containing the patterns

27I1. 'table3d' - uvcopy job to create table summaries of data following a
unique pattern (such as COBOL programs & datafiles in jcls)

27J1. 'xrefA' - general purpose cross-reference, example of use
- for each control card member, list all jcl/scripts referencing
 27K1. Creating test data files with the uvcopy utility
      - example to create records with 56 packed fields to test SYNCSORT SUM
 27L1. writing customized uvcopy jobs to make complex mass changes
      - when the pre-programmed jobs above can not do the job

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

27A1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

scan/replace jobs more powerful than grep & sed

Vancouver Utilities provides several general purpose 'scan/replace' utilities that can be more effective than 'grep' & 'sed' in complex situations because:

  1. The search pattern can be qualified with 1 or 2 other patterns that must or must not be present on the same line.

  2. Table driven scan jobs provide unlimited no of search & qualifier patterns

  3. These scan jobs create a much more informative report, with page headings to document the search & qualifier patterns, directory scanned, date, etc - matching lines reported with line# - End-Of-File total hits & total lines for each file with at least 1 hit - End-Of-Directory total hits & total lines

  4. Some of these scan jobs allow for patterns on 1 line qualified by patterns on other lines, preceding or following.

  5. Most of these jobs show matched data lines with their line numbers, which are useful for subsequent edit sessions.

  6. The scan reports are handy for assigning work to other programmers. Scan for patterns & qualifiers that represent a problem & the report can be used as a check list during editing & to make notes about problem situations.

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

27A2. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

JCL/script Update Recommendations

This section will present several alternatives to scan your entire directory of jcl/scripts for unique patterns that identify problems to be fixed.

If the number of matches is low, you can use the scan match list as a guide for manual changing using an editor (vi). But if the number of matches is more than 10 or 15, it may be faster to run a mass change job (assuming you can think of unique search/replace/qualify patterns).

Please be mindful of the following important principles:

  1. Manually copy each script from jcl3 to jcls only when you are ready to test/debug that particular script. This gives you an easy way to check your progress. Scripts in subdir 'jcls' have been debugged or are in the the test phase (vs scripts in 'jcl3' which are unchanged).

  2. Edit/modify scripts only in jcls, never in jcl3, because re-conversions overwrite jcl3.

  3. During test/debug, there may be frequent re-conversions of jcl3 to jcls as improvements are made in the conversion search/replace tables. We will have already fixed the problem manually in the jcls scripts, but the updates to REPTBL2 in ctl/jclunixop5 & reconversion's will fix the problem in all scripts in jcl3 which are yet to be test/debugged.

  4. You can scan jcl3 for problems, but you can only fix them after they have been copied to jcls (when their turn comes up for test/debug). You might keep the scan problem hit list handy & refer to it when you are ready to debug each script.

  5. For newly discovered problems (or desired changes), you may need to scan both jcl3 & jcls. Of course after all jobs have been tested at least once we will only need to scan 'jcls', since there will be no more reconversions.

  6. For the fully demos, we will assume that we have completed the conversions & we will use only subdir 'jcls' for our scan/replace examples.

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

27A3. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

sample Problem for scan & rep jobs

Here are the sample patterns to be scanned for (& replaced) by the several scan (& replace) utilities documented in this section. We will illustrate solutions using: grep, scan1d, scan2d, rep1d,& rep2d.

Our example is based on changing data subdirs (originally 'Top Level Nodes' or 'High Level Qualifiers'). Suppose we wanted to change HLQ/subdirs 'tgl0', 'tar0',& 'tsy0' to 'targlsy'. Here are some examples of the before & after file definitions:

 exportfile AR2004 tar0/mnkc.ar2004xx         #<-- Before changes
 exportfile GLMST01 tgl0/mnkc.glmaster        #    (tar0,tgl0,tsy0)
 exportfile AS091 tsy0/mnkc.glossary.file
 exportfile AR2004 targlsy/mnkc.ar2004xx      #<-- After changes
 exportfile GLMST01 targlsy/mnkc.glmaster     #    (all changed to 'targlsy')
 exportfile AS091 targlsy/mnkc.glossary.file

We could have made these changes during conversion by using the search/replace tables built in to the JCL converter. We could have modified 'REPTBL2' in the conversion control file (ctl/jclunixop5) & then reconverted our JCL (from subdir jcl2 to jcl3).

 :REPTBL2:     search/replace table for output UNIX script
 tar0/~~~~~~~~~~~~~~~~~~~~~~~~~targlsy/~~~~~~~~~~~~~~~~~~~~~~
 tgl0/~~~~~~~~~~~~~~~~~~~~~~~~~targlsy/~~~~~~~~~~~~~~~~~~~~~~
 tsy0/~~~~~~~~~~~~~~~~~~~~~~~~~targlsy/~~~~~~~~~~~~~~~~~~~~~~
 :ENDTBL2:

Let us suppose we had not discovered the need for change until after we were finished our initial test/debug. Now all JCLs have been converted into subdir 'jcls' & we can no longer use the search/replace function of the jcl converter.

So we will use other scan/replace methods (grep,scan1d,scan2d,rep1d,& rep2d).

preparation for scan/rep test/demos

For these demos, we will copy the converted scripts from 'jcl3' to 'jcls'. Note that you would never do this in your real life conversion, because this would overwrite our debugged scripts with the original converter outputs (please note the recommendations on the previous page).


 cp jcl3/* jcls       <-- copy scripts to subdir 'jcls' for demo only
 ==============

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

27B1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

'grep' demo - scan jcls for 1 pattern

We will scan our sample scripts in subdir 'jcls' for pattern 'tgl0/' & print out the results to facilitate subsequent manual changes with 'vi'.

Please refer back to page '27A3' for the full description of this sample scan/replace being illustrated for grep,scan1d,scan2d,rep1d,& rep2d. The project described on page '27A3' is to replace 'tar0','tgl0',& 'tsy0' with 'targlsy' in all jcl/scripts. For 'grep' we will use 'tgl0' as the demo pattern (since it occurs 3 times in our test scripts vs 1 for the others).

Note that we will use the '-n' grep option to include the line# where the search pattern was found within each file.


 #1. grep -n 'tgl0/' jcls/* >tmp/tgl0    <-- grep for pattern
     ================================      - save grep report in a tmp/file

 #2. uvlp12 tmp/tgl0    <-- print out grep report for manual edit guide
     ===============

sample report from 'grep'

jcls/ivm04.ksh:179:exportfile GLMST01 tgl0/mnkc.glmaster

jcls/ivm04.ksh:694:exportfile GLMST01 tgl0/mnkc.glmaster

jcls/ivm042.ksh:157:exportfile GLMST01 tgl0/mnkc.glmaster


 #3a. vi jcls/ivm04.ksh        <-- manual change/edit
      =================            (2 changes in this file)

 #3c. vi jcls/ivm042.ksh       <-- 1 change in this file
      ==================

grep advantages/disadvantages

'grep' is faster than the following uvcopy jobs, but does not provide for qualifying patterns (present &/or absent). The uvcopy job reports are also nicer to use for subsequent edit sessions. You can use them to assign edit work to junior programmers.

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

27C1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

'scan1d' demo - scan jcls for 1 pattern

Here is a Vancouver Utility alternative to 'grep' which provides for qualifier patterns & creates a nicer report (guide for subsequent editing).

We will duplicate the grep demo (searching jcls subdir for pattern 'tgl0/'. You could enter all arguments on the command line, but I recommend entering only the subdir to be scanned & wait for the prompts to enter search pattern.


 uvcopy scan1d,fild1=jcls    <-- enter subdir on command line
 ========================
 uop=q1a1b99999c0d256e0p1 - option defaults
       a1                 - begin scan at line #1 (default) of input file
       a0                 - causes prompt for search pattern to BEGIN scan
         b99999           - end scan at line #99999 (dflt) of input file
         b0               - causes prompt for search pattern to END scan
               c0         - begin scan at col #1 (zero rel) of input lines
                 d256     - length of scan area default 256 bytes
                     e1   - inhibit errmsgs when LF not found within rcsz
                       p1 - 1 present qual(31-60) & 1 absent qual(61-80)
                       p2 - 2 present quals(31-60+61-80) & NO absent quals
                       p4 - 2 absent quals(31-60+61-80) & NO present quals
 User OPtion (uop) defaults  = q1a1b99999c0d256e0p1
  null to accept or re-specify (1 or more) ----->       <-- null for defaults
 enter your search pattern (max 64 bytes)  -----> tgl0/ <-- enter SEARCH PATTERN
 enter 1st qualifier (or null to disable)  ----->       <-- not required
 enter 2nd qualifier (or null to disable)  ----->       <-- n/r
 match options: i=case-insen,p=patterns(@,#)
 quote inhibits: q1=singles,q2=doubles,q3=both
 enter match options: i,p,q1/q2/q3,n,or null---->       <-- n/r
 EOJ, Output File written to: tmp/jcls_tgl0
 view/print: vi,cat,more,lp,uvlp12 (or null) ---> more  <-- display report

scan1d - sample report

 Job: scan1d  Dir: jcls  Search: tgl0  Qual1:   Qual2:
  SearchBgn:    SearchEnd:    MatchOps:   UserOps: q1a1b99999c0d256e0p1
 ====================================================== 2004/04/18_16:27:20
 00179 exportfile GLMST01 tgl0/mnkc.glmaster
 00694 exportfile GLMST01 tgl0/mnkc.glmaster
 00898                   2 hits @EOF: jcls/ivm04.ksh
 00157 exportfile GLMST01 tgl0/mnkc.glmaster
 00260                   1 hits @EOF: jcls/ivm042.ksh
 ====================================================== 2004/04/18_16:27:20
  EOD: 00003 hits in 0002 files of 0005 total (01365 lines)
Note
  • compare the 'scan1d' report to the 'grep' report on the previous page
  • the additional info makes this report a better guide for subsequent edits

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

27D1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

'scan2d' - scan for multiple patterns via table file

Our sample problem (proposed on page '27A1') was to scan all files in the 'jcls' subdir for 'tar0', 'tgl0',& 'tsy0', so that we could change them to a desired alternate 'targlsy'.

The previous pages have illustrated using 'grep' & 'scan1d', but these can only search for 1 pattern at a time. 'scan2d' solves this problem using a pre-edited table file of multiple patterns.


 #1. vi ctl/scan2d.demo    <-- prepare the table file for scan2d
     ==================

sample table file of multiple patterns

 # scan2d.demo - table file to demo scan2d search for multiple patterns
 #             - to scan all files in jcls subdir for following patterns:
 # 01-30 - search pattern (tilde filled)
 # 31-60 - presence qualifier, disabled by all tildes
 # 61-80 - absence qualifier, must NOT be present, disabled by tildes
 #       - table file must be terminated by a line of all tildes
 tar0/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tgl0/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tsy0/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

 #2. uvcopy scan2d,fild1=jcls,fili2=ctl/scan2d.demo  <- enter subdir & tablefile
 ==================================================     on scan2d command line
 q1a1b99999c0d256p1t1 - user option defaults (uop=...)
 q1                   - prompt operator to change uops (q0 inhibits prompt)
   a1                 - begin scan at line #1 (default) of input file
   a0                 - causes prompt for search pattern to BEGIN scan
     b99999           - end scan at line #99999 (dflt) of input file
     b0               - causes prompt for search pattern to END scan
           c0         - begin scan at col #1 (zero rel) of input lines
             d256     - length of scan area default 256 bytes
                 p1   - 1 presence qual(31-60) & 1 absence qual(61-80)
                 p2   - 2 presence quals(31-60)+(61-80) & NO absence quals
                   t1 - type 1 table (quals apply only to current line)
                   t2 - type 2 table (quals independent of search pats)
 User OPtion (uop) defaults  = q1a1b99999c0d256p1t1
  null to accept or re-specify (1 or more) -------->      <-- not required here
 match options: i=case-insen,p=patterns(@,#)
 quote inhibits: q1=singles,q2=doubles,q3=both
 enter match options: i,p,q1/q2/q3,n,or null ------>      <-- n/r
 EOJ, Out File written to: tmp/jcls_scan2d.demo
 view/print: vi,cat,more,lp,uvlp12,etc (or null) --> more <-- display report

Please see the output report on the next page --->

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

27D2. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

scan2d - sample report

 Job: scan2d  Dir: jcls  MatchOps: dg  UserOps: q1a1b99999c0d256p1t1
 TableFile: ctl/scan2d.demo  SearchBgn:    SearchEnd:
 ====================================================== 2004/04/18_19:12:01
 tar0/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tgl0/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tsy0/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ====================================================== 2004/04/18_19:12:01
 00179 exportfile GLMST01 tgl0/mnkc.glmaster
 00476 exportfile AR2004 tar0/mnkc.ar2004xx
 00619 exportfile AS091 tsy0/mnkc.glossary.file
 00694 exportfile GLMST01 tgl0/mnkc.glmaster
 00898                   4 hits @EOF: jcls/ivm04.ksh
 00157 exportfile GLMST01 tgl0/mnkc.glmaster
 00260                   1 hits @EOF: jcls/ivm042.ksh
 ====================================================== 2004/04/18_19:12:02
  EOD: 00005 hits in 0002 files of 0005 total (01365 lines)

Compare the 'scan2d' report to the 'grep' & 'scan1d' report on the previous pages. Here we have all 3 of our search patterns on 1 report, making it easier for the subsequent edit sessions to modify these subdirs to 'targlsy'.

The following demos (sed, rep1d,& rep2d) will show you how we can automatically change these patterns to the desired alternative (saving the manual edits).

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

27E1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

mass change demos

The next few pages will illustrate using 'sed', 'rep1d',& 'rep2d' to solve our sample problem first proposed on page '27A1' (changing 'tgl0', 'tar0', & 'tsy0' to 'targlsy' in all files in subdir 'jcls').

The previous solutions used grep, scan1d,& scan2d to find the search patterns and then we manually changed them to the desired replacement using an editor.

For automated mass changes, we might copy the file to some other subdir while performing the mass changes. Then we can verify our results before copying the file back to the original subdir. Here is an example using 'sed' to change all 'tgl0' to 'targlsy' in file jcls/ivm04.ksh.

mass change example - using 'sed'


 #1. sed -e's/tgl0/targlsy/' jcls/ivm04.ksh >tmp/ivm04.ksh
     =====================================================
         - copy the file to tmp, while performing mass change

 #2a. vi tmp/ivm04.ksh      <-- verify change made correctly ?
      ================

 #2b. diff -b jcls/ivm04.ksh tmp/ivm04.ksh  <-- better way to verify
      ====================================

 #3. cp tmp/ivm04.ksh jcls     <-- if OK, copy the file back to jcls
     =====================

The above method is very inefficient for multiple files & multiple patterns

It would be much better to have a script to copy all files to an alternate subdir, making changes in files where the patterns are found,& copying files unchanged where patterns are not found. Here is a possible solution:

 for i in jcls/*
   do  f=$(basename $i)
       sed -e's/tgl0/targlsy/' jcls/$f tmp/$f
   done

You can enter the above at the shell prompt, but of course it would be better to write it as a script (especially if you might have to repeat it).

Or we might write some general purpose scripts to do the 'for each file' logic & you would only have to supply the sed commnads. The Vancouver Utilities includes scripts 'runsed1' & 'runsed2' in /home/uvadm/sf/util.

'runsed1' prompts you to enter the sed command and then executes it for all files while copying from arg1 subdir to arg2 subdir. For 'runsed2', you would pre-edit the sed commands into a file & then specify its filename and the 2 subdirs as arguments on the 'runsed2' command line.

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

27F1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

'rep1d' - mass change demo

'rep1d' is a Vancouver Utility pre-programmed uvcopy job to copy all files from 1 directory to another, while changing any 1 specified pattern to an alternate. 'rep1d' provides qualifiers & various options.

Automated solutions can make the changes much faster. They can also screw things up much faster, so we must have backup. I recommend you first change the name of the existing 'jcls' to 'jcls.old', make a new empty 'jcls' subdir, run the mass change while copying files from jcls.old to jcls,& then verify the results using the 'alldiff' script.


 #1. mv jcls jcls.old          - rename existing subdir (for backup)
     ================

 #2. mkdir jcls                - make new empty subdir (to receive changes)
     ==========

 #3. uvcopy rep1d,fild1=jcls.old,fild2=jcls
     ======================================
 uop=q1a1b99999c0d256e0p1 - option defaults
       a1                 - begin scan at line #1 (default) of input file
       a0                 - causes prompt for search pattern to BEGIN scan
         b99999           - end scan at line #99999 (dflt) of input file
         b0               - causes prompt for search pattern to END scan
               c0         - begin scan at col #1 (zero rel) of input lines
                 d256     - length of scan area default 256 bytes
                     e0   - do not erase any output files
                     e1   - erase output files with no replacements
                       p1 - 1 present qual(31-60) & 1 absence qual(61-80)
                       p2 - 2 present quals(31-60+61-80) & NO absent quals
 User OPtion (uop) defaults  = q1a1b99999c0d256e0p1
  null to accept or re-specify (1 or more) ----->         <-- defaults OK
 did you create tmp outdir or remove files -----> y       <--
 enter your search pattern (max 64 bytes) ------> tgl0    <-- SEARCH pattern
 enter replacement pattern (max 64 bytes) ------> targlsy <-- REPLACE pattern
 enter qualifier present (null to disable) ----->         <-- n/r
 enter absent qual (2nd present if optn p2) ---->         <-- n/r
 match options: p(@,#,etc), s(in replace)
 quote inhibits: q1=singles,q2=doubles,q3=both
 enter match options: p,s,q1/q2/q3,n,or null --->         <-- n/r
 EOJ, OutFile written to: tmp/jcls.old_tgl0
 enter: vi,cat,more,lp,uvlp12,etc (or null) ----> more    <-- display audit file

Please see the 'rep1d' audit file on the next page --->

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

27F2. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

'rep1d' creates an audit file of the 'after changes' images of any lines modified by the search/replace patterns. By default the audit file is created in the 'tmp' subdir & the filename is a concatenation of the input directory & the search pattern. For example: tmp/jcls_tgl0

sample rep1d audit file

 Job: rep1d InDir: jcls.old OutDir: jcls Search: tgl0 Replace: targlsy
 QualPresent:   Absent:   SearchBgn:    SearchEnd:
 MatchOptions:   UserOptions: q1a1b99999c0d256e0p1
 ====================================================== 2004/04/19_17:43:04
 00179 exportfile GLMST01 targlsy/mnkc.glmaster
 00694 exportfile GLMST01 targlsy/mnkc.glmaster
 00898                   2 reps @EOF: jcls/ivm04.ksh
 00157 exportfile GLMST01 targlsy/mnkc.glmaster
 00260                   1 reps @EOF: jcls/ivm042.ksh
 ====================================================== 2004/04/19_17:43:05
 EOD: 00003 reps in 0002 files of 0005 total (01365 lines)
 Audit filename: tmp/jcls.old_tgl0

verify results with 'alldiff'


 #4. alldiff jcls.old jcls
     =====================
 179c179
 < exportfile GLMST01 tgl0/mnkc.glmaster
 ---
 > exportfile GLMST01 targlsy/mnkc.glmaster
 694c694
 < exportfile GLMST01 tgl0/mnkc.glmaster
 ---
 > exportfile GLMST01 targlsy/mnkc.glmaster
 diff file# 1 - jcls.old/ivm04.ksh
 157c157
 < exportfile GLMST01 tgl0/mnkc.glmaster
 ---
 > exportfile GLMST01 targlsy/mnkc.glmaster
 diff file# 2 - jcls.old/ivm042.ksh

2 different of 5 files compared jcls.old to jcls

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

27G1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

rep2d - table driven search/replace

'rep2d' copies all files from 1 dir to a 2nd, while performing mass change via a pre-edited table of search/replace patterns. 'rep1d' is handier when you only have 1 search/replace pair (because it solicits the patterns), but 'rep2d' is more powerful (because it allows an unlimited number of search/replace patterns in the pre-edited table file).


 #1. vi ctl/rep2d.demo     <-- create table file of search/replace patterns
     =================         (in this case, inspect supplied demo table)

 #2a. mv jcls jcls.old     <-- change name of existing jcls (to backup file)
      ================
 #2b. mkdir jcls           <-- create new subdir to receive updated files
      ==========

 #3.  uvcopy rep2d,fild1=jcls.old,fild2=jcls,fili3=ctl/rep2d.demo
      ===========================================================
             - copy jcls.old to jcls with search/replace
             - also creates an audit file (tmp/jcls.old_rep2d.demo)
 uop=q1a1b99999c0d256e0p1 - option defaults
       a1                 - begin scan at line #1 (default) of input file
       a0                 - causes prompt for search pattern to BEGIN scan
         b99999           - end scan at line #99999 (dflt) of input file
         b0               - causes prompt for search pattern to END scan
               c0         - begin scan at col #1 (zero rel) of input lines
                 d256     - length of scan area default 256 bytes
                     e0   - do not erase any output files
                     e1   - erase output files with no replacements
                       p1 - 1 present qual(31-60) & 1 absent qual(61-80)
                       p2 - 2 present quals(31-60+61-80) & NO absent quals
 User OPtion (uop) defaults  = q1a1b99999c0d256e0p1
  null to accept or re-specify (1 or more) ------>      <-- defaults OK
 did you create outdir or remove all files ------> y    <--
 match options: p=matchchars(@,#), s=also replace
 quote inhibits: q1=singles,q2=doubles,q3=both
 enter match options: p,s,q1/q2/q3,n,or null ---->      <-- n/r
 EOJ, OutFile written to: tmp/jcls.old_rep2d.demo
 enter command: vi,cat,more,uvlp12,etc(or null)--> more <-- display audit rpt

Please see audit file report on the next page --->

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

27G2. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

sample rep2d Audit report

 Job: rep2d  InDir: jcls.old  OutDir: jcls  Table: ctl/rep2d.demo
 SearchBgn:    SearchEnd:    MatchOptns: dfg  UserOptns: q1a1b99999c0d256e0p1
 ====================================================== 2004/04/20_08:43:57
 tar0/~~~~~~~~~~~~~~~~~~~~~~~~~targlsy/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tgl0/~~~~~~~~~~~~~~~~~~~~~~~~~targlsy/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 tsy0/~~~~~~~~~~~~~~~~~~~~~~~~~targlsy/~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 ====================================================== 2004/04/20_08:43:57
 00179 exportfile GLMST01 targlsy/mnkc.glmaster
 00476 exportfile AR2004 targlsy/mnkc.ar2004xx
 00619 exportfile AS091 targlsy/mnkc.glossary.file
 00694 exportfile GLMST01 targlsy/mnkc.glmaster
 00898                   4 reps @EOF: jcls/ivm04.ksh
 00157 exportfile GLMST01 targlsy/mnkc.glmaster
 00260                   1 reps @EOF: jcls/ivm042.ksh
 ====================================================== 2004/04/20_08:44:04
 EOD: 00005 reps in 0002 files of 0005 total (01365 lines)
 Audit filename: tmp/jcls.old_rep2d.demo

verify changes with alldiff script


 #4. alldiff jcls.old jcls >tmp/jcls.dif   <-- create alldiff report
     ===================================
 179c179
 < exportfile GLMST01 tgl0/mnkc.glmaster
 ---
 > exportfile GLMST01 targlsy/mnkc.glmaster
 476c476
 < exportfile AR2004 tar0/mnkc.ar2004xx
 ---
 > exportfile AR2004 targlsy/mnkc.ar2004xx
 619c619
 < exportfile AS091 tsy0/mnkc.glossary.file
 ---
 > exportfile AS091 targlsy/mnkc.glossary.file
 694c694
 < exportfile GLMST01 tgl0/mnkc.glmaster
 ---
 > exportfile GLMST01 targlsy/mnkc.glmaster
 diff file# 1 - jcls.old/ivm04.ksh
 157c157
 < exportfile GLMST01 tgl0/mnkc.glmaster
 ---
 > exportfile GLMST01 targlsy/mnkc.glmaster
 diff file# 2 - jcls.old/ivm042.ksh

2 different of 5 files compared jcls.old to jcls

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

27H1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

scan3d - report lines between 2 patterns

'scan3d' allows you to extract blocks of code, based on 3 patterns (starting, ending,& a qualifying pattern between start & end lines).

For example, you can extract all the SORT specs from all jcl/scripts in the jcls subdir into a report in tmp/jcls_cat as follows:


 uvcopy scan3d,fild1=jcls     <-- run scan3d utility
 ========================       - solicits patterns as shown below
 options: uop=q1m40 - defaults (50 lines is absolute max)
                m40 - max lines tabled if stop pattern not found
 User OPtion (uop) defaults  = q1m40
  null to accept or re-specify (1 or more) -->       <-- defaults OK
 enter select start pattern (max 30) --------> cat > <-- start pattern
 enter select stop pattern (max 30) ---------> #4--- <-- end pattern
 qualifier 1st char "="(match), "!"(nomatch)
 enter qualifying pattern (null=disable) ----> fili1 <-- qualifier between
 match options: p=patternchars(@#etc),i=case,n=none
 for case insensitive, enter patterns in lower case
 enter 3 chars for start/stop/qual (p,i,or n) --------> nnn <-- no match ops
 EOJ, Output File has been written to: tmp/jcl3_cat
 enter command: vi,cat,more,lp,uvlp12,etc (or null) --> more <-- display report

Please see the sample report on the next page --->

extract/print SORT specs report for inspection/correction

The preceding section illustrated several SORT situations that required manual correction. You can use 'scan3d' to create a report of all SORT specs extracted from all converted jcl/scripts. This report makes it easy to inspect all SORT conversions & identify any needing correction.

From the preceding JCL/SORT examples, you will notice that the JCL converter inserts a unique separator line 'cat >' prior to the original SORT specs. Also note that the converted equivalent uvsort/uvcp specs are ended by another unique separator line '#4---'.

The uvcopy utility job 'scan3d' will exploit these unique beginning & ending patterns to extract the SORT spec code blocks into a report.

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

27H2. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

scan3d - sample report

 Job=scan3d   scan files in Dir: jcl3
 Selecting From: "cat >"  To: "#4---"  Qualified By: "=fili1="
 ====================================================== 2004/04/20_16:10:30
 00140 cat > $SYSIN <</*
 00141    SORT FIELDS=(01,31,A),FORMAT=BI,WORK=1
 00142    RECORD TYPE=F,LENGTH=200
 00146 /*
 00147 ## EXEC SORT,SIZE=100K
 00148 #3----------------------------------------------------------------------
 00149 uvsort "fili1=$SORTIN1,typ=RSF,rcs=200,filo1=$SORTOUT,typ=RSF,rcs=200,\
 00150 keys=(0,31,b,a)"
 00151 #4----------------------------------------------------------------------
 00205 cat > $SYSIN <</*
 00206  INPUT  TYPEFIL=SD,RECSIZE=200,BLKSIZE=2000,FORMAT=F
 00207  OUTPUT TYPEFIL=MT,RECSIZE=200,BLKSIZE=2000,FORMAT=F,DEVICE=TAPE
 00208  MOVE=1,200,1
 00210 /*
 00211 ## EXEC JCOPY,SIZE=128K
 00212 #3----------------------------------------------------------------------
 00213 uvcp "fili1=$JFILIN,typ=RSF,rcs=200,filo1=$JFILOUT,typ=RSF,rcs=200"
 00214 #4----------------------------------------------------------------------
 00898                     101 selected from   898 @EOF: jcl3/ivm04.ksh
 00039 cat > $SYSIN <</*
 00040    SORT FIELDS=(31,6,A,1,6,A),FORMAT=CH,WORK=1
 00041    RECORD TYPE=F,LENGTH=64
 00045 /*
 00046 ## EXEC SORT,SIZE=100K
 00047 #3----------------------------------------------------------------------
 00048 uvsort "fili1=$SORTIN1,typ=RSF,rcs=64,filo1=$SORTOUT,typ=RSF,rcs=64,\
 00049 keys=(30,6,c,a,0,6,c,a)"
 00050 #4----------------------------------------------------------------------
 00083                      12 selected from    83 @EOF: jcl3/jar200.ksh
 ====================================================== 2004/04/20_16:10:30
  EOD: 00159 selects in 0004 files of 0005 total (01365 lines)

Notes

The report was run using the 5 demo JCL/scripts supplied with this package. I have removed many lines, so I can fit the results on 1 page.

Note the statistics that are reported at the end of each file with any hits, & the total statistics at the end of all files in the directory.

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

27I1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

table3d - General Purpose Keyword Analysis

'table3d' is a general purpose Keyword/Targetword analysis (table summary). It builds table summary counts of Targetwords following specified Keywords for all files in a directory. Here is an example to create a table summary of all COBOL programs executed in all jcl/scripts in the directory.

 cobrun $ANIM $RLX/car100    <-- sample COBOL program execution in jcl/script
 #----------------------

We will specify the Keyword as 'cobrun' & the Targetword as the 2nd following word.


 uvcopy table3d,fild1=jcls      <-- run table3d
 =========================        - will prompt for options & keywords
 uop=q1b1c0f0l0p1w1     - option defaults
       b1               - "=" converted to blank before wordsep & count
       b2               - "/" converted to blank before wordsep & count
         c1             - bypass comments in COBOL programs (* column 7)
         c2             - bypass comments in shell scripts (# column 1)
           f0           - do not prepend/append table entry with filename
           f1           - prepend table argument with filename
           f2           - append table argument with filename
             l0         - translate lower case before matching patterns
               p1       - qualifier#1 present & qualifier#2 absent
               p2       - qualifier#1 present & qualifier#2 present
               p4       - qualifier#1 absent  & qualifier#2 absent
                 w1     - target word is 1st word following keyword
                 w2     - target word is 2nd word following keyword
                        - =,/ converted to blanks before word sep & count
 User OPtion (uop) defaults  = q1b1c0f0l0p1w1
  null to accept or re-specify (1 or more) ------> c2w2   <-- OPTIONS (see above)
 enter search word(s), (use ":" sep if multi) ---> cobrun <-- KEYWORD
 enter qualifier#1 (null=disable) --------------->        <-- n/r (in this case)
 enter qualifier#2 (null=disable) --------------->        <-- n/r
 EOJ, OutFile written to: tmp/jcl3_cobrun
 enter command: vi,cat,more,uvlp12,etc(or null)--> more   <-- to display report

Please see the sample report on the next page --->

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

27I2. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

table3d - sample report

 Job: table3d Dir: jcl3 Keyword(s): cobrun
 Qual1:   Qual2:   Userops: q1b1c0f0l0p1w1c2w2
 table3d  2004/04/20_13:18:59  Counts by Targetword following specified Keyword
 tbl#001 pg#001     -argument-                            -acum#1-    %
 line#  count    %  target-word                              count
     1       1   7   $RLX/car100                                  1    7
     2       1   7   $RLX/car200                                  1    7
     3       2  15   $RLX/iv007                                   2   15
     4       2  15   $RLX/iv008                                   2   15
     5       1   7   $RLX/iv009                                   1    7
     6       1   7   $RLX/iv011                                   1    7
     7       1   7   $RLX/iv014                                   1    7
     8       1   7   $RLX/iv015                                   1    7
     9       1   7   $RLX/iv016                                   1    7
    10       1   7   $RLX/iv017                                   1    7
    11       1   7   $RLX/iv018                                   1    7
            13*100   *TOTAL*                                    13 *100

table3d ex#2 - summary counts by filename

We could summarize all filenames in all jcl/scripts in a directory by using 'exportfile' as the keyword & the targetword as 2nd word following.

exportfile SORTIN1 tiv0/emsd.rcurbill.extractx <-- sample file def in jcls


 uvcopy table3d,fild1=jcls      <-- run table3d
 =========================
Note
  • here is just the essential responses to the prompts
  • see all prompts on the cobrun example on the previous page
 specify options (1 or more) -------------------> c2w2       <-- OPTIONS
 enter search word(s), (use ":" sep if multi)---> exportfile <-- KEYWORD
 enter qualifier#1 (null=disable) --------------> /          <-- QUALIFIER

We could have entered our Keywords as 'export:exportfile' if we wanted to summarize 'export' files as well as 'exportfile' files. We specified a qualifier '/' to ensure we don't include the autoload definition of exportfile that occurs at the beginning of all scripts.

Please see the sample report on the next page --->

Note that you can create many other 'cross-references' from your JCL/scripts & COBOL programs as documented XREFjobs.htm. Those dedicated cross-refs might be better for their stated purpose, but this general purpose keyword/ targetword analyzer can come in handy.

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

27I3. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

table3d - sample report #2

 Job: table3d Dir: jcl3 Keyword(s): exportfile
 Qual1: /  Qual2:   Userops: q1b1c0f0l0p1w1c2w2
 table3d  2004/04/20_13:44:56  Counts by Targetword following specified Keyword
 tbl#001 pg#001     -argument-                            -acum#1-    %
 line#  count    %  target-word                              count
     1       3   3   $DT/bercurb_$(date                          3    3
     2       1   1   $DT/dtlstat_$(date                          1    1
     3       2   2   $DT/ivbildt_$(date                          2    2
     4       1   1   $DT/ivglmtd_$(date                          1    1
     5       1   1   $DT/ivgltrn_$(date                          1    1
     6       1   1   $DT/ivmrevh_$(date                          1    1
     7       2   2   $DW/##srtbal                                2    2
     8       2   2   $DW/##srtbil                                2    2
     9       6   6   $DW/##srtext                                6    6
    10       2   2   $DW/##srtmtd                                2    2
    11       2   2   $DW/##srtrev                                2    2
    12       1   1   ar/customer.master                          1    1
    13       1   1   ar/customer.namelist                        1    1
    14       2   2   ar/sales.items                              2    2
    15       1   1   ar/sales.list                               1    1
    16       1   1   tar0/mnkc.ar2004xx                          1    1
    17       2   2   tbe0/mnkc.ratecode.master                   2    2
    18       3   3   tbe0/mnkc.wharfcde.master                   3    3
    19       6   6   tbe0/tnkc.recuring.billingx                 6    6
    20       3   3   tgl0/mnkc.glmaster                          3    3
    21       4   4   tiv0/emsd.billdtlx.andstats                 4    4
    22       2   2   tiv0/emsd.billingx.dtltrans                 2    2
    23       3   3   tiv0/emsd.billingx.invoicex                 3    3
    24       2   2   tiv0/emsd.billingx.suspense                 2    2
    25       2   2   tiv0/emsd.glsummry.workfile                 2    2
    26       4   4   tiv0/emsd.prelimxx.andstats                 4    4
    27       5   5   tiv0/emsd.prelimxx.dtltrans                 5    5
    28       4   4   tiv0/emsd.prelimxx.invoicex                 4    4
    29       4   4   tiv0/emsd.rcurbill.extractx                 4    4
    30       3   3   tiv0/emsd.rcurbill.statchgx                 3    3
    31       2   2   tiv0/emsd.revhistx.billtrnx                 2    2
    32       3   3   tiv0/emsd.revhistx.mtdcopyx                 3    3
    33       2   2   tiv0/tnec.glbillng.mtdtrans                 2    2
    34       2   2   tiv0/tnkc.billingx.glmtdbal                 2    2
    35       4   4   tiv0/tnkc.revhistx.mtdbillx                 4    4
    36       2   2   tiv0/tnsd.billingx.invcnbr                  2    2
    37       2   2   tiv0/tnsd.billingx.invcnbr(v                2    2
    38       1   1   tsy0/mnkc.glossary.file                     1    1
    39       1   1   work/sales.group1                           1    1
    40       1   1   work/sales.group2                           1    1
            96*100   *TOTAL*                                    96 *100

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

27J1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

cross-reference JCL to ctlcdlib module names

The Vancouver Utilities include several cross-references documented in XREFjobs.htm. We will use the 'xrefA' script (which calls UNIX grep & uvcopy job xref1) to create a report showing all jobs referencing each control card member found in jcls. Here is a sample control card library file definition (taken from the SORT example shown on page '26A1').

 //SYSIN    DD DSN=ORDR.CTLCDLIB(ORDR190S),DISP=SHR    <-- mainframe JCL
 exportfile SYSIN cpop/ctlcdlib/cpop190s               <-- script equivalent

Note that any one ctlcdlib module could be called by multiple JCLs. If manual corrections are required, it would be nice to know if the problem module is also included by other JCLs.

This example will show you all JCLs that include a common ctlcdlib module. ctlcdlib modules are listed alphabetically with all JCL references listed on the right side. Of course you would change 'ctlcdlib' to whatever name your site used for the control card library.


 #1. xrefA jcl3 ctlcdlib w1d1 'ctlcdlib vs JCLnames'
     ===============================================

 #2. uvlp12 xref/ctlcdlib         - print report (listed below)

Sample Report #2

 xrefA: DIR=/part4/libs/apay/jcl3  Keyword=ctlcdlib  page#  1
 Report: ctlcdlib vs JCLnames Options=w1d1 Exclude:  Include:
 =====================================================2002/10/03_12:04:11
 c9301060         c9t301sr.ksh
 c9301130         c9t301sr.ksh
 c9301140_2       c9t301sr.ksh    c9t302sr.ksh
 c9a55111         c9a551j1.ksh
 c9a55310_3       c9a553j1.ksh    c9a553j2.ksh    c9a555j1.ksh

........... many lines omitted ...........

 ========================================================================
 EOD: 1130 lines selected from 1523 jobs in jcl3 (total 352193 lines)

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

27J2. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

cross-reference JCL to ctlcdlib module names

  1. Note that we can not correct the original ctlcdlib SORT spec modules because the JCL converter expects them to be in the IBM mainframe format.

  2. But knowing the JCLs referencing a problem ctlcdlib allows you to copy the corrections you have already made in a previous JCL into your current JCL being test/debugged.

  3. Do not to modify jobs in jcl3. Modify jobs only after you manually copy them from jcl3 to jcls as their turn comes up during the test/debug process. This allows us to repeat the mass convert of jcl2 to jcl3 if you discover discover improvements that can be made to the jclunixop5 search/replace tables or the the jclunix51.c converter program.

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

27K1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

Creating Test files using uvcopy

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

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

The sum/sort on page '26G1' required a data file of 346 byte records with the key in the 1st 8 bytes, followed by 56 consecutive 6 byte packed decimal fields. Here is the plan to create the file & test the sum/sort.

  1. Use the editor to create a text file with only the record keys desired. I created a file with 8 records of 8 bytes + Linefeed (FHDR0000,00000001,00000002,00000002,00000003,00000003,00000003,TRLR0000) I duplicated some keys so I could easily prove the SUM feature was working.

  2. Write a simple uvcopy job to read the text file of record keys & generate fixed length 346 byte records with 56 packed 6 byte fields from 9 to 344. I called the job 'gen56pk' & stored it in the 'pf' subdirectory. It will create packed value 1 in the 1st field, 2 in the 2nd, etc, 56 in field 56. See the uvcopy job pf/gen56pk listed at the top of the next page --->

  3. Execute the uvcopy job to create the test file.

  4. Use 'uvhd' to verify the uvcopy job has correctly generated the test file with the 56 packed decimal fields. See the 'uvhd' listing of generated record key 00000002 listed at the bottom of the next page --->

  5. Run the uvsort step extracted from the c9je3@01.ksh script (see page '26G1') using the generated test file as input.

  6. Verify the summarized output file using uvhd to view the packed fields. Note that record key 00000002 had 2 records & the summarized output had double the field values (2 in the 1st, 4 in the 2nd, etc, 112 in the 56th). See the 'uvhd' listing of SORT output record key 00000002 2 pages ahead --->

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

27K2. MVSJCL2: Testing Converted JCL/scripts

gen56pk - uvcopy job to generate test data file

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

sample record (key=00000002) in generated test file

 rec#=3 recs=8 rsiz=346 fsiz=2768 tmp/test56pk.dat--> p1
                       1         2         3         4         5         6
 r#        3 0123456789012345678901234567890123456789012345678901234567890123
         692 00000002...........,.....<.....L.....\.....l.....|..............
             3333333300000100000200000300000400000500000600000700000800000900
             0000000200000C00000C00000C00000C00000C00000C00000C00000C00000C00
          64 ...............,.....<.....L.....\.....l.....|..................
             0000000001000002000003000004000005000006000007000008000009000000
             001C00001C00001C00001C00001C00001C00001C00001C00001C00001C00002C
         128 ...........,.....<.....L.....\.....l.....|......................
             0000010000020000030000040000050000060000070000080000090000000000
             00002C00002C00002C00002C00002C00002C00002C00002C00002C00003C0000
         192 .......,.....<.....L.....\.....l.....|..........................
             0100000200000300000400000500000600000700000800000900000000000100
             3C00003C00003C00003C00003C00003C00003C00003C00003C00004C00004C00
         256 ...,.....<.....L.....\.....l.....|.............................,
             0002000003000004000005000006000007000008000009000000000001000002
             004C00004C00004C00004C00004C00004C00004C00004C00005C00005C00005C
         320 .....<.....L.....\.....l
             00000300000400000500000622
             00005C00005C00005C00005C00
 Note the 56 * 6 byte packed decimal fields from byte 8 to byte 344.
 First field x'00000000001C', 2nd x'00000000002C', 56th x'00000000056C'

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

27K3. MVSJCL2: Testing Converted JCL/scripts

Op-Instrns: create test file, test SORT/SUM, verify output


 1. vi tmp/test56pk.txt          - create text file input for generate job
    ===================

 2. vi pf/gen56pk                - create uvcopy job to generate test file
    =============

 3. uvcopy gen56pk,fili1=tmp/test56pk.txt,filo1=tmp/test56pk.dat
    ============================================================

 4. uvhd tmp/test56pk.dat r346       - verify generated file correct
    ==========================
 5a. export SORTIN=tmp/test56pk.dat  - export value for $SORTIN in uvsort jcl
 5b. export SORTOUT=tmp/test56pk.dat - export value for $SORTOUT in uvsort jcl
 5c. jcl3/c9je3@01                   - run SORT/SUM (step 2 extracted from job)
     =============                   - see SORT/uvsort listed on page '26G1'

 6. uvhd tmp/test56pk.datsum r346    - verify SORT/SUM output file (see below)
    =============================

sample record (key=00000002) in SORT/SUM output file

 rec#=2 recs=3 rsiz=346 fsiz=1038 tmp/test56pk.datsum--> p1
                       1         2         3         4         5         6
 r#        2 0123456789012345678901234567890123456789012345678901234567890123
         346 00000002.....,.....L.....l.................,.....L.....l........
             3333333300000200000400000600000800000000000200000400000600000800
             0000000200000C00000C00000C00000C00001C00001C00001C00001C00001C00
          64 .........,.....L.....l.................,.....L.....l............
             0000000002000004000006000008000000000002000004000006000008000000
             002C00002C00002C00002C00002C00003C00003C00003C00003C00003C00004C
         128 .....,.....L.....l.................,.....L.....l................
             0000020000040000060000080000000000020000040000060000080000000000
             00004C00004C00004C00004C00005C00005C00005C00005C00005C00006C0000
         192 .,.....L.....l.................,.....L.....l.................,..
             0200000400000600000800000000000200000400000600000800000000000200
             6C00006C00006C00006C00007C00007C00007C00007C00007C00008C00008C00
         256 ...L.....l.................,.....L.....l.................,.....L
             0004000006000008000000000002000004000006000008000010000012000014
             008C00008C00008C00009C00009C00009C00009C00009C00000C00000C00000C
         320 .....l.................,
             00001600001800001000001222
             00000C00000C00001C00001C00
 Since there were 2 records for key 00000008, the values in the packed fields
 were doubled, x'00000000002C' in 1st, up to x'00000000112C' in the 56th.

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

27L1. MVSJCL2: Scanning for Problems & Mass-Change Fix-ups

Writing uvcopy jobs for Complex Mass Changes

Here is an example of a mass change required for all files in the 'jcls' directory of converted JCL/scripts, after testing was in progress.


 exportgenall INPUT1 $ORDR/$DM/ordr060f.weekly    <-- sample BEFORE fix
 =============================================

 exportgenall INPUT1 $ORDR/$DM/ordr060f.weekly_   <-- desired CHANGE '_' appended
 =============================================

Background

The trailing underscore is the convention to identify a generation file used by the other scripts (exportgen0, exportgen1, etc). We wanted to make the 'exportgenall' script conform to the convention. We modified the converter & reran the conversion of all jcl2 to jcl3 to catch any JCL/scripts not yet manually copied to jcls for test/debug. But we also wanted to make existing JCL/scripts in 'jcls' conform, so we wrote the uvcopy job shown on the next page.

why not use sed or rep1d ?

We could not do this mass change with 'sed' or 'rep1d' (pre-programmed utility), since this is not a simple search/replace situation. Here we must identify a line by 1 pattern (exportgenall), then change another part of the line (append '_' onto the filename (end of line in this case)).

Solution

We wrote the 1 shot uvcopy fixup job listed on the next page --->

Note that is is self-documented, with many #comment lines to describe the problem & give the operating instructions.


 #1. mv jcls jcls.old                 - change name of existing jcl lib
 #2. mkdir jcls                       - make new subdir for output
 #3. uvcopyx fixexportgenall jcls.old jcls uop=q0i7  <- run this job on all jcls
 #   ==============================================
 #4. alldiff jcls.old jcls | more     - verify changes correct

Saving the original jcls & running the alldiff is essential to verify the results of any mass changes. You can easily verify that the differences are what you expected & that you did not screw up some other things.

sample alldiff report

 98c98
 < exportgenall RIPSIN ordr/ordr030b.billing
 ---
 > exportgenall RIPSIN ordr/ordr030b.billing_
 diff file# 1 - tmp3.old/ordr080d.ksh
 ------ omitted many other file diffs similar to the above ------

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

27L2. MVSJCL2: Mass Changes to converted JCL/scripts

Mass Changes to jcl/scripts - simple uvcopy job

 # fixexportgenall - scan JCL for exportgenall & append '_' on filename
 #
 # June05/03 - exportgenall function changed to expect trailing '_'
 #           - will then be consistent with exportgen0,1,p
 #
 # exportgenall INPUT1 ordr/ordr060f.weekly    <-- sample BEFORE fix
 # exportgenall INPUT1 ordr/ordr060f.weekly_   <-- AFTER fix (append '_')
 #
 # If 'exportgenall' at begin line, append '_' to filename
 # (assuming filename is last on line, which is the case)
 # - Code below compares 1st 12 bytes for exportgenall
 # - would be wrong to scan anywhere in line since exportgenall
 #   appears on the function declares at begin every jcl
 #
 #                  ** Operating Instructions **
 #
 # - need to run on jcls of ordr,apay,arcv
 # - jclunix51 converter fixed but, this assumes you wont want to reconvert
 #    because of many manual fixes during the test/debug phase
 # - this assumes all jcl in 'jcls' subdir, could run on both jcls & jcl3
 #   if you are copying from jcl3 to jcls as you debug each job ??
 # - 'uvcopyx' is a script that repeats 'uvcopy' for each file in directory
 #
 # 1. mv jcls jcls.old                 - change name of existing jcl lib
 # 2. mkdir jcls                       - make new subdir for output
 # 3. uvcopyx fixexportgenall jcls.old jcls uop=q0i7  <- run this job on all jcls
 #    ==============================================
 # 4. alldiff jcls.old jcls | more     - verify changes correct
 #
 fili1=?in,rcs=256,typ=LST
 filo1=?out,rcs=256,typ=LSTt
 @run
        opn    all
 #
 # begin loop to get & search for DD stmts
 man20  get    fili1,a0(200)          get next line
        skp>   eof                    (cc set > at EOF)
        mvc    b0(200),a0             copy input to outarea
        cmc    b0(12),'exportgenall'  line to be fixed ?
        skp!   man25
        cat    b0(100),'_'            concat '_' (onto filename)
 man25  put    filo1,b0(200)          identify file just ended
        skp    man20                  return to get next
 #
 # EOF - close files & end job
 eof    cls    all
        eoj
 #

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

Part_28 MVSJCL2.doc - Converting Mainframes to Unix/Linux

Part 28 - Special Considerations, Problems & Solutions

 28A1. Cataloged Generation GDG files - Unix/Linux Implementation
      GDG files replaced by UNix/Linux Functions
      (exportgen0, exportgen1, exportgen-1, exportgenall)
 28B1. GDG files, manual changes required for 'exportgenx'
      - converter stores 'exportgenx' if manual changes required
 28C1. GDG files, manual changes required for 'reruns'
      - rerun considerations for GDG files

28D1. Correction for files with generation(0) & 'DISP=MOD (indicates appending).

28E1. Concatenated Data Sets may need manual changes in converted JCL/scripts

28F1. Condition test Investigation & Corrections Required

28G1. IF/ELSE/ENDIF conversions & Corrections Required
 28H1. Mass change to converted JCL/scripts to modify the number of generations
      specified as argument #2 on the 'exportgen1' functions for various files.
 28I1. Run a JCL/script when an input file is detected
      - used to trigger a job when a data file is FTP'd to the server
      - 'ftrigger51' sample script supplied in /home/uvadm/sf/util/ftrigger51
      - will illustrate using jcls/jar160.ksh & datafile ar/customer.master
      - ftrigger51 has hard-coded datafilename & jobname
      - need to copy/rename/modify for other datafiles & jobnames
 28J1. General-Purpose version of script to trigger a job when file FTP'd
      - ftrigger52 takes 2 arguments for the datafilename & jobname
      - does require minor minor changes in the target job
 28K1. Detect FTP'd files & move/rename to a 2nd subdir to prevent overwrite
      - remote sites should append a trailing '_' on their FTP filenames
      - allows use of the 'exportgen1' function to assign next 6 digit seq#
      - see script 'ftpgdg1' listed on page '28K3'.
 28L1. Processing JCL from ESP workload scheduler
      - substituting %symbols with desired values or &symbols
      - converting '%INCLUDE IF's with %symbols to Korn shell 'if's with $symbols
 28M1. Process scripts converted from mainframe JCL containing BMC Control-M
      - to allow testing on unix before unix version of control-M installed
      - 'ctlmjcl51' extracts %%symbols into a search/replace table
      - you will edit, changing replacements as required for testing
      - 'ctlmjcl52' copies the converted JCL/script, substituting %% symbols
      - and processing %%IF's to include or drop JCL/script lines

28X0. Miscellaneous Problems & Solutions (collection of short stories)
28X1. Carriage Returns in Korn shell scripts cause problems

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

28A1. MVSJCL2: Special Considerations, Problems & Solutions

Cataloged Generation files

Mainframe GDG files are implemented via unix/linux Korn shell functions (exportgen0, exportgen1, exportgen-1,& exportgenall). These functions were documented & listed in MVSJCL.htm#Part_5. Here is a sample conversion (before & after) of Non-GDG & GDG files:

sample conversion - NON GDG files (before & after)

      //RETURNS  DD DSN=ORDR.ORDR010I.RETURNS.RR
      //REPTFILE DD DSN=ORDR.ORDR270F.REPORT
      export RETURNS=ordr/ordr010i.returns.rr
      export REPTFILE=ordr/ordr270f.report

sample conversion - GDG files (BEFORE & AFTER)

      //RETURNS  DD DSN=ORDR.ORDR010I.RETURNS.RR(0)
      //REPTFILE DD DSN=ORDR.ORDR270F.REPORT(+1)
      exportgen0 RETURNS ordr/ordr010i.returns.rr_
      exportgen1 REPTFILE ordr/ordr270f.report_ gdg=35
  1. IBM Generation files are recognized by the suffixes (0), (+1), (-1). The UNIX converted files will have an underscore '_' suffix & the (0),(+1),(-1) is indicated by functions exportgen0,1,p.

  2. Non generation files are converted to 'export DDname=DSNname'

  3. Generation files are converted to 'exportgen0/1/p DDname DSNname'

  4. exportgen0, exportgen1,& exportgen-1 are UNIX functions that have been written to provide some of the functionality of cataloged generation files. See exportgen0 & exportgen1 documented & listed in MVSJCL.htm#Part_5.

  5. These functions expect a 6 digit generation# appended on the end of the filename after an underscore '_'. Note that you must create the first generation names before testing/production, for example:
      ordr010i.returns.rr_000001
      ordr270f.report_000001
  1. exportgen0 defines the current (highest gen#) of the file & exportgen1 defines the next (not yet existing gen#). After a few runs we might have:
      ordr010i.returns.rr_000001
      ordr010i.returns.rr_000002
      ordr010i.returns.rr_000003
      ordr270f.report_000001
      ordr270f.report_000002
      ordr270f.report_000003

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

28A2. MVSJCL2: Special Considerations, Problems & Solutions

7. Generation#s now 6 digits

In 2005, the generation# was increased from 4 to 6 digits. Functions exportgen0, exportgen1, etc that read/write the current/next generation were modified accordingly.

For existing 4 digit users who wish to update to the 6 digit functions, uvcopy job 'gdg4to6' is provided. 'gdg4to6' reads your data directories & creates as script to rename any 4 digit GDG files to 6 digits by inserting '00' after the identifying '_' & prior to the existing 4 digit GDG#.

Here are the operating instructions & sample before/after conversions taken from the 1st page of the uvcopy job which is stored at /home/uvadm/pf/IBM/gdg4to6.

sample Op. Instrns. for gdg4to6


 uvcopy gdg4to6,fild1=gl      <-- generate script & write to tmp/gdg4to6_gl
 =======================

sample input filenames in subdir gl

      account.acntlist_0001
      account.acntlist_0002
      account.acntlist_0003
      account.master_0001
      account.master_0002
      account.master_0003
      account.trans

sample script output for above input

#!/bin/ksh echo "gdg4to6 - increase generation#s from 4 to 6 digits" echo "LOGNAME=mvstest SITENAME=ACME Ltd. DATETIME=2005/12/10_13:02:56 " echo "input directory: gl " echo "generated script written to: tmp/gdg4to6_gl " mv -i gl/account.acntlist_0001 gl/account.acntlist_000001 mv -i gl/account.acntlist_0002 gl/account.acntlist_000002 mv -i gl/account.acntlist_0003 gl/account.acntlist_000003 mv -i gl/account.master_0001 gl/account.master_000001 mv -i gl/account.master_0002 gl/account.master_000002 mv -i gl/account.master_0003 gl/account.master_000003 echo "- renamed 0006 of 0007 total files in directory: dirname"

internal logic

  1. reads all filenames in directory & puts to the sort
  2. sorts the filenames & reads back sorted filenames
  3. stores each sorted gdg set of filenames in a memory table
  4. for filenames ending with '_######' (underscore & 4 digits) - generate script 'mv' (rename) command to insert '00' - write out mv/renames to the script output file
  5. at end, prompt to Display & Execute script now (or later manually)

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

28A3. MVSJCL2: Special Considerations, Problems & Solutions

8. Generation# does not auto wrap

The unix function exportgen1 does not automatically handle generation wrap (as did the mainframe), but uvcopy jobs are provided to rename files with suffixes over 900000 (or 9500 for the older 4 digit versions). The uvcopy jobs is 'gdgreset6' for 6 digit GDG#s (versions since Dec 2005). and 'gdgreset4' for versions older than Dec 2005.

Note that if you had a generation file that was updated once a day it would take 2500 years to exceed 900000 (or 25 years for the older 4 digit GDGs).

uvcopy jobs gdgreset6 & gdgreset4 are provided to reset generation#s.

sample Op. Instrns. for gdgreset6


 uvcopy gdgreset6,fild1=gl  <-- generate script & write to tmp/gdgreset6_gl
 =========================

sample input filenames in subdir gl

      account.acntlist_899999
      account.acntlist_900000
      account.acntlist_900001
      account.master_555555
      account.master_555556
      account.master_555557
      account.trans

sample script output for above input

#!/bin/ksh echo "gdgreset6 - reset generation#s if any GDG#s in file set > 900000 " echo "LOGNAME=mvstest SITENAME=$regsite DATETIME=2005/08/23_22:53:16 " echo "input directory: gl " echo "generated script written to: tmp/gdgreset6_gl " mv -i gl/account.acntlist_899999 gl/account.acntlist_049999 mv -i gl/account.acntlist_900000 gl/account.acntlist_050000 mv -i gl/account.acntlist_900001 gl/account.acntlist_050001 echo "- will reset 0003 filenames in 0001 GDG sets (if no manual changes)"

internal logic

  1. reads all filenames in directory & puts to the sort
  2. sorts the filenames & reads back sorted filenames
  3. stores each sorted gdg set of filenames in a memory table
  4. if any gdg# in set > 900000 - convert filename into 'mv/rename' from 900000 range to 010000 range - write out mv/renames to the script output file
  5. at end, prompt to Display & Execute script now (or later manually)

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

28A4. MVSJCL2: Special Considerations, Problems & Solutions

9. Cataloged Generation files - caveats

Note
  • In May 2007, the GDG system was significantly enhanced
  • Please see MVSJCL.htm#Part_5 which documents the new system
  • The 'caveats' here in Part 8 are now obsolete
  • But will be retained here for some period of time

The exportgen0,1,p functions are somewhat different than the IBM cataloged generation files. Under MVS the generation# is updated only at the successful end of the job, but function exportgen0 will always define the CURRENT generation & exportgen1 will always define the NEXT (not yet existing) generation.

This means that files that are created within a job and then read back within the same job require special conversion because IBM MVS JCL would use the same gen# for the readback as for the creation. For example:

IBM mainframe

 //REPTFILE DD DSN=ORDR.ORDR270F.REPORT(+1)           <-- IBM create

//REPTFILE DD DSN=ORDR.ORDR270F.REPORT(+1),DISP=SHR <-- IBM readback

converted equivalent

 exportgen1 REPTFILE ordr/ordr270f.report_           <-- UNIX create
          ^
 exportgen0 REPTFILE ordr/ordr270f.report_           <-- UNIX readback
          ^

The JCL converter now recognizes this situation and automatically changes the 2nd reference of the same file by 'exportgen1' to 'exportgen0' to allow read back after being previously created in the same job. A #comment is inserted to alert you to this fact, thus the above would be:

exportgen0 DLYTRAN ordr/ordr280f.dlytran_ #gen1->gen0 #above exportgen0 (1) changed to readback prior creation by exportgen1

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

28B1. MVSJCL2: Special Considerations, Problems & Solutions

Note
  • In May 2007, the GDG system was significantly enhanced
  • Please see MVSJCL.htm#Part_5 which documents the new system
  • The 'caveats' here in Part 8 are now obsolete
  • But will be retained here for some period of time

(+2) generations require manual changes

Functions are provided only for previous, current,& next generations (because the next generation function increments immediately vs at EOJ). Here is an example of converting a (+2) generation (IBM JCL & UNIX script)

      //REPTFILE DD DSN=ORDR.ORDR270F.REPORT(+2)
      exportgenx REPTFILE ordr/ordr270f.report_

You will need to find & manually correct any exportgenx since any (+2) or higher is converted to exportgenx.

 grep exportgenx jcl3/*         <-- find any exportgenx for correction
               ^

In many cases you would simply change exportgenx to exportgen1, since the (+2) would usually have been preceded by a (+1), so the (+2) should now be a (+1). This is because the UNIX exportgen1 function increments the generation# immediately & not at end of job as on IBM mainframe.

The above assumes that any readback of the (+1) creation has occurred before the (+2) creation & that you do not need to readback the (+1) generation after the (+2) generation has been created. Please see #7 above which explains how the readback is performed by converting a subsequent reference of exportgen1 to exportgen0 if DISP=SHR were present (indicating a readback of an existing file).

If you did need to access the 1st exportgen1 creation, then you could use the 'exportgen-1' function to access the previous generation.

scanning JCL/scripts for 'exportgenx'

You can use 'grep' or 'uvcopy scan1d,scan2d' to find problems in output jcl/scripts that need to be corrected manually. If the grep output is not too many lines, I suggest you print it out to serve as a guide for manual editing. Note the '-n' grep option to include the line# in the output.

Note that it is best NOT make any corrections in the jcl3 subdir, but rather only after you have manually copied a job to the jcls subdir. This is because we would lose any corrections in jcl3 if we subsequently need to to another mass conversion from jcl2. Also because we want jcls contents to measure test/debug progress. Therefore we could keep these 'grep' lists of problems & refer to them as we copy each jcl from jcl3 to jcls during test/debug.

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

28B2. MVSJCL2: Special Considerations, Problems & Solutions

Note
  • In May 2007, the GDG system was significantly enhanced
  • Please see MVSJCL.htm#Part_5 which documents the new system
  • The 'caveats' here in Part 8 are now obsolete
  • But will be retained here for some period of time

scan for exportgenx - using 'grep'

This will Find 'exportgenx's (originally +2,+3,etc) that need manual correction. (see corrections explained on page '28B1').


 #1. grep -n jcl3/* >tmp/exportgenx   <-- find exportgenx problems to correct
     ==============================

 #2. vi tmp/exportgenx      <-- edit results to delete unwanted 'autoload' lines
     =================
     --> :g/autoload/d      <-- delete autoload lines
     --> :w                 <-- write out

 #3. uvlp12 tmp/exportgenx  <-- print exportgenx for later correction
     =====================

sample grep report

jcl3/c9r00p0k.ksh:10:autoload exportgen0 exportgen1 exportgen-1 exportgenx exportgenall exportfile

 jcl3/c9r01c0b.ksh:709:exportgenx TMCSEBO0 arcv/pfhb/nixx.c9r01.tmerrso1_
 jcl3/c9r01c0d.ksh:714:exportgenx TMCSEBO0 arcv/pfhd/nixx.c9r01.tmerrso1_
 jcl3/c9r09c0b.ksh:328:exportgenx $ORTPARM01 apay/pfhb/ctlcdlib_
 jcl3/c9r09c0b.ksh:492:exportgenx $ORTPARM apay/pfhb/ctlcdlib_
 jcl3/c9r09c0b.ksh:719:exportgenx $ORTPARM apay/pfhb/ctlcdlib_
 jcl3/c9r09c0b.ksh:778:exportgenx DD2 arcv/pfhb/nbxx.c9r09.iivseqop_

Note that grep picked up a lot of unwanted lines because of the 'autoload' command at the beginning of all converted jcl/scripts. We deleted these before we print the report.

Please see 'uvcopy scan1d' (grep alternative) listed on the next page ---->

'scan1d' provides qualifier patterns to eliminate the necessity of pre-editing the grep report before printing.

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

28B3. MVSJCL2: Special Considerations, Problems & Solutions

scan for exportgenx - using 'uvcopy scan1d'

Here is the 'uvcopy scan1d' equivalent of the 'grep exportgenx' report (shown on the previous page). Note that scan1d will solicit options & patterns as illusrtrated below).


 uvcopy scan1d,fild1=jcl3       <-- run scan1d on 'jcl3' directory
 ========================
 uop=q1a1b99999c0d256e0p1 - option defaults
       a1                 - begin scan at line #1 (default) of input file
       a0                 - causes prompt for search pattern to BEGIN scan
         b99999           - end scan at line #99999 (dflt) of input file
         b0               - causes prompt for search pattern to END scan
               c0         - begin scan at col #1 (zero rel) of input lines
                 d256     - length of scan area default 256 bytes
                     e1   - inhibit errmsgs when LF not found within rcsz
                       p1 - 1 present qual(31-60) & 1 absent qual(61-80)
                       p2 - 2 present quals(31-60+61-80) & NO absent quals
                       p4 - 2 absent quals(31-60+61-80) & NO present quals
 User OPtion (uop) defaults  = q1a1b99999c0d256e0p1
  null to accept or re-specify (1 or more)  -->            <-- null=accept
 enter your search pattern (max 64 bytes)   --> exportgenx <-- search pattern
 enter 1st qualifier (present)              -->            <-- null=disable
 enter 2nd qualifier (absent)               --> autoload   <-- absent qualifier
 match: i=case-insensitive, p=patterns(@,#,etc)
 quote inhibits: q1=singles,q2=doubles,q3=both
 enter match options: i,p,q1/q2/q3,n,or null-->            <-- null accept dflt
 display/edit/print/none ? (more/vi/lp/null)--> uvlp12     <-- print report

sample scan1d report


 JOB: scan1d  dir: jcl3  search: exportgenx  qual1:   qual2: autoload
 ====================================================== 2002/11/14_12:07:48
 00709 exportgenx TMCSEBO0 arcv/pfhb/nixx.c9r01.tmerrso1_
 00784                   1 hits @EOF: jcl3/c9r01c0b.ksh
 00714 exportgenx TMCSEBO0 arcv/pfhd/nixx.c9r01.tmerrso1_
 00789                   1 hits @EOF: jcl3/c9r01c0d.ksh
 00328 exportgenx $ORTPARM01 apay/pfhb/ctlcdlib_
 00492 exportgenx $ORTPARM apay/pfhb/ctlcdlib_
 00719 exportgenx $ORTPARM apay/pfhb/ctlcdlib_
 00778 exportgenx DD2 arcv/pfhb/nbxx.c9r09.iivseqop_
 00874                   4 hits @EOF: jcl3/c9r09c0b.ksh
 ====================================================== 2002/11/14_12:07:51
  EOD: 00164 hits in 0079 files of 0213 total (69681 lines)

'scan1d' solicits options & patterns as illustrated above. Here we specified the input directory on the command line (,fild1=jcl3) but it would have been solicited if omitted. The output file is 'tmp/subdir_pattern' when 'filo1=' is not specified on the command line. See more about scan1d in SCANjobs.htm.

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

28C1. MVSJCL2: Special Considerations, Problems & Solutions

Note
  • In May 2007, the GDG system was significantly enhanced
  • Please see MVSJCL.htm#Part_5 which documents the new system
  • The 'Rerun Considerations' here in Part 8 are now obsolete
  • But will be retained here for some period of time

Rerun Considerations for Generation files

You must also note the recovery operations required for jobs that bomb out or where you want to rollback generations for reruns. The following example assumes all update files in the job are generation type & not indexed update in place type files.

To rerun a successful job, you would remove the latest generation of all files that had been created in the job.

To rerun a job that had bombed out part way thru, you would have to identify & remove only those generation files that had been created in the bomb out run. Listing the files (via ls -l) will show you the creation times of the files.


 ls -l ordr/ordr270f*    <-- list files to see which dates to remove
 ====================
 -rw-rw-r--  1 armasp  uvgrp   39686 Sep 16 18:59 ordr270f.report_000001
 -rw-rw-r--  1 armasp  uvgrp   39686 Sep 17 19:11 ordr270f.report_000002
 -rw-rw-r--  1 armasp  uvgrp   39686 Sep 18 15:53 ordr270f.report_000003

For example, to rerun a Sep 18 job, you would examine the files created on Sep 18 & remove the appropriate files.


 rm ordr/ordr270f.report_000003    <-- remove generation file for rerun
 ==============================

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

28C2. MVSJCL2: Special Considerations, Problems & Solutions

using the console log to determine file removes for reruns

The console log will help you determine which files to remove for reruns since exportgen0/1 functions display the defined generation on the console. If the job aborted, the console log will help you determine how far the job ran before aborting.

For example, here is the console log for jar200.ksh, originally shown on '1S3'.


 jar200.ksh         <-- run the job
 ==========
 --> exit
 --> login mvstest  <-- must logout & back in to process console log file

 logview            <-- view the console log file
 =======
 1                  <-- enter 1 when prompted for file # to view (1=latest)

OR, you could view the file directly if you know the name (date:time)


 vi /home/appsadm/log2/mvstest/031122_132149
 ===========================================
 JAR200:031122:132149: JOB begun=JAR200
 JAR200:031122:132149: RUNDATA=/home/mvstest/testdata RUNLIBS=/home/mvstest
 JAR200:031122:132149: DW=wrk,DS=sysout/031122
 JAR200:031122:132149: begin step# 1/1 iebgener
 JAR200:031122:132149: gen0: SYSUT1=ar/customer.master_000003
 JAR200:031122:132149: file: SYSUT2=wrk/JAR200_tempcm
 JAR200:031122:132149: uvcp fili1=ar/customer.master_000003,filo1=wrk/JAR200_tempcm
 JAR200:031122:132149: EOF input, 32 recs, 8192 bytes: ar/customer.master_000003
 JAR200:031122:132149: close out, 32 recs, 8192 bytes written: wrk/JAR200_tempcm
 JAR200:031122:132149: begin step# 2/2 idcams
 JAR200:031122:132149: file: TEMPCM=wrk/JAR200_tempcm
 JAR200:031122:132149: gen+1: CUSMAS=ar/customer.master_000004 gens=10
 JAR200:031122:132149: JOB completed=JAR200

Note that generation files created are clearly identified by the 'gen+1'. We could remove the generation file created above as follows:


 rm ar/customer.master_000004      <-- remove generation file for rerun
 ============================

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

28C3. MVSJCL2: Special Considerations, Problems & Solutions

creating a script to remove GDG files for reruns

For smaller jobs, it is easy to use the recovery methods described above (listing files &/or investigating the console log).

For large jobs with many files, a uvcopy job is provided to extract the 'gen+1' filenames from a specified job begun at a specified time. This job will create a script of 'rm' commands that you can inspect & modify if necessary before executing. If the job had aborted, you would need to remove the lines for files created after the abort point.

For example, suppose we had to rerun 'ordr280d' run on Nov 29 begun at 13:45. Note that the console log could be very large (for a whole day) & there could be several earlier runs of the job to be rerun.

Here is just the lines for the ordr280d begun at 13:45. Following the console log shown immediately below, we will show you the uvcopy command to extract the 'gen+1' filenames & reformat them into 'rm' commands.

.............. console log for ordr280d .....................


 uvcopy logxgen1,fili1=logfile,arg1=jobname,arg2=date:time(job begun)
 ====================================================================

 uvcopy logxgen1,fili1=/home/appsadm/log1/ordr/031129_134500
 ===========================================================
                ,arg1=ordr280d,arg2=031129:1353
                ===============================
Note
  • console log filenames use an underscore between date & time
    (vs colons on the date:times within the file)
  • no need to specify the full 6 digit time as long as it is unique
  • if there were only 1 run in the console log file (today)
    you can omit arg2 & enter null when prompted.

'rm' commands created by logxgen1

........................ rm script ...........................

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

28D1. MVSJCL2: Special Considerations, Problems & Solutions

Correction for files with generation(0) & DISP=MOD (appending)

We need to find all 'DD's with generation (0) & DISP=MOD. This indicates appending to an existing file & may require manual changes to the converted scripts or programs. If the file is in a COBOL program step, change the 'OPEN' to 'OPEN EXTEND'. If the file is output from a utility such as 'uvsort', add the 'a' option onto the output file typ (typ=RSFa).

special purpose scan job required

The Pre-Programmed uvcopy jobs (scan1d,scan2d,scan3d,etc) are not flexible enough to handle this problem. We cant use scan1d because DISP=MOD is not necessarily on same the same line as the generation (0) DSN. We cant use scan3d because we don't have a reliable pattern to mark the end of a multi-line DD (continuation ',' absent).

So we decided to write a special purpose uvcopy job (named as 'scandd0') which is listed on the next 2 pages --->

Note that this job first tables each DD (possibly multi-lines) before scanning the memory table for the desired conditions. This makes it easy to modify this job for other situations as the need arises.

Operating Instructions


 #1. login ordr --> libs/ordr with subdir jcl2 (IBM JCL with expanded PROCs)
 #2. uvcopyx scandd0 jcl2 tmp uop=q0i7   - run scandd0 job on all files in jcl2
 #3. cat tmp/* >scandd0.rpt              - concatenate all results to 1 file
 #4. uvlp12 scandd0.rpt                  - print report

Note that 'uvcopyx' is a script (supplied in /home/uvadm/sf) that repeats the uvcopy job for all files found in the input directory (jcl2 in this case) & writes the corresponding output file (with same name) to the output directory (tmp in this case). This script & concatenating all output files into 1 report means we can write our job to process only 1 file rather that having to read the directory (as do the pre-programmed jobs scan1d,scan2d,scan3d,etc).

sample report scandd0.rpt

      //CNTLRPT  DD DSN=ORDR.ORDR030B.CNTLRPT.&PE(0),
                    DISP=(MOD,KEEP,KEEP)
      file: jcl2/ordr08bs.jcl
      //CNTLRPT  DD DSN=ORDR.ORDR030B.CNTLRPT.&PE(0),DISP=(MOD,KEEP,KEEP)
      file: jcl2/ordr08ds.jcl
      //CNTLRPT  DD DSN=ORDR.ORDR030B.CNTLRPT.&PE(0),
                    DISP=(MOD,KEEP,KEEP)
      file: jcl2/ordr08fs.jcl

Note this sample report shows only the 1st 3 files of 7 found.

See the uvcopy job (scandd0) listed on the next 2 pages --->

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

28D2. MVSJCL2: Special Considerations, Problems & Solutions

 # scandd0 - scan JCL for DISP=MOD on generation 0
 #         - indicates appending onto existing file
 #
 # - JCL converter does not handle appending onto existing file
 # - this scandd0 job can be used to identify & fix manually
 #
 # 1. \rm tmp/*                - remove all files from tmp subdir
 # 2. uvcopyx scandd0 jcl2 tmp uop=q0i7   - run this job on all jcls
 #    =================================
 # 3. cat tmp/* >scandd0.rpt   - concat to 1 report
 # 4. uvlp12 scandd.rpt        - print report
 #
 was=d8000                  # increase area d (from default 1024)
 fili1=?in,rcs=256,typ=LST
 filo1=?out,rcs=128,typ=LSTt
 @run
        opn    all
 #
 # begin loop to get & search for DD stmts
 man20  bal    getr               get next line
        skp>   eof
 #
 # return point after processing tabled DD stmt
 man22  scn    a0(40),' DD '      DD stmt ?
        skp!   man20
 #
 # DD found - build table in area d til no ',' continuation
 man24  clr    d0(5000),'~'       clear table area to all tildes
        mvn    $rd,0              clear table ctl rgstr
 #
 # begin loop to store DD lines & get next til no ',' continuation present
 man30  mvc    dd0(100),a0        store current line via rgstr d
        add    $rd,100            up for next
        bal    getr               get next line
        skp>   eof
        scn    a0(80),', '        continued ?
        skp=   man30
 #
 # DD stored in table in area d
 # - scan for DSN generation (0) with DISP=(MOD
 man40  scn    d0(80),'(0)'       generation 0 ?
        skp!   man22
        sts    d0(100),d0(100),'DISP=(MOD'
        skp!   man22
 #
 # - scn found (0) on 1st line (DSN assumed)
 # - sts looks on all lines for DISP=(MOD (table ended by tildes)
 # dump tabled DD stmt to output file (tildes mark end of table)
        wtbe   filo1,d0(100),d0(100)
        add    $ca1,1              set switch for space at EOF
        skp    man22
 #

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

 # EOF - identify jcl filename for report
 #       & create blank line if any matches in this file
 #     - for separator when all output files concatenated together
 eof    cmn    $ca1,1              any matches this file ?
        skp<   eof2
        mvfv1  g0(80),'file: $fili1'
        put    filo1,g0(80)        identify file just ended
        put    filo1,' '           create blank line separator
 eof2   cls    all
        eoj
 #
 #------------------------------------------------------------------
 # getr - subrtn to get next line
 #      - bypass non JCL & comments
 #
 getr   get    fili1,a0
        skp>   getr9
        cmc    a0(3),'//*'           comment ?
        skp=   getr
        cmc    a0(2),'//'            JCL ?
        skp!   getr
        ret=
 #
 # on EOF return with cc >
 getr9  ret>
 #

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

28E1. MVSJCL2: Special Considerations, Problems & Solutions

Concatenated Data Sets

The current JCL converter (jclunix51) now handles concatenated data sets, so no manual changes should be required. In order to understand the conversions (now performed automatically) here is the example extracted from ordr320d.

sample concatenated data set - IBM JCL

 //ORDRST01 EXEC PGM=ORDR270F
 //STEPLIB  DD DSN=&LOAD,DISP=SHR
 //  - - - - irrelevant mainframe statements omitted - - - -
 //SORTWK06 DD UNIT=DISK,SPACE=(CYL,(5,15),RLSE)
 //RETURNS  DD DSN=ORDR.ORDR010I.RETURNS.RR(0),DISP=SHR
 //         DD DSN=ORDR.ORDR010I.RETURNS.UE(0),DISP=SHR
 //         DD DSN=ORDR.ORDR010I.RETURNS.UO(0),DISP=SHR
 //         DD DSN=ORDR.ORDR010I.RETURNS.UD(0),DISP=SHR
 //         DD DSN=ORDR.ORDR010I.RETURNS.NO(0),DISP=SHR
 //REPTFILE DD DSN=ORDR.ORDR270F.REPORT(+1),
 //            DISP=(,CATLG,DELETE),
 //            UNIT=DISK,SPACE=(CYL,(10,5),RLSE),
 //            DCB=(MODEL.DSCB,RECFM=FB,LRECL=133,BLKSIZE=6118)

sample concatenated data set - AFTER automatic conversion

 S0010=A
 ((JOBSTEP++))
 logmsg "step# $JOBSTEP ordr270f begun"
 export TIMESTAMP=$(timestamp)
 ##ORDRST01 EXEC PGM=ORDR270F
 export PROGID=ordr270f
 export STEPID=ORDRST01
 export SYSOUT=$DP/${JOBID}_${PROGID}_SYSOUT_$(date +%H%M%S)
 exportgen0 RETURNS01 ordr/ordr010i.returns.rr_
 exportgen0 RETURNS02 ordr/ordr010i.returns.ue_
 exportgen0 RETURNS03 ordr/ordr010i.returns.uo_
 exportgen0 RETURNS04 ordr/ordr010i.returns.ud_
 exportgen0 RETURNS05 ordr/ordr010i.returns.no_
 cat $RETURNS01 $RETURNS02 $RETURNS03 $RETURNS04 $RETURNS05 \
     >$DW/ordr010i.returns.rr_05
 export RETURNS=$DW/ordr010i.returns.rr_05
 exportgen1 REPTFILE ordr/ordr270f.report_
 #----------------------------------------------------------------
 cobrun $ANIM $RLX/ordr270f
 #----------------------------------------------------------------
Notes
  • DDname of 1st file appended with '01'
  • DDnames of concatenated files appended with 02,03,etc
  • unix 'cat' statement inserted to concatenate all parts and redirect
    output to wrk subdir, using name of 1st part suffixed by no of parts
  • 'export' for the original DDname (RETURNS in this case)
    inserted to equate DDname to the temp/work file (for COBOL program)

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

28F1. MVSJCL2: Special Considerations, Problems & Solutions

CONDition test Investigation & Modification

You must inspect & possibly modify CONDition code conversions. The mainframe convention was that CONDition codes 4 or less were not serious (the job should continue).

The JCL converter assumes that any non-zero is a failure. We have to do this because various unix/linux equivalents might return values different than the original mainframe utilities. Even the COBOL programs might return different values if the conversion was not perfect. You must watch for the following situations:

  1. JCL steps that tested for CONDitions other than 0 (see example next page).

  2. COBOL programs that return values differently than on the mainframe. The COBOL converter inserts 'STOP RUN RETURNING 0' if no return value was detected (the conversion might not be perfect).

  3. Unix/Linux utilities that return values < 4. For example, the 'cp' command will return '1' if the file is not found.

  4. Unix/Linux utilities that return values < 0 (negative). Mainframe programs never returned < 0, but this is possible on unix/linux.

    Confused about CONDition tests

Note that after conversion, we have 2 types of CONDition tests. First there is code inserted after every program or utility to test the return code condition. This test is not apparent in the original JCL, because the mainframe handled it automatically. The second type is the converted equivalent of the original mainframe COND test (which may or may not be present).

For an example of the 1st type of condition testing, see the lines marked with '<-$?' on the next page. These lines are inserted after every program or utility to test the program return code for success or failure.

For an example of the 2nd COND test, see the lines marked with '<-COND' on the next page. Line k#34 is the original ##commented out EXEC with the CONDition. Line k#32 is the 'if' equivalent of the COND,& line k#43 is the 'fi' marking the end of the 'if' condition code.

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

28F2. MVSJCL2: Special Considerations, Problems & Solutions

                       ** sample JCL with CONDition test **
 //JGL400   JOB  (1234),'DEMO CONVERT JCL WITH CONDITION'
 //STEP010  EXEC PGM=COBOL1
 //SYSUT1   DD   DSN=GL.ACCOUNT.MASTER(0),DISP=SHR
 //SYSUT2   DD   DSN=&&TEMPGLM,DISP=(NEW,PASS),DCB=(LRECL=80)
 //*
 //STEP020  EXEC PGM=COBOL2,COND=(4,LT,STEP010)
 //TEMPGLM  DD   DSN=&&TEMPGLM,DISP=(OLD,PASS)
 //ACNTMAS  DD   DSN=GL.ACCOUNT.MASTER(+1),DISP=(NEW,CATLG),LRECL=80

sample JCL/script with CONDition test


 ..... front end 11 lines omitted .....
 k#012 #1======================= begin step#S0010 COBOL1 ========================
 k#013 S0010=A
 k#014 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#015 logmsg1 "Begin Step $JSTEP cobol1 (#$XSTEP)"
 k#016 ##STEP010  EXEC PGM=COBOL1
 k#017 export PROGID=cobol1
 k#018 export PARM=""
 k#019 exportgen0 SYSUT1 gl/account.master_ gdg=15
 k#020 exportfile SYSUT2 $JTMP/__tempglm
 k#021 #3----------------------------------------------------------------------
 k#022 cobrun $ANIM $RLX/cobol1
 k#023 #4----------------------------------------------------------------------
 k#024 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 k#025 if ((S0010C >  4))   # modified by COND step S0020
 k#026    then logmsg1 "step#$JSTEP cobol1 abterm $SCC"
 k#027    alias goto="<<S9900=A"; fi
 k#028 goto
 k#029 #1======================= begin step#S0020 COBOL2 ========================
 k#030 S0020=A
 k#031 JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#032 if ((S0010C <= 4)); then   # COND=(4,LT,STEP010)                  <--COND
 k#033 logmsg1 "Begin Step $JSTEP cobol2 (#$XSTEP)"
 k#034 ##STEP020  EXEC PGM=COBOL2,COND=(4,LT,STEP010)                    <--COND
 k#035 export PROGID=cobol2
 k#036 export PARM=""
 k#037 exportfile TEMPGLM $JTMP/__tempglm
 k#038 exportgen1 ACNTMAS gl/account.master_ gdg=15
 k#039 #3----------------------------------------------------------------------
 k#040 cobrun $ANIM $RLX/cobol2
 k#041 #4----------------------------------------------------------------------
 k#042 LCC=$?; S0020C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0020R=1; alias goto="";
 k#043 fi   #endof: COND=(4,LT,STEP010)                                  <--COND
 k#044 if ((S0020C != 0))
 k#045    then logmsg1 "step#$JSTEP cobol2 abterm $SCC"
 k#046    alias goto="<<S9900=A"; fi
 k#047 goto
 ..... 10 back end lines omitted .....

See discussion of CONDition test Modifications Required on next page --->

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

28F3. MVSJCL2: Special Considerations, Problems & Solutions

CONDition test Illustrations

Please see the 'COND'ition code conversion on the previous page. Here are the essential lines extracted from the converted script:

k#024 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto=""; k#025 if ((S0010C > 4)) # modified by COND step S0020 k#026 then logmsg1 "step#$JSTEP cobol1 abterm $SCC" k#027 alias goto="<<S9900=A"; fi k#028 goto

       ......... lines omitted .........
 k#032 if ((S0010C <= 4)); then   # COND=(4,LT,STEP010)                  <--COND
       ......... lines omitted .........
 k#043 fi   #endof: COND=(4,LT,STEP010)                                  <--COND

CONDition Changes Required

Line k#24 captures the return code ($?) from step1. Line k#25 tests the step1 return code & if non-zero, an errmsg is displayed & we will 'goto' the Abnormal Termination label (S9900=A) at the end of the job.

Note that the usual step return code test has been modified to allow us to reach the COND if test. This change was made in May 2006


 k#032 if ((S0010C != 0))    <-- JCL conversion prior to May 2006
       ==================        (& usual test if no CONDs following)

 k#032 if ((S0010C > 4))     <-- conversions since May 2006
       =================

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

28F4. MVSJCL2: Special Considerations, Problems & Solutions

CONDition test Investigation & Modification

You can use 'uvcopy scan1d' to find all 'EXEC PGM's with 'COND'ition codes. Since the JCL converter passes the EXEC thru to the output script as a #comment, you can scan jcl2(JCL), jcl3(scripts unmodified), or jcls(scripts debugged). I recommend you run this on the 'jcls' subdir, before going live, but after all scripts have had initial testing (then all scripts are in jcls vs jcl3).

We use 'uvcopy scan1d' (vs 'grep') because scan1d allows us to specify a qualifier. We can select only those 'EXEC PGM's that also have 'COND'. 'scan1d' was previously illustrated on page '27C1' where we waited for the prompt to enter our search pattern. In this case we will enter both our search pattern & qualifier on the command line using arg1u=... & arg2=...

The command line does not allow blanks so we use an underscore in 'EXEC_PGM' which is changed back to blank internally by the 'u' option of arg1u. You don't have to use the underscore if you wait for the prompt to enter the search patterns.


 uvcopy scan1d,fild1=jcl1,arg1u=EXEC_PGM,arg2=COND
 ================================================
 uvcopy scan1d,fild1=jcl1,arg1=EXEC,arg2=PGM,arg3=COND,uop=p2  <-- alternative
 ============================================================

sample report from scan1d

 Job: scan1d  Dir: jcls  Search: EXEC  Qual1: COND  Qual2:
  SearchBgn:    SearchEnd:    MatchOps:   UserOps: q1a1b99999c0d256e0p1
 ====================================================== 2004/04/24_11:58:41
 00055 ##STEP020  EXEC PGM=IDCAMS,COND=(4,LT,STEP010)
 00083                   1 hits @EOF: jcls/jar300.ksh
 00034 ##STEP020  EXEC PGM=CGL100,COND=(4,LT),REGION=1024K,PARM=$PARM1
 00058                   1 hits @EOF: jcls/jgl100.ksh
 00122 ##ORDRST04 EXEC PGM=IEBGENER,COND=(01,NE,ORDRST03)
 00149                   1 hits @EOF: jcls/ordr320d.ksh
 ====================================================== 2004/04/24_11:58:41
  EOD: 00003 hits in 0003 files of 0008 total (00656 lines)
  1. scan1d creates a report with page headings showing relevant info (directory scanned, patterns & qualifiers, date & time).

  2. scan1d provides qualifiers that must be present &/or absent in addition to the primary search pattern.

  3. scan1d shows matched data lines with their line numbers, which are useful for subsequent edit sessions. scan1d also shows the hit count at the end of each file,& the total hits in all files at the end of the directory.

  4. The scan1d report is handy for assigning work to other programmers. Scan for patterns & qualifiers that represent a problem & the report can be used as a check list during editing & to make notes about problem situations.

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

28G1. MVSJCL2: Special Considerations, Problems & Solutions

IF/ELSE/ENDIF

Considerations for IF/ELSE/ENDIF are similar to those documented on the previous pages for COND. You will probably have to change the test code values inserted by the converter after COBOL program executions.

Here is an example showing both COND & IF, which would be unlikely since the COND would probably have been removed when IF tests were added.

sample JCL with IF & COND

 j#01 //JGL420   JOB  (1234),'TEST MVS JCL CONVERSION'
 j#02 //* DEMO IF/THEN/ENDIF & CONDITION CODES
 j#03 //STEP010  EXEC PGM=COBOL1
 j#04 //SYSUT1   DD   DSN=GL.ACCOUNT.MASTER(0),DISP=SHR
 j#05 //SYSUT2   DD   DSN=&&TEMPGLM,DISP=(NEW,PASS),DCB=(LRECL=80)
 j#06 //*
 j#07 // IF (RC LE 4) THEN
 j#08 //STEP020  EXEC PGM=COBOL2,COND=(4,LT,STEP010)
 j#09 //TEMPGLM  DD   DSN=&&TEMPGLM,DISP=(OLD,PASS)
 j#10 //ACNTMAS  DD   DSN=GL.ACCOUNT.MASTER(+1),DISP=(NEW,CATLG),LRECL=80
 j#11 // ENDIF

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

28G2. MVSJCL2: IF/ELSE/ENDIF

Here is the Korn shell script converted from the JCL listed above. The 1st 11 lines & last 10 lines are omitted since they are the same in all jobs.

sample JCL/script with IF & COND

 k#013 #1======================= begin step#S0010 COBOL1 ========================
 k#014 S0010=A
 k#015 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#016 logmsg1 "Begin Step $JSTEP cobol1 (#$XSTEP)"
 k#017 ##STEP010  EXEC PGM=COBOL1
 k#018 export PROGID=cobol1
 k#019 export PARM=""
 k#020 exportgen0 SYSUT1 gl/account.master_ gdg=15
 k#021 exportfile SYSUT2 $JTMP/__tempglm
 k#022 #3----------------------------------------------------------------------
 k#023 cobrun $ANIM $RLX/cobol1
 k#024 #4----------------------------------------------------------------------
 k#025 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 k#026 if ((S0010C >  4))   # modified by COND step S0020
 k#027    then logmsg1 "step#$JSTEP cobol1 abterm $SCC"
 k#028    alias goto="<<S9900=A"; fi
 k#029 goto
 k#030 if ((S0010C <= 4)); then  # IF (RC LE 4) THEN
 k#031 #1======================= begin step#S0020 COBOL2 ========================
 k#032 S0020=A
 k#033 JSTEP=S0020; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 k#034 if ((S0010C <= 4)); then   # COND=(4,LT,STEP010)
 k#035 logmsg1 "Begin Step $JSTEP cobol2 (#$XSTEP)"
 k#036 ##STEP020  EXEC PGM=COBOL2,COND=(4,LT,STEP010)
 k#037 export PROGID=cobol2
 k#038 export PARM=""
 k#039 exportfile TEMPGLM $JTMP/__tempglm
 k#040 exportgen1 ACNTMAS gl/account.master_ gdg=15
 k#041 #3----------------------------------------------------------------------
 k#042 cobrun $ANIM $RLX/cobol2
 k#043 #4----------------------------------------------------------------------
 k#044 LCC=$?; S0020C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0020R=1; alias goto="";
 k#045 fi   #endof: COND=(4,LT,STEP010)
 k#046 if ((S0020C != 0))
 k#047    then logmsg1 "step#$JSTEP cobol2 abterm $SCC"
 k#048    alias goto="<<S9900=A"; fi
 k#049 goto
 k#050 ##*.
 k#051 fi   #ENDIF: IF (RC LE 4) THEN

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

28G3. MVSJCL2: IF/ELSE/ENDIF

note re: 'IF' conversions on previous page


 k#026 if ((S0010C >  4))  #modified by COND step S0020 <-- end step1 status test
       ================================================

 j#07 // IF (RC LE 4) THEN                              <-- JCL IF
      ====================

 k#030 if ((S0010C <= 4)); then  #IF (RC LE 4) THEN     <-- script if
       ============================================

Please note the 'COND' conversions on the previous page:


 j#08 //STEP020 EXEC PGM=COBOL2,COND=(4,LT,STEP010)     <-- JCL COND
      =============================================

 k#034 if ((S0010C <= 4)); then  #COND=(4,LT,STEP010) <-- script equivalent COND
       ==============================================

modifications required

First of all, the 'COND' test should be removed since the IF is the more modern method of testing for conditional step execution.

Note that prior to converter enhancement in May 2006, you had to change the prior step status test from ((S0010C != 0)) or you would never reach the 'IF' test.


 k#026 if ((S0010C != 0))  <-- usual end step status test if no COND following
       ==================      (or prior to May 2006 converter enhancement)

 k#026 if ((S0010C >  4))  #modified by COND step S0020 <-- end step1 status test
       ================================================

The converter usually tests for non-zero after any program execution. The converter now modifies this if following COND's reference a prior step. If step1 fails with return code '> 4', the normal goto AbTerm will occur. But if step1 returns 4 or less, the script will continue to line k#26 where the IF condition for step 2 will be tested.

If the IF were testing for '> 4' then you could simply remove the step1 return code test (lines k#026 to k#029).

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

28G4. MVSJCL2: Special Considerations, Problems & Solutions

Verifying IF conversions

We can verify 'IF' conversions by scanning the converted scripts for a unique pattern to identify the converted IF statement. Don't use just ' IF ' because you would pick up extraneous statements (comments with unrelated ' IF 's).


 00093 if ((S0010C <= 4)); then  # IF RC LE 4 THEN   <-- typical IF conversion
 =================================================

Scanning for '# IF' will detect the desired IF stmnts without many if any extraneous stmnts.

The command line does not allow blanks so we use an underscore in '#_IF' which is changed back to blank internally by the 'u' option of arg1u. You don't have to use the underscore if you wait for the prompt to enter the search patterns.


 uvcopy scan1d,fild1=jcl1,arg1u=#_IF
 ===================================

sample report - scan1d for IF

 Job: scan1d  Dir: ordr3  Search: # IF  Qual1:   Qual2:
  SearchBgn:    SearchEnd:    MatchOps:   UserOps: q1a1b99999c0d256e0p1
 ====================================================== 2004/05/16_18:17:35
 00093 if ((S0010C > 0)); then  # IF RC GT 0 THEN
 00205                   1 hits @EOF: ordr3/ordraa51.ksh
 00128 if ((S0010C < 8)); then  # IF RC < 8 THEN
 00167 if ((S0020C > 4)); then  # IF RC GT 4 THEN
 00202                   2 hits @EOF: ordr3/ordraa52.ksh
 00188 if ((S0030C == 08 || S0030C == 12)); then  # IF (STEP3.RC = 08) OR (STEP3.RC = 12) THEN
 00223 if ((S0030C == 00 || S0030C == 04)); then  # IF (STEP3.RC = 00) OR (STEP3.RC = 04) THEN
 00381 if ((S0080C > 4 || S0090C > 4)); then  # IF (STEP8.RC GT 4) OR (STEP9.RC GT 4) THEN
 00422                   3 hits @EOF: ordr3/ordraa53.ksh
 00129 if ((ABEND)); then  # IF (ABEND) THEN
 00131 ERR+ if ((ABEND)); then  # IF (ABEND) THEN
 00206                   1 hits @EOF: ordr3/ordraa54.ksh
 00098 if ((STEP2.RUN > 0 && S0020C <= 4)); then  # IF (STEP2.RUN AND STEP2.RC LE 4) THEN
 00100 ERR+ if ((STEP2.RUN > 0 && S0020C <= 4)); then  # IF (STEP2.RUN AND STEP2.RC LE 4) THEN
 00173                   1 hits @EOF: ordr3/ordraa55.ksh
 ====================================================== 2004/05/16_16:14:00
  EOD: 00008 hits in 0005 files of 0182 total (29478 lines)

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

28G5. MVSJCL2: Special Considerations, Problems & Solutions

IF Conversion Corrections Required

Please refer to the scan1d for IF report shown on the previous page. You can see that the converter has flagged 2 errors. First we will discuss the 'ABEND':


 00131 ERR+ if ((ABEND)); then  # IF (ABEND) THEN
 ================================================

The converter converts only 'RC' & 'STEPNAME.RC' to the Korn shell equivalent 'S###C' (S0010C, S0020C, etc). 'ABEND' has no equivalent, but you can simply use the 'S###C' symbol already stored by the script.

 cobrun $ANIM $RLX/cobol1
 if ((S0010C != 0))
    then logmsg ...
         goto AbTerm; fi

if ((ABEND)); then ...(abend steps)...

The easy thing to do is to remove the 'logmsg', 'goto AbTerm',& 'if ((ABEND))', and fall into the 'abend steps'.

Now, we will discuss the 2nd ERR shown on the previous page:


 00100 ERR+ if ((STEP2.RUN > 0 && S0020C <= 4)); then  # IF (STEP2.RUN AND STEP2.RC LE 4) THEN
 ============================================================================================

You could init the 'STEP2.RUN' symbol to 0 before the step, set it to '1' after the step has been executed,& then test it as shown above.

 STEP2.RUN=0
 cobrun $ANIM $RLX/cobol2
 if ((S002 > 4))
    then logmsg ...
         goto AbTerm; fi
 STEP2.RUN=1

if ((STEP2.RUN > 0 && S0020C <= 4)); then #IF (STEP2.RUN AND STEP2.RC LE 4) THEN ...................

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

28G6. MVSJCL2: Special Considerations, Problems & Solutions

IF Conversion Corrections Required

Note that the JCL converter ignores the parenthesis on 'IF's with complex AND/OR conditions. For example, consider the following JCL & script equivalent:

 // IF ((STEP1.RC GT 4) OR (STEP2.RC GT 4)) AND (STEP3.RC LE 4) THEN
 if ((S0010C > 4 || S0020C > 4 && STEP3 <= 4)); then

The 'AND' condition will not be tested if either of the OR's is TRUE. You could correct as follows:

 if (((S0010C > 4 || S0020C > 4) && STEP3 <= 4)); then

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

28H1. MVSJCL2: Special Considerations, Problems & Solutions

Mass change to JCL/scripts to Modify Generations

Note
  • this tip is now outdated by MVSJCL.htm#Part_5, which uses
  • GDG Indexed control file to specify number of generations per file

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

28I1. MVSJCL2: Problems, Solutions & Special Techniques

Run a JCL/script when input file detected

We will demonstrate a technique used to run a JCL/script when an input data file is detected. This is usually used to run a job when a file is FTP'd to the server. The following files will be used in this demo:

ftrigger51
  • a sample 'trigger detection' script
  • supplied with Vancouver Utilities
  • in /home/uvadm/sf/util/ftrigger51
jcl0/JAR160.jcl
  • demo JCL supplied to illustrate this technique
  • after conversion will be jcls/jar160.ksh
cbl0/CAR100.cbl
  • demo program supplied (executed by JAR160.jcl)
  • after conversion will be cbls/car100.cbl
  • after compile will be cblx/car100.int
  • same as used in other test/demos
customer.master
  • data file supplied to demo this & other jobs
  • supplied in testdata/ar/customer.master
  • we will copy to subdir 'ftp' to trigger jar160.ksh
Note
  • 4 versions of 'ftrigger' script are supplied
ftrigger51
  • has data filename & JCL/script name HARD-CODED
  • must copy/rename/modify for other datafiles & jobnames
  • documented here (28I1-28I4)
ftrigger52
  • general purpose with arguments for datafilename & jobname
  • documented in the following section '28J1'
ftrigger41
  • same as ftrigger51, but for VSE (vs MVS)
ftrigger42
  • same as ftrigger52, but for VSE (vs MVS)

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

28I2. MVSJCL2: Problems, Solutions & Special Techniques

test/demo Operating Instructions


 #1. cd testdata          <-- change to $RUNDATA
     ===========

 #2. mkdir ftp            <-- make subdir 'ftp' (or rm -f ftp/* if present)
     =========

 #3. ftrigger51 &
     ============
     - run the trigger script (will wait for file presence)
     - run in background via '&' OR do following on a 2nd login screen

 #4. cp ar/customer.master ftp
     =========================
     - copy the datafile to the ftp subdir to trigger jar160.ksh JCL/script

 #5. Observe that jar160.ksh runs
     ============================
     - see console log listed below
     - if using 2nd login screen, switch back to the 1st login screen

 #6. ls -l ftp      <-- observe datafile name appended with date:time stamp
     =========

console log - from ftrigger51 & jar160.ksh

 :050402:075519: ftrigger51 waiting for ftp/customer.master to run jar160.ksh
 JAR160:050402:075525: JOB begun=JAR160
 JAR160:050402:075525: RUNDATA=/home/mvstest/testdata
 JAR160:050402:075525: RUNLIBS=/home/mvstest
 JAR160:050402:075525: DW=wrk,DS=sysout/050402
 JAR160:050402:075525: begin step# 001/1 car100
 JAR160:050402:075525: file: CUSTMAS=ftp/customer.master
 JAR160:050402:075525: file: NALIST=ar/customer.nameadrs.list160
 JAR160:050402:075525: JOB=JAR160 Terminated Normally
 :050402:075525: jar160.ksh ran OK & ftp/customer.master renamed to ftp/customer.master_050402:075525

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

28I3. MVSJCL2: Problems, Solutions & Special Techniques

ftrigger51 script

 # ftrigger51 - script to test for a file presence & run a 2nd script
 #            - could use to run a JCL/script when a file is FTP'd to server
 #            - by Owen Townsend, March 30/2005
 #            - 2 versions of this script (ftrigger51 & ftrigger52)
 #*ftrigger51 - simple version with hard-coded filename & jobname
 #            - need to copy/rename/modify for other filenames & jobnames
 # ftrigger52 - general purpose version with 2 args for filename & jobname
 #       NOTE - these versions for MVS, see ftrigger41 & ftrigger42 for VSE
 #            - only difference is jobset51 for MVS & jobset4 for VSE
 #
 jobset51;    # call setup function common to all JCL/scripts
 #           # changes directory to $RUNDATA (with subdirs ftp, etc)
 #           # allows use of logmsg, etc
 #
 # assign variables for hard-coded file/job names up front in 1 place only
 # - to make script easier to copy/rename/modify for other filenames/jobnames
 file1="ftp/customer.master"     # hard-code filename here (1 place only)
 script1="jar160.ksh"            # hard-code jobname here (1 place only)
 #
 logmsg "$0 waiting for $file1 to run $script1"
 #
 # sleep 2 seconds repeatedly, until the arg1 file is detected
 until [[ -f $file1 ]]
    do sleep 2
    done
 #
 # file presence detected - run arg2 JCL/script & rename the file
 file2=${file1}_$(date +%y%m%d:%H%M%S)  # add _date:time stamp on filename
 #
 $script1        # run the JCL/script with no arguments (vs ftrigger52)
 #=======
 cc=$?           # capture return status
 if (($cc != 0))
    then logmsg "$script1 $file1 FAILED (return code $cc)"; exit $cc; fi
 #
 mv $file1 $file2   # rename the input file (so we can rerun this script)
 #
 logmsg "$script1 ran OK & $file1 renamed to $file2"
 exit 0
 #

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

28I4. MVSJCL2: Problems, Solutions & Special Techniques

jcl0/JAR160 - before conversion

 //JAR160   JOB  (1234),'TEST MVS2UNIX CONVERSION SPECIAL TECHNIQUE'     00000010
 //*  TEST/DEMO JCL/SCRIPT TO BE RUN WHEN A FILE IS FTP'D TO THE SERVER  00000020
 //*  - SCRIPTS FTRIGGER1/2 TEST FOR PRESENCE OF FTP/CUSTOMER.MASTER     00000030
 //*  - FTRIGGER1 IS SIMPLE VERSION WITH HARD-CODED FILENAMES/JOBNAMES   00000040
 //*  - FTRIGGER2 IS GENERAL PURPOSE WITH 2 ARGS FOR FILENAME & JOBNAME  00000050
 //*  - FTRIGGER2 REQUIRES CHANGING FILENAME IN CONVERTED SCRIPT TO "$1" 00000060
 //*  - AFTER JOB RUNS, FTRIGGER1/2 APPENDS DATE:TIME STAMP TO FILE      00000070
 //*  - SEE DOCUMENTATION ON PAGE 28I1 OF WWW.UVSOFTWARE.CA/MVSJCL.HTM   00000080
 //STEP010  EXEC PGM=CAR100                                              00000090
 //CUSTMAS  DD DSN=FTP.CUSTOMER.MASTER,DISP=SHR                          00000100
 //NALIST   DD DSN=AR.CUSTOMER.NAMEADRS.LIST160,DISP=(,CATLG,DELETE),    00000110
 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),                       00000120
 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)         00000130

jcls/jar160.ksh - essential lines only

 #!/bin/ksh
 ##JAR160   JOB  (1234),'TEST MVS2UNIX CONVERSION SPECIAL TECHNIQUE'
 #
 #             - - - - - 41 lines omitted - - - - -
 #
 exportfile CUSTMAS ftp/customer.master
 exportfile NALIST ar/customer.nameadrs.list160
 #3----------------------------------------------------------------------
 cobrun $ANIM $RLX/car100
 #4----------------------------------------------------------------------
 #
 #             - - - - - 14 lines omitted - - - - -
 #

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

28J1. MVSJCL2: Problems, Solutions & Special Techniques

Run a JCL/script when input file detected

We will demonstrate a technique used to run a JCL/script when an input data file is detected. This is usually used to run a job when a file is FTP'd to the server. The following files will be used in this demo:

  1. ftrigger52 - a sample 'trigger detection' script - supplied with Vancouver Utilities - in /home/uvadm/sf/util/ftrigger52

  2. jcl0/JAR160.jcl - demo JCL supplied to illustrate this technique - after conversion will be jcls/jar160.ksh

  3. cbl0/CAR100.cbl - demo program supplied (executed by JAR160.jcl) - after conversion will be cbls/car100.cbl - after compile will be cblx/car100.int - same as used in other test/demos

  4. customer.master - data file supplied to demo this & other jobs - supplied in testdata/ar/customer.master - we will copy to subdir 'ftp' to trigger jar160.ksh
Note
  • 4 versions of 'ftrigger' script are supplied
ftrigger51
  • has data filename & JCL/script name HARD-CODED
  • must copy/rename/modify for other datafiles & jobnames
  • documented in previous section '28I1'
ftrigger52
  • general purpose with arguments for datafilename & jobname
  • documented here (28J1-28J4)
ftrigger41
  • same as ftrigger51, but for VSE (vs MVS)
ftrigger42
  • same as ftrigger52, but for VSE (vs MVS)

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

28J2. MVSJCL2: Problems, Solutions & Special Techniques

test/demo Operating Instructions


 #1. vi jcls/jar160.ksh   <-- modify for demo
     ==================
   - replace original line #2 with 2 lines:
     delete: if [ -n "$1" ]; then export $*; fi           #<- delete orig line2
        add: export CUSTMAS=ar/customer.master            #default for CUSTMAS
        add: if [ -n "$1" ]; then export CUSTMAS="$1"; fi #export if on cmd line
   - modify original line#44:
       from: exportfile CUSTMAS ar/customer.master        #<- modify orig line44
         to: exportfile CUSTMAS "$CUSTMAS"                #<- $symbol filename

# Note - original line above modified as below for 'ftrigger52' test


 #2. cd testdata          <-- change to $RUNDATA
     ===========

 #3. mkdir ftp            <-- make subdir 'ftp' (or rm -f ftp/* if present)
     =========

 #4. ftrigger52 ftp/customer.master jar160.ksh &
     ===========================================
     - run the trigger script (will wait for file presence)
     - run in background via '&' OR do following on a 2nd login screen

 #5. cp ar/customer.master ftp
     =========================
     - copy the datafile to the ftp subdir to trigger jar160.ksh JCL/script

 #6. Observe that jar160.ksh runs
     ============================
     - see console log listed below
     - if using 2nd login screen, switch back to the 1st login screen

 #7. ls -l ftp      <-- observe datafile name appended with date:time stamp
     =========

console log - from ftrigger52 & jar160.ksh

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

28J3. MVSJCL2: Problems, Solutions & Special Techniques

ftrigger52 script

 # ftrigger52 - script to test for a file presence & run a 2nd script
 #            - could use to run a JCL/script when a file is FTP'd to server
 #            - by Owen Townsend, March 30/2005
 #            - 2 versions of this script (ftrigger51 & ftrigger52)
 # ftrigger51 - simple version with hard-coded filename & jobname
 #            - would need to copy/rename/modify for other filenames & jobnames
 #*ftrigger52 - general purpose version with 2 args for filename/jobname
 #       NOTE - these versions for MVS, see ftrigger41 & ftrigger42 for VSE
 #            - only difference is jobset51 for MVS & jobset4 for VSE
 #
 jobset51;    # call setup function common to all JCL/scripts
 #           - changes directory to $RUNDATA & allows use of logmsg, etc
 #
 if [[ -n "$1" && -n "$2" ]]; then :
 else echo "usage: ftrigger52 filename JCL/script  <-- 2 arguments must be coded"
      echo "       ============================="
      echo "example: ftrigger52 ftp/customer.master jar160.ksh"
      echo "         ========================================"
      exit 1; fi
 #
 file1=$1; script1=$2;   # name the variables
 logmsg "$0 waiting for $file1 to run $script1"
 #
 # sleep 2 seconds repeatedly, until the arg1 file is detected
 until [[ -f $file1 ]]
    do sleep 2
    done
 #
 # file presence detected - run arg2 JCL/script & rename the file
 file2=${file1}_$(date +%y%m%d:%H%M%S)  # add _date:time stamp on filename
 #
 $script1 $file1    # run the JCL/script with filename as arg1
 #==============
 cc=$?              # capture return status
 if (($cc != 0))
    then logmsg "$script1 $file1 FAILED (return code $cc)"; exit $cc; fi
 #
 mv $file1 $file2   # rename the input file (so we can rerun this script)
 #
 logmsg "$script1 ran OK & $file1 renamed to $file2"
 exit 0
 #

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

28J4. MVSJCL2: Problems, Solutions & Special Techniques

jcl0/JAR160 - before conversion

 //JAR160   JOB  (1234),'TEST MVS2UNIX CONVERSION SPECIAL TECHNIQUE'     00000010
 //*  TEST/DEMO JCL/SCRIPT TO BE RUN WHEN A FILE IS FTP'D TO THE SERVER  00000020
 //*  - SCRIPTS FTRIGGER1/2 TEST FOR PRESENCE OF FTP/CUSTOMER.MASTER     00000030
 //*  - FTRIGGER1 IS SIMPLE VERSION WITH HARD-CODED FILENAMES/JOBNAMES   00000040
 //*  - FTRIGGER2 IS GENERAL PURPOSE WITH 2 ARGS FOR FILENAME & JOBNAME  00000050
 //*  - FTRIGGER2 REQUIRES CHANGING FILENAME IN CONVERTED SCRIPT TO "$1" 00000060
 //*  - AFTER JOB RUNS, FTRIGGER1/2 APPENDS DATE:TIME STAMP TO FILE      00000070
 //*  - SEE DOCUMENTATION ON PAGE 28I1 OF WWW.UVSOFTWARE.CA/MVSJCL.HTM   00000080
 //STEP010  EXEC PGM=CAR100                                              00000090
 //CUSTMAS  DD DSN=FTP.CUSTOMER.MASTER,DISP=SHR                          00000100
 //NALIST   DD DSN=AR.CUSTOMER.NAMEADRS.LIST160,DISP=(,CATLG,DELETE),    00000110
 //            UNIT=DISK,SPACE=(TRK,(25,25),RLSE),                       00000120
 //            DCB=(MODEL.DSCB,LRECL=133,BLKSIZE=6118,RECFM=FBA)         00000130

jcls/jar160.ksh - after convert & modify

Note
  • we will show only the 1st few lines (with modification)
  • then the line #44 modification & the essential step coding
 #!/bin/ksh
 ##JAR160   JOB  (1234),'TEST MVS2UNIX CONVERSION SPECIAL TECHNIQUE'
 #
 ## if [ -n "$1" ]; then export $*; fi   ##<-- original line #2 deleted
 export CUSTMAS=ar/customer.master  # establish default for CUSTMAS
 if [ -n "$1" ]; then export CUSTMAS="$1"; fi
 #Note - above 2 lines replace original line #2
 #     - so CUSTMAS filename may be specified by arg1 on command line
 #     - see 2nd modification below on origianl line #44
 #
 #          - - - - - 40 lines omitted - - - - -
 #
 ## exportfile CUSTMAS ar/customer.master  ##<-- original line #44 modified
 # Note - original line above modified as below for 'ftrigger2' test
 exportfile CUSTMAS "$CUSTMAS"
 #
 exportfile NALIST ar/customer.nameadrs.list160
 #3----------------------------------------------------------------------
 cobrun $ANIM $RLX/car100
 #4----------------------------------------------------------------------
 #
 #          - - - - - 14 lines omitted - - - - -
 #

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

28K1. MVSJCL2: Problems, Solutions & Special Techniques

ftpgdg1 - detect/rename FTP'd files

The 'ftpgdg1' script is designed to detect files FTP'd from remote sites & move them to a 2nd directory, renaming to prevent overwriting existing files.

The remote site should name their files with a trailing underscore '_', so we can use the 'exportgen1' function (listed on page '5J2' of MVSJCL.doc).

'exportgen1' is the Vancouver Utility function to replace the mainframe 'GDG' function. It replaces the trailing '_' with '_000001' if there is no existing matching filename, or assign the next 6 digit sequential number if there is an existing match.

The 'ftpgdg1' script is listed on page '28K3' & the next page '28K2' shows how I tested it at UV Software. This assumes you have installed the Vancouver Utilities as instructed in install.htm.

You should have already run the test/demos in MVSJCL.htm#Part_1 to prove that all required components have been installed correctly (exportgen1, jobset51, .bash_profile, common_profile, etc). Be sure you test 'jgl300.ksh' (on page '1G1') since it uses the 'exportgen1' function.

MVSJCL.htm#Part_1 instructed you to setup userid 'mvstest' for those tests. We will use the mvstest home directories to test ftpgdg1. See the mvstest subdirs listed on page '1A1'.

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

28K2. MVSJCL2: Problems, Solutions & Special Techniques

testing ftpgdg1


 #1. login as mvstest ---> /home/mvstest

 #2. cd testdata ---> /home/mvstest/testdata = $RUNDATA (defined in profile)
     ===========

 #3. mkdir ftp0 ftp1 ftp2    <-- make subdirs for test
     ====================

 #4a. echo "ftpgdg_test1" > ftp0/ftpgdg_test1_
      ========================================
 #4b. echo "ftpgdg_test2" > ftp0/ftpgdg_test2_
      ========================================
      - make some test files in ftp0, to copy into ftp1 to rerun tests

 #5. cp ftp0/* ftp1     <-- store test files for 1st test
     ==============

 #6. ftpgdg1 &          <-- run 1st test ('&' runs job in background)
     =========            - observe console messages
     - should see msg that files have been moved/renamed as
       ftpgdg_test1_000001 & ftpgdg_test2_000001

 #7. touch ftp1/ftpgdg_stop  <-- create stop file (tested by script loop)
     ======================

 #8. cp ftp0/* ftp1     <-- store test files for 2nd test
     ==============

 #9. ftpgdg1 &          <-- run 2nd test
     =========            - observe console messages
     - should see msg that files have been moved/renamed as
       ftpgdg_test1_000002 & ftpgdg_test2_000002

 #10. touch ftp1/ftpgdg_stop  <-- create stop file to halt 2nd test
      ======================

 #11. ls -l ftp*         <-- list files in all 3 subdirs
      ==========

ftp* subdirs after 2 tests

 ftp0:
 -rw-rw-r--    1 mvstest  users          12 May 21 18:25 ftpgdg_test1_
 -rw-rw-r--    1 mvstest  users          12 May 21 18:25 ftpgdg_test2_
 ftp1:
 -rw-rw-r--    1 mvstest  users           0 May 21 18:31 ftpgdg1_stop
 ftp2:
 -rw-rw-r--    1 mvstest  users          12 May 21 18:25 ftpgdg_test1_000001
 -rw-rw-r--    1 mvstest  users          12 May 21 18:27 ftpgdg_test1_000002
 -rw-rw-r--    1 mvstest  users          12 May 21 18:25 ftpgdg_test2_000001
 -rw-rw-r--    1 mvstest  users          12 May 21 18:27 ftpgdg_test2_000002

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

28K3. MVSJCL2: Problems, Solutions & Special Techniques

ftpgdg1 - script listing

 #!/bin/ksh
 # ftpgdg1 - script to test for FTP file arrival & move/rename to 2nd dir
 #         - by Owen Townsend, 20070521, see www.uvsoftware.ca/mvstest.htm#28K1
 #
 # ftpgdg1 &   #<-- run this script (in the background)
 # =========      - runs until killed or 'stop' file detected
 #
 # Remote sites FTP files should identify GDG files with trailing '_'
 # - GDG convention on IBM MVS mainframes was (+1)
 # - Vancouver Utility functions identify GDG files with trailing '_'
 # - this script runs in background looking for such files in subdir ftp1/...
 # - when detected, move/rename to subdir ftp2/... using exportgen1 function
 #   which will replace the '_' suffix with '_000001' if no match exists
 #   or assign next 6 digit number if that filename already exists in ftp2/...
 #
 JOBID1=ftpgdg1; JOBID2=ftpgdg1; # jobset51 uses JOBID2
 autoload jobset51 exportgen1    #<-- load ksh functions
 jobset51                        #<-- to init Van Util JCL/scripts
 #=======                           - see notes at bottom this script
 #                                  - cd $RUNDATA with subdirs ftp1 & ftp2
 echo "$0 waiting for files in ftp1/... with trailing '_'"
 echo "- will move/rename from ftp1/ to ftp2/ using exportgen1"
 echo "- will replace trailing '_' with '_000001' if no match in ftp2/..."
 echo "- or will assign next 6 digit sequence# if matching filenames exist"
 rm -f ftp1/ftpgdg1_stop # remove any old stop file
 integer fcnt=0          # to count files moved/renamed from ftp1 to ftp2
 # sleep 2 seconds repeatedly, until the 'stop' file detected
 until [[ -f ftp1/ftpgdg1_stop ]]
   do sleep 2
   for dfx in ftp1/*
     { if [[ $dfx == *_ ]]; then
          fx=$(basename $dfx)
          exportgen1 FTP2 ftp2/$fx   # assign filename with seq# suffix
          #=======================
          mv $dfx $FTP2              # move input ftp1/... to output ftp2/...
          #============
          ((fcnt++))
          echo "#$fcnt - $dfx moved/renamed to $FTP2"
       fi
     }
   done
 echo "$0 terminated by detection of stop file"
 echo "$fcnt files moved/renamed from ftp1/ to ftp2/..."
 exit 0
 #------------- pre-requisites for this script ---------------
 # exportgen1 - Korn shell function to determine next GDG#
 #            - see www.uvsoftware.ca/mvsjcl.htm#5J2
 # common_profile - profiles used with exportgen1
 #           - see www.uvsoftware.ca/mvsjcl.htm#3B2
 #           - define FPATH to locate exportgen1 (export FPATH=$RUNLIBS/sfun)
 # jobset51  - JCL/script init function
 #           - see www.uvsoftware.ca/mvsjcl.htm#3C1
 #           - changes to $RUNDATA (defined in profile)
 #           - sets up tmp subdir used by exportgen1

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

28L1. MVSJCL2: Problems, Solutions & Special Techniques

converting JCL from ESP workload scheduler

ESP (Enterprise System Platform) is a mainframe JOB scheduling package from Cybermatic Inc. JCL prepared for ESP may contain '%symbols' & '%INCLUDE IF's that are processed dynamically by ESP before job submission.

UV Software provides 2 uvcopy jobs to perform this processing for users who wish to convert the ESP JCL to Korn shell scripts.

The 1st job extracts the %symbols & writes them to a control file, to allow you to specify desired replacements. The 2nd job replaces the 'cleanup' step of the normal conversion process (documented on page '1Q1').

normal JCL conversion

 jcl0 --------------> jcl1 --------------> jcl2 -----------------> jcl3
         cleanup           PROC expansion       convert to script

ESP JCL conversion

  1. jcl0 -----------> ctl/jobname.esp <-- create control file of %symbols espjcl21

 2. vi ctl/jobname.esp    <-- edit control file with desired substitutions
    ==================
  1. jcl0 --------------> jcl1 --------------> jcl2 -----------------> jcl3 espjcl22 PROC expansion convert to script

    scripts for normal & ESP JCL conversion

jcl2ksh51
  • convert any 1 normal JCL from jcl0 thru all steps to jcl3
jcl2ksh5A
  • convert all JCLs in jcl0 thru all steps to jcl3
jcl2ksh52
  • convert any 1 ESP JCL from jcl0 thru all steps to jcl3
jcl2ksh5B
  • convert all ESP JCLs in jcl0 thru all steps to jcl3

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

28M1. MVSJCL2: Problems, Solutions & Special Techniques

Converting JCL with BMC Control-M scheduler %%coding

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

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

If you do not want to retain Control-M coding, UV Software can supply uvcopy jobs to strip out the %%symbols, or replace them with $symbols for unix/linux.

ctlmjcl51
  • extract %%symbols from Control-M JCL (step 1 of 2 steps)
  • for Control-M JCL copy & %%symbol substitute (ctlmjcl52 follows)
  • ctlmjcl51 performs following (in preparation for 'ctlmjcl52')
ctlmjcl52
  • Control-M JCL processor for JCL/scripts converted from JCL
  • when JCL contained embedded control-M statements & %%symbols
  • copies the converted JCL/script, substituting %% symbols
  • processing %%IF's to include or drop JCL/script lines

double percent symbols cause printing problems

'control-M' uses double percents '%%' to identify symbols for substitution.

Double percents will print as '%.' (percent+period) in this documentation, because double is a 'postscript' controls sequence & may cause printing problems.

The 'uvlist' utility (& it's scripts such as uvlp12D) are used to print this documentation & it has an option to make this conversion (double percent to '%.'). Option 'x' is on by default (x1), but you turn off if you wish (x0). See uvlist.htm#C1 for all uvlist options.

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

28M2. MVSJCL2: Problems, Solutions & Special Techniques

Operating Instrns - for 1 JCL at a time


 1. jcl2ksh51 jcl0/HPHRECON3 <-- convert JCL from jcl0 -> jcl1 -> jcl2 -> jcl3
    ========================

 2. uvcopy ctlmjcl51,fili1=jcl0/HPHRECON3[,filo1=ctlm/hphrecon3.cm]
    ===============================================================
    - ctlmjcl52 is preceded with ctlmjcl51 to create the %%symbol/value table
    - no need to key [,filo1=...] since it defaults to fili1 basename

 3. vi ctlm/hphrecon3.cm  <-- edit symbol/value control file
    ====================    - replace right hand values as desired

 4. uvcopy ctlmjcl52,fili1=jcl3/HPHRECON3 <-- this job (enter only fili1=...)
    =====================================
              [,filo1=jcls/hphrecon3.jcl,fili2=ctlm/hphrecon3.cm]
              ===================================================

Operating Instrns - for ALL JCLs in directory


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

 2. uvcopyx ctlmjcl51 jcl3 ctlm uop=q0i7j2
    ======================================
    - ctlmjcl51 creates %%symbol/value search/replace tables for all JCL/scripts

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

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

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

28M3. MVSJCL2: Problems, Solutions & Special Techniques

sample JCL to demo control-M processor

 %%SET %%ON = %%SUBSTR %%FILE1%%ODATE 1 4              <-- front end %%code
 %%IF %%LVL EQ P                                       <-- %%LVL = 'P' or 'T'
   %%LIBSYM WIN.JOBPROD.SYMLIB %%MEMSYM HPH2937B
   %%SET %%JOBCARD = 6666-6666-%%YLOC
 %%ENDIF
 %%IF %%LVL EQ T
   %%LIBSYM WIN.SMR.JOBTEST.SYMLIB %%MEMSYM HPH2937B
   %%SET %%JOBCARD = 4444-4444-%%YLOC
 %%ENDIF
 //HPHRECON JOB '%%JOBCARD%%.%%LVL%%.01,HPH METRICS'
 //BKUPLDWK EXEC PGM=SORT
 %%IF %%LVL EQ T                                       <-- test 'T' or 'P' ?
 //SORTIN   DD DSN=WIN%%LVL%%.V.SMR.RECONT,DISP=SHR    <-- included if 'T'
 %%ELSE
 //SORTIN   DD DSN=WIN%%LVL%%.V.SMR.RECONP,DISP=SHR    <-- else this
 %%ENDIF
 //SORTOUT  DD DSN=WIN%%LVL.SMR.HPH%%ON.RECON          <-- %%symbols will sub
 //SYSIN    DD *                                           (see later scripts)
     SORT FIELDS=(1,10,CH,A)
 /*

ctlm/hphrecon3.cm search/replace table

 %%$CENTURY~~~~~~~~~~~~~~~001~~%%$CENTURY~~~~~~~~~~~~~~~~~~~~
 %%FFILE~~~~~~~~~~~~~~~~~~006~~WINT~~~~~~~~~~~~~~~~~~~~~~~~~~
 %%LVL~~~~~~~~~~~~~~~~~~~~030~~P~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 %.ON~~~~~~~~~~~~~~~~~~~~~027~~2937~~~~~~~~~~~~~~~~~~~~~~~~~~
Note
  • search/replace table generated by uvcopy 'ctlmjcl51'
  • generated with right side symbols same as left side
  • the 001,003,etc are occurrences, ignored for substitutions
  • manually edited to insert desired values on right side
  • for demo we make %%LVL 'T' for Test (vs 'P' for Production)
  • we made other %%symbols __symbols jsut to prove substitutions work
Note
  • I had to code last line above as '%.ON' to print this documentation
  • because that sequence is a laser printer 'postscript' command

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

28M4. MVSJCL2: Problems, Solutions & Special Techniques

jcl3/hphrecon3.ksh - converted script BEFORE control-M process

 #!/bin/ksh
 # *HPHRECON3 JOB
 %%SET %%ON = %%SUBSTR %%FILE1%%ODATE 1 4
 %%IF %%LVL EQ P
   %%LIBSYM WIN.JOBPROD.SYMLIB %%MEMSYM HPH2937B
   %%SET %%JOBCARD = 6666-6666-%%YLOC
 %%ENDIF
 %%IF %%LVL EQ T
   %%LIBSYM WIN.SMR.JOBTEST.SYMLIB %%MEMSYM HPH2937B
   %%SET %%JOBCARD = 4444-4444-%%YLOC
 %%ENDIF
 ##HPHRECON JOB '%%JOBCARD%%.%%LVL%%.01,HPH METRICS'
 # ... 11 lines omittted (standard JCL converter front end boiler plate) ...
 #1======================= begin step#S0010 SORT ============================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg1 "Begin Step $JSTEP SORT (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 ##BKUPLDWK EXEC PGM=SORT
 export PROGID=SORT
 export PARM=""
 %%IF %%LVL EQ T                               <-- %%LVL is 'T' in table above
 exportfile SORTIN WIN%%LVL%%/V.SMR.RECONT     <-- this file will be included
 %%ELSE
 exportfile SORTIN WIN%%LVL%%/V.SMR.RECONP     <-- NOT this file
 %%ENDIF
 exportfile SORTOUT WIN%%LVL/SMR.HPH%%ON.RECON <-- %%symbols will be replaced
 export SYSIN=$DJ/${JSTEP}_${PROGID}_SYSIN
 cat > $SYSIN <</*
     SORT FIELDS=(1,10,CH,A)
 /*
 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=99999,filo1=$SORTOUT,typ=RSF,rcs=99999,\
 keys=(0,10,c,a)"
 #4----------------------------------------------------------------------
 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0060R=1; alias goto="";
 if ((S0010C != 0))
    then logmsg1 "step#$JSTEP SORT abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
 # ... 10 lines omittted (standard JCL converter back end boiler plate) ...

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

28M5. MVSJCL2: Problems, Solutions & Special Techniques

jcl3/hphrecon3.ksh - converted script AFTER control-M process

 #!/bin/ksh
 # *HPHRECON3 JOB
 #_%%SET %%ON = %%SUBSTR %%FILE1%%ODATE 1 4    <-- table replace %%ON with 2937
 #_%%IF %%LVL EQ P
 #_  %%LIBSYM WIN.JOBPROD.SYMLIB %%MEMSYM HPH2937B
 #_  %%SET %%JOBCARD = 6666-6666-%%YLOC
 #_%%ENDIF
 #_%%IF %%LVL EQ T                                      <-- %%LVL = T in table
 #_  %%LIBSYM WIN.SMR.JOBTEST.SYMLIB %%MEMSYM HPH2937B
 #_  %%SET %%JOBCARD = 4444-4444-%%YLOC
 #_%%ENDIF
 ##HPHRECON JOB '%%JOBCARD%%LVL01,HPH METRICS'
 # ... 11 lines omittted (standard JCL converter front end boiler plate) ...
 #1======================= begin step#S0010 SORT ========================
 S0010=A
 JSTEP=S0010; ((XSTEP+=1)); SCC=0; LCC=0; alias goto="";
 logmsg1 "Begin Step $JSTEP SORT (#$XSTEP)"
 stepctl51  # test oprtr jcpause/jcclear
 ##BKUPLDWK EXEC PGM=SORT
 export PROGID=SORT
 export PARM=""
 #_%%IF %%LVL EQ T
 #_%%IF T EQ T                              <-- %%IF shown again with value
 exportfile SORTIN WINT/V.SMR.RECONT        <-- 'T'est file included
 #_%%ELSE                                   <-- 'P'rod file omitted
 #_%%ENDIF
 exportfile SORTOUT WINT/SMR.HPH2937.RECON  <-- %%LVL rep by 'T' %%ON/2937
 export SYSIN=$DJ/${JSTEP}_${PROGID}_SYSIN
 cat > $SYSIN <</*
     SORT FIELDS=(1,10,CH,A)
 /*
 #3----------------------------------------------------------------------
 uvsort "fili1=$SORTIN,typ=RSF,rcs=99999,filo1=$SORTOUT,typ=RSF,rcs=99999,\
 keys=(0,10,c,a)"
 #4----------------------------------------------------------------------
 LCC=$?; S0010C=$LCC; ((SCC+=LCC)); ((JCC+=LCC)); S0010R=1; alias goto="";
 if ((S0010C != 0))
    then logmsg1 "step#$JSTEP SORT abterm $SCC"
    alias goto="<<S9900=A"; fi
 goto
 # ... 10 lines omittted (standard JCL converter back end boiler plate) ...
Note
  • this uvcopy control-M processor is not perfect
  • but does save a lot of manual editing
  • if you want to test the converted scripts without having control-M

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

28X0. MVSJCL2: Miscellaneous Problems & Solutions

This section is a place to document 'short story' problems & solutions. These may be short, but they can be serious if you do not recognize the problem.


28X1. Carriage Returns in Korn shell scripts cause problems

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

28X1. MVSJCL2: Miscellaneous Problems & Solutions

Carriage Returns in Korn shell scripts

Here is a script that had me scratching my head. Even when I reduced it to the 2 lines shown below, I got an error "ksh - cannot execute".

#!/bin/ksh # test1 - why do I get error "ksh - cannot execute" echo "hello world"

Of course I checked the permissions, and the excute bits were set. When you cant see anything wrong, it is a good idea to change your view. So I examined with uvhd with option 't' for text & 'h2' to force hex display.


 uvhd jcls/test1 th2   <-- uvhd with option 't'(text) & 'h2'(force hex)
 ===================
                      10        20        30        40        50        60
 r#        1 0123456789012345678901234567890123456789012345678901234567890123
           0 #!/bin/ksh..
             222666267600
             31F29EFB38DA

Notice that the vital 1st line that specifies ksh ends with CR+LF x'0D'+x'0A'. The CR x'0D' caused the error, at least on my Linux Red Hat Enterprise 3.0. ksh 1993 was downloaded from www.kornshell.com.

Sometimes the 'vi' editor will show the Carriage Return as '^M', but it did not in this case, so I could not see anything wrong until I used uvhd.

Removing CR's from text files

Linux systems supply utilities 'dos2unix' to remove CR's from & 'unix2dos' to insert CR's into text files. These utilities write to stdout, so use '>' to redirect to a file, for example:


 dos2unix jcls/test1 >tmp/test1  <-- remove CR's during copy out to tmp subdir
 ==============================

 cp tmp/test1 jcls               <-- copy back to original subdir
 =================

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

Permuted Index of Keywords from ** Headings **

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

28M1 %%coding: Converting JCL with BMC Control-M scheduler %%coding

27B1 Advantages: grep advantages/disadvantages
27F2 Alldiff: verify results with 'alldiff'
27G2 Alldiff: verify changes with alldiff script
27L1 Alldiff: sample alldiff report
26E1 Allowed: SORT - OMITs & INCLUDEs in same step not allowed
27I1 Analysis: table3d - General Purpose Keyword Analysis
26B1 And: SYNCSORT - with INCLUDE AND/OR CONDitions
26B1 And: uvsort equivalent - select AND/OR CONDitions
28D1 Appending: Correction for files with generation(0) & DISP=MOD (appending)
27F2 Audit: sample rep1d audit file
27G2 Audit: sample rep2d Audit report
28E1 Automatic: sample concatenated data set - AFTER automatic conversion

27L1 Background: Background
28M1 Bmc: Converting JCL with BMC Control-M scheduler %%coding
26K2 Byte: 2. SYSIN module - 2000 * 14 byte INCLUDE CONDitions

26J5 Called: uvcopy parameter file (called following the uvsort
26K2 Calling: 1. Mainframe SORT calling SYSIN module
26K4 Calling: 5. modified JCL/script, calling 'uvcopy' to lookup control file
26J3 Card: SYSIN SORT control card module (MMZIP006)
26K5 Card: 5. uvcopy job to lookup control card file for matches
26K2 Cards: 3. numbers only control cards - SORT CONDitions stripped out
28X1 Carriage: Carriage Returns in Korn shell scripts
28A1 Cataloged: Cataloged Generation files
28A4 Cataloged: 9. Cataloged Generation files - caveats
28M1 Cause: double percent symbols cause printing problems
28A4 Caveats: 9. Cataloged Generation files - caveats
28C3 Commands: 'rm' commands created by logxgen1
28E1 Concatenated: Concatenated Data Sets
28E1 Concatenated: sample concatenated data set - IBM JCL
28E1 Concatenated: sample concatenated data set - AFTER automatic conversion
28G1 Cond: sample JCL with IF & COND
28G2 Cond: sample JCL/script with IF & COND
28F1 Condition: CONDition test Investigation & Modification
28F1 Condition: Confused about CONDition tests
28F2 Condition: sample JCL/script with CONDition test
28F3 Condition: CONDition Changes Required
28F3 Condition: CONDition test Illustrations
28F4 Condition: CONDition test Investigation & Modification
26B1 Conditions: SYNCSORT - with INCLUDE AND/OR CONDitions
26B1 Conditions: SYNCSORT with INCLUDE 'OR' CONDitions
26B1 Conditions: uvsort equivalent - select AND/OR CONDitions
26K2 Conditions: 2. SYSIN module - 2000 * 14 byte INCLUDE CONDitions
26K2 Conditions: 3. numbers only control cards - SORT CONDitions stripped out
28C1 Considerations: Rerun Considerations for Generation files
28C2 Console: using the console log to determine file removes for reruns
28I2 Console: log - from ftrigger51 & jar160.ksh
28J2 Console: log - from ftrigger52 & jar160.ksh
26J3 Control: SYSIN SORT control card module (MMZIP006)
26K2 Control: 3. numbers only control cards - SORT CONDitions stripped out
26K4 Control: 5. modified JCL/script, calling 'uvcopy' to lookup control file
26K5 Control: 5. uvcopy job to lookup control card file for matches
28M1 Control-m: Converting JCL with BMC Control-M scheduler %%coding
28M3 Control-m: sample JCL to demo control-M processor
28M4 Control-m: jcl3/hphrecon3.ksh - converted script BEFORE control-M process
28M5 Control-m: jcl3/hphrecon3.ksh - converted script AFTER control-M process
26K3 Converter: 4. original JCL/script, output from VU JCL/converter
26L2 Converter: sample JCL converted by the SyncSort converter
27H1 Correction: extract/print SORT specs report for inspection/correction
28D1 Correction: Correction for files with generation(0) & DISP=MOD (appending)
26C1 Corrections: SORT - 'INCLUDE's requiring MANUAL Corrections
26D1 Corrections: uvsort equivalent - after manual corrections
28G5 Corrections: IF Conversion Corrections Required
28G6 Corrections: IF Conversion Corrections Required
27I2 Count: table3d ex#2 - summary counts by filename
27J1 Cross-reference: JCL to ctlcdlib module names
27J2 Cross-reference: JCL to ctlcdlib module names
27J1 Ctlcdlib: cross-reference JCL to ctlcdlib module names
27J2 Ctlcdlib: cross-reference JCL to ctlcdlib module names
28M3 Ctlm: ctlm/hphrecon3.cm search/replace table

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

27K2 Data: gen56pk - uvcopy job to generate test data file
28E1 Data: Concatenated Data Sets
28E1 Data: sample concatenated data set - IBM JCL
28E1 Data: sample concatenated data set - AFTER automatic conversion
26H2 Demo: Running splitsl1 demo SORT file split
26H2 Demo: ar/sales.items - test file for demo sort splitsl1
26O1 Demo: FTP 'put' Demo Conversion - Mainframe JCL
26O1 Demo: FTP 'put' demo - converted script
26O2 Demo: FTP 'get' Demo Conversion - Mainframe JCL
26O2 Demo: FTP 'get' demo - converted script
26P1 Demo: FTP PUT Demo Conversion for GDG file
26P1 Demo: FTP PUT Demo Converted script
26P2 Demo: FTP GET Demo Conversion for GDG file
26P2 Demo: FTP GET Demo Converted script
27B1 Demo: 'grep' demo - scan jcls for 1 pattern
27C1 Demo: 'scan1d' demo - scan jcls for 1 pattern
27F1 Demo: 'rep1d' - mass change demo
28I2 Demo: test/demo Operating Instructions
28J2 Demo: test/demo Operating Instructions
28M3 Demo: sample JCL to demo control-M processor
27A3 Demos: preparation for scan/rep test/demos
27E1 Demos: mass change demos
28K1 Detect: ftpgdg1 - detect/rename FTP'd files
28I1 Detected: Run a JCL/script when input file detected
28J1 Detected: Run a JCL/script when input file detected
28A2 Digits: 7. Generation#s now 6 digits
26L1 Directories: Op Instrns - all JCLs in directories
26L1 Directories: used
28M2 Directory: Operating Instrns - for ALL JCLs in directory
27B1 Disadvantages: grep advantages/disadvantages
28D1 Disp=mod: Correction for files with generation(0) & DISP=MOD (appending)
28A3 Does: 8. Generation# does not auto wrap
28M1 Double: percent symbols cause printing problems

26F1 Edit: SORT - OUTREC EDIT/SIGNS require manual changes
28G1 Else: IF/ELSE/ENDIF
28G1 Endif: IF/ELSE/ENDIF
28L1 Esp: ESP JCL conversion
28L1 Esp: converting JCL from ESP workload scheduler
28L1 Esp: scripts for normal & ESP JCL conversion
26A1 Essential: code extracted from script
28I4 Essential: jcls/jar160.ksh - essential lines only
26A1 Example: SORT example - JCL before conversion
27E1 Example: mass change example - using 'sed'
28B1 Exportgenx: scanning JCL/scripts for 'exportgenx'
28B2 Exportgenx: scan for exportgenx - using 'grep'
28B3 Exportgenx: scan for exportgenx - using 'uvcopy scan1d'
27H1 Extract: extract/print SORT specs report for inspection/correction
26A1 Extracted: essential code extracted from script

26G1 Fields: SORT - multiple SUM fields
26G2 Fields: creating a test file - with 56 SUM fields
27I2 Filename: table3d ex#2 - summary counts by filename
28A2 Filenames: sample input filenames in subdir gl
28A3 Filenames: sample input filenames in subdir gl
26J5 Following: uvcopy parameter file (called following the uvsort
26O1 Ftp: FTP 'put' Demo Conversion - Mainframe JCL
26O1 Ftp: FTP 'put' demo - converted script
26O2 Ftp: FTP 'get' Demo Conversion - Mainframe JCL
26O2 Ftp: FTP 'get' demo - converted script
26P1 Ftp: FTP PUT Demo Conversion for GDG file
26P1 Ftp: FTP PUT Demo Converted script
26P1 Ftp: Notes re FTP PUT conversion
26P2 Ftp: FTP GET Demo Conversion for GDG file
26P2 Ftp: FTP GET Demo Converted script
26P2 Ftp: Notes re FTP GET conversion
28K1 Ftp: ftpgdg1 - detect/rename FTP'd files
28K2 Ftp*: subdirs after 2 tests
28K1 Ftpgdg1: - detect/rename FTP'd files
28K2 Ftpgdg1: testing ftpgdg1
28K3 Ftpgdg1: - script listing
28I2 Ftrigger51: console log - from ftrigger51 & jar160.ksh
28I3 Ftrigger51: script
28J2 Ftrigger52: console log - from ftrigger52 & jar160.ksh
28J3 Ftrigger52: script

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

26P1 Gdg: FTP PUT Demo Conversion for GDG file
26P2 Gdg: FTP GET Demo Conversion for GDG file
28A1 Gdg: sample conversion - GDG files (BEFORE & AFTER)
28A1 Gdg: sample conversion - NON GDG files (before & after)
28C3 Gdg: creating a script to remove GDG files for reruns
28A2 Gdg4to6: sample Op. Instrns. for gdg4to6
28A3 Gdgreset6: sample Op. Instrns. for gdgreset6
27K2 Gen56pk: - uvcopy job to generate test data file
27I1 General: table3d - General Purpose Keyword Analysis
27K2 Generate: gen56pk - uvcopy job to generate test data file
27K2 Generated: sample record (key=00000002) in generated test file
28A1 Generation: Cataloged Generation files
28A2 Generation: 7. Generation#s now 6 digits
28A3 Generation: 8. Generation# does not auto wrap
28A4 Generation: 9. Cataloged Generation files - caveats
28C1 Generation: Rerun Considerations for Generation files
28D1 Generation: Correction for files with generation(0) & DISP=MOD (appending)
28B1 Generations: (+2) generations require manual changes
28H1 Generations: Mass change to JCL/scripts to Modify Generations
26O2 Get: FTP 'get' Demo Conversion - Mainframe JCL
26O2 Get: FTP 'get' demo - converted script
26P2 Get: FTP GET Demo Conversion for GDG file
26P2 Get: FTP GET Demo Converted script
26P2 Get: Notes re FTP GET conversion
27A1 Grep: scan/replace jobs more powerful than grep & sed
27B1 Grep: 'grep' demo - scan jcls for 1 pattern
27B1 Grep: advantages/disadvantages
27B1 Grep: sample report from 'grep'
28B2 Grep: sample grep report
28B2 Grep: scan for exportgenx - using 'grep'

28M3 Hphrecon3.cm: ctlm/hphrecon3.cm search/replace table
28M4 Hphrecon3.ksh: jcl3/hphrecon3.ksh - converted script BEFORE control-M process
28M5 Hphrecon3.ksh: jcl3/hphrecon3.ksh - converted script AFTER control-M process

28A4 Ibm: IBM mainframe
28E1 Ibm: sample concatenated data set - IBM JCL
28G3 If: note re 'IF' conversions on previous page
26L1 Illustrate: samples to illustrate merging SyncSort params
28F3 Illustrations: CONDition test Illustrations
26B1 Include: SYNCSORT - with INCLUDE AND/OR CONDitions
26B1 Include: SYNCSORT with INCLUDE 'OR' CONDitions
26C1 Include: SORT - 'INCLUDE's requiring MANUAL Corrections
26D1 Include: SORT - complex INCLUDE manual changes
26J1 Include: SORTs with too many OMIT/INCLUDE patterns
26J2 Include: SORT with too many OMIT/INCLUDE patterns
26K2 Include: 2. SYSIN module - 2000 * 14 byte INCLUDE CONDitions
26E1 Includes: SORT - OMITs & INCLUDEs in same step not allowed
26K1 Includes: SORTs with too many OMIT/INCLUDEs ex# 3
26L4 Inserted: sample output with SyncSort params inserted into VU script
27H1 Inspection: extract/print SORT specs report for inspection/correction
26L1 Instrns: Op Instrns - 1 JCL at a time (testing)
26L1 Instrns: Op Instrns - all JCLs in directories
28M2 Instrns: Operating Instrns - for 1 JCL at a time
28M2 Instrns: Operating Instrns - for ALL JCLs in directory
28A2 Instrns.: sample Op. Instrns. for gdg4to6
28A3 Instrns.: sample Op. Instrns. for gdgreset6
28D1 Instructions: Operating Instructions
28I2 Instructions: test/demo Operating Instructions
28J2 Instructions: test/demo Operating Instructions
28A2 Internal: logic
28A3 Internal: logic
26L1 Into: ssmerge1 - merge SyncSort params into VU JCL/scripts
26L4 Into: sample output with SyncSort params inserted into VU script
28F1 Investigation: CONDition test Investigation & Modification
28F4 Investigation: CONDition test Investigation & Modification

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

28I4 Jar160: jcl0/JAR160 - before conversion
28J4 Jar160: jcl0/JAR160 - before conversion
28I2 Jar160.ksh: console log - from ftrigger51 & jar160.ksh
28I4 Jar160.ksh: jcls/jar160.ksh - essential lines only
28J2 Jar160.ksh: console log - from ftrigger52 & jar160.ksh
28J4 Jar160.ksh: jcls/jar160.ksh - after convert & modify
26L1 Jc: Op Instrns - 1 JCL at a time (testing)

27K2 Key=00000002: sample record (key=00000002) in generated test file
27K3 Key=00000002: sample record (key=00000002) in SORT/SUM output file
27I1 Keyword: table3d - General Purpose Keyword Analysis
28X1 Korn: Carriage Returns in Korn shell scripts

26H3 List: the output files from splitsl1
28K3 Listing: ftpgdg1 - script listing
28C2 Log: using the console log to determine file removes for reruns
28I2 Log: console log - from ftrigger51 & jar160.ksh
28J2 Log: console log - from ftrigger52 & jar160.ksh
26L4 Logic: Logic
28A2 Logic: internal logic
28A3 Logic: internal logic
28C3 Logxgen1: 'rm' commands created by logxgen1
26K4 Lookup: 5. modified JCL/script, calling 'uvcopy' to lookup control file
26K5 Lookup: 5. uvcopy job to lookup control card file for matches

26K2 Mainframe: 1. Mainframe SORT calling SYSIN module
26L2 Mainframe: sample Mainframe JCL BEFORE conversions
26O1 Mainframe: FTP 'put' Demo Conversion - Mainframe JCL
26O2 Mainframe: FTP 'get' Demo Conversion - Mainframe JCL
28A4 Mainframe: IBM mainframe
26C1 Manual: SORT - 'INCLUDE's requiring MANUAL Corrections
26D1 Manual: SORT - complex INCLUDE manual changes
26D1 Manual: uvsort equivalent - after manual corrections
26E1 Manual: converted script - AFTER manual changes
26E1 Manual: converted script - BEFORE manual changes
26F1 Manual: SORT - OUTREC EDIT/SIGNS require manual changes
26F1 Manual: converted script - AFTER manual changes
26F1 Manual: converted script - BEFORE manual changes
28B1 Manual: (+2) generations require manual changes
26J1 Many: SORTs with too many OMIT/INCLUDE patterns
26J2 Many: SORT with too many OMIT/INCLUDE patterns
26K1 Many: SORTs with too many OMIT/INCLUDEs ex# 3
26K5 Matches: 5. uvcopy job to lookup control card file for matches
26L1 Merge: ssmerge1 - merge SyncSort params into VU JCL/scripts
26L1 Merging: samples to illustrate merging SyncSort params
26J6 Methods: Notes re alternative methods
26J3 Mmzip006: SYSIN SORT control card module (MMZIP006)
28F1 Modification: CONDition test Investigation & Modification
28F4 Modification: CONDition test Investigation & Modification
28G3 Modifications: required
26K4 Modified: 5. modified JCL/script, calling 'uvcopy' to lookup control file
28H1 Modify: Mass change to JCL/scripts to Modify Generations
28J4 Modify: jcls/jar160.ksh - after convert & modify
26J3 Module: SYSIN SORT control card module (MMZIP006)
26K2 Module: 1. Mainframe SORT calling SYSIN module
26K2 Module: 2. SYSIN module - 2000 * 14 byte INCLUDE CONDitions
27J1 Module: cross-reference JCL to ctlcdlib module names
27J2 Module: cross-reference JCL to ctlcdlib module names

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

28L1 Normal: JCL conversion
28L1 Normal: scripts for normal & ESP JCL conversion
28A2 Now: 7. Generation#s now 6 digits
26L3 Null: sample JCL converted by VU, with null syncsorts
26K2 Numbers: 3. numbers only control cards - SORT CONDitions stripped out

26J1 Omit: SORTs with too many OMIT/INCLUDE patterns
26J2 Omit: SORT with too many OMIT/INCLUDE patterns
26K1 Omit: SORTs with too many OMIT/INCLUDEs ex# 3
26E1 Omits: SORT - OMITs & INCLUDEs in same step not allowed
27K3 Op-instrns: Op-Instrns create test file, test SORT/SUM, verify output
28A2 Op.: sample Op. Instrns. for gdg4to6
28A3 Op.: sample Op. Instrns. for gdgreset6
28D1 Operating: Operating Instructions
28I2 Operating: test/demo Operating Instructions
28J2 Operating: test/demo Operating Instructions
28M2 Operating: Operating Instrns - for 1 JCL at a time
28M2 Operating: Operating Instrns - for ALL JCLs in directory
26K2 Out: 3. numbers only control cards - SORT CONDitions stripped out
26H1 Outfil: SORT - complex multiple 'OUTFIL's
26F1 Outrec: SORT - OUTREC EDIT/SIGNS require manual changes

28G3 Page: note re 'IF' conversions on previous page
26J5 Parameter: uvcopy parameter file (called following the uvsort
26L1 Params: samples to illustrate merging SyncSort params
26L1 Params: ssmerge1 - merge SyncSort params into VU JCL/scripts
26L4 Params: sample output with SyncSort params inserted into VU script
27B1 Pattern: 'grep' demo - scan jcls for 1 pattern
27C1 Pattern: 'scan1d' demo - scan jcls for 1 pattern
26J1 Patterns: SORTs with too many OMIT/INCLUDE patterns
26J2 Patterns: SORT with too many OMIT/INCLUDE patterns
27D1 Patterns: 'scan2d' - scan for multiple patterns via table file
27D1 Patterns: sample table file of multiple patterns
27H1 Patterns: scan3d - report lines between 2 patterns
28M1 Percent: double percent symbols cause printing problems
27A3 Preparation: for scan/rep test/demos
28G3 Previous: note re 'IF' conversions on previous page
27H1 Print: extract/print SORT specs report for inspection/correction
28M1 Printing: double percent symbols cause printing problems
27A3 Problem: sample Problem for scan & rep jobs
28M1 Problems: double percent symbols cause printing problems
28M4 Process: jcl3/hphrecon3.ksh - converted script BEFORE control-M process
28M5 Process: jcl3/hphrecon3.ksh - converted script AFTER control-M process
28M3 Processor: sample JCL to demo control-M processor

27A2 Recommendations: JCL/script Update Recommendations
27K2 Record: sample record (key=00000002) in generated test file
27K3 Record: sample record (key=00000002) in SORT/SUM output file
26G1 Relevant: converted UNIX script (relevant code only)
28C3 Remove: creating a script to remove GDG files for reruns
28C2 Removes: using the console log to determine file removes for reruns
28X1 Removing: Removing CR's from text files
28K1 Rename: ftpgdg1 - detect/rename FTP'd files
27A3 Rep: preparation for scan/rep test/demos
27A3 Rep: sample Problem for scan & rep jobs
27F1 Rep1d: 'rep1d' - mass change demo
27F2 Rep1d: sample rep1d audit file
27L1 Rep1d: why not use sed or rep1d ?
27G1 Rep2d: - table driven search/replace
27G2 Rep2d: sample rep2d Audit report
27A1 Replace: scan/replace jobs more powerful than grep & sed
27G1 Replace: rep2d - table driven search/replace
28M3 Replace: ctlm/hphrecon3.cm search/replace table
26I1 Replacements: Alternative 'uvcopy job' replacements
28C1 Rerun: Rerun Considerations for Generation files
28C2 Reruns: using the console log to determine file removes for reruns
28C3 Reruns: creating a script to remove GDG files for reruns
27F2 Results: verify results with 'alldiff'
28X1 Returns: Carriage Returns in Korn shell scripts
28I1 Run: Run a JCL/script when input file detected
28J1 Run: Run a JCL/script when input file detected
26H2 Running: Running splitsl1 demo SORT file split

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

26H2 Sales.items: ar/sales.items - test file for demo sort splitsl1
26E1 Same: SORT - OMITs & INCLUDEs in same step not allowed
26L2 Sample: JCL converted by the SyncSort converter
26L2 Sample: Mainframe JCL BEFORE conversions
26L3 Sample: JCL converted by VU, with null syncsorts
26L4 Sample: output with SyncSort params inserted into VU script
27A3 Sample: Problem for scan & rep jobs
27B1 Sample: report from 'grep'
27C1 Sample: scan1d - sample report
27D1 Sample: table file of multiple patterns
27D2 Sample: scan2d - sample report
27F2 Sample: rep1d audit file
27G2 Sample: rep2d Audit report
27H2 Sample: scan3d - sample report
27I2 Sample: table3d - sample report
27I3 Sample: table3d - sample report #2
27J1 Sample: Sample Report #2
27K2 Sample: record (key=00000002) in generated test file
27K3 Sample: record (key=00000002) in SORT/SUM output file
27L1 Sample: alldiff report
28A1 Sample: conversion - GDG files (BEFORE & AFTER)
28A1 Sample: conversion - NON GDG files (before & after)
28A2 Sample: Op. Instrns. for gdg4to6
28A2 Sample: input filenames in subdir gl
28A2 Sample: script output for above input
28A3 Sample: Op. Instrns. for gdgreset6
28A3 Sample: input filenames in subdir gl
28A3 Sample: script output for above input
28B2 Sample: grep report
28B3 Sample: scan1d report
28D1 Sample: report scandd0.rpt
28E1 Sample: concatenated data set - IBM JCL
28E1 Sample: concatenated data set - AFTER automatic conversion
28F2 Sample: JCL/script with CONDition test
28F4 Sample: report from scan1d
28G1 Sample: JCL with IF & COND
28G2 Sample: JCL/script with IF & COND
28G4 Sample: report - scan1d for IF
28M3 Sample: JCL to demo control-M processor
26L1 Samples: to illustrate merging SyncSort params
27A1 Scan: scan/replace jobs more powerful than grep & sed
27A3 Scan: preparation for scan/rep test/demos
27A3 Scan: sample Problem for scan & rep jobs
27B1 Scan: 'grep' demo - scan jcls for 1 pattern
27C1 Scan: 'scan1d' demo - scan jcls for 1 pattern
27D1 Scan: 'scan2d' - scan for multiple patterns via table file
28B2 Scan: for exportgenx - using 'grep'
28B3 Scan: for exportgenx - using 'uvcopy scan1d'
28D1 Scan: special purpose scan job required
27C1 Scan1d: 'scan1d' demo - scan jcls for 1 pattern
27C1 Scan1d: - sample report
28B3 Scan1d: sample scan1d report
28B3 Scan1d: scan for exportgenx - using 'uvcopy scan1d'
28F4 Scan1d: sample report from scan1d
28G4 Scan1d: sample report - scan1d for IF
27D1 Scan2d: 'scan2d' - scan for multiple patterns via table file
27D2 Scan2d: - sample report
27H1 Scan3d: - report lines between 2 patterns
27H2 Scan3d: - sample report
28D1 Scandd0.rpt: sample report scandd0.rpt
28B1 Scanning: JCL/scripts for 'exportgenx'
28L1 Scheduler: converting JCL from ESP workload scheduler
28M1 Scheduler: Converting JCL with BMC Control-M scheduler %%coding
27G1 Search: rep2d - table driven search/replace
28M3 Search: ctlm/hphrecon3.cm search/replace table
27A1 Sed: scan/replace jobs more powerful than grep & sed
27E1 Sed: mass change example - using 'sed'
27L1 Sed: why not use sed or rep1d ?
26B1 Select: uvsort equivalent - select AND/OR CONDitions
28E1 Set: sample concatenated data set - IBM JCL
28E1 Set: sample concatenated data set - AFTER automatic conversion
28E1 Sets: Concatenated Data Sets
28X1 Shell: Carriage Returns in Korn shell scripts
26F1 Signs: SORT - OUTREC EDIT/SIGNS require manual changes
26G1 Solution: alternate solution possible with uvsort
26I2 Solution: SORT uvcopy alternative solution#2
26I3 Solution: SORT uvcopy alternative solution#3
26I4 Solution: SORT uvcopy alternative solution#4
26I5 Solution: SORT uvcopy alternative solution#5
26J4 Solution: converted JCL/script with workaround solution
27L1 Solution: Solution
26A1 Sort: SORT example - JCL before conversion
26A2 Sort: SORT conversion - script output
26C1 Sort: SORT - 'INCLUDE's requiring MANUAL Corrections
26D1 Sort: SORT - complex INCLUDE manual changes
26E1 Sort: SORT - OMITs & INCLUDEs in same step not allowed
26F1 Sort: SORT - OUTREC EDIT/SIGNS require manual changes
26G1 Sort: SORT - multiple SUM fields
26H1 Sort: SORT - complex multiple 'OUTFIL's
26H2 Sort: Running splitsl1 demo SORT file split
26H2 Sort: ar/sales.items - test file for demo sort splitsl1
26I2 Sort: SORT uvcopy alternative solution#2
26I3 Sort: SORT uvcopy alternative solution#3
26I4 Sort: SORT uvcopy alternative solution#4
26I5 Sort: SORT uvcopy alternative solution#5
26J2 Sort: SORT with too many OMIT/INCLUDE patterns
26J3 Sort: SYSIN SORT control card module (MMZIP006)
26K2 Sort: 1. Mainframe SORT calling SYSIN module
26K2 Sort: 3. numbers only control cards - SORT CONDitions stripped out
27H1 Sort: extract/print SORT specs report for inspection/correction
27K3 Sort: Op-Instrns create test file, test SORT/SUM, verify output
27K3 Sort: sample record (key=00000002) in SORT/SUM output file
26J1 Sorts: SORTs with too many OMIT/INCLUDE patterns
26K1 Sorts: SORTs with too many OMIT/INCLUDEs ex# 3
28D1 Special: purpose scan job required
27H1 Specs: extract/print SORT specs report for inspection/correction
26H2 Split: Running splitsl1 demo SORT file split
26H2 Splitsl1: Running splitsl1 demo SORT file split
26H2 Splitsl1: ar/sales.items - test file for demo sort splitsl1
26H3 Splitsl1: list the output files from splitsl1
26L1 Ssmerge1: - merge SyncSort params into VU JCL/scripts
26E1 Step: SORT - OMITs & INCLUDEs in same step not allowed
26K2 Stripped: 3. numbers only control cards - SORT CONDitions stripped out
28A2 Subdi: sample input filenames in subdir gl
28A3 Subdi: sample input filenames in subdir gl
28K2 Subdirs: ftp* subdirs after 2 tests
26G1 Sum: SORT - multiple SUM fields
26G2 Sum: creating a test file - with 56 SUM fields
27K3 Sum: Op-Instrns create test file, test SORT/SUM, verify output
27K3 Sum: sample record (key=00000002) in SORT/SUM output file
27I2 Summary: table3d ex#2 - summary counts by filename
28M1 Symbols: double percent symbols cause printing problems
26B1 Syncsort: SYNCSORT - with INCLUDE AND/OR CONDitions
26B1 Syncsort: SYNCSORT with INCLUDE 'OR' CONDitions
26L1 Syncsort: samples to illustrate merging SyncSort params
26L1 Syncsort: ssmerge1 - merge SyncSort params into VU JCL/scripts
26L2 Syncsort: sample JCL converted by the SyncSort converter
26L4 Syncsort: sample output with SyncSort params inserted into VU script
26L3 Syncsorts: sample JCL converted by VU, with null syncsorts
26J3 Sysin: SYSIN SORT control card module (MMZIP006)
26K2 Sysin: 1. Mainframe SORT calling SYSIN module
26K2 Sysin: 2. SYSIN module - 2000 * 14 byte INCLUDE CONDitions

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

27D1 Table: 'scan2d' - scan for multiple patterns via table file
27D1 Table: sample table file of multiple patterns
27G1 Table: rep2d - table driven search/replace
28M3 Table: ctlm/hphrecon3.cm search/replace table
27I1 Table3d: - General Purpose Keyword Analysis
27I2 Table3d: - sample report
27I2 Table3d: ex#2 - summary counts by filename
27I3 Table3d: - sample report #2
26G2 Test: creating a test file - with 56 SUM fields
26H2 Test: ar/sales.items - test file for demo sort splitsl1
27A3 Test: preparation for scan/rep test/demos
27K1 Test: Creating Test files using uvcopy
27K2 Test: gen56pk - uvcopy job to generate test data file
27K2 Test: sample record (key=00000002) in generated test file
27K3 Test: Op-Instrns create test file, test SORT/SUM, verify output
27K3 Test: Op-Instrns create test file, test SORT/SUM, verify output
28F1 Test: CONDition test Investigation & Modification
28F2 Test: sample JCL/script with CONDition test
28F3 Test: CONDition test Illustrations
28F4 Test: CONDition test Investigation & Modification
28I2 Test: test/demo Operating Instructions
28J2 Test: test/demo Operating Instructions
26L1 Testing: Op Instrns - 1 JCL at a time (testing)
28K2 Testing: ftpgdg1
28F1 Tests: Confused about CONDition tests
28K2 Tests: ftp* subdirs after 2 tests
28X1 Text: Removing CR's from text files
26J1 Too: SORTs with too many OMIT/INCLUDE patterns
26J2 Too: SORT with too many OMIT/INCLUDE patterns
26K1 Too: SORTs with too many OMIT/INCLUDEs ex# 3

26G1 Unix: converted UNIX script (relevant code only)
26H1 Unix: converted UNIX script
27A2 Update: JCL/script Update Recommendations
26I1 Uvcopy: Alternative 'uvcopy job' replacements
26I2 Uvcopy: SORT uvcopy alternative solution#2
26I3 Uvcopy: SORT uvcopy alternative solution#3
26I4 Uvcopy: SORT uvcopy alternative solution#4
26I5 Uvcopy: SORT uvcopy alternative solution#5
26J5 Uvcopy: parameter file (called following the uvsort
26K4 Uvcopy: 5. modified JCL/script, calling 'uvcopy' to lookup control file
26K5 Uvcopy: 5. uvcopy job to lookup control card file for matches
27K1 Uvcopy: Creating Test files using uvcopy
27K2 Uvcopy: gen56pk - uvcopy job to generate test data file
27L1 Uvcopy: Writing uvcopy jobs for Complex Mass Changes
27L2 Uvcopy: Mass Changes to jcl/scripts - simple uvcopy job
28B3 Uvcopy: scan for exportgenx - using 'uvcopy scan1d'
26B1 Uvsort: equivalent - select AND/OR CONDitions
26C1 Uvsort: equivalent
26D1 Uvsort: equivalent
26D1 Uvsort: equivalent - after manual corrections
26G1 Uvsort: alternate solution possible with uvsort
26J5 Uvsort: uvcopy parameter file (called following the uvsort

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

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

27F2 Verify: results with 'alldiff'
27G2 Verify: changes with alldiff script
27K3 Verify: Op-Instrns create test file, test SORT/SUM, verify output
28G4 Verifying: Verifying IF conversions
26L3 Vu: sample JCL converted by VU, with null syncsorts

28I1 When: Run a JCL/script when input file detected
28J1 When: Run a JCL/script when input file detected
26J4 Workaround: converted JCL/script with workaround solution
28L1 Workload: converting JCL from ESP workload scheduler
28A3 Wrap: 8. Generation# does not auto wrap
27L1 Writing: Writing uvcopy jobs for Complex Mass Changes

A  B  C  D  E  F  G  H  I  J  K  L  M  N  O  P  Q  R  S  T  U  V  W  X  Y  Z 

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

Visitor Counters for ThisYear and LastYear