Вы находитесь на странице: 1из 48

State Farm Pattern JCL User's Guide

State Farm Pattern JCL - User's Guide

Table of Contents Overview Why Pattern JCL? ...................................................................................................................3 User Guide Layout.......................................................................................................................................3 Pattern Text Format.....................................................................................................................................4 Pattern Variables........................................................................................................................................4 Predefined Variables...............................................................................................................................4 Global Variables......................................................................................................................................6 Local Variables .......................................................................................................................................6 Control Statements.....................................................................................................................................6 %ALL.......................................................................................................................................................6 %CON .....................................................................................................................................................7 %DECR...................................................................................................................................................7 %DIV .......................................................................................................................................................8 %DO........................................................................................................................................................9 %DO%VAR ...........................................................................................................................................10 %ENDJOB ............................................................................................................................................11 %EXPLODE ..........................................................................................................................................11 %GLOBAL.............................................................................................................................................12 %IF........................................................................................................................................................13 %INCR ..................................................................................................................................................16 %MOD...................................................................................................................................................16 %MULT .................................................................................................................................................17 %PRSYM ..............................................................................................................................................17 %SEQ ...................................................................................................................................................18 Pattern Text Tools .....................................................................................................................................20 Explode Tools...........................................................................................................................................20 EXPLODE .............................................................................................................................................20 BOOM ...................................................................................................................................................23 Patternizing Tools.....................................................................................................................................26 Requirements for Use ...........................................................................................................................26 PATMENU.............................................................................................................................................26 PATRENUM ..........................................................................................................................................27 PATBASIC ............................................................................................................................................28 A PATBASIC Example..........................................................................................................................32 Model Macros........................................................................................................................................35 Typical Patternization Session..............................................................................................................40 Pattern JCL Documentation .....................................................................................................................41 PATDOC ...............................................................................................................................................41 PATVARS .............................................................................................................................................41 Appendix A - EXPLODER Program (PI854).............................................................................................43 GLOBAL DD.............................................................................................................................................44 PATTERN DD ..........................................................................................................................................44 CODES DD ..............................................................................................................................................45 Q063 (Predefined Variable) Data Set Record Format ..........................................................................45 CTLCARD DD ..........................................................................................................................................46 CTLCARD Data Set Record Format .....................................................................................................46 PRODJCL DD ..........................................................................................................................................47 PRINT DD ................................................................................................................................................47

Page 2

State Farm Pattern JCL - User's Guide

Overview Why Pattern JCL?


At one time, all of the computing needs for State Farms policyholders were handled at Corporate headquarters. As the number of policyholders grew, the need to expand led to our current set up multiple regional offices, ISCs and testing sites. To help cut down the amount of time and effort to produce and maintain production JCL, a macro language called pattern JCL was created. A single pattern set could be used for any office or location. A pattern set that executes on a state division basis could generate over 100 sets of production JCL. Although initially used only for JCL, pattern text has gone on to other uses as well. At State Farm, pattern statements can also be found in PSBs, DBDs and in some system tables. For the purpose of this document, the terms pattern sets and pattern JCL will have the same meaning.

User Guide Layout


The first section, entitled Pattern Text Format, is a complete language reference for the pattern text macro language. The examples included are generally small enough for you to type in a PDS for your own understanding and experimentation. The second section, Pattern Text Tools, looks at the tools used to create, test and maintain pattern text. The final section, Appendix A - EXPLODER Program (PI854), is a detailed breakdown of the JCL needs for running the Exploder program. This program is the "brains" behind the conversion process used on pattern text.

Page 3

State Farm Pattern JCL - User's Guide

Pattern Text Format


Lets begin by looking at the following example of pattern text, in form of some production pattern JCL.
%&PATTERNIZED.(DPSR 04/06/94 13:47:44 - DO NOT DELETE!!!) //Z1988&OA.## JOB (&OF.1&ON.DIV0020000P0, // 'CLAIMS-PRODUCTION '), // REGION=512K,MSGLEVEL=1,MSGCLASS=F,CLASS=P %IF&SYSTEM.%EQ(168) //*MAIN FAILURE=CANCEL %ENDIF //* VERSION A00 //* A JSNX101 Z1988&OA.## CREATE SALVAGE LISTING //STEP10 EXEC PLIXG,&GOLIB. // PROG=&*PIXKF. //A291 DD DSN=&ONME.&ON..CLAIM.A291&ON.(0), // DISP=(OLD,KEEP,KEEP) //R1234567 DD &STOCK., // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118) %ENDJOB

Each line highlighted in Italics is an example of pattern text. Pattern text consists of two statement types variables and control statements. Lets first take a look at pattern variables. Pattern Variables A pattern variable is a symbolic representation of one or more values. When a pattern variable is converted to production (exploded), the value is substituted. The rules for pattern variables are: 1. The variable must begin with an ampersand (&). 2. The variable must end with a period (.). 3. The total length of the variable, including the ampersand and the period, must not exceed 12 characters. 4. The text between the ampersand and period is the variable name. Some example pattern variables are: &ON. &ONME. &STDN. Pattern variables are broken into three types predefined, global and local. These variable types are described below. Predefined Variables State Farm has created several variables to represent the distinct codes used in its business. These variables represent such codes as office number, division code and state code. There are two types of predefined variables constant by office and variable by office. Constant by office predefined variables contain values that allow a clear distinction between each State Farm office and Corporate. For example, each office has its own code that is constant within that office.

Page 4

State Farm Pattern JCL - User's Guide

The Illinois office code is 01 while Corporate is 00. The predefined variable used for office code is &ON. Whenever you use &ON in pattern text, it converts to the appropriate regional office code. Here is a table of the current predefined variables that are constant. Variable &OA &ON &ONME Description Alphabetic office code Numeric office code Alphabetic office abbreviation Corporate value 9 00 HOME Illinois value A 01 ILIO

Variable by office predefined variables change within a single office. For example, many of our regional offices contain several Auto divisions. These variables are used to create looping constructs in pattern text. Here is a table of the predefined variables that vary within an office. Variable &DIV &FDIV &FODIV &FODIVA &FOMID &GOMID &HOMID &MID &OMID &ST &STDA &STDN &TUMID Description Numeric Auto division code Numeric Fire division code Numeric Fire division code Alphabetic Fire division code Fire offload machine ID General department offload machine ID Health offload machine ID Auto offload machine ID All offload machine Ids Numeric Auto state code Alphabetic Auto division code Numeric Auto state division code Telephone update offload machine ID Corporate value * 0 0 1 X 4 4 4 4 4 00 # 000 4 Illinois value(s) * 1,3,4,5,6,7 1,2,6 1,2,6 X,Y,Z 3 2 2 4 4,3,2 13 A,D,E,F,C,B 131,133,134,135,13 6,137 3

Page 5

State Farm Pattern JCL - User's Guide

Global Variables The second type of pattern variable is the global variable. Where predefined variables allow for distinctions between each regional office and Corporate, global variables typically have values for all regional offices combined with a different value for Corporate. For example, the global variable &SYSTEM has the value of 158 for all regional offices while Corporate uses the value 168. Global variables do not vary within an office and cannot be used to generate looping constructs. State Farm has defined over 200 different global variables. For a complete list of global variables, see the Data Processing Manual, standards section. Local Variables The last type of pattern variable is the local variable. Local variables do not maintain their values beyond a single set of pattern text. Local variables are defined within the pattern text. Since local variables are rendered last by the conversion process, they are useful as overrides to predefined or global variables. Here is an example of a local variable assignment. In this example, the variable name is &APPLE and the value of the variable is RED.
%&APPLE.(RED)

Now that weve covered pattern variables, lets shift our focus to the second type of pattern statement the control statement. Control Statements The purpose of the pattern control statement is to allow for assignments of variables, the creation of loops, decision-making and other common programming constructs found in other programming languages. The rules for coding control statements are: 1. 2. 3. 4. 5. 6. All control statements must begin with a percent sign (%). Only one control statement is allowed per line. Control statements may begin in any column. Control statements may not contain any embedded blanks. All alphabetic characters must be in UPPERCASE. Comments may be placed on any control statement. The comment must be separated from the statement by at least two blanks. 7. Control statements can be continued to a second line in one of two ways: 8. Interrupt the control statement after a complete variable or constant, including the comma that follows at or before column 71. 9. Code an X in column 72. Below is a complete list, including rules of usage and examples, of the pattern control statements. %ALL The %ALL control statement is used to concatenate all of the values of a single predefined variable into a single local variable. The predefined variable used must vary within an office.

Page 6

State Farm Pattern JCL - User's Guide

See example below.


//STDIVS DD * 'CODES=%ALL(&STDN.)' %ENDJOB

Explodes in Illinois as:


//STDIVS DD * 'CODES=131133134135136137'

%CON The %CON statement provides a method for concatenating several local variables into a single local variable. The syntax for the %CON statement is: %CON&var1.(&var1.,&var2.,) The rules for coding the %CON statement are: 1. The variables within the parentheses are processed from left to right. 2. The value of each variable is retrieved and concatenated into a variable-length character string (&var1.). 3. If the variable does not have a currently active value then a null string is used. 4. After all values for the variables within the parentheses have been retrieved and concatenated, the resulting character string is loaded as the value for the variable immediately following the %CON verb (&var1.). 5. If none of the variables within the parentheses contain a current value then the variable following the %CON verb will be deleted from the current symbol table. See the example below.
%&TYPE.(B) %DO%VAR(&STDN.) %CON&BPARM.(&BPARM.,&STDN.,&TYPE.) %ENDDO // GPARM='&BPARM.' %ENDJOB

Explodes as:
// GPARM='131B133B134B135B136B137B'

%DECR The %DECR statement is used to subtract (decrement) one number from another. The syntax for the %DECR statement is: %DECR&var1.(&var2.,&var3.,)

Page 7

State Farm Pattern JCL - User's Guide

The rules for using %DECR are: 1. The items within the parentheses are evaluated from left to right. 2. Any value within the parentheses that has a non-numeric value or no value will be treated as a zero. 3. The variable immediately following the %DECR keyword will contain the value of the operation. 4. All leading zeros will be suppressed. 5. If the result is a negative value, the value stored will be preceded by a minus (-) sign. Here is an example where the result of one operation is a positive number and the second is negative.
%&VAL1.(100) %&VAL2.(33) %DECR&TESTVAR.(&VAL1.,&VAL2.) //THE RESULT OF &VAL1. %DECR &VAL2. IS &TESTVAR. %DECR&TESTVAR.(&VAL2.,&VAL1.) //THE RESULT OF &VAL2. %DECR &VAL1. IS &TESTVAR. %ENDJOB

Explodes as:
//THE RESULT OF 100 %DECR 33 IS 67 //THE RESULT OF 33 %DECR 100 IS -67

%DIV The %DIV statement is used to divide one number by another. The syntax for %DIV is: %DIV&var1.(&var2.,&var3.,) The rules for using %DIV are: 1. The items within the parentheses are evaluated from left to right. 2. Any value within the parentheses that has a non-numeric value or no value will be treated as a zero. 3. The variable immediately following the %DIV keyword will contain the value of the operation. 4. All leading zeros will be suppressed. 5. If the result is a negative value, the value stored will be preceded by a minus (-) sign. Below is an example of using %DIV.
%&VAL1.(100) %&VAL2.(33) %DIV&TESTVAR.(&VAL1.,&VAL2.) //THE RESULT OF &VAL1. %DIV &VAL2. IS &TESTVAR. %DIV&TESTVAR.(&VAL2.,&VAL1.) //THE RESULT OF &VAL2. %DIV &VAL1. IS &TESTVAR. %ENDJOB

Explodes as:
//THE RESULT OF 100 %DIV 33 IS 3 //THE RESULT OF 33 %DIV 100 IS 0

Page 8

State Farm Pattern JCL - User's Guide

%DO The %DO statement is used to define a repetitive loop using a list of items you define or found in a local or global variable. The syntax for the %DO is: (hard-coded list) %DO&variable.(item1,item2,..itemx) text %ENDDO or (local variable) %&LIST.(item1,item2,..itemx) %DO&variable.(&LIST.) text %ENDDO or (global variable) %DO&variable.(&GLOBALVAR.) text %ENDDO The rules for using %DO are: 1. 2. 3. 4. The &variable field represents a valid pattern variable. The number of items in the list or variable equals the number of loops performed. The text between the %DO and %ENDDO is repeated for each loop. The %ENDDO statement is required absence will generate very unpredictable results.

Here is an example of %DO.


%DO&NAME.(V1,V2,V3) //A200&NAME. DD DSN=&ONME.&ON..PREM.A200&NAME., ----%ENDDO %ENDJOB or %&LIST.(V1,V2,V3) %DO&NAME.(&LIST.) //A200&NAME. DD DSN=&ONME.&ON..PREM.A200&NAME., ----%ENDDO %ENDJOB

Explodes in Illinois as:


//A200V1 //A200V2 //A200V3 DD DSN=ILIO01.PREM.A200V1, ---DD DSN=ILIO01.PREM.A200V2, ---DD DSN=ILIO01.PREM.A200V3, ----

Page 9

State Farm Pattern JCL - User's Guide

In this example, there are two inner lists of values.


%DO&NAME.((A,B,D),E,(F,G,H)) //A200&NAME. DD DSN=&ONME.&ON..PREM.A200&NAME., ---%ENDDO %ENDJOB

Explodes in Illinois as:


//A200(A,B,D) DD DSN=ILIO01.PREM.A200(A,B,D), ---//A200E DD DSN=ILIO01.PREM.A200E, ---//A200(F,G,H) DD DSN=ILIO01.PREM.A200(F,G,H), ----

This example shows how the Exploder processes nested loops.


%DO&FRUIT.(PEACH,PEAR) %DO&MEAT.(PORK,BEEF) %DO&GRAIN.(CORN,WHEAT) FRUIT=&FRUIT. MEAT=&MEAT. GRAIN=&GRAIN. %ENDDO %ENDDO %ENDDO %ENDJOB

Explodes as:
FRUIT=PEACH MEAT=PORK GRAIN=CORN FRUIT=PEACH MEAT=PORK GRAIN=WHEAT FRUIT=PEACH MEAT=BEEF GRAIN=CORN FRUIT=PEACH MEAT=BEEF GRAIN=WHEAT FRUIT=PEAR MEAT=PORK GRAIN=CORN FRUIT=PEAR MEAT=PORK GRAIN=WHEAT FRUIT=PEAR MEAT=BEEF GRAIN=CORN FRUIT=PEAR MEAT=BEEF GRAIN=WHEAT

%DO%VAR The %DO%VAR statement is used to define a repetitive loop using a State Farm predefined variable as the looping mechanism. The syntax for using %DO%VAR is: %DO%VAR(&predefvar.) text %ENDDO The rules for using %DO%VAR are: 1. The &predefvar field represents a valid predefined variable that has varying values within a location. 2. The number of loops performed equals the number of values of the predefined variable in that location. 3. The text between the %DO%VAR and %ENDDO is repeated for each loop. 4. The %ENDDO statement is required its absence will generate very unpredictable results.

Page 10

State Farm Pattern JCL - User's Guide

Here is the first of two examples. This first example uses the predefined variable &STDN for numeric state codes as a looping mechanism.
%DO%VAR(&STDN.) //A200&STDN. DD DSN=&ONME&ON..PREM.A200&STDN., %ENDDO %ENDJOB

Explodes in Illinois as:


//A200131 //A200133 //A200134 //A200135 //A200136 //A200137 DD DD DD DD DD DD DSN=ILIO01.PREM.A200131, DSN=ILIO01.PREM.A200133, DSN=ILIO01.PREM.A200134, DSN=ILIO01.PREM.A200135, DSN=ILIO01.PREM.A200136, DSN=ILIO01.PREM.A200137,

The next example includes an embedded constant.


%DO%VAR(&STDA.,#) //A1234&OA.&STDA.# %ENDDO %ENDJOB DD ----

Explodes in Illinois as:


//A1234AA# //A1234AD# //A1234AE# //A1234AF# //A1234AC# //A1234AB# //A1234A## DD DD DD DD DD DD DD ----------------------

%ENDJOB The %ENDJOB statement controls the end of a pattern set. The rules for using the %ENDJOB statement are: 1. %ENDJOB is used to mark the end of a pattern set. 2. Any %DO or %IF statements that have not been properly paired with %ENDDO or %ENDIFs will be terminated. 3. All local variables currently stored in memory are released. 4. Careful use of %ENDJOB prevents long running explode processing. If the end of a pattern set is reached without a %ENDJOB statement, the %ENDJOB is implied. %EXPLODE The %EXPLODE statement acts as a toggle switch for turning pattern conversion on or off. The syntax for the %EXPLODE statement is: %EXPLODE(ON) %EXPLODE(OFF)

Page 11

State Farm Pattern JCL - User's Guide

The rules for using %EXPLODE are: 1. %EXPLODE(ON) acts to turn on pattern set conversion (explode). This is the default setting. 2. %EXPLODE(OFF) is a toggle to turn off all exploding until either the end of the pattern set or a %EXPLODE(ON) is encountered. In this example, there is embedded SAS code within the JCL. SAS allows for the use of statements with the percent (%) sign to signify macro statements. Normally, the Exploder will attempt to convert these SAS statements as pattern control statements. Since this action is not desired, the %EXPLODE statement is used to turn off the pattern conversion.
//STEP10 EXEC SAS %EXPLODE(OFF) %IF &UNIT = '&DISK.' %THEN %DO; ... (SAS CODE) ... (SAS CODE) %END; %EXPLODE(ON) //DD1 DD DSN=&ONME.&ON..PREM.DATA,DISP=SHR %ENDJOB

Explodes in Illinois as:


//STEP10 EXEC SAS %IF &UNIT = '&DISK.' %THEN %DO; ... (SAS CODE) ... (SAS CODE) %END; //DD1 DD DSN=ILIO01.PREM.DATA,DISP=SHR

%GLOBAL The %GLOBAL statement is used to set the scope of a pattern variable from local to global. The syntax for the %GLOBAL statement is: %GLOBAL text %ENDGLOBAL The rules for using %GLOBAL are: 1. All pattern variable assignments become global in scope and maintain their values until the end of the data set containing one or more pattern sets. 2. A global pattern variable maintains its value across multiple %ENDJOB statements. 3. A %ENDGLOBAL statement is optional if all variables in the pattern set are to be global. 4. Any pattern variable assignments following a %ENDGLOBAL statement are considered local.

Page 12

State Farm Pattern JCL - User's Guide

Below is a side-by-side example showing the effect of using the %GLOBAL statement on a pattern variable (&STATENUM).
Example 1 (local variable) %&STATENUM.(ABC) //*JOB 1 //STATE1 DD * &STATENUM. /* %ENDJOB //*JOB 2 //STATE2 DD * &STATENUM. /* %ENDJOB Example 2 (global variable) %GLOBAL %&STATENUM.(ABC) %ENDGLOBAL //*JOB 1 //STATE1 DD * &STATENUM. /* %ENDJOB //*JOB 2 //STATE2 DD * &STATENUM. /* %ENDJOB

Explodes as:
//*JOB 1 //STATE1 DD * ABC /* //*JOB 2 //STATE2 DD * &STATENUM. /* //*JOB 1 //STATE1 DD * ABC /* //*JOB 2 //STATE2 DD * ABC /*

%IF The %IF statement provides a method for testing the value of a pattern variable and conditionally converting any enclosed text based on the results of the test. The syntax of the %IF statement is: %IF&var1.%cond.(item1,item2,,itemx) text %ELSE text %ENDELSE %ENDIF The rules for using the %IF statement are: 1. The &var1 parameter is any valid pattern variable. 2. The valid conditional comparison operators (%cond.) are: %EQ equal %NE not equal %LT less than %GT greater than %IN index greater than zero %NX index equal to zero 3. Item1, Item2 and so on can be either constants or previously assigned pattern variables. 4. The %EQ, %NE, %LT, %GT operators will OR the results of individual comparisons between the variable being tested and the items in the list. If any of the comparisons are true, the entire statement is considered true. 5. The %NE and %NX operators will AND the results of an individual comparison. For %NE, if the variable being tested is equal to any items in the list, the entire statement is considered not true. For %NX, if the variable matches any items in the list, the %IF statement is considered not true.

Page 13

State Farm Pattern JCL - User's Guide

6. The %ELSE statement is optional. If it is used, it must be terminated with a %ENDELSE statement. 7. The %ENDIF statement is required to terminate a %IF statement. 8. The %IF and %ELSE statements can be nested to any level desired. In this example, a test is made for state code 13.
%IF&ST.%EQ(13) //B9999 DD DSN=&ONME.&ON..PREM.A035,DISP=SHR %ENDIF //* COMMENT %ENDJOB

Explodes in Illinois (which is state code (&ST) 13) as:


//B9999 DD DSN=ILIO01.PREM.A035,DISP=SHR //* COMMENT

This example shows the negation of the earlier test.


%IF&ST.%NE(13) //B9999 DD DSN=&ONME.&ON..PREM.A035,DISP=SHR %ENDIF //* COMMENT %ENDJOB

Explodes in Illinois as:


//* COMMENT

In this example, a local variable (&TEST) is used to control the setting of a second local variable (&HLEV).
%&TEST.(YES) %IF&TEST.%EQ(YES) %&HLEV.(TW.TRANSFER) %ELSE %&HLEV.(&ONME.&ON.) %ENDELSE %ENDIF %DO%VAR(&STDN.) //A100&STDN. DD DSN=&HLEV..PREM.A100&STDN.,DISP=SHR %ENDDO %ENDJOB

Explodes in Illinois as:


//A100131 //A100133 //A100134 //A100135 //A100136 //A100137 DD DD DD DD DD DD DSN=TW.TRANSFER.PREM.A100131,DISP=SHR DSN=TW.TRANSFER.PREM.A100133,DISP=SHR DSN=TW.TRANSFER.PREM.A100134,DISP=SHR DSN=TW.TRANSFER.PREM.A100135,DISP=SHR DSN=TW.TRANSFER.PREM.A100136,DISP=SHR DSN=TW.TRANSFER.PREM.A100137,DISP=SHR

Page 14

State Farm Pattern JCL - User's Guide

Explodes when &TEST is NO as:


//A100131 //A100133 //A100134 //A100135 //A100136 //A100137 DD DD DD DD DD DD DSN=ILIO01.PREM.A100131,DISP=SHR DSN=ILIO01.PREM.A100133,DISP=SHR DSN=ILIO01.PREM.A100134,DISP=SHR DSN=ILIO01.PREM.A100135,DISP=SHR DSN=ILIO01.PREM.A100136,DISP=SHR DSN=ILIO01.PREM.A100137,DISP=SHR

This example shows the use of the %IN conditional comparison operator.
%&TEST.(A) %IF&TEST.%IN(A,B,C) //TEST IS TRUE %ELSE //TEST IS FALSE %ENDELSE %ENDIF %&TEST.(X) %IF&TEST.%IN(A,B,C) //TEST IS TRUE %ELSE //TEST IS FALSE %ENDELSE %ENDIF %ENDJOB

Explodes as:
//TEST IS TRUE //TEST IS FALSE

This example uses the %NX conditional operator.


%&TEST.(A) %IF&TEST.%NX(A,B,C) //TEST IS TRUE %ELSE //TEST IS FALSE %ENDELSE %ENDIF %&TEST.(X) %IF&TEST.%NX(A,B,C) //TEST IS TRUE %ELSE //TEST IS FALSE %ENDELSE %ENDIF %ENDJOB

Explodes as:
//TEST IS FALSE //TEST IS TRUE

Page 15

State Farm Pattern JCL - User's Guide

%INCR The %INCR statement is used to add (increment) one or more numbers. The syntax for using %INCR is: %INCR&var1.(&var2.,&var3.,) The rules for using %INCR are: 1. The local variables and constants can be placed within the parentheses in any order. 2. The items within the parentheses are evaluated from left to right. 3. Any value within the parentheses that has a non-numeric value or no value will be treated as a zero. 4. The variable immediately following the %INCR keyword will contain the value of the operation. 5. All leading zeros will be suppressed. 6. If the result is a negative value, the value stored will be preceded by a minus (-) sign. Heres an example.
%&VAL1.(100) %&VAL2.(33) %INCR&TESTVAR.(&VAL1.,&VAL2.) //THE RESULT OF &VAL1. %INCR &VAL2. IS &TESTVAR. %INCR&TESTVAR.(&VAL2.,&VAL1.) //THE RESULT OF &VAL2. %INCR &VAL1. IS &TESTVAR. %ENDJOB

Explodes as:
//THE RESULT OF 100 %INCR 33 IS 133 //THE RESULT OF 33 %INCR 100 IS 133

%MOD When dividing a number by another, the %MOD statement is used to extract the remainder. The syntax for using %MOD is: %MOD&var1.(&var2.,&var3.,) The rules for using %MOD are: 1. The items within the parentheses are evaluated from left to right. 2. Any value within the parentheses that has a non-numeric value or no value will be treated as a zero. 3. The variable immediately following the %MOD keyword will contain the value of the operation. 4. All leading zeros will be suppressed.

Page 16

State Farm Pattern JCL - User's Guide

Heres an example of using %MOD.


%&VAL1.(100) %&VAL2.(33) %MOD&TESTVAR.(&VAL1.,&VAL2.) //THE RESULT OF &VAL1. %MOD &VAL2. IS &TESTVAR. %MOD&TESTVAR.(&VAL2.,&VAL1.) //THE RESULT OF &VAL2. %MOD &VAL1. IS &TESTVAR. %ENDJOB

Explodes as:
//THE RESULT OF 100 %MOD 33 IS 1 //THE RESULT OF 33 %MOD 100 IS 33

%MULT The %MULT statement is used to multiply two or more numbers. The syntax for using %MULT is: %MULT&var1.(&var2.,&var3.,) The rules for using %MULT are: 1. The local variables and constants can be placed within the parentheses in any order. 2. The items within the parentheses are evaluated from left to right. 3. Any value within the parentheses that has a non-numeric value or no value will be treated as a zero. 4. The variable immediately following the %MULT keyword will contain the value of the operation. 5. All leading zeros will be suppressed. 6. If the result is a negative value, the value stored will be preceded by a minus (-) sign. Here is an example.
%&VAL1.(100) %&VAL2.(33) %MULT&TESTVAR.(&VAL1.,&VAL2.) //THE RESULT OF &VAL1. %MULT &VAL2. IS &TESTVAR. %MULT&TESTVAR.(&VAL2.,&VAL1.) //THE RESULT OF &VAL2. %MULT &VAL1. IS &TESTVAR. %ENDJOB

Explodes as:
//THE RESULT OF 100 %MULT 33 IS 3300 //THE RESULT OF 33 %MULT 100 IS 3300

%PRSYM The %PRSYM statement is used to debug pattern text by printing of the contents of all local, global and predefined pattern variables. The rules for using %PRSYM are: 1. Can be placed anywhere in the pattern set. 2. Can be used as many times as desired. 3. The %PRSYM statement is only recognized by the BOOM tool or by batch JCL used to run the Exploder (PI854) program.

Page 17

State Farm Pattern JCL - User's Guide

4. When used with BOOM tool, the results will be placed in a data set with the naming convention userid.@JCLX.PRINT. In this example, the values of the predefined, global and local variables is captured twice given the placement of the two %PRSYM statements.
%PRSYM %&VAL1.(100) %&VAL2.(33) %PRSYM %ENDJOB

%SEQ The %SEQ statement controls the conversion of pattern text in columns 72-80. This control is especially useful for in-stream data statements. The syntax of the %SEQ statement is: %SEQ(x) The rules for using %SEQ are: 1. If x = 0, all 80 columns of data in the pattern text will be treated as data, subject to pattern variable substitution. 2. If x = 2, columns 1-71 are treated as data with pattern variable substitution while any data found in columns 72-80 is left untouched. This is the default setting for pattern sets. 3. If x = 3, columns 1-71 are treated as data with pattern variable substitution, columns 72-73 are left untouched and columns 74-80 are blanked out. Here is an example showing how each of the %SEQ codes will handle the same text.
%&A.(AB) %&B.(CD) %&C.(EF) %&D.(GH) %&V1.(******) //SOMEDATA DD * 0 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 %SEQ(0) *EXAMPLE USING %SEQ(0) &V1. &A.&B.&C. %SEQ(2) *EXAMPLE USING %SEQ(2) &V1. &A.&B.&C. %SEQ(3) *EXAMPLE USING %SEQ(3) &V1. &A.&B.&C. %ENDJOB

Page 18

State Farm Pattern JCL - User's Guide

Explodes as:
//SOMEDATA DD * 0 1 2 3 4 5 6 7 8 12345678901234567890123456789012345678901234567890123456789012345678901234567890 *EXAMPLE USING %SEQ(0) ****** ABCDEF *EXAMPLE USING %SEQ(2) ****** A&B.&C. *EXAMPLE USING %SEQ(3) ****** A&B

This completes the section on the pattern control statements. When combined with the proper pattern variables, you can create simple pattern sets that can be used for a wide variety of uses. The next section will take a look at the tools available to work with pattern sets.

Page 19

State Farm Pattern JCL - User's Guide

Pattern Text Tools


There are several tools for building and testing pattern sets. These tools cover a wide variety of functions, from handling the conversion from pattern to production, the conversion from production to pattern and the insertion of the pattern variables and control statements themselves. Two groups of tools are reviewed in this section - tools that run the Exploder program and tools that can insert pattern control statements or convert non-pattern JCL into pattern. Explode Tools The first group of tools we will look at are called Explode tools because each of them runs the Exploder (PI854) program to convert pattern sets. The first of these tools we will look at is EXPLODE. If you would like to work on an example yourself as you follow along in the document, retrieve member QZ050EXP from ED.PANVALET into a PDS of your choice. EXPLODE The EXPLODE tool is a full-screen ISPF application that takes input from one or more PDS or Panvalet members or a sequential data set and converts the pattern text into production text, placing the output in a data set. EXPLODE runs the conversion process in the background, making EXPLODE a good choice for processing many pattern sets. Lets take a look at an EXPLODE example. To invoke EXPLODE, type TSO EXPLODE from any TSO command line or type EXPLODE from SPF option 6. Press Enter and the following menu will appear.
S1149---------------- EXPLODE - PRIMARY OPTION MENU ------------------------| COMMAND ===> | | | | | | SELECT OPTION ===> 1 | | | | 1 - EXPLODE FROM PDS | | | | 2 - EXPLODE FROM SEQUENTIAL DATA SET | | | | 3 - EXPLODE FROM PANVALET | | | | 4 - SPF | | | | 5 - TUTORIAL | | | | | | FULLY QUALIFIED PDS NAME (NO QUOTES) | | OUTPUT DATASET NAME ==> UTXX.EXPLODE.OUTPUT | | | | | | PRESS ENTER TO CONTINUE | -----PRESS END TO TERMINATE---------------------------------------------------

The first step in running EXPLODE is to select your input source type. EXPLODE allows pattern sets to be placed in a PDS, sequential data set or on Panvalet. At this time, you will also indicate where the exploded output will be placed. Keep in mind the output PDS does not have to exist EXPLODE will create it if necessary. If you send your exploded output to the PDS where your pattern sets are located, be sure to rename the exploded

Page 20

State Farm Pattern JCL - User's Guide

output member name. If you do not change the member name, your exploded output will overlay your input. You will see how to avoid an overlay in a moment. In this example, the input will be coming from a PDS, so option 1 is chosen. Press Enter to continue.
S1142----------------------- EXPLODE FROM PDS -----------------------------| COMMAND ===> | | | | | | ISPF LIBRARY: | | | | PROJECT ==> UTXX | | LIBRARY ==> WORK | | TYPE ==> JCL | | MEMBER ==> QZ050 ENTER FULL OR GENERIC NAME | | FOR PARTIAL LIST | | ENTER BLANK FOR ENTIRE LIST | | | | | | OTHER PARTITIONED DATASET: | | | | DATASET NAME ==> | | | | | | | | | | PRESS ENTER FOR SELECTION LIST | -----PRESS END TO TERMINATE---------------------------------------------------

From this screen, you can type in the name of the PDS containing your pattern sets. You can indicate the member to be processed or type in a partial name or even leave the member name field blank. If a partial name or no name is indicated, a list of matching members is displayed. In this example, a partial member name is indicated. Press Enter to continue.
S1143------------------COMMAND INPUT ===> EXPLODE - SELECTION LIST --------------- Row 1 of 1 SCROLL ===> PAGE

ENTER S ALL ABOVE TO SELECT ALL MEMBERS LISTED BELOW ENTER S BELOW TO SELECT INDIVIDUAL MEMBERS AFTER SELECTING INDIVIDUAL MEMBERS HIT PF15 KEY TO CONTINUE *** IF #_MEMBERS X #_EXPLODE_OFFICES > 15, YOU WILL GET OVERNIGHT TURNAROUND *** ---- PATTERN ---- OUTPUT JCL ---- PRINT ---- PRINT ---- NAME ---- MEMBER NAME ---- PATTERN ---- JCL QZ050EXP QZ050EXP NO NO *SELECTED* ******************************* Bottom of data ********************************

A list of matching members is displayed. In this example, a single member is displayed. From this screen you can control several options. First, the output member name field defaults to the input member name. As mentioned previously, if you are using the same output PDS as input, you should change the member name to prevent overlaying your source. If the input and output PDS names are different, the member name field can be left as is. You can also specify whether or not you wish to print the input and output members. If the number of members selected times the number of offices chosen is greater than 15, an overnight job class is used for the explode job; otherwise, turnaround is immediate.

Page 21

State Farm Pattern JCL - User's Guide

Type an S next to the member to be processed and press Enter.


------------------ EXPLODE - OFFICE SELECTION -----------------------------| COMMAND ===> | | ENTER S TO SELECT OFFICES IF NO OTHER EXPLODE VARIABLES ARE REQUIRED | | ENTER S* TO SELECT OFFICES IF OTHER EXPLODE VARIABLES ARE REQUIRED | | | | ==> 00-HOME OFFICE | | ==> 73-ISC EAST ==> 74-ISC CENTRAL ==> 75-ISC WEST | | ==> 77-ISC HOTSITE ==> 80-LIFE COMPANY ==> 91-REG. OFF. SUPP. | | ==> 50-ISC YEAR 2000 ==> 51-BLMJ51 YR 2000 ==> 40-ISC C.I. | | ==> TEST ENV. 41 ==> TEST ENV. 42 ==> TEST ENV. 43 | | ==> TEST ENV. 45 ==> TEST ENV. 45 ==> TEST ENV. 46 | | | | ==> s 01-ILLINOIS ==> 02-NORTH COAST ==> 03-CANADIAN | | ==> 04-MICHIGAN ==> 05-NO. CENTRAL ==> 06-WEST CENTRAL | | ==> 07-EASTERN ==> 08-NORTH TEXAS ==> 09-ALABAMA | | ==> 11-SOUTH CENTRAL ==> 12-GREATER CAL | | ==> 13-PENNSYLVANIA ==> 14-MISSOURI ==> 15-PACIFIC NW | | ==> 16-OHIO ==> 17-NORTHEASTERN ==> 18-INDIANA | | ==> 19-FLORIDA ==> 20-MT. STATES ==> 21-SEABOARD | | ==> 22-MID-SOUTH ==> 23-SOUTH COAST ==> 24-SUNLAND | | ==> 25-SOUTH TEXAS ==> 26-OKLAHOMA-KANS ==> 27-GEORGIA-S. CAR | | ==> 28-NO. ATLANTIC | | | -----PRESS ENTER TO CONTINUE-------------------------------------------------IKJ56250I JOB UTXXX001(JOB06846) SUBMITTED ***

With the member chosen, you will now indicate which office or offices to explode for. Type an S next to each office and press Enter. A batch job will be fabricated and submitted. After the job has completed, you can look at the converted text. Below is an example comparing a before and after look at some sample pattern text. Before (pattern set)
SPF/E EDIT L1 UTXX.WORK.JCL(QZ050EXP) - 01.00 Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //QZ050&OA.## JOB (,'BATCH DATABASE UPDATE OF QZ100BTM'), 000002 // CLASS=P,MSGCLASS=F,MSGLEVEL=1,REGION=384K 000003 //* VERSION A00 000004 //* Q JZZQ16 QZ050&OA.## BATCH DATABASE UPDATE OF QZ100BTM 000005 //STEP10 EXEC COBXG 000006 // PROG=&*PLC70. 000007 //LC20I1 DD DSN=VSAM&ON.02.FPERSYS.QZ100BTM.CLUSTER, 000008 // DISP=(SHR,KEEP,KEEP) 000009 //LC75O1 DD &STOCK. 000010 //LC72I1 DD * 000011 %ENDJOB ****** **************************** Bottom of Data ****************************

Page 22

State Farm Pattern JCL - User's Guide

Now look at the JCL after EXPLODE has converted it.


SPF/E EDIT L1 UTXX.EXPLODE.OUTPUT(QZ050EXP) - 01.00 Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //QZ050A## JOB (,'BATCH DATABASE UPDATE OF QZ100BTM'), 000002 // CLASS=P,MSGCLASS=F,MSGLEVEL=1,REGION=384K 000003 //* VERSION A00 000004 //* Q JZZQ16 QZ050A## BATCH DATABASE UPDATE OF QZ100BTM 000005 //STEP10 EXEC COBXG 000006 // PROG=PLC70 000007 //LC20I1 DD DSN=VSAM0102.FPERSYS.QZ100BTM.CLUSTER, 000008 // DISP=(SHR,KEEP,KEEP) 000009 //LC75O1 DD SYSOUT=(J,,0012),FCB=0012 000010 //LC72I1 DD * ****** **************************** Bottom of Data ****************************

The process for using a sequential data set or Panvalet as input to EXPLODE is very similar to using a PDS. Once the data set or member (for Panvalet) is selected, you choose the office or offices to process, a batch job is created and submitted and your pattern text is converted. BOOM The second tool available to run the Exploder program is BOOM. Since BOOM is an edit macro, you must in SPF edit of a member of a PDS. In addition to running the Exploder, BOOM can also run the JCLPREP vendor product. JCLPREP is used to check JCL for syntax errors and to validate the JCL for State Farm standards. The syntax for BOOM is: BOOM location options Location indicates where the job will run when executed: D Job runs on the Devplex P Job runs on the Prodplex S Job runs on the Supplex Nn Job runs in ISC or test system (office code) Options include: HODC regional JCL runs at Corporate (rarely used) NOPREP will not run JCLPREP (default is to run JCLPREP) ? Invokes an options screen Here are a few examples of how BOOM can be invoked. In the first example, the pattern JCL will be exploded for Corporate Prodplex and JCLPREP will be run. BOOM P In this example, the Exploder and JCLPREP are run for Illinois. BOOM 01 In this example, only the Exploder is run for Illinois. BOOM 01 NOPREP

Page 23

State Farm Pattern JCL - User's Guide

Now lets take a look at some JCL and an example of running BOOM against it.
SPF/E EDIT L1 UTXX.WORK.JCL(QZ050EXP) - 01.00 Columns 00001 00072 Command ===> boom ? Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //QZ050&OA.## JOB (,'BATCH DATABASE UPDATE OF QZ100BTM'), 000002 // CLASS=P,MSGCLASS=F,MSGLEVEL=1,REGION=384K 000003 //* VERSION A00 000004 //* Q JZZQ16 QZ050&OA.## BATCH DATABASE UPDATE OF QZ100BTM 000005 //STEP10 EXEC COBXG 000006 // PROG=&*PLC70. 000007 //LC20I1 DD DSN=VSAM&ON.02.FPERSYS.QZ100BTM.CLUSTER, 000008 // DISP=(SHR,KEEP,KEEP) 000009 //LC75O1 DD &STOCK. 000010 //LC72I1 DD * 000011 %ENDJOB ****** **************************** Bottom of Data ****************************

First, go into SPF edit of the member. If youd like, you can follow along with this example by retrieving member QZ050EXP from ED.PANVALET into your own PDS (if you haven't already done so). Type BOOM ? on the command line and press Enter to display the BOOM options screen.
+-----------------------------------------------------------------------------+ | BOOM - Options | | Command ===> | | | | | | | | Below are options for running BOOM. You must indicate the location | | where the JCL will run and if JCLPREP standards checking should be | | done (recommended). Optionally, you may indicate office code or | | global pattern JCL tables. | | | | Location: 01 (see list below) | | Run JCLPREP: Y (y,n) | | | | Office code table: HOME00.PIC.Q063 | | (default is HOME00.PIC.Q063) | | | | Global pattern JCL table: HOME00.PIC.LC222 | | (default is HOME00.PIC.LC222) | | | | The location values are D-Devplex, P-Prodplex, S-Supplex and office | | codes 00-09, 11-28, 40-46, 50-51, 73-75, 77, 80 and 91. | | | +-----------------------------------------------------------------------------+

You may indicate the location (office), optionally run JCLPREP and set overrides for the office code table (predefined variables) or global variable data set. The first time this screen is displayed all input fields would contain default values. In most cases, youll only need to change the office you wish to process.

Page 24

State Farm Pattern JCL - User's Guide

Once youve finished adjusting the options, press Enter to continue. BOOM will make a temporary copy of your JCL, explode that copy and then run JCLPREP. When BOOM completes, you will be in edit of the exploded copy of your JCL and see any JCLPREP messages.
EDIT UTXX.@JCLX.EXPLODED JCLPREP CC 8 Command ===> reset Scroll ===> CSR ****** ***************************** Top of Data ****************************** =NOTE= 3 MESSAGE(S) REPORTED BY JCLPREP =NOTE= 2 ERROR MESSAGE(S) =NOTE= 1 WARNING MESSAGE(S) ==MSG> .JCPA JCP0460E 'PGMNAME' IS REQUIRED AND MUST NOT BE OMITTED -- (J)5(P)3 ==MSG> .JCPA JCP0508W VALIDATION CAN NOT BE PERFORMED FOR THIS STEP -- (J)5(P)3 ==MSG> .JCPA JCP0526E JCL ERROR: 1 UNRECOGNIZED JCL STATEMENT(S) -- (J)6 000001 //QZ050A## JOB (,'BATCH DATABASE UPDATE OF QZ100BTM'), 000002 // CLASS=P,MSGCLASS=F,MSGLEVEL=1,REGION=384K 000003 //* VERSION A00 000004 //* Q JZZQ16 QZ050A## BATCH DATABASE UPDATE OF QZ100BTM .JCPA //STEP10 EXEC COBXG =NOTE= XXCOBXG PROC PROGM=,PROG=, =NOTE= XX GPARM=, =NOTE= XX SYSFICH='*', =NOTE= XX DMPCLAS='X' =NOTE= *** V E R S I O N 0 2 R E G I O N A L S U P P O R T 84/09/25 =NOTE= ==MSG> JCP0460E 'PGMNAME' IS REQUIRED AND MUST NOT BE OMITTED -- (J)5(P)3 ==MSG> JCP0508W VALIDATION CAN NOT BE PERFORMED FOR THIS STEP -- (J)5(P)3 =NOTE= =NOTE= &&GO EXEC PGM=&PROGM&PROG, =NOTE= XXGO EXEC PGM=, =NOTE= && PARM='&GPARM' =NOTE= XX PARM='' ==MSG> JCP0526E JCL ERROR: 1 UNRECOGNIZED JCL STATEMENT(S) -- (J)6 000006 // PROG=PLC70 000007 //LC20I1 DD DSN=VSAM0102.FPERSYS.QZ100BTM.CLUSTER, 000008 // DISP=(SHR,KEEP,KEEP) 000009 //LC75O1 DD SYSOUT=(J,,0012),FCB=0012 000010 //LC72I1 DD * ****** **************************** Bottom of Data ****************************

In this example, two error messages and one warning message was produced by JCLPREP. It is important you review these messages. Any errors left in your JCL will cause the Issuance processor to fail when you issue your JCL. To remove the messages, type RESET and press Enter. You can return to your original pattern source by pressing the End key. Lets remove the messages from JCLPREP by typing RESET and pressing Enter.
EDIT UTXX.@JCLX.EXPLODED Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //QZ050A## JOB (,'BATCH DATABASE UPDATE OF QZ100BTM'), 000002 // CLASS=P,MSGCLASS=F,MSGLEVEL=1,REGION=384K 000003 //* VERSION A00 000004 //* Q JZZQ16 QZ050A## BATCH DATABASE UPDATE OF QZ100BTM .JCPA //STEP10 EXEC COBXG 000006 // PROG=PLC70 000007 //LC20I1 DD DSN=VSAM0102.FPERSYS.QZ100BTM.CLUSTER, 000008 // DISP=(SHR,KEEP,KEEP) 000009 //LC75O1 DD SYSOUT=(J,,0012),FCB=0012 000010 //LC72I1 DD * ****** **************************** Bottom of Data ****************************

The messages are removed and your converted pattern text is shown. This converted text is identical to the output generated by the EXPLODE tool.

Page 25

State Farm Pattern JCL - User's Guide

As mentioned previously, the most popular use of the Exploder and pattern text is for JCL. However, other text such as PSBs or DBDs also contain pattern text. For those uses, Appendix A has been included. In Appendix A, a detailed look at running Exploder using JCL is presented. This concludes a look at the tools for running the Exploder. Next, well take a look at the tools available to convert production or test JCL to pattern the patternizing tools. Patternizing Tools A set of tools has been developed to help you create production pattern JCL from either executable production or test JCL. These tools can automate much of the work involved in creating pattern JCL; however, some manual effort may still be required especially for complex jobs. For maximum flexibility, these tools use SPF edit macros to perform the patternization functions. This allows you to have complete control over the patternization process. You can handle unusual situations by excluding lines and easily adding or modifying the resulting pattern JCL. If you already know the specific edit macro to use, you can specify the macro name or use the PATMENU macro to select from a list instead. You can also assign the macro to your PF keys. The patternizing macros perform the following functions: 1. Display a selection menu of the patternizing macros (PATMENU). 2. Renumber all job steps by 10 (PATRENUM macro). 3. Perform basic patternization of standard JCL (PATBASIC macro) and control the patternization session flow (PATBROW, PATPRINT, and PATPROF macros). 4. Insert model statements of pattern control statements (PATA, PATDO, PATDOVAR and PATIF macros). Requirements for Use The patternizing tools automatically handle most of the common Corporate-Regional differences. However, you must be aware of any application-specific differences in the JCL at a particular location. Obviously, you must have existing source JCL to patternize. The source JCL can be executable, pattern, or a mixture (such as pattern with an additional step or DD coded in executable JCL). However, some patternizing tools will not process the portion of the JCL that has been previously patternized. PATMENU You only really need to remember the name of one patternizing tool - PATMENU. If you do not remember the names of the other macros, type PATMENU on the command line of SPF edit. The PATMENU macro will display a list of the available patternizing macros. You can then choose the desired macro from the menu. Two restrictions apply when selecting macros from the menu: 1. There is no way to specify any parameters for the macro. For example, if you want to use the TERSE option of the PATRENUM macro, you must invoke the PATRENUM macro directly (PATRENUM TERSE on the command line), as TERSE is not the default. Selection through the menu always implies that defaults are to be used. You will still be presented with any additional input screens. 2. If you plan to select a model macro (such as PATDO), you must specify the line destination before invoking PATMENU.

Page 26

State Farm Pattern JCL - User's Guide

If the B (before) or A (after) line command is not used first, the model will be placed after the cursor line, which is the default destination. Choosing the macro from the menu is somewhat slower than entering the name directly, as it requires one additional step. Here is the menu that displays as a result of using PATMENU.
---------------------COMMAND ===> JCL PATTERNIZER --- MACRO MENU -----------------------

Select an Option ==> 1 2 3 4 5 6 PATBASIC PATRENUM PATDO PATDOVAR PATIF PATA -

Basic Patternization Renumber job steps Model - Repetition using local variables Model - Repetition using office pre-defined variables Model - Decision logic Model - Assignment statement

Date 00/00/00 User UTXX Time 00:00

PF - PATPROF - Set Patternization Profile Values PT - PATPRINT - Print Selected Reports PB - PATBROW - Browse Patternization Reports PD - PATDOC - Browse or Print the JCL Patternizer Documentation

PRESS ENTER TO CONTINUE ---PRESS END TO TERMINATE------------------------------------------------------

PATRENUM PATRENUM will renumber job steps by 10, starting with STEP10. All occurrences of the old step name, including backward references, will be changed. The source JCL can be either executable or patternized. Existing steps can be unnamed or named using any legal step name -- they do not have to be in the form STEPnnn. To renumber the steps, type PATRENUM in the command field of SPF edit. The job steps will be renumbered by 10 and the JCL redisplayed with all lines excluded except for those which contain a step reference or message. This highlighting allows for easier visual verification. If you would like a more concise display, use the TERSE option of the PATRENUM macro by entering PATRENUM TERSE or PATRENUM T in the command field. In this case, all lines will be excluded except for those that were actually changed. There are some restrictions to keep in mind when using PATRENUM: 1. All steps will be renumbered, even those in excluded lines. 2. All existing step names must be literals -- they cannot contain pattern variables. For example, //STEP&NUM. is not allowed. If some steps must be numbered using variables, then variables should be used for all steps. 3. Jobs which contain varying numbers of steps based upon location will probably not be numbered correctly. You must number these yourself using a variable in the step name that you increment. 4. The source JCL must not contain more than 999 different steps.

Page 27

State Farm Pattern JCL - User's Guide

Heres an example of using PATRENUM.


SPF/E EDIT L1 UTXX.WORK.JCL(PATRENM1) - 01.03 Command ===> patrenum Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //**PATRENUM EXAMPLE** 000002 //STEP11 EXEC ... 000003 //STEP12 EXEC ... 000004 //STEP25 EXEC ... 000005 //STEPXX EXEC ... 000006 //STEPAA EXEC ... 000007 %ENDJOB ****** **************************** Bottom of Data ****************************

Go into edit of your JCL. Type PATRENUM on the command line and press Enter.
SPF/E EDIT L1 UTXX.WORK.JCL(PATRENM1) - 01.03 Columns 00001 00072 Command ===> Scroll ===> CSR INFO: STEPS HAVE BEEN RENUMBERED - - - - - - - - - - - - - - - - - - - 1 Line(s) not Displayed 000002 //STEP10 EXEC ... 000003 //STEP20 EXEC ... 000004 //STEP30 EXEC ... 000005 //STEP40 EXEC ... 000006 //STEP50 EXEC ... - - - - - - - - - - - - - - - - - - - 1 Line(s) not Displayed ****** **************************** Bottom of Data ****************************

Each of the steps in the JCL has been renumbered, beginning with STEP10. PATBASIC PATBASIC performs standard patternization and will patternize the bulk of your JCL automatically. This includes items such as data set name, SYSOUT class and job card. Source JCL can be either executable JCL or a mixture of both pattern and executable JCL (such as an existing patternized job with new steps added in executable JCL form). If you wish to prevent PATBASIC from patternizing or altering any portion of the JCL, just exclude the statements. Only non-excluded lines are patternized. Previously patternized statements cannot be re-patternized, and must be excluded. You may not exclude just part of a JCL statement. If you need to exclude any part of it, then the entire JCL statement must be excluded. Because PATBASIC works by transforming the contents of the data set you are editing into pattern JCL, it is a good idea to either work with a copy of the source JCL or to save the resulting pattern to a different member name. If you have not yet saved the pattern JCL, you can CANCEL the edit session to avoid overlaying your source. PATBASIC will inform you of patternization that was done by inserted message lines and three reports. The Data Set Report is used to show before and after patternization of data set names. All other messages will be written to the Audit Report and the most important of these will also be written to the Miscellaneous Error Report. Messages are in the form PATnnn X YYYYYYYY, where PATnnn is the message number, X is the severity (I=Information, W=Warning, E=Error, S=Severe error), and YYYYYYYYY is the text of the message. Automatic or manual browse of the reports can be controlled by using the PATPROF, PATBROW, and PATPRINT macros, which are documented at the end of this section.

Page 28

State Farm Pattern JCL - User's Guide

Test versus Production JCL PATBASIC performs patternization somewhat differently depending upon when the source JCL is production or test. In general, production JCL is considered to be correct, while test JCL may need to be changed to use standard production concepts before patternizing. Due to the ambiguity of test JCL, incorrect assumptions may be made, resulting in incorrect pattern JCL. Patternization is likely to be more accurate if production JCL is used as input. With production JCL, no logical changes will be made to the JCL. Production source JCL is assumed to be correct - PATBASIC will not try to second-guess your intentions and make logical changes to your JCL, although it may warn you about unusual situations. No attempt will be made to change a test value to a production value. For example, test data set names will be left alone. The resulting pattern JCL should explode back to the equivalent of the source JCL, except for formatting and other cosmetic changes. With test JCL, logical changes may be made, as it is assumed that test JCL will likely have differences in items such as data set names, SYSOUT classes, and job card parameters. PATBASIC assumes that regional test JCL uses Corporate SYSOUT class concepts (i.e., SYSOUT=V, not SYSOUT=(J,,0012)) since the Regional format will not work for Corporate Devplex jobs. An attempt will be made to change test data set names to the correct production names. The assigned data set number portion or low level qualifier (LLQ) of the data set name will be matched with existing patternized data set names from production JCL. High and middle level qualifiers may be changed to match those of the production data set. A best match will be attempted; however, using the same LLQ with various suffixes may cause ambiguous or incorrect matches. Corporate versus Regional Input When the PATBASIC screen asks Does this JCL run at Corporate? remember that it is asking you about the location where this specific piece of executable JCL that you are using as the source will run. Some jobs run at both Corporate and in the regions; however, the specific JCL that you are using as source either runs at Corporate or in a region. For example, if your job runs at all locations, but the source JCL is for office 01, you should answer this question 'NO'. The only time that you should answer this question 'YES' is when either 1) office number is 00 or 2) this is Regional JCL at Corporate (jobs are run at Corporate for each Region). If a job runs in both Corporate and the regions, you will usually find that it can be more accurately patternized if you use the Corporate JCL as input, rather than the JCL for a regional office. This is because regional office JCL has a null default for many parameters. If the Corporate parameter can be one of several values, PATBASIC has no way of determining what value should be used and may not be able to even guess at a possible value. In particular - retention is not coded for disk data sets in regional office JCL. Since no retention information is available in the source JCL, no retention will be used in the pattern JCL. This will cause the JCL to explode for Corporate without retention information. Unless the Corporate retention is permanent, this is not likely to be correct. You may need to manually add the patternized retention information.

Page 29

State Farm Pattern JCL - User's Guide

GOLIB is not coded in regional JCL but is generally used in Corporate JCL. PATBASIC will assume that the Corporate GOLIB is HOME00.PRODLOAD.S073 if the program is a standard eight-character name of the form PXXXXV99. TIME is not usually coded on regional JCL. It will be defaulted to TIME=1439 at Corporate. SYSFICH is not usually coded on regional JCL. It will be defaulted to class F at Corporate. If the default assumptions are not valid, you will need to modify the generated pattern JCL. Limitations and Restrictions PATBASIC won't generate %DO control statements for you since it cannot accurately determine what is to be repeated job, step(s), or individual DD names. You can add the necessary loop controls manually with the PATDO or PATDOVAR macros. You may also need to collapse the repeated portion of the JCL into just the statements that should be repeated. Jobstream comments will not be created or patternized, and the version will not be updated. Controlling the Patternization Session Several macros are available to control the browsing and printing of the reports that are produced by the PATBASIC macro. Flexibility is provided so that browsing can be either automatic or only done when specifically requested. The PATPROF macro is used to set the default options for handling the reports from the PATBASIC macro. You can specify whether or not you want to automatically browse each report and whether to have the Print Options panel automatically displayed. This allows you to easily bypass viewing the reports. Important messages are always inserted in the JCL being edited, so it may not be necessary to view the reports, particularly after you become familiar with how PATBASIC handles various situations. Here is an example screen shot of PATPROF.
SI774 --------------COMMAND ===> JCL PATTERNIZER --- SET PROFILE -----------------------

Do you want Automatic Browse of the following reports? Audit report ==> Y Dataset report ==> Y Miscellaneous error report ==> Y (Y/N)

Date 00/00/00 User UTXX Time 00:00

Do you want to overide the above choices and Browse the reports when severe errors are encountered? ==> Y (Y/N) Do you want to see the Print Options panel after you have browsed the report files? ==> N (Y/N) Pattern model PDS ==> No quotes

PRESS ENTER TO CONTINUE AND SAVE THE CHANGES ---PRESS END TO TERMINATE AND NOT SAVE THE CHANGES-----------------------------

Page 30

State Farm Pattern JCL - User's Guide

The PATBROW macro allows you to browse the reports produced by the PATBASIC macro. You can also request the Print Options panel. PATBROW is useful if you have requested NO to automatic browse of the reports, as it allows you to view the last set of reports that were produced if you later change your mind. Here is an example screen shot of PATBROW.
SI784 -------------COMMAND ===> JCL PATTERNIZER --- BROWSE OPTIONS ---------------------

Select the Report(s) you want to Browse: Audit report ==> N Dataset report ==> N Miscellaneous error report ==> N (Y/N)

Date 00/00/00 User UTXX Time 00:00

Do you want to go to the Print Options panel after you have Browsed the Report(s)? ==> N (Y/N)

PRESS ENTER TO CONTINUE ---PRESS END TO TERMINATE -----------------------------------------------------

The PATPRINT macro allows you to print the reports produced by the PATBASIC macro. One or two or all three of the reports can be printed to either a system printer or local printer. Here is an example screen shot of PATPRINT.
SI771 -------------COMMAND ===> JCL PATTERNIZER --- PRINT OPTIONS ----------------------

Select a Print Option ==> S - System print P - Printo to Local Printer D - Dsprint Select the Report(s) you want Printed: Audit report ==> N Dataset report ==> N Miscellaneous error report ==> N (Y/N)

Date 00/00/00 User UTXX Time 00:00

Printer Id for PRINTO Number of copies for PRINTO Printer Id for DSPRINT Sysout class for System print

==> ==> 1 ==> ==> A

(1-9)

PRESS ENTER TO CONTINUE AND PRINT THE REPORT(S) ---PRESS END TO TERMINATE AND NOT PRINT THE REPORT(S)--------------------------

Page 31

State Farm Pattern JCL - User's Guide

A PATBASIC Example Here is an example using the PATBASIC tool. In this example, the JCL is production JCL from the Illinois regional office. PATBASIC has been set up to automatically browse all reports in the event a severe error is encountered.
SPF/E EDIT L1 UTXX.WORK.JCL(QZ050PRD) - 01.00 Columns 00001 00072 Command ===> patbasic Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //QZ050A## JOB (,'BATCH DATABASE UPDATE OF QZ100BTM'), 000002 // CLASS=P,MSGCLASS=F,MSGLEVEL=1,REGION=384K 000003 //* VERSION A00 000004 //* Q JZZQ16 QZ050A## BATCH DATABASE UPDATE OF QZ100BTM 000005 //STEP10 EXEC COBXG, 000006 // PROG=PLC70 000007 //LC20I1 DD DSN=VSAM0102.FPERSYS.QZ100BTM.CLUSTER, 000008 // DISP=(SHR,KEEP,KEEP) 000009 //LC75O1 DD SYSOUT=(J,,0012),FCB=0012 000010 //LC72I1 DD * 000011 /* ****** **************************** Bottom of Data ****************************

While in SPF edit of the JCL, type PATBASIC on the command line and press Enter.
SI769 ---------------COMMAND ===> JCL PATTERNIZER --- JCL SOURCE ----------------------

Source JCL Information:

Jobname: QZ050A## Date 00/00/00 User UTXX Time 00:00

- Which Office Number was used for the source? ==> 01 - Does this JCL run at Corporate? ==> N (Y/N)

Source JCL Type: - Is this Test JCL? ==> N (Y/N)

Other Information: - Do you want other Dataset-like names that are not in DD statements patternized? ==> Y (Y/N)

PRESS ENTER TO CONTINUE ----PRESS END TO TERMINATE----------------------------------------------------

PATBASIC will display the screen above. From this screen, you can provide information to PATBASIC to control how the patternization will take place. In this instance, the office number is set as Illinois (01), does not run at Corporate, is not test JCL and the option to replace data set-like names not in DD statements is accepted.

Page 32

State Farm Pattern JCL - User's Guide

Press Enter to continue.


SI770 --------------COMMAND ===> Describe this job: JCL PATTERNIZER --- JOB/MACHINE -----------------------

Jobname: QZ050A## Date 00/00/00 User UTXX Time 00:00

- From which Machine does this job access data? S Host (Select only one, Use any character) Any Machine (OMID) Auto Machine (MID) Fire Machine (FOMID) General Machine (GOMID) Health Update Machine (HOMID) Telephone Update Machine (TUMID)

- Enter A (Auto) or F (Fire) if jobname and default dataset high level qualifiers should contain Auto/Fire alpha State/Division code. ==> (A/F/blank)

PRESS ENTER TO CONTINUE ----PRESS END TO TERMINATE----------------------------------------------------

PATBASIC now needs to know if data will be accessed on host or offload machines. Offload machines are rarely used any more, so Host is selected. Also, this job will not contain Auto or Fire state/division data. Press Enter to continue.
BROWSE UTXX.@PAT.AUDIT Line 00000000 Col 001 079 Command ===> Scroll ===> PAGE ********************************* Top of Data ********************************** DSNAME: UTXX.WORK.JCL(QZ050PRD) PAGE: 1 CHRONOLOGICAL PATTERNIZATION PROCESS AUDIT TRAIL 00/00/00 00:00:00

PAT103 W REGION SIZE WAS LESS THAN 512K - USING REGION=512K PAT053 E PROD DSN LLQ NOT LOCATED IN DSN XREF FILE OLD DSN: VSAM0102.FPERSYS.QZ100BTM.CLUSTER PAT042 I PATTERNIZED SYSOUT=(J,,0012),FCB=0012 AS &STOCK. PAT104 I JOBNAME IN JOBSTREAM COMMENT CARD PATTERNIZED

END OF PROCESSING FOR JOB: QZ050A## HIGHEST SEVERITY LEVEL WAS: 8 ******************************** Bottom of Data ********************************

PATBASIC has now processed the original JCL, made its attempt to patternize the JCL and has generated its reports. Since PATBASIC was set up to browse the reports automatically, the Audit report is displayed.

Page 33

State Farm Pattern JCL - User's Guide

Press the End key to continue.


BROWSE UTXX.@PAT.DSNERR Line 00000000 Col 001 079 Command ===> Scroll ===> PAGE ********************************* Top of Data ********************************** DSNAME: UTXX.WORK.JCL(QZ050PRD) PAGE: 1 DATASET NAME PATTERNIZATION RESULTS 00/00/00 00:00:00

INPUT : VSAM0102.FPERSYS.QZ100BTM.CLUSTER PATTERN: VSAM&ON.02.FPERSYS.QZ100BTM.CLUSTER MESSAGE: PROD DSN LLQ NOT LOCATED IN DSN XREF FILE

END OF PROCESSING FOR JOB: QZ050A## HIGHEST SEVERITY LEVEL WAS: 8 ******************************** Bottom of Data ********************************

The Data Set Error Report is now displayed. Press End to continue.
BROWSE UTXX.@PAT.MISCERR Line 00000000 Col 001 079 Command ===> Scroll ===> PAGE ********************************* Top of Data ********************************** DSNAME: UTXX.WORK.JCL(QZ050PRD) PAGE: 1 MISCELLANEOUS PATTERNIZATION ERRORS 00/00/00 00:00:00

PAT053 E PROD DSN LLQ NOT LOCATED IN DSN XREF FILE OLD DSN: VSAM0102.FPERSYS.QZ100BTM.CLUSTER

END OF PROCESSING FOR JOB: QZ050A## HIGHEST SEVERITY LEVEL WAS: 8 ******************************** Bottom of Data ********************************

The final report, Miscellaneous Patternization Errors, is displayed. Press End to continue.
SPF/E EDIT L1 UTXX.WORK.JCL(QZ050PRD) - 01.01 Columns 00001 00072 Command ===> Scroll ===> CSR HAP620B: PATTERNIZATION COMPLETED ==MSG> PAT103 W REGION SIZE WAS LESS THAN 512K - USING REGION=512K 000001 %&PATTERNIZED.(UTXX 00/00/00 00:00:00 - DO NOT DELETE!!!) 000002 //QZ050&OA.## JOB (&OF.0&ON.0000000000P0, 000003 // 'BATCH DATABASE UPDATE OF QZ100BTM'), 000004 // REGION=512K,MSGLEVEL=1,MSGCLASS=F,CLASS=P 000005 //* VERSION A00 ==MSG> PAT104 I JOBNAME IN JOBSTREAM COMMENT CARD PATTERNIZED 000006 //* Q JZZQ16 QZ050&OA.## BATCH DATABASE UPDATE OF QZ100BTM 000007 //STEP10 EXEC COBXG, 000008 // PROG=PLC70 ==MSG> PAT053 E PROD DSN LLQ NOT LOCATED IN DSN XREF FILE ==MSG> OLD DSN: VSAM0102.FPERSYS.QZ100BTM.CLUSTER 000009 //LC20I1 DD DSN=VSAM&ON.02.FPERSYS.QZ100BTM.CLUSTER, 000010 // DISP=(SHR,KEEP,KEEP) 000011 //LC75O1 DD &STOCK. 000012 //LC72I1 DD * 000013 /* 000014 %ENDJOB ****** **************************** Bottom of Data ****************************

The original JCL has now been altered with pattern statements. Messages are displayed near the changes to describe what the patternizer did. You can now make any adjustments necessary.

Page 34

State Farm Pattern JCL - User's Guide

Model Macros While the PATBASIC macro will perform the required patternization for many typical jobs, you may need to insert one or more pattern control statements into the JCL to perform special processing. Several JCL patternizer macros are available which will insert a model or example of the necessary statement(s) for common situations. The steps required to use the model are the same regardless of the specific model. First, decide where you want the model inserted and mark the destination line with B (before) or A (after). The default destination is the line after which the cursor is on. Next, invoke the desired model macro directly by typing its name on the command line or use the PATMENU macro to choose the macro from a list. Depending on the model, you may be asked for more information. Upon return, the model line and a message will be inserted in the JCL. You may need to edit the model line. Typing RESET will remove any messages; however, this is not necessary as the messages are not part of the data and will not be saved. The following model macros are available. PATA The PATA edit macro inserts a pattern variable assignment model statement into an edit member. Here is an example of using PATA.
SPF/E EDIT L1 UTXX.WORK.JCL(Z1988COR) - 01.01 Columns 00001 00072 Command ===> pata Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //Z1988A## JOB (01101DIV0020000P0, 000002 // 'CLAIMS-PRODUCTION '), 000003 // REGION=320K,MSGLEVEL=1,MSGCLASS=F,CLASS=P 000004 //*MAIN FAILURE=CANCEL 000005 //* VERSION A00 a00006 //* A JSNX101 Z1988A## CREATE SALVAGE LISTING 000007 //STEP10 EXEC PLIXG, 000008 // PROG=PIXKF 000009 //A291 DD DSN=HOME00.CLAIM.A29101(0), 000010 // DISP=(OLD,KEEP,KEEP) 000011 //R1234567 DD SYSOUT=A, 000012 // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118) ****** **************************** Bottom of Data ****************************

Page 35

State Farm Pattern JCL - User's Guide

First, go into edit of your JCL. Type PATA on the command line and place an A or B on the line to put the sample assignment control statement after or before. Press Enter.
SPF/E EDIT L1 UTXX.WORK.JCL(Z1988COR) - 01.02 Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //Z1988A## JOB (01101DIV0020000P0, 000002 // 'CLAIMS-PRODUCTION '), 000003 // REGION=320K,MSGLEVEL=1,MSGCLASS=F,CLASS=P 000004 //*MAIN FAILURE=CANCEL 000005 //* VERSION A00 000006 //* A JSNX101 Z1988A## CREATE SALVAGE LISTING ==MSG> SAMPLE PATTERN VARIABLE ASSIGNMENT STATEMENT SHOWN BELOW 000007 %&LOCALVAR.(VALUE) 000008 //STEP10 EXEC PLIXG, 000009 // PROG=PIXKF 000010 //A291 DD DSN=HOME00.CLAIM.A29101(0), 000011 // DISP=(OLD,KEEP,KEEP) 000012 //R1234567 DD SYSOUT=A, 000013 // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118) ****** **************************** Bottom of Data ****************************

The sample pattern variable assignment statement is inserted into your JCL at the location you specified along with a message. PATDO The PATDO edit macro inserts a model %DO control statement into your JCL. Heres an example of the PATDO edit macro.
SPF/E EDIT L1 UTXX.WORK.JCL(Z1988COR) - 01.01 Columns 00001 00072 Command ===> patdo Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //Z1988A## JOB (01101DIV0020000P0, 000002 // 'CLAIMS-PRODUCTION '), 000003 // REGION=320K,MSGLEVEL=1,MSGCLASS=F,CLASS=P 000004 //*MAIN FAILURE=CANCEL 000005 //* VERSION A00 a00006 //* A JSNX101 Z1988A## CREATE SALVAGE LISTING 000007 //STEP10 EXEC PLIXG, 000008 // PROG=PIXKF 000009 //A291 DD DSN=HOME00.CLAIM.A29101(0), 000010 // DISP=(OLD,KEEP,KEEP) 000011 //R1234567 DD SYSOUT=A, 000012 // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118) ****** **************************** Bottom of Data ****************************

Page 36

State Farm Pattern JCL - User's Guide

First, go into edit of your JCL. Type PATDO on the command line and place an A or B on the line to put the sample control statement after or before. Press Enter.
SI768 --------------COMMAND ===> JCL PATTERNIZER --- LOOP VALUES -----------------------

Local variable name to be used ==> STDN Enter the literal values for the loop below: 1) 1 2) 2 3) 3 4) 5) 6) 7) 8) 9) 10) 11) 12) 13) 14)

Date 00/00/00 User UTXX Time 00:00

Do not use commas or other special characters in the literal values. This could result in unpredictable results.

PRESS ENTER TO CONTINUE ---PRESS END TO TERMINATE-----------------------------------------------------

PATDO will then display a screen to allow you to control how the %DO statement will be built. First, you indicate the name of the local variable to be used (leave out the ampersand and period use only the letters of the variable name). Then indicate up to 14 values that you wish to place in a list. These values will cause the loop to iterate the same number of times as values in the list. Once youve filled in the information you desire, press Enter to continue.
SPF/E EDIT L1 UTXX.WORK.JCL(Z1988COR) - 01.02 Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //Z1988A## JOB (01101DIV0020000P0, 000002 // 'CLAIMS-PRODUCTION '), 000003 // REGION=320K,MSGLEVEL=1,MSGCLASS=F,CLASS=P 000004 //*MAIN FAILURE=CANCEL 000005 //* VERSION A00 000006 //* A JSNX101 Z1988A## CREATE SALVAGE LISTING 000007 %DO&STDN.(1,2,3) ==MSG> MOVE THE STATEMENTS TO BE REPEATED FOR EACH &STDN. HERE 000008 %ENDDO 000009 //STEP10 EXEC PLIXG, 000010 // PROG=PIXKF 000011 //A291 DD DSN=HOME00.CLAIM.A29101(0), 000012 // DISP=(OLD,KEEP,KEEP) 000013 //R1234567 DD SYSOUT=A, 000014 // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118) ****** **************************** Bottom of Data ****************************

The sample %DO/%ENDDO loop is built with the list of values previously indicated and inserted into your JCL at the location you specified along with a message to indicate where to place additional statements.

Page 37

State Farm Pattern JCL - User's Guide

PATDOVAR The PATDOVAR edit macro inserts a model %DO%VAR control statement into your JCL. Heres an example of using the PATDOVAR edit macro.
SPF/E EDIT L1 UTXX.WORK.JCL(Z1988COR) - 01.01 Columns 00001 00072 Command ===> patdovar Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //Z1988A## JOB (01101DIV0020000P0, 000002 // 'CLAIMS-PRODUCTION '), 000003 // REGION=320K,MSGLEVEL=1,MSGCLASS=F,CLASS=P 000004 //*MAIN FAILURE=CANCEL 000005 //* VERSION A00 a00006 //* A JSNX101 Z1988A## CREATE SALVAGE LISTING 000007 //STEP10 EXEC PLIXG, 000008 // PROG=PIXKF 000009 //A291 DD DSN=HOME00.CLAIM.A29101(0), 000010 // DISP=(OLD,KEEP,KEEP) 000011 //R1234567 DD SYSOUT=A, 000012 // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118) ****** **************************** Bottom of Data ****************************

First, go into edit of your JCL. Type PATDOVAR on the command line and place an A or B on the line to put the sample control statement after or before. Press Enter.
SI767 ------------COMMAND ===> JCL PATTERNIZER --- DO VAR VARIABLES --------------------

Select a variable to loop by ==> 4 1 2 3 4 5 6 7 8 9 10 11 12 13 Any Machine Auto Machine Auto Alpha State/Division Auto Numeric State/Division Auto Numeric State Auto Numeric Division Fire Machine Fire Processing Code Fire Alpha Division Fire Numeric Division General Machine Health Machine Telephone Update Machine (OMID) (MID) (STDA) (STDN) (ST) (DIV) (FOMID) (FDIV) (FODIVA) (FODIV) (GOMID) (HOMID) (TUMID)

Date 00/00/00 User UTXX Time 00:00

PRESS ENTER TO CONTINUE ---PRESS END TO TERMINATE-----------------------------------------------------

Page 38

State Farm Pattern JCL - User's Guide

PATDOVAR will then display a list of predefined variables that vary within an office. Indicate the number that matches the predefined variable of your choice and press Enter.
SPF/E EDIT L1 UTXX.WORK.JCL(Z1988COR) - 01.02 Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //Z1988A## JOB (01101DIV0020000P0, 000002 // 'CLAIMS-PRODUCTION '), 000003 // REGION=320K,MSGLEVEL=1,MSGCLASS=F,CLASS=P 000004 //*MAIN FAILURE=CANCEL 000005 //* VERSION A00 000006 //* A JSNX101 Z1988A## CREATE SALVAGE LISTING 000007 %DO%VAR(&STDN.) ==MSG> MOVE THE STATEMENTS TO BE REPEATED ==MSG> FOR EACH AUTO NUMERIC STATE/DIVISION HERE 000008 %ENDDO 000009 //STEP10 EXEC PLIXG, 000010 // PROG=PIXKF 000011 //A291 DD DSN=HOME00.CLAIM.A29101(0), 000012 // DISP=(OLD,KEEP,KEEP) 000013 //R1234567 DD SYSOUT=A, 000014 // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118) ****** **************************** Bottom of Data ****************************

The sample %DO%VAR/%ENDDO loop is built using the predefined variable previously indicated and inserted into your JCL at the location you specified along with a message to indicate where to place additional statements. PATIF The PATIF edit macro inserts a model %IF control statement into your JCL. Heres an example using the PATIF edit macro.
SPF/E EDIT L1 UTXX.WORK.JCL(Z1988COR) - 01.01 Columns 00001 00072 Command ===> patif Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //Z1988A## JOB (01101DIV0020000P0, 000002 // 'CLAIMS-PRODUCTION '), 000003 // REGION=320K,MSGLEVEL=1,MSGCLASS=F,CLASS=P 000004 //*MAIN FAILURE=CANCEL 000005 //* VERSION A00 a00006 //* A JSNX101 Z1988A## CREATE SALVAGE LISTING 000007 //STEP10 EXEC PLIXG, 000008 // PROG=PIXKF 000009 //A291 DD DSN=HOME00.CLAIM.A29101(0), 000010 // DISP=(OLD,KEEP,KEEP) 000011 //R1234567 DD SYSOUT=A, 000012 // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118) ****** **************************** Bottom of Data ****************************

Page 39

State Farm Pattern JCL - User's Guide

First, go into edit of your JCL. Type PATIF on the command line and place an A or B on the line to put the sample control statement after or before. Press Enter.
SPF/E EDIT L1 UTXX.WORK.JCL(Z1988COR) - 01.02 Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //Z1988A## JOB (01101DIV0020000P0, 000002 // 'CLAIMS-PRODUCTION '), 000003 // REGION=320K,MSGLEVEL=1,MSGCLASS=F,CLASS=P 000004 //*MAIN FAILURE=CANCEL 000005 //* VERSION A00 000006 //* A JSNX101 Z1988A## CREATE SALVAGE LISTING 000007 %IF&SYSTEM.%EQ(168) ==MSG> STATEMENTS TO BE INSERTED WHEN TRUE . . . 000008 %ELSE ==MSG> STATEMENTS TO BE INSERTED WHEN FALSE . . . 000009 %ENDELSE ==MSG> MORE STATEMENTS TO BE INSERTED WHEN TRUE . . . 000010 %ENDIF 000011 //STEP10 EXEC PLIXG, 000012 // PROG=PIXKF 000013 //A291 DD DSN=HOME00.CLAIM.A29101(0), 000014 // DISP=(OLD,KEEP,KEEP) 000015 //R1234567 DD SYSOUT=A, 000016 // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=6118) ****** **************************** Bottom of Data ****************************

The sample %IF statement is built and inserted into your JCL at the location you specified along with a message to indicate where to place additional statements. Typical Patternization Session As you prepare to convert production or test JCL using the patternization tools, you should take some steps to increase the accuracy of the JCL these tools produce. Here is a typical scenario to follow when converting production or test JCL to pattern: 1. If the source JCL is executable, make sure the JCL is syntactically correct and meets State Farm standards by using the PREP command to run JCLPREP. 2. Go into SPF edit on a new member so that you dont accidentally alter you original source JCL. 3. Copy the source JCL member into the new member using the SPF COPY edit command. 4. Use the PATRENUM edit macro to renumber the job steps by 10. 5. Use the RESET command to unhide all statements. Then use the XX (exclude) line block commands to exclude any JCL statements that should not be automatically patternized, such as nonstandard lines the patternizer cant handle or are already patternized. 6. Use the PATBASIC edit macro to convert the non-excluded JCL. Be sure to type job information when prompted. Review all messages produced by PATBASIC and carefully examine the alterations. 7. Add do loops or special processing by invoking one of the pattern model macros. 8. Use SPF edit to finalize or customize any patternization. 9. Save or Cancel your edit session. 10. Optionally explode the pattern JCL for one or more offices to verify the executable JCL once again with JCLPREP. 11. Repeat steps 1-10 until the JCL in step 10 is correct.

Page 40

State Farm Pattern JCL - User's Guide

Pattern JCL Documentation PATDOC The PATDOC tool points to additional documentation for pattern JCL. Type PATDOC from any TSO command line or SPF option 6 and press Enter.
SI794 -----------Command ===> JCL PATTERNIZER --- ANALYST DOCUMENTATION ---- Row 1 of 1 Scroll ===> PAGE

Enter a B to browse the document or a P to print the document to the system printer.

_ Explanation of messages produced by the PATBASIC macro ******************************* Bottom of data ********************************

PATDOC contains a document that explains all of the messages produced by the PATBASIC edit macro. To browse this document, type B and press Enter. To print the document, type P and press Enter. PATVARS The PATVARS command will produce a data set containing all of the pre-defined variables and global pattern variables found in the production HOME00.PIC.LC222 table. This output is useful for variable documentation or testing new or changed variables. The output data set contains two sections - one for the pre-defined variables and the other for the global variables. Each line of the data set contains an assignment statement for the variable. To run PATVARS, type 'TSO PATVARS' from any TSO command line or type 'PATVARS' from SPF option 6 and press Enter. You can also specify an office code as a parameter to PATVARS. When an office code is indicated, the Exploder program is run for that office.

Page 41

State Farm Pattern JCL - User's Guide

Below is a snapshot of the data set produced by PATVARS without an office code specified:
SPF/E EDIT L1 UTXX.T83577.OUTPUT Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 ********************************** 000002 * PRE-DEFINED VARIABLES SECTION * 000003 ********************************** 000004 &ON = &ON. 000005 &ONME = &ONME. 000006 %DO%VAR(&STDN.) 000007 &STDN = &STDN. 000008 %ENDDO 000009 %DO%VAR(&STDA.) 000010 &STDA = &STDA. 000011 %ENDDO 000012 %DO%VAR(&MID.) 000013 &MID = &MID. 000014 %ENDDO 000015 %DO%VAR(&FDIV.) 000016 &FDIV = &FDIV. 000017 %ENDDO 000018 %DO%VAR(&FODIV.) 000019 &FODIV = &FODIV. 000020 %ENDDO 000021 %DO%VAR(&FODIVA.) 000022 &FODIVA = &FODIVA. 000023 %ENDDO 000024 %DO%VAR(&FOMID.) 000025 &FOMID = &FOMID. 000026 %ENDDO 000027 %DO%VAR(&GOMID.) 000028 &GOMID = &GOMID. 000029 %ENDDO 000030 %DO%VAR(&HOMID.) 000031 &HOMID = &HOMID. 000032 %ENDDO 000033 %DO%VAR(&TUMID.) 000034 &TUMID = &TUMID. 000035 %ENDDO 000036 ********************************** 000037 * GLOBAL VARIABLES SECTION * 000038 **********************************

Page 42

State Farm Pattern JCL - User's Guide

You could run the BOOM tool at this point to explode these variables for the office you choose. However, by adding the office code to the PATVARS command, you can combine these two steps into one. Here is an example of typing PATVARS 01 to view the exploded pre-defined and global variables for Illinois.
SPF/E EDIT L1 UTXX.T63430.OUTPUT Columns 00001 00072 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 ********************************** 000002 * PRE-DEFINED VARIABLES SECTION * 000003 ********************************** 000004 &ON = 01 000005 &ONME = ILIO 000006 &STDN = 131 000007 &STDN = 133 000008 &STDN = 134 000009 &STDN = 135 000010 &STDN = 136 000011 &STDN = 137 000012 &STDA = A 000013 &STDA = D 000014 &STDA = E 000015 &STDA = F 000016 &STDA = C 000017 &STDA = B 000018 &MID = 4 000019 &FDIV = 1 000020 &FDIV = 2 000021 &FDIV = 6 000022 &FODIV = 1 000023 &FODIV = 2 000024 &FODIV = 6 000025 &FODIVA = X 000026 &FODIVA = Y 000027 &FODIVA = Z 000028 &FOMID = 3 000029 &GOMID = 2 000030 &HOMID = 2 000031 &TUMID = 3 000032 ********************************** 000033 * GLOBAL VARIABLES SECTION * 000034 ********************************** 000035 &++ = ++ 000036 &+* = /* 000037 &+= +000038 &-= --

Appendix A - EXPLODER Program (PI854)


In this section, well take a detailed look at some JCL to run PI854 and examine all of the requirements to run Exploder properly. The intent of this section is to provide a thorough understanding of the explode process for non-JCL applications such as PSBs, DBDs or system tables. Of course, you can use the JCL discussed here to explode your own JCL, but keep in mind there are tools for this purpose (EXPLODE and BOOM).

Page 43

State Farm Pattern JCL - User's Guide

Here is an example of JCL that runs the Exploder.


SPF/E EDIT L1 UTXX.WORK.JCL(EXPLODE) - 01.45 Command ===> Scroll ===> CSR ****** ***************************** Top of Data ****************************** 000001 //UTXXEXPL JOB CLASS=S,MSGCLASS=1,NOTIFY=UTXX,REGION=0M 000002 //* 000003 //********************************************************************** 000004 //* SAMPLE JCL TO RUN THE PI854 EXPLODER PROGRAM 000005 //********************************************************************** 000006 //********************************************************************** 000007 //* STEP10 - DELETE ANY EXISTING OUTPUT EXPLODE DATASET 000008 //********************************************************************** 000009 //STEP10 EXEC PGM=IDCAMS 000010 //SYSPRINT DD SYSOUT=* 000011 //SYSIN DD * 000012 DELETE UT.XX.EXPLODED PURGE 000013 //********************************************************************** 000014 //* STEP20 - RUN EXPLODER ON DATASET ASSOCIATED WITH //PATTERN 000015 //********************************************************************** 000016 //STEP20 EXEC PLIXG,PROG=PI854 000017 //STEPLIB DD DSN=PIC.DELTA.LOADLIB4,DISP=SHR 000018 //GLOBAL DD DSN=HOME00.PIC.LC222,DISP=SHR 000019 //PATTERN DD DSN=UTXX.WORK.JCL(QZ050EXP),DISP=SHR 000020 //CODES DD DSN=HOME00.PIC.Q063,DISP=SHR 000021 //CTLCARD DD * 000022 ON(01) 000023 /* 000024 //PRODJCL DD DSN=UT.XX.EXPLODED, 000025 // DISP=(NEW,CATLG,DELETE), 000026 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS), 000027 // SPACE=(TRK,(15,15),RLSE),UNIT=DISK, 000028 // LABEL=RETPD=005 000029 //PRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0,DSORG=PS) ****** **************************** Bottom of Data ****************************

In this example JCL, pattern text in UTXX.WORK.JCL(QZ050EXP) is converted by the Exploder program and written to data set UT.XX.EXPLODED. STEP20 of this JCL runs the Exploder. To help you better understand how STEP20 is constructed, lets start with the GLOBAL DD. GLOBAL DD
000018 //GLOBAL DD DSN=HOME00.PIC.LC222,DISP=SHR

The GLOBAL DD is an optional statement used to point to the global variable data set. The global variables used by State Farm are in data set HOME00.PIC.LC222. Recall from an earlier section that global variables maintain their scope from one pattern set to another. The LC222 data set is maintained in accordance with State Farm standards. If you decide to use your own global variable data set, the variables defined must be contained within a %GLOBAL and %ENDGLOBAL control statement pair. The GLOBAL DD data set, as all data sets used by the Exploder, must have an 80-byte record length. PATTERN DD
000019 //PATTERN DD DSN=UTXX.WORK.JCL(QZ050EXP),DISP=SHR

If the GLOBAL DD statement was not used, the PATTERN DD statement should point to data that contains global variable definitions (if used) and your pattern set input. If the GLOBAL DD statement was used, the data set pointed to by the PATTERN DD statement will be your pattern set input.

Page 44

State Farm Pattern JCL - User's Guide

In this example, the pattern set is stored in the member of a PDS. You may find the need to use multiple members or have multiple data sets concatenated. Keep in mind the rules for pattern sets all statements preceding a %ENDJOB control statement or the end of the input source. If you include multiple members or data sets on the PATTERN DD statement, multiple pattern sets may be used. If you want a variable to maintain its value across multiple pattern sets, it must be either a global or predefined variable. CODES DD
000020 //CODES DD DSN=HOME00.PIC.Q063,DISP=SHR

The CODES DD statement points to the predefined variable data set. Predefined variables are used to represent the codes that are unique across each State Farm location. State Farms standard set of predefined variables are located in the data set HOME00.PIC.Q063. Each record in the Q063 represents a State Farm location region, test bed and Corporate. In normal practice, you will use the Q063 for your processing. The most common deviation from this practice as at the time of a regional realignment. During a realignment, State Farm policyholder records may be transferred from one agent to another, requiring the new codes within their records. To test the conditions after the realignment, a test set of predefined variable codes may be established by the project team. This test data set can be input to the CODES DD. The Exploder program requires the Q063 to follow a special format. Q063 (Predefined Variable) Data Set Record Format /OFEREGNSTDAM*F*DXM*M*M*M The syntax for the Q063 data set record format is: 1. 2. 3. 4. 5. 6. 7. 8. 9. 10. 11. 12. 13. 14. 15. 16. 17. 18. 19. 20. 21. 22. First character must be a single quote (). The second character must be a slash (/). OF is the numeric office code. E is the alphabetic office code known as the entry point. REGN is the alphabetic region abbreviation. ST is the numeric state code(s) for Auto. D is the numeric division code(s) for Auto. A is the alphabetic division code(s) for Auto. M is the numeric offload machine number for Auto. The * is a constant. F is the numeric FMR processing code(s) for Fire. The * is a constant. D is the numeric division code(s) for Fire. X is the alphabetic division code(s) for Fire. M is the numeric offload machine number for Fire. The * is a constant. M is the numeric offload machine number for General divisions. The * is a constant. M is the numeric offload machine number for Health. The * is a constant. M is the numeric offload machine number for Telephone Update. The last character must be a single quote ().

Page 45

State Farm Pattern JCL - User's Guide

Below is a partial view of the Q063 data set itself. Note in the Q063 multiple lines are used for each office with each line beginning and ending with a single quote. The partial view is showing the codes for offices 00-06 (HOME00.PIC.Q063 as of 9/2000).
'/009HOME000#4' '*0*1X42Y46Z4*4*4*4' '/01AILIO131A4133D4134E4135F4136C4137B4' '*126*1X32Y36Z3*2*2*3' '/02BROSA051A4053B4' '*126*1X32Y36Z3*2*2*3' '/03CTRNT601A4607B4611C4641E4' '*16*1X36Z3*3*3*3' '/04DMRSH222A4225B4226C4227D4' '*126*1X32Y36Z3*2*2*3' '/05ESTPL235A4236B4494C4' '*126*1X32Y36Z3*2*2*3' '/06FLINC154A4272B4342C4412D4' '*16*1X36Z3*2*2*3'

As you can see in the partial view above, some offices have multiple occurrences of a state or division code. The exploder program will set up loops for %DO%VAR control statements for the number of instances it finds of these codes. CTLCARD DD
000021 //CTLCARD DD * 000022 ON(01) 000023 /*

Input to the CTLCARD DD statement will control number of offices to explode the pattern text for and to set any office-specific global variables. The Exploder program requires the CTLCARD input to follow a special format. Here are the details on the CTLCARD record format.

CTLCARD Data Set Record Format ON(nn),ON(nn),ON(nn),,, or ON(nn),var(value),var(value),ON(nn),,, or ON(nn) Var(value) ON(nn) Var(value) The CTLCARD record format follows these rules: 1. 2. 3. 4. ON is a constant and signifies the office code. (nn) is the numeric office code and is required. Var is a global variable name followed by the value in parentheses. The value of a global variable is only applicable to the office code preceding it. If the global variable is needed for another office code, it must be re-specified.

Page 46

State Farm Pattern JCL - User's Guide

5. Multiple office codes and global variables can be coded on the same line but must be separated by commas. 6. Office codes and global variables can be coded on separate lines. The following examples will explode identically. Each example will explode the pattern sets for offices 00 and 01 while establishing a global variable (TMS) for office 01. Example 1 ON(00),ON(01),TMS(YES) Example 2 ON(00) ON(01) TMS(YES) By coding multiple office CTLCARD statements you can have the Exploder generate JCL for many locations. PRODJCL DD
000024 //PRODJCL DD DSN=UT.XX.EXPLODED, 000025 // DISP=(NEW,CATLG,DELETE), 000026 // DCB=(RECFM=FB,LRECL=80,BLKSIZE=0,DSORG=PS), 000027 // SPACE=(TRK,(15,15),RLSE),UNIT=DISK, 000028 // LABEL=RETPD=005

The PRODJCL DD statement points to the data set to receive the output of the explode process. All records written to PRODJCL are in 80 byte format. PRINT DD
000029 //PRINT DD SYSOUT=*,DCB=(RECFM=FBA,LRECL=133,BLKSIZE=0,DSORG=PS)

The file pointed to by the PRINT DD statement is used to format and print the contents of local, global and predefined pattern variables as dictated by the %PRSYM control statement.

Page 47

State Farm Pattern JCL - User's Guide

State Farm Pattern JCL - Users Guide


Date Created: October 2002 Date Updated: October 2002 State Farm Insurance Companies 3 State Farm Plaza Bloomington, Illinois 61791

Page 48