REfreresher All Mainframes

Embed Size (px)

Citation preview

  • 8/11/2019 REfreresher All Mainframes

    1/204

    Mainframe Refresher Part-1 Page:1

    ISPF &

    TSO

  • 8/11/2019 REfreresher All Mainframes

    2/204

    Mainframe Refresher Part-1 Page:2

    ISPF

    ISPF (Interactive Spool Productivity Facility) is a popular editor in the mainframeplatform !here are t"o #inds of commands that can $e entered in edit%vie" panel of

    ISPF editor

    !hey are:1 Primary &ommands that can $e entered in the &ommand 'ine

    'ine &ommands that can $e entered in the line(s)

    Mastering in these commands "ill $e highly helpful in analying%developingapplication programs

    Primary &ommand Meaning

    *+,S isplays the PF *eys and its definition for that panel

    PFS./0 Sho"s PF *eys definition at the $ottom of panel !o /FF

    this option enter P.S./0 /FFR+S+! &lears all message lines and reset the display of the

    dataset R+S+! '2+' is re3uired to clear la$els

    4 '' +5clude all the lines

    &/'6M7S%&/'S % &/'S/7%&/'

    isplay a ruler at the top of the screen !his can $eremoved $y &/'S /FF or R+S+!

    !/P%2/! Move to the !/P or 2/!!/M of the file

    .+4 isplays the data in .e5adecimal mode !ype .+4 /FF to

    come $ac# to normal display .ighly helpful for readingcomputational fields and lo"-values

    S0P S"itch $et"een split screens

    S0P 'IS! 'ists the availa$le screens

    &6! 0ith & or && line command8 this "ill copy the lines totemporary storage

    &6! 2 "ill cut the lines in $et"een the la$els 9 2

    &6! ISP', isplay the lines already cut

    &6! PP+7 ppended the lines to the lines already cut

    PS!+ Paste the already cut lines 'ine commands or 2 should

    $e used $efore issuing paste to indicate after or $efore"hich line this paste should occur

    S&R7M+ 44444 !he current screen is named as 44444 If you are usingmultiple split screens8 then you can come $ac# to this

    screen $y S0P 44444 line command Its good

    convention to name the screens "ith the purpose so thatyou can easily come $ac# 2y default the screens are

    named "ith num$ers'/&!+ line-num$er%'a$el

    'ocates the line-num$er or the la$el 'a$els can $eesta$lished in any line $y the line command

    la$elname

    R+&/+R, /7

    R+&/+R, /FFR+&/+R, /FF

    670R767/

    0ith R+&/+R, on8 67/ line command "ill revert the

    last recent change made in the edit%vie" session R+&/FF "ill off the recovery option and 67/ 6navaila$le

    message "ill appear in the first line R+& /FF 670R7 issame as R+& /FF $ut there "on;t $e any 67/

  • 8/11/2019 REfreresher All Mainframes

    3/204

    Mainframe Refresher Part-1 Page:3

    unavaila$le "arning message

    F

  • 8/11/2019 REfreresher All Mainframes

    4/204

    Mainframe Refresher Part-1 Page:4

    Special String &haracters that can $e used "ith FI7 and &.7B+:

    &har Meaning &har Meaning

    P;C; isplays any character P;; isplays any non-displaya$lecharacter

    P;D; isplays any numeric P;-< isplays any non-numeric

    P;E; isplays any alpha$etic P;; isplays any lo"er-case

    alpha$etic

    P;G; isplays any upper-case

    alpha$etic

    P;H; isplays any special character

    4;nn; Finds the he5 value of nn P to spaces

    Primary commands prefi5ed "ith 9 (ampersand) is left in the command line aftere5ecution !his "ay the same command can $e entered multiple times "ithout

    retyping it in each time

    Primary &ommands Mapping to PF *ey

    ny of the line commands can $e mapped to a PF #ey and invo#ed $ypressing that #ey +5ample if you map

  • 8/11/2019 REfreresher All Mainframes

    5/204

    Mainframe Refresher Part-1 Page:5

    'I7+ &ommands:

    &om-mand

    Meaning &om-Mand

    Meaning

    & &opy this line & 1> copies 1>

    lines !his "ill $e follo"ed $y theline commands or 2

    && &opy the $loc# of lines

    M Move this line M 1> copiesmove 1> lines !his "ill $e

    follo"ed $y the line commands or 2

    MM Move the $loc# of lines

    %2 fter()%2efore(2) this line8place the copied%moved line(s)

    1> repeats the copied%movedlines 1> times

    R n Repeats the current line n timesust R repeat 1 time

    RR Repeats the $loc# of lines RR 1>repeats the $loc# 1> times

    6& &hange this line content touppercase

    6&& &hanges the content of the$loc#ed lines to upper-case

    '& &hange this line content tolo"er-case

    '&& &hanges the content of the$loc#ed lines to lo"er-case

    eletes the line e5cludes

    1> lines starting "ith this line

    44 +5clude a $loc# of lines

    S Sho" one line of the e5cluded

    te5t S 1> sho"s 1> lines

    F%' Sho"s the First%last line of

    e5cluded te5t ' 1> sho"s thelast 1> lines

    )n Shift the line content $y ncolumns to the right side

    (outside) Gn is same as )n $utin case of data truncation8

    operation "ill $e error out

    ))n Shift the $loc# of lines $y ncolumns to the right side

    GGn is same as ))n $ut in caseof data truncation8 operation "ill

    $e error out

    (n Shift the line content $y n

    columns to the left side(inside)n is same as (n $ut in case of

    data truncation8 operation "ill

    $e error out

    ((n Shift the $loc# of lines $y n

    columns to the left siden is same as ((n $ut in case

    of data truncation8 operation "ill

    $e error out!S n !o split te5t in t"o at the point

    of cursor to allo" a "ord8 phrase

    or sentence to $e inserted 7num$er of lines are inserted

    $et"een the t"o parts of te5t

    !F n !o flo" fragments of sentencesinto paragraph 7 defines the

    "idth

    !+ !e5t +ntry mode is used for $ul#

    entry of te5t and allo"s po"ertyping techni3ues to $e used at

    27S !o process only over a column of

    data8 define the range ofcolumns using 27S line

  • 8/11/2019 REfreresher All Mainframes

    6/204

    Mainframe Refresher Part-1 Page:6

    the terminal (!ype data "ithout

    $othering a$out end of line8 line

    num$ers etc !he FI7' enter"ill re flo" the data)

    command

    MS* It allo"s to put fi5ed data into

    the ne" lines $eing entered!ype MS* over a line num$er

    and press enter /vertype themas# "ith "hatever "e "ant

    7o" every time "e enter ne"

    lines "ith I8 !+8 !S N mas# lines"ill $e displayed rather than

    empty lines

    /

    (overlay)

    /verlay command indicates the

    target line(s) "hen merginglines /verlay is used in

    conQunction "ith M or & linecommands

    C0300 *O0400 MVSQuestResult:

    0300 *0400 * MVSQuest

    /1> overlaid the first 1> lines

    //-// overlaid the $loc# oflines

    !S/

    Fre3uently used !S/ commands are listed in the ta$le !hey can $e issued

    from any ISPF panel "ith !S/ prefi5 !S/ prefi5 is not re3uired if you e5ecute themin !S/ panel (/ption of ISPF)

    If the command is incomplete8 !S/ prompts for the missed parameters

    !he output of the processed command is displayed in ISPF8 in line mode

    SYS1.HELPdataset contains all the !S/ commands8 synta5 and their usage

    &ommand Synta5 Purpose.+'P &/MM7 isplays the purpose and synta5 of the command

    !he source for this information is retrieved from

  • 8/11/2019 REfreresher All Mainframes

    7/204

    Mainframe Refresher Part-1 Page:7

    datasets start "ith 2PMI7!+S! to 2PMI767I!

    R+7M+ 1

    %%R672!&. +4+& PBMCI*+F!>1

    %%S,S!SPR! S,S/6!C?

    %%S,S!SI7 ? R+7M+

  • 8/11/2019 REfreresher All Mainframes

    8/204

    Mainframe Refresher Part-1 Page:8

    !he a$ove step renames t"o datasets from MSV6+S! 3ualifier to '+S/F!

    3ualifier ny high volume manual Qo$ can $e completed in matter of minutes if youhave good #no"ledge in ISPF and !S/ commands "ith little e5posure to R+44

  • 8/11/2019 REfreresher All Mainframes

    9/204

    Mainframe Refresher Part-1 Page:9

    Job Control Lan!a"

    JCL

  • 8/11/2019 REfreresher All Mainframes

    10/204

    Mainframe Refresher Part-1 Page:10

    &'

    ny $usiness application is divided into logical modules and these modules aredeveloped using programming languages !hese programs should $e e5ecuted in a

    pre-defined se3uence to achieve the $usiness functionality

    &' (o$ &ontrol 'anguage) is used to +FI7+ and &/7!R/' the /2 to theoperating system

    efinition involves definition ofthe programs need to $e e5ecuted8 the data for the

    programs and the se3uence of programs &/7!R/' involves controlling thee5ecution or $ypassing of a program in the se3uence $ased on the result of the prior

    program e5ecution

    &' &oding Sheet

    1 = 11 1 = J>

    7M+ /P+R!I/7 /P+R7S

    &' statements should have %% in column 1 and S!R (

  • 8/11/2019 REfreresher All Mainframes

    11/204

    Mainframe Refresher Part-1 Page:11

    o$ +ntry Su$system (+S)

    o$ +ntry Su$system (+S) is the Qo$ processor of MS operating system

    MS installation can have either +S or +S= !he su$mitted Qo$s are ta#en $y +Sfor processing

    +S +S=

    ecentralied +nvironment +veryprocessor processes the incoming Qo$s

    individually

    &entralied +nvironment !here is aglo$al processor that controls all the

    other processors and assigns the Qo$s to

    them

    atasets are allocated $efore the stepe5ecution

    atasets are allocated $efore the Qo$e5ecution

    &' Statements

    /2 It should $e the first statement in the &' It indicates accounting information

    and /2 related information to the system If the mem$er $eing su$mitted containsmultiple Qo$ cards8 then multiple Qo$s "ill $e su$mitted !hese Qo$s "ill runconcurrently or one after other $ased on Qo$ name8 class and initiator availa$ility

    +4+& !he name of the program or procedure to $e e5ecuted is coded here +very

    +4+& statement in a /2 identifies one step Ma5imum of AA +4+& statements can$e coded in a /2

    ata escriptor !he dataset details are coded here ataset contains the data

    that need to $e processed $y the program or data that is produced $y the programMa5imum == statements can $e coded in a step

    Abnormal End (ABEND) & ERROR

    /nce the "or# to $e done is defined in &'8 it can $e su$mitted to theoperating system using S62MI! command 6sually programmer is e5pected to issue+M or S&7 to chec# out any possi$le &' +rrors $efore su$mission

    &' +RR/R:

    1 +rrors $efore Qo$ starts e5ecution: If there are synta5 errors8 then the "holeQo$ is reQected "ith error message in +S M+SSB+S !ypically this needs

    correction and resu$mission of the "hole /2 +rrors $efore step starts e5ecution: If there is any allocation issues in a

    particular (li#e dataset not found8 duplicate dataset)8 then also the Qo$ "ill $eerror out $ut in this case there might $e already n steps got e5ecuted

    !ypically this needs correction and restart in the /2

    2+7:

    6nli#e &' +rrors8 2+7 happens during the e5ecution of a program in astep 2+7S are classified into categories

    System 2+7(Snnn): System a$end occurs "hen the system is not a$le to e5ecutea statement that is instructed in the program ivide $y U+R/ results S/&2 system

    a$end !he /S thro"s it

  • 8/11/2019 REfreresher All Mainframes

    12/204

    Mainframe Refresher Part-1 Page:12

    6ser 2+7(6nnnn): 0hen some une5pected condition occurs in the data passed8

    the program "ill call an a$end routine and a$end the step "ith proper displays !hisis thro"n $y application $ased on the re3uirement

    JOB Sa!m!n

    Sample Synta5:%%/27M+ /2 (&&/67!I7B I7F/)8 (PR/BRMM+R 7M+)8

    %% !IM+C(MI76!+S8S+&/7S)8 &'SSC8MSB&'SSC8PR!,C1K8RCIR!8

    %% R+BI/7Cn*8MSB'++'C(82)8&/7C(78/P+R!/R)8 !,PR67CS&7JOBNA"E

    It identifies name of the Qo$ !he Qo$ is identified in the +S SP//' using this

    name 7aming rules are already mentioned in the coding sheet section

    &&/67!I7B I7F/ (Mandatory Installation ependant)

    1 Resource usage charges are charged to the account mentioned here If you don;t #no" your installation account8 you cannot su$mit the Qo$ It is li#e

    "hen you don;t have account8 you cannot "ithdra" cash in $an#

    = Ma5imum 1K characters can $e coded as accounting information

    #RO$RA""ER NA"E

    Programmer name or program functionality or group can $e mentioned It is

    used for documentation (Ma5 > chars)

    %ASS ('nallaon D!*n!d)

    1 &'SS is coded "ith single alphanumeric character (-U8 >-O) uring installation8 every &'SS and its properties are defined

    = efinition descri$es the Qo$ characteristics li#e &P6 time usage8 num$er oftape%cart usage and other resource constraints

    K +very class is assigned to one or more initiators !he Qo$s run in initiator addressspace /ne initiator can process one Qo$ at one time

    #R+,

    Synta5: PR!,C7 (7 can $e > N1A)

    1 0hile selecting the Qo$s "ith same class for e5ecution8 +S schedules the highpriority Qo$s first !he Qo$ coded "ith PR!,C1A has the highest priority and

    PR!,C> has the lo"est priority PR!, "or#s "ithin the /2&'SS If there are Qo$s "ith &'SS is su$mitted

    and one "ith PR!, = and other "ith PR!, K then PR!, K "ill get into e5ecution3ueue first

    = PR!, function is disa$led in most of the installations

    "S$E-E

    Synta5: MSB'++'C(48,) (4 can $e >- 9 , can $e >-1)

    1 It is used to control the lists of information appear in the o$ log !o getma5imum information in the listing8 code MSB'++' as MSB'++'(181)

    !he first parameter controls the statements (>-/nly Qo$ statement8 1-&'8 +S

    statements "ith e5panded procedures8 -/nly &' and +S statement)

    = !he second parameter controls the messages (>- /nly Step e5ecution messages81-ll &'8 +S8 operator and allocation messages)

  • 8/11/2019 REfreresher All Mainframes

    13/204

    Mainframe Refresher Part-1 Page:13

    "S$%ASS ('nallaon D!*n!d)

    Synta5: MSB&'SSC4 (4 can $e -U8 >-O)1 MSB&'SS is coded "ith single alphanumeric character (-U8 >-O)

    +ach MSB&'SS is mapped to a device or location8 "here the messages are

    routed

    ADDRS#%

    It is used to specify "hether the Qo$ "ill run in the Real storage or irtual

    storageSynta5: RSP&CWR+'TIR!X

    R+' N llocation is done in R+' storage and the program is not page-a$le

    IR! N llocation is done in IR!6' storage and the program is page-a$le

    RE$'ON

    Synta5: R+BI/7CW5* T yMX (5 can $e 1->O1J 9 y can $e 1->K)

    1 It is used to specify the amount of central %virtual storage the Qo$ re3uires

    It can $e re3uested in the units of #ilo$ytes (5*) or mega$ytes (yM) If re3uestedin terms of #ilo$ytes8 then 5 should $e multiple of K or the system "ill round it to

    nearest K* allocates for your Qo$ R+BI/7 can $e coded in +4+& statement also R+BI/7 parameter coded on /2

    card overrides the parameter coded on +4+& card= Ma5imum virtual memory availa$le is B2

    K RegionC>M allocate all the availa$le memory in the address space to this Qo$A Region related 2+7S: 0hen the re3uested region is not availa$le8 the /2 "ill

    2+7 "ith SJ 0hen the re3uested region is not enough for the program torun8 you "ill get 2+7 SJ> or SJ>K

    RES+AR+

    R+S!R! parameter allo"s restarting from any particular step in the Qo$

    Synta5: R+S!R! C Step-name in the Qo$R+S!R! C ? means restart from the $eginning

    !o restart from any procedure steps8 code R+S!R!CPR/&S!+PS!+P7M+0hereas PR/&S!+PCname of the &' step that invo#ed the PR/& 9

    S!+P7M+Cname of the proc step "here you "ant e5ecution to startR+S!R! ignores any condition in the step $eing restarted and it can also $e step

    that is in the +'S+ part of the IF+'S++7IF

    +,#R.N

    It is used to re3uest special Qo$ processing1 !,PR67CS&7 chec#s the synta5 errors "ithout actual e5ecution

    !,PR67C./' chec#s the synta5 error and if there is any error8 it is notified andif there are no errors8 the Qo$ is #ept in a"aiting e5ecution 3ueue and it should $e

    released $y user for e5ecution Release can $e done $y typing

  • 8/11/2019 REfreresher All Mainframes

    14/204

    Mainframe Refresher Part-1 Page:14

    +'"E

    It defines the ma5imum allo"a$le &P6 time for the /2 !he parameter can $e codedat +4+& card also /n +4+&8 it defines &P6 limit of step

    Synta5: !IM+ C (MI76!+S8 S+&/7S)8 MI76!+S C 1KK> and S+&/7S >

    !IM+C7/'IMI!%1KK>%M4IM6M means the Qo$ can use &P6 for unlimited time!IM+C> "ill produce unpredicta$le results

    If !IM+ is coded on $oth /2 as "ell as +4+&8 then +4+& !ime limit or the

    time left out in the Qo$ !ime limit N "hichever is smaller "ill $e the time permittedfor the step to complete

    If a /2 runs more than allo"ed time8 then it "ill 2+7 "ith system 2+7code S= If there is no !IM+ parameter8 then the &P6 time limit pre-defined "ith

    &'SS Parameter "ill $e effective

    NO+'/,

    !S/ 6ser-id to "hom the Qo$ +7 % 2+7 % +RR/R status should $enotified 7/!IF,C9S,S6I "ill send the notification to the user "ho su$mitted the

    Qo$

    %OND

    1 It is used for conditional e5ecution of /2 $ased on return code of /2 steps !he return code of every step is chec#ed against the condition coded on /2

    card If the condition is found !R6+8 then all the steps follo"ing it are $ypassed= Ma5imum eight conditions can $e coded in the &/7 parameter In case of

    multiple conditions8 if 7, of the condition is found !R6+ then the /2 stopsproceeding further

    Synta5: &/7C(&/+8/P+R!/R8S!+P7M+)S!+P7M+ is optional If you code it8 then that particular step-name return

    code is chec#ed against the &/+ "ith the /P+R!/R If omitted8 then the returncodes of all the steps are chec#ed /n comparison8 if the condition found to $e true8

    then all the follo"ing steps are $ypassed&/+ can $e >-K>OA

    /P+R!/R can $e B!8 '!8 B+8 '+8 +VIt can $e coded on +4+& statement S!+P level control is popular then /2

    level control /n +4+& statement8 you may find /7',8 ++7 #ey"ords against &/7parameter

    &/7C/7', allo"s the step e5ecution only if any prior step is 2+7+ &/7C++7 allo"s the step e5ecution independent of any prior 2+7S

    &onsider the &/7 parameter coded on +4+& statement8

    +5: %%S!+P +4+& PBMCPBM=8&/7C((18B+)8(O>8'+8S!+P1)8/7',)

    Step gets e5ecuted only if preceding step a$normally terminated /R

    !he return codes from all preceding steps are 1 or greater /R !he return code from S!+P1 is JO or less

    EE% Sa!m!n

    It defines the Step and Step level information to the system

    Synta5: %%S!+P7M+ +4+& WPBMCprogram-name T PR/&Cproc-name T

    proc-nameX

  • 8/11/2019 REfreresher All Mainframes

    15/204

    Mainframe Refresher Part-1 Page:15

    S+E#NA"E

    It is an /P!I/7' field $ut it is needed if you "ant to restart a Qo$ from thisstep and for the same reason8 it should $e uni3ue "ithin the Qo$

    #$" or #RO%

    &ode the Program name or PR/& name to $e e5ecuted (1-J characters)#AR"

    1 It is used to pass varia$le information to the processing program8 e5ecuted $y this

    Qo$ step If there is more than one su$ parameter or if there is any special character then

    enclose them in parentheses%3uotes= Ma5imum 1>> characters can $e passed in this "ay Vuotes and $rac#ets are not

    included in this 1>>!o pass a 3uote to the program8 indicate that "ith t"o 3uotesone follo"ed $y other

    K !he program can receive them using lin#age section 'in#age section must $ecoded "ith half "ord $inary field as first field !his field is populated "ith length of

    the PRM passed from the &'

    +5ample:%%S!+P= +4+& PBMC0/R*8PRMC(+&*8'IS!8Y'I7+&7!CJ>Y8

    %% Y1LJ>Y87/MP)

    A !o continue the PRM in the second line8 start the second line from 1thposition

    PR!,

    PR!, assigns priority to a Qo$ and PR!, assigns dispatching priority to Qo$

    step Synta5: PR!,C(value18 value) alue1 and value can $e >-1A -Priority iscalculated using the formula (value1?1 L value)

    '/ +ENESEEND'/

    It is used for conditionally e5ecuting one or more steps 7esting is possi$le upto 1A levels !he meaning is same as programming IF If the coded condition is true8

    the follo"ing steps till +'S+ "ill $e e5ecuted If the condition is false8 then the steps

    coded on +'S+ part "ill $e e5ecutedSynta5:

    %%name IF (relational operation) !.+7%%ZSteps

    %% +'S+%%ZSteps

    %% +7IF

    PR/& P+7 I7&'6+

  • 8/11/2019 REfreresher All Mainframes

    16/204

    Mainframe Refresher Part-1 Page:16

    the name

  • 8/11/2019 REfreresher All Mainframes

    17/204

    Mainframe Refresher Part-1 Page:17

    *++P ataset is to $e #ept on the volume

    67&!'B System is to delete the catalog entry corresponding to this dataset and#eep this dataset

    Abnormal-termination-status:PSS is not allo"ed Meaning of &!'B8 67&!'B8 *++P8 +'+!+ are same as

    normal-termination status

    $sence of any parameter should $e mentioned "ith

  • 8/11/2019 REfreresher All Mainframes

    18/204

    Mainframe Refresher Part-1 Page:18

    R+&FM and R+S+R+ clause specifies 26F7/ S/RB can $e assumed from the

    name of the dataset and the directory space allocation of SP&+ parameter

    6sually for an e5isting dataset8 "e don;t have to code &2 parameters It "ill $eavaila$le in the dataset la$el !he dataset la$el is STO#E$ in the !/& (S) or

    along "ith dataset (!P+) during the dataset creation

    '2+'Synta5: '2+' C (ataset-se3uence-num$er

    8la$el-type 8PSS0/R T 7/P0R+

    8I7 T /6! 8R+!PCnnn T+4P! C (yydddTyyyy%ddd))

    Dataset Se#uence number - identifies the relative position of a dataset on a

    tape%cart volume Should $e 1 through K decimal digits /mit this parameter ifaccess is $eing made to the first dataset on the tape volume

    Label- indicates the la$el type of the tape%cart volume

    S' - indicates that a dataset has I2M standard la$els efault value

    7' - indicates that a tape dataset has no la$els7S' - indicates that a tape dataset has nonstandard la$els

    S6' - indicates that a tape dataset has $oth I2M standard and user la$els2'P - re3uests that the system $ypass la$el processing for a tape dataset

    PASSW$%D- indicates that a dataset cannot $e read8 changed8 deleted or "ritten tounless the correct pass"ord is specified

    N$PW%EAD- indicates that a dataset cannot $e changed8 deleted or "ritten8 unlessthe correct pass"ord is specified 7o pass"ord is necessary for reading the dataset

    IN- indicates that a dataset opened for I%/ is to $e read only$&- indicates that a dataset opened for I%/ is to $e "ritten only

    %EPD ' EPD- indicates the retention period and the e5piration date for adataset

    +5: '2+'C+4P!C>K11 (ataset e5pires on 11stday of >>K)

    '2+'CR+!PC>> (ataset is retained for >> days)

  • 8/11/2019 REfreresher All Mainframes

    19/204

    Mainframe Refresher Part-1 Page:19

    S#A%E

    It is used to re3uest space for the ne" dataset It is mandatory for all the7+0 datasets

    SP&+ C (W!R* T &,' T $l#lgthX (8Primary-3ty 8 Second-3ty8 irectory)

    8R'S+ 8&/7!IB 8M4IB 8R/67)

    %)'C*L - Re3uests that space $e allocated in trac#s or cylinders

    +llt. - Specifies the average $loc# length8 in $ytes8 of data Specify a decimalnum$er from 1 through AA=A !his ta#es precedence8 "hen specified8 together "ith

    the 2'*SIU+ field of &2 parameter

    Primar/-#t/- Specifies the amount of primary space re3uired in terms of the spaceunit (trac#s%cylinders%num$er of data $loc#s) /ne volume must have enough space

    for the primary 3uantity If a particular volume is re3uested and it does not haveenough space availa$le for the re3uest8 the Qo$ step is terminated

    Secon0-#t/ - Specifies the num$er of additional trac#s8 cylinders8 $loc#s to $eallocated8 if additional space is re3uired

    Director/ - Specifies the num$er of A-$yte records needed in the directory of aPS (In every $loc# "e can store A- mem$ers)

    %LSE - re3uests that space allocated to an output dataset8 $ut not used8 is to $e

    released "hen the dataset is closed Release occurs only if dataset is open for outputand the last operation "as a "rite

    C$NI1- re3uests that space allocated to the dataset must $e contiguous It affects

    only primary space allocation

    MII1N It is used to specify that space re3uested should $e allocated to the largest

    contiguous area of space availa$le on the volume It affects only primary allocation

    %$&ND - 0hen the first parameter specifies the average $loc# length8 this parameter

    re3uests that allocated space must $e e3ual to an integral num$er of cylinders +lseignored

  • 8/11/2019 REfreresher All Mainframes

    20/204

    Mainframe Refresher Part-1 Page:20

    E!n

    +5tent is contiguous memory location /nly 1 e5tents are possi$le for aphysical se3uential dataset in a volume In loose terms8 only 1 pointers can $e

    stored for a PS dataset in one volume For a SM dataset it can $e 1= In addition

    to this8 the primary (first) or secondary (consecutive) space re3uest has to $e met

    "ithin A e5tentsIf any of the a$ove is not met8 then there "ill $e space 2+7 So for a PS

    dataset8 even though you re3uest 1>> trac#s (using the space parameter

    (SP&+C!R*S8(1>>81>>))8 the system may not allocate you 1>> trac#s al"aysIf all the contiguous availa$le spaces are of sie > trac#s8 then A e5tents are

    used for satisfying every primary or secondary So 1A e5tents are used for providingQust =>> trac#s If the system could find any 1>> trac#s for the 1the5tent8 it "ould

    offer it and if not8 there "ill $e space 2+7 So in the $est case you "ill get 1>>trac#s and in the "orst case you "ill get K>> trac#s for the space parameter

    mentioned

    Space 2+7S:!he most fre3uent 2+7 in any production system is space a$end

    S2=: +nd of volume If the program tries to "rite more than the allocated space or

    if the system could not find the re3uested primary or secondary space even $yQoining A e5tents8 then the step a$normally ends "ith S2=

    !o solve this a$end8 increase the primary%secondary reasona$ly and if the Qo$again comes do"n8 create the dataset as multi-volume $y coding /'C(888=) s

    every volume "ill offer 1 e5tents8 KJ e5tents in this case should $e more thanenough

    S=: If the primary space is filled and the program tries to "rite more $ut nosecondary is mentioned in the SP&+ parameter8 then the step "ill come do"n "ith

    S=!o solve this a$end8 provide secondary allocation in the SP&+ parameter

    S+=: +nd of olume !his is same as S2= ,ou "ill get this 2+7 usually for a

    partitioned dataset !o solve this8 compress the PS $y typing

  • 8/11/2019 REfreresher All Mainframes

    21/204

    Mainframe Refresher Part-1 Page:21

    .N'+

    It is used to re3uest the system to place the dataset on a specific device%acertain type or group of devices or the same device as another dataset

    67I!C((device-num$er T device-type T group-name)

    (8unit-count T P)

    (8+F+R)) /R67I!CFFCddname

    0e2ice-number- identifies a particular device $y a =-character he5adecimal num$er

    It should not $e used unless a$solutely necessary

    0e2ice-t/3e - Re3uests a device $y its I2M supplied generic name (+g ==J>)

    rou3-name - Re3uests a group of devices $y its sym$olic name Installation musthave assigned the name to the device(s) during system initialiation

    !he group-name is 1 through J alphanumeric characters (+g !+MP)

    unit-count- Specifies the num$er of devices for the dataset (1-AO)

    P - as#s the system to mount all volumes for a dataset in parallel

    DEFE% - s#s the system to assign the dataset to the device $ut re3uests thatthe volume(s) not $e mounted until the dataset is opened +F+R is ignored for a

    ne" dataset on direct access

    AFF=00name- Re3uests that system to allocate different datasets residing on

    different remova$le volumes to the same device during step e5ecution !he ddnameis that of an earlier statement in the same step It reduces num$er of devices

    used in a Qo$ step

    +5: 67I!C(!P+88+F+R) 67I!CFFC1

    -O."E

    reel of !P+ or a dis# pac# is called as one volume /'6M+ parameter isused to identify the volume(s) on "hich a dataset resides or "ill reside

    /'6M+ C ((PRI!+)

    (8R+!I7) (8volume-se3uence-num$er)

    (8volume-count)) (S+RCserial-num$er18

    serial num$er)

    P%I4AE- Re3uests a private volume8 that is e5clusive use of volume for the datasetspecified /nly one Qo$ can access it at a time !P+S are PRI!+ $y default

    %EAIN- Re3uests that volume is not to $e demounted or re"ound after the dataset

    is closed or at the end of this step It is used "hen a follo"ing step is to use thesame volume

    2olume-se#uence-number- identifies the volume of an e5isting multi volume dataset

    to $e used to $egin processing the dataset (1-AA)

  • 8/11/2019 REfreresher All Mainframes

    22/204

    Mainframe Refresher Part-1 Page:22

    2olume-count- Specifies the ma5imum num$er of volumes that an output datasetre3uires (1-AA)

    SE%=serial-number- Identifies $y serial num$er the volume(s) on "hich the dataset

    resides or "ill reside 1 through alphanumeric or national(E8D8H) characters,ou can code a ma5imum of AA volume serials

    +5 : /'6M+CS+RC+>>1 /'C(888=8S+RC(PB+>18PB+>8PB+>=))

    S,SO.+la

    It is used to identify this dataset as a system output dataset !he S,S/6!dataset is assigned to an output class !he attri$utes for each class are defined

    during +S initialiation8 including device or devices for the output class ;?; refer-$ac#s to MSB&'SS character of /2 &R

    #oonal and !:;ord #aram!!r

    ll the parameters of /28 and +4+& statements can $e $roadly classified

    into t"o types !hey are P/SI!I/7' and *+,0/R parameters

    Parameter that has its meaning defined $y its position is positional parameter2ypassing of any positional parameter has to $e informed to system $y

  • 8/11/2019 REfreresher All Mainframes

    23/204

    Mainframe Refresher Part-1 Page:23

    DD

    O+ER Sa!m!n

    O.+'"

    It limits the num$er of print lines !he limit ranges from 1 to 11A !heQo$ is terminated if the limit is reached

    %%name S,S/6!C?8/6!'IMC=>>>If the program tries to "rite =>>1stline8 /2 "ill 2+7 "ith S

    DES+

    !he +S! parameter is used in conQunction "ith the S,S/6! parameter

    "here the output is to $e sent !his might $e used "here a Qo$ is run on several MSsystems and the output is directed to a single system for the convenience of the end-

    userSynta5: %%name S,S/6!C?8+S!Cdestination-I

    O.+#.+

    /6!P6! statement is used to specify S,S/6! parameters for several statements "ith a single &' statement It allo"s printing the output from single statement several times8 each "ith different S,S/6! parameters

    &/PI+S8 /6!'IM8 &'SS8 +S!8 F/RMS8 BR/6PI can $e coded in /6!P6!

    +F6'!C, can $e coded on /2 and S!+P level S!+P level default overrides/2'++' default

    %%!+S!D1> /2 %%S!+P1 +4+& PBMC/7+

    %%F/RM /6!P6! +F6'!C,+S8&/PI+SC8+S!CPPP%%S,SPRI7! S,S/6!C --G Produces copies at PPP

    %%S!+P +4+& PBMC!0/

    %%F/RM= /6!P6! &/PI+SC=8+S!C4,U%%S,SPRI7! S,S/6!CV8/6!P6!C(S!+PF/RM=8S!+P1F/RM)

    --G Produces = copies at 4,U and copies at PPP

    Ma5imum num$er of &/PI+S possi$le is AK

    /OR"S

    Specify the type of forms on "hich the S,S/6! datasets should $e printedIt is 1-J alphanumeric or national character S,S/6! F/RMS parameter overrides

    /6!P6! PRMS parameter%%name /6!P6! F/RMSCform-name

    /REE

    !he datasets are allocated Qust $efore the e5ecution of step and de-allocatedafter the e5ecution of step FR++ parameter de-allocates the file as soon as the file isclosed %%ddname S,S/6!C48FR++C&'/S+

    'N%.DE

    !he purpose of I7&'6+ statement is same as &/P, statement of &/2/'

    program !his is used to specify a PS mem$er that "ill $e copied into the &' at Qo$su$mission time It is used to specify a standard list of 7M+S8 "hich "ould

    other"ise $e duplicated in many similar PR/&S !his also has the advantage that

  • 8/11/2019 REfreresher All Mainframes

    24/204

    Mainframe Refresher Part-1 Page:24

    amendments need only $e made in one place 2ut it ma#es &' unnecessarily

    fragmented or difficult to read%maintain in a live environment

    %% I7&'6+ M+M2+R1

    M+M2+R1 should e5ist in the procedure li$rary Procedure li$raries are coded using&''I2 statement Include must not $e used to e5ecute a PR/& It is possi$le to nest

    up to 1A levels of I7&'6+ statements

    %ona!naon R

  • 8/11/2019 REfreresher All Mainframes

    25/204

    Mainframe Refresher Part-1 Page:25

    RE/ERBA%

    !he $ac#"ard reference or refer $ac# permits you to o$tain information froma previous &' statement in the Qo$ stream S!R (?) is the refer-$ac# operator

    It improves consistency and ma#es the coding easier

    &28 S78 /'CS+R8 /6!P6!8 PBM can $e referred-$ac#

    Refer $ac# can $e done using the follo"ing "ays:1nother of the same step "ill $e referred

    ?7M+ of another step can $e referred

    ?S!+P7M+7M+ (7M+ of the S!+P7M+)= of another proc step can $e referred

    ?S!+P-I7/*I7B-PR/&PR/&-S!+P-7M+7M+

    S!R in the S,S/6! parameter refers $ac# to MSB&'SS of /2 card

    Refer-$ac# e5ample:%%S!+P1 +4+& PBMC!R7S

    %%!R7FI'+ S7M+CR!R7SFI'+8ISPC(7+08*++P)8%% 67I!CS,S8/'CS+RCMPSJ>>8

    %% SP&+C(&,'8(A81))8%% &2C(S/RBCPS8R+&FMCF28'R+&'CJ>)

    %%!R7+RR S7M+CR!R7S+RR8ISPC(7+08*++P)8%% 67I!CS,S8/'CS+RCMPSJ>18

    %% SP&+C(&,'8(81))8%% &2C?!R7FI'+

    %%S!+P +4+& PBMC!R7S+P

    %%!R7I7 S7M+C?S!+P1!R7FI'+8ISPCS.R%%!R7/6! S7M+CR!R7SFI'+8ISPC(7+08*++P)8

    %% 67I!CS,S8/'CR+FC?S!+P1!R7FI'+8

    %% SP&+C(&,'8(A81))8%% &2C?S!+P1!R7FI'+

    %%S!+PA +4+& PBMC?S!+P='/M/

  • 8/11/2019 REfreresher All Mainframes

    26/204

    Mainframe Refresher Part-1 Page:26

    S=!al DD nam!

    S+E#'B

    It follo"s +4+& statement 'oad modules "ill $e chec#ed first in this li$rary

    and then in the system li$raries If it is not found in $oth places8 then the /2 "ould2+7 "ith SJ> codeJOB'B

    It follo"s the Qo$ statement 'oad modules of any steps (+4+&) that don;thave respective S!+P'I2 "ill $e loo#ed into this PS If not found8 it "ill $e chec#ed

    against system li$raries If it is not found there also8 then the /2 "ould 2+7 "ithSJ>

    J%'B

    It follo"s /2 statement &atalogued procedures in the /2 are searched in

    this PS If they are not found8 they "ill $e chec#ed in system procedure li$rariesIf they are not there8 then there "ill $e &'+RR/R "ith

  • 8/11/2019 REfreresher All Mainframes

    27/204

    Mainframe Refresher Part-1 Page:27

    #ro!d>*

    %% +4+& &/2&'B8 R+BI/7&/2C1M CG /verrides the value of K>>*%% +4+& &/2&'B8 !IM+&/2C(>81>) CG dds 1> seconds time limit for &/2 step

    %% +4+& &/2&'B8 R+BI/7&/2C CG 7ullifies K>>* region re3uest efault

    region "ill $e allocated no"

  • 8/11/2019 REfreresher All Mainframes

    28/204

    Mainframe Refresher Part-1 Page:28

    /ther Rules:

    1 Multiple overrides are allo"ed $ut they should follo" the order !hat is first youshould override the parameters of step18 then step and then step= ny overrides in

    the "rong order are IB7/R+ If the S!+P7M+ is not coded during override8 then the system applies the

    override to first step alone%%+4+& &/2&'B8R+BI/7CA1*

    #ro!d

  • 8/11/2019 REfreresher All Mainframes

    29/204

    Mainframe Refresher Part-1 Page:29

    #ro!d> +4+& PBMC+MPRP!%%S,S/6! S,S/6!C9&'SS%%I7MS! S7M+C99I7S+'8ISPC(/'8+'+!+)

    %%I7S'S! S,S/6!C9&'SS

    SMS4'J!+S!&''I2(+MP&')

    %%+MP&' /2 (1>>>8>>)8&'SSC8MSB&'SSCV87/!IF,C9S,S6I%%PR/&'I2 &''I2 /R+RC(SMS4'J!+S!PR/&'I2)

    %% S+! SP&+C1 +4+& +MPPR/&8PRMS!+P1C;>%11%1OO;8.'VCPR/%%S!+P1+MPMS!

    %% S7CPR/+MP'/,++&!S8ISPCS.R

    ''81>))

    ''

  • 8/11/2019 REfreresher All Mainframes

    30/204

    Mainframe Refresher Part-1 Page:30

    'EB%O#,

    It is used to copy one or more mem$ers from an e5isting dataset to a ne" ore5isting PS data set It can $e also used for compressing PS8 'oading PS to !P+

    and unloading from !P+ to dis# !his utility needs t"o "or# files S,S6!= and

    S,S6!K in addition to S,SI7 and S,SPRI7!

    FI+' Meaning

    &/P, Function is &/P,

    S+'+&! Specifies the mem$ers to $e copied%replacedSynta5: (7M+-I7-/6!P6!87M+-I7-/6!P6!8#+P'&+-IF-+4IS!S)

    +4&'6+ Specifies the mem$ers to $e e5cluded from copy

    'IS!C,+S isplays the copied mem$ers in the S,SPRI7!

    I7 Points to input dataset

    /6! Points to output dataset Should e5ist on the same line of &/P,

    'EB%O#, %ON+RO %ARD /OR "ER$'N$ +?O 'BRAR'ES

    %%S,SI7 ?&/P, /6!C/6!P6! I7C(I7P6!>18(I7P6!>8R)8'IS!C7/)

    %?It says statements I7P6!>1 and I7P6!> are input files /6!P6! is the

    output file 7ote the YRY in (I7P6!>8R) It instructs to I+2&/P, that li#e namedmem$ers are to $e replaced 'IS!C7/ indicates that the names of the mem$ers

    copied need not $e listed in the S,SPRI7! dataset

    'EB%O#,%ON+RO %ARD /OR SEE%+'-E %O#,RE#A%E

    &/P, /6!C/6!P6!8I7CI7P6!>1S+'+&! M+M2+RC((M+M187+07M+8R)8(M+M88R))

    M+M1 is copied as 7+0M+M in /6!P6! If already 7+0M+M e5ist8 it "ill $e replaced

    'EB%O#,%ON+RO %ARD /OR O"'++'N$ SEE%+ED "E"BERS

    &/P, /6!C/6!P6!8I7CI7P6!>1+4&'6+ M+M2+RC(M+M18M+M)

    ll the mem$ers e5cept M+M1 and M+M are copied into /6!P6! from I7P6!>1

    'EB%O#,%om=l!! != *or %om=r!n> #DS

    %%&/MPR+SS +4+& PBMCI+2&/P,%%S,SPRI7! S,S/6!C?

    %%&/MPFI'+ S7CMM>1&/P,'I2&/28ISPC/'%%S,S6!= 67I!CS,S8SP&+C(!R*8(181))

    %%S,S6!K 67I!CS,S8SP&+C(!R*8(181))%%S,SI7 ?

    &/P, /6!C&/MPFI'+8I7C&/MPFI'+

    %?

  • 8/11/2019 REfreresher All Mainframes

    31/204

    Mainframe Refresher Part-1 Page:31

    'EB$ENER

    In addition to S,SI7 and S,SPRI7! datasets8 it needs S,S6!1 and S,S6!datasets S,S6!1 is coded "ith input dataset and S,S6! is coded "ith output

    dataset If attri$utes "ere not given for S,S6!8 then the program "ould assume

    S,S6!1 attri$utes for S,S6!

    It is primarily used as &/P, utility If you "ant to copy any !P+ file to IS*or IS* to !P+8 then no S,SI7 is needed

    If you "ant to reformat your input file or if you "ant to create mem$ers out

    of your PS file8 then you need control card (S,SI7) and the first statement should $eB+7+R!+

    FI+' Meaning

    B+7+R!+ First Statement "hich sets the values for M47M+8M4BPS8M4'I!S8 M4F'S

    M47M+ Ma5imum M+M2+R statements that can follo"(uring mem$ergeneration)

    Synta5: M47M+C=

    M4BPS Ma5imum I+7! statement that can follo" (uring mem$ergeneration)

    M4F' Ma5imum FI'+ statements that can follo" (uring reformatting)

    Synta5: M4F'SC1>

    M4'I!S Ma5imum sie of literal during reformatting

    M+M2+R It identifies the name of the mem$er to $e createdSynta5: M+M2+R 7M+CM+M1

    R+&/RI+7!

    It usually follo"s M+M2+R statement to identify the last record to $ecopied from the input dataset

    R+&/R I+7!C ('ength8;'iteral;8Start-&olumn)

    +5ample: R+&/R I+7!C(=8;MS;81)8 then the last record to $ecopied into the mem$er from the input dataset8 has MS in column

    1-=R+&/R

    FI+'

    It is used for reformatting the records in the input file

    R+&/R FI+'C('ength8 ;literal; or input column8 conversion8 outputcolumn)

    /utput column says "here the field should $e placed in the outputfile &onversion can $e UP or PU PU means the input pac#ed decimal

    field is $eing converted into oned format and UP is the reverse

    'EB$ENER S,S'N %ARD /OR %REA+'N$ +REE "E"BERS /RO" 'N#.+ #S /'E

    %%S,SI7 ?

    B+7+R!+ M47M+C=8M4BPSC

    M+M2+R 7M+C M+M21R+&/R I+7!C(J8Y11111111Y1)

    M+M2+R 7M+CM+M2R+&/R I+7!C(J8YY81)

    M+M2+R 7M+CM+M2=%%

    I+2B+7+R creates three mem$ers It reads input file "rites into mem$1 until it finds

    11111111 in column 1 In the same "ay it reads and "rites the records into mem$

  • 8/11/2019 REfreresher All Mainframes

    32/204

    Mainframe Refresher Part-1 Page:32

    until it finds in column 1 !he remaining records in the input dataset are

    copied into M+M2=

    'EB$ENER S,S'N %ARD /OR RE/OR"A++'N$ D.R'N$ %O#,

    %%S,SI7 ?

    B+7+R!+ M4F'SCA8M4'I!SCKR+&/R FI+'C(A81881)8FI+'C(>8188)8FI+'C(O818UP8)8 4 FI+'C(O8>8UP8=1)8FI+'C(K8Y!+S!Y88=)

    %?

    Input &olumn ny &onversion /utput column

    alues in column 1-A &opied into column 1-A

    alues in column 1-K> &opied into column -A

    alues in column 1-O &onvert the oned into

    pac#ed $efore copying

    Pac#ed value is "ritten in

    -=>

    alues in >-O &onvert the oned intopac#ed $efore copying

    Pac#ed value is "ritten in=1-=A

    !+S! literal is "ritten incolumn =-=O

    'E'S+

    It is used to list1 !he entries in the catalog (S,SI7 *+,0/R- 'IS!&!'B)

    irectory(s) of 1-1> PS (S,SI7 *+,0/R- 'IS!PS)= !he entries in !/& (S,SI7 *+,0/R-'IS!!/&)

    &ode S,SI78 S,SPRI7! and one more that "ill mount the volume 3ueried in

    S,SI7

    !he follo"ing /2 lists the !/& of I7!2>1 in a formatted "ay%%M,/2 /2 &'SSC8MSB&'SSC8R+BI/7CA*8MSB'++'C(181)

    %%'IS!!/& +4+& PBMCI+.'IS!%%S,SPRI7! S,S/6!C?

    %%/' 67I!CS,S8/'CS+RCI7!2>18ISPC/'%%S,SI7 ?

    'IS!!/& F/RM!8/'C===>CI7!2>1%?

    !o list the contents of any PS:'IS!PS S7M+C(S,S1'I7*'I2)8 /'CS+RCI7!2>1

    !o list the catalog for a specific S volume:

    'IS!&!'B /'C==A>CP62>>>

    'E"O-E

    It is used to move one dataset from one volume to another volume

    //STEP01 EXEC PGM=IE$MOVE//FROMVO !! VO=SER=TST001%!ISP=O!%"#IT=SS!+ /*+OC+T FROM VO"ME*///TOVO !! VO=SER=PR!001%!ISP=O!%"#IT=SS!+ /*+OC+TE TO VO"ME*///SSPRI#T !! SSO"T=*//!!01 !! "#IT=SS!+%VO=REF=SS1'SVCIB%!ISP=O!//SSI# !! * MOVE P!S=M"T$"'TEST'P!S%TO=33,0=PR!001%FROM=33,0=TST001

  • 8/11/2019 REfreresher All Mainframes

    33/204

    Mainframe Refresher Part-1 Page:33

    /*

    FR/M clause in the S,SI7 is not needed for catalogued datasets It is suggested toallocate the Supervisor &all 'i$rary

    'EB%O"#R

    It is used to compare t"o PS or PS datasets !"o PS are same8 if thenum$er of records is same and all the records are identical S,SI7 is not needed forPS comparison If they are not identical8 then the follo"ing "ill $e listed in the

    S,SPRI7! statements that define the dataset8 Record and 2loc# num$ers8 the

    une3ual records and ma5imum of 1> une3ual records found

    !"o PS are same8 if the corresponding mem$ers contain same num$er ofrecords and all the records are identical S,SI7 should have &/MPR+ !,P+CP/ for

    PS%%S,S6!1 I7P6! !S+! 1

    %%S,S6! I7P6! !S+! %%S,SPRI7!

    %%S,SI7 ?

    I+22!P&.

    I+2+I!:

    /ne typical intervie" 3uestion is ho" to run the selected steps For e5ample8 ho" toe5ecute stepK and stepO of 1> steps &' !he typical ans"er is to restart the Qo$

    from stepK and include a O8B!)) in steps A888J and 1> If the intervie"er said &/7 should not

    used8 then only "ay is I+2+I!

    %%MA=A& /2 (MSVuest)8YI+2+I! !+S!Y8%% &'SSC28MSB&'SSC487/!IF,CA=A8R+BI/7CJM

    %%?

    %%S62MI! +4+& PBMCI+2+I!%%S,S6!1 S7C!+S!M6!.6&'(&'I7P)8ISPCS.R

    %%S,S6! S,S/6!C(?8I7!RR)

    %%S,SPRI7! S,S/6!C?%%S,SI7 ?

    +I! S!R!CMA=A&8!,P+CI7&'6+8S!+P7M+C(S!+P>>>K8S!+P>>>O)%%?

    In the a$ove &'8 &'I7P is the 1> steps &' MA=A& is the Qo$-name in the &'

    If !,P+ is e5clude8 then the mentioned steps "ill not $e copied%su$mitted

    D/SOR+

    If you do a glo$al search of your &' inventory8 you "ill find the program thatis used very fre3uently is S/R! !here are t"o famous S/R! products are availa$le in

    the mar#et /ne is FS/R! and the other is S,7&S/R! !he $asic commands in $oththe products are same

  • 8/11/2019 REfreresher All Mainframes

    34/204

    Mainframe Refresher Part-1 Page:34

    I&+!//' provides a lot more than "hat S/R! can offer and it comes "ith

    FS/R! product S,7&!//' comes "ith S,7&S/R! product PBMCS/R! can pointto FS/R! or S,7&S/R! It is actually an alias to S/R! product in your installation

    FS/R! is I2M product and it needs the follo"ing datasets for its operationS/R!I7 (Input dataset)8 S/R!/6! (/utput dataset)8 S,SI7 (&ontrol &ard) and

    S,S/6! (Message dataset)Message dataset can $e altered using MSB7C parameter of S,SI7

    SOR+ %ard o o=: all @! r!ord *rom SOR+'N o SOR+O.+

    S/R! FI+'SC&/P,

    SOR+ ard o = *r 100 r!ord and @!n o=: 20 r!ord

    S/R! FI+'SC&/P, S*IPR+&C1>> S!/PF!C>

    SOR+ %ard o or @! r!ord ba!d on !: *!ld

    S/R! FI+'SC(S!R!P/S8'+7B!.8!,P+8AS&T$+S&)

    !ype C &. (&haracter)8 2I (2inary)8 U (Uoned ecimal)8 P(Pac#ed ecimal)8 FS (Signed num$ers)

    +5: S/R! FI+'SC(181>8&.881A88&.8)SOR+S all @! SOR+'N r!ord ;@ 110 @ol @! r!ra

    I7&'6+ &/7C(S!R!P/S8'+7B!.8!,P+8R/8'6+)R/-Relational operator can $e +V87+8'!8B!8'+8B+

    &ard to select the records "ith !RI&., in the column K-OI7&'6+ &/7C (K88&.8+V8&;!RI&.,;)

    &ard to select the records "hich has same values in -= and A-I7&'6+ &/7C (88&.8+V8A88&.)

    SOR+ ard o r!! @! r!ord m!!n> @! r!ra

    /MI! &/7C(S!R!P/S8'+7B!.8!,P+8R/8'6+)

    &ard to reQect the records "ith !RI&., in the column K-O/MI! &/7C (K88&.8+V8&;!RI&.,;)

    &ard to reQect the records "hich has same values in -= and A-/MI! &/7C (88&.8+V8A88&.)

    S/R! card to change P to U

    If input file has a P field SO(A)OO &omp-= and to reformat as PI& SO(A)O() thenuse8

    /6!R+& FI+'SC(18A8P8+I!(S!!!!!!!)8SIB7SC(8-88))

    S/R! card to remove the duplicates

    S/R! FI+'SC (18A8&.8)8+V6'SS6M FI+'SC7/7+

    S/R!I7 records are sorted on the #ey 1-A and if more than one record is

    found to have same #ey8 then only one record "ill $e "ritten to S/R!/6! If +V6'S

    is coded8 then the record to $e "ritten is the FIRS! record else it can $e anything

    SOR+ ard o S/R! FI+'SC (18A8&.8)8+V6'S

    S6M FI+'SC(1>8A8P)

  • 8/11/2019 REfreresher All Mainframes

    35/204

    Mainframe Refresher Part-1 Page:35

    S/R!I7 records are sorted on #ey 1-A and if more than one record is found to

    have same #ey8 then the records are summed on column 1>-1K and one record is"ritten "ith total sum

    S/R! card to add se3uence num$er to the output file

    /6!R+&C(18>8S+V76M8K8U) K digit oned decimal se3uence num$er is

    added "ith all the records of input file in column 1-K

    !his "ill $e useful for reading a file from $ottom to top !his "ill $e useful formatching logic in &' Matching logic in &' "ill $e e5plained later

    SOR+ ard o r!r8 CG FIRS! > &.R FR/M I7P6! FI'+

    1:&;M6!.6;8 C G F/''/0+ 2, S!RI7B U8 CG F/''/0+ 2, 1> 2I7R, U+R/S

    =:181>) CG 1S!to 1> &.R&!+RS FR/M I7P6! FI'+

    S/R! card to change any

  • 8/11/2019 REfreresher All Mainframes

    36/204

    Mainframe Refresher Part-1 Page:36

    +OO'N ard o o=: S+'+&! FR/M(I7) !/(/6!) /7 (S!R!P/S8'+7B!.8!,P+)7/6PS%''6PS%'/0+R(n)%.IB.+R(n)%+V6'(n)%FIRS!%'S!

    7/6PS N &/P, only the uni3ue records

    ''6PS N &/P, only the duplicates.IB.+R(n) N &/P, those duplicates that occurs more than n times (n CG 1-OO)'/0+R(n) N &/P, those duplicates that occurs less than n times (n CG 1-OO)

    +V6'(n) N &/P, those duplicates that occurs e5actly n times (n CG 1-OO)FIRS! - Retains the first copy in case of duplicates

    'S! - Retains the first copy in case of duplicates

    +OO'N %ard o >! @! a o* a n! @! n! all @! al

    ISP', FR/M(I7) /7(S!R!P/S8'+7B!.8!,P+) 'IS!('IS!)

    Prints values of a field in the input dataset to 'IS! (> /7 possi$le)

    +OO'N %ard o >! all @! al

    /&&6RS FR/M(I7) /7(S!R!P/S8'+7B!.8!,P+) 'IS!('IS!) /P!I/7

    /P!I/7 C G .IB.+R(n) '/0+R(n) +V6'(n) ''6PS 7/6PS

    .IB.+R() means only the values that are repeated more than times is reported at'IS! dataset

    +OO'N %ard o >! n! m!non!d

    R7B+ FR/M(I7) /7(S!R!8'+7B!.8F/RM!) 'IS!(/6!) options

    /ptions are /&&6RS .IB.+R(n)%'/0+R(n)%.IB.+R(n1) '/0+R(n)%

    +V6'(n) 7/!+V6'(n)It prints count of records meeting value criteria and the F/RM! should $e numeric

    +OO'N ard o no! SOR+

    S/R! FR/M(I7) !/(/6!) 6SI7B(5555)

    S/R! statements should $e coded under the 7M+ 5555&7!'

    Matching 'ogic in &'

    I have t"o files file1 and file I "ant to generate three reports out of theset"o files

    1!he first report should have records that e5ist in $oth files!he second report should contain records that e5ist only in first file and not in

    second file=!he third report should contain records that e5ist only in the second file and not in

    the first file

    %%S!+P>1>> +4+& PBMCI&+!//'%%?

    %%!//'MSB S,S/6!C?

  • 8/11/2019 REfreresher All Mainframes

    37/204

    Mainframe Refresher Part-1 Page:37

    %%FSMSB S,S/6!C?

    %%I71 ?1=KAJO>

    =KAJO>1AJO>1=K

    %%I7 ?=KAJO>1

    JO>1=KAJO>1=KA

    %%!1 S7C9!18SP&+C(&,'8(A8A)8R'S+)8ISPC(8PSS)%%! S7C9!8SP&+C(&,'8(A8A)8R'S+)8ISPC(8PSS)

    %%I7! S7C?!18ISPC(/'8PSS)8/'CR+FC?!1%% S7C?!8ISPC(/'8PSS)8/'CR+FC?!

    %%FI'+ S,S/6!C?%%FI'+2 S,S/6!C?

    %%/6! S,S/6!C?%%!//'I7 ?

    S/R! FR/M(I71) 6SI7B(&!'1)S/R! FR/M(I7) 6SI7B(&!')

    S/R! FR/M(I7!) 6SI7B(&!'=)

    %%&!'1&7!' ?S/R! FI+'SC(181>8&.8)

    /6!FI' F7M+SC!18/6!R+&C(18J>8&Y1Y)%%&!'&7!' ?

    S/R! FI+'SC(181>8&.8)

    /6!FI' F7M+SC!8/6!R+&C(18J>8&YY)%%&!'=&7!' ?

    S/R! FI+'SC(181>8&.8)S6M FI+'SC(J1818U)

    /6!FI' F7M+SC/6!8I7&'6+C(J1818U8+V8=)8/6!R+&C(18J>)

    /6!FI' F7M+SCFI'+8I7&'6+C(J1818&.8+V8&Y1Y)8/6!R+&C(18J>)/6!FI' F7M+SCFI'+28I7&'6+C(J1818&.8+V8&YY)8/6!R+&C(18J>)

    %?

    +5planation:

    &!'1 N dd 1 to all the records of the first file at J>thcolumn&!' N dd to all the records of the second file at J> thcolumn

    &!'= N &oncatenate $oth files and sort the file on #ey if duplicates found8 sum onJ1stcolumn So if any record e5ists in $oth the file8 it "ill have = after summing

    So no" e5tract records "ith

  • 8/11/2019 REfreresher All Mainframes

    38/204

    Mainframe Refresher Part-1 Page:38

    Aeleting the inde5 for BB ('!4 I7+4Cinde5-name)

    !he S,SI7 cards are given in $rac#et !he utility needs t"o "or# datasets andS,SPRI7! for messages &ontinuation of control card needs to $e indicated $y 1P,R/''MS!+RBnnnn55\nnnn is generation num$er (>1-OOOO) and 55 is version num$er (>>-OO)

    R!*!rrn> $!n!raon n J%

    !he current generation is referred $y BB2S+(>)8 the previous generation

    $y BB2S+(-1) and the ne5t generation $y BB2S+(L1)

    B+7+R!I/7S R+ 6P!+ /7', ! !.+ +7 /F !.+ /2 It means8 if thefirst step creates one generation8 code it as BB2S+(L1) and if the second step

    creates another generation8 then it S./6' $e coded as BB2S+(L) as the (L1)version is not yet promoted to current version Similarly to refer the BB created in

    the second step8 refer it $y BB2S+(L)

    BB datasets can $e also referenced "ith their generation num$er li#e1P,R/''MS!+RB>>1>>;

    Adana>! o* $D$

    1 BB datasets are referred in the &' using BB $ase and relative num$er So the

    same &' can $e used again and again "ithout changing the dataset name and thisis the $iggest advantage of BB

    BB 2ase has pointers to all its generations 0hen you "ant to read all the

    transactions done till today8 you can easily do it $y reading the BB $ase if it isavaila$le /ther"ise you have to concatenate all the transaction files $efore reading

    %r!aon o* $D$

    1BB 2ase is created using I&MS !he parameters given "hile creating the BBare:

  • 8/11/2019 REfreresher All Mainframes

    39/204

    Mainframe Refresher Part-1 Page:39

    Parameter Purpose

    7M+ 2ase of the BB is given here

    'IMI! !he ma5imum num$er of BB version that can e5ist at any pointof time It is a num$er and should $e less than A

    +MP!,%7/+MP!, 0hen the 'IMI! is e5ceeded8+MP!, #eeps /7', the most recent generation

    7/+MP!, #eeps the 'IMI! num$er of ne"est generation

    S&R!&.%

    7/S&R!&.

    S&R!&. un-catalogue and deletes the versions that are not #ept

    7/S&R!&. Qust does un-cataloguing and it is not physically

    deleted from the volume

    /07+R /"ner of the BB

    F/R ,S (n) %

    !/ (!+)

    +5piry date &an $e coded either in the unit of days or till

    particular date

    Model dataset is defined after or along "ith the creation of $ase /nce model &2

    is defined8 then during the allocation of ne" versions8 "e no need to code &2parameter Model &2 parameter can $e overridden $y coding ne" parameter "hile

    creating the BB version It is "orth to note that t"o BB version can e5ist in t"odifferent formats

    step that defines a BB and allocates a model S&2

    %%BB +4+& PBMCI&MS

    %%S,SPRI7! S,S/6!C?%%M/+' S7M+CMM>1P,R/''MS!+R8ISPC(8*++P)8

    %% 67I!CS,S8/'CS+RCMPSJ>>8SP&+C(!R*8(>))8%% &2C(S/RBCPS8R+&FMCF28'R+&'CK>>)

    %%S,SI7 ?+FI7+ BB ( 7M+(MM>1P,R/''MS!+R) -

    'IMI!(A) - 7/+MP!, -

    S&R!&. )%?

    .o" to Solve 2+7S]

    !here are t"o #inds of a$ends- 6S+R and S,S!+M

    6S+R (6nnnn) S,S!+M (Snnnn)

    Prefi5ed "ith 6 Prefi5ed "ith Spplication riven N !he applicationprogram issues the user a$end $y calling

    installation specific a$end routineI2M Supplied a$end routine: I'2/27>

    System riven N 0hen the system is nota$le to perform a statement8 it a$ended

    "ith respective system a$end

    M/+ OOO !/ 2+7-&/+&''

  • 8/11/2019 REfreresher All Mainframes

    40/204

    Mainframe Refresher Part-1 Page:40

    +5: In a $illing application8 the country

    referred in the $ill-to address is missing

    in the country ta$le "hich is an seriousissue and so the program "ill $e "ritten

    in such a "ay to a$end in this scenario

    +5: !rying to do an arithmetic operation

    on non-numeric data s system could

    not perform this8 it "ill a$end "ith S>&

    Solution: 'oo# for the a$end code in theprogram and study the application logic

    $ehind this a$end !hen appropriately fi5the data%rerun

    Solution: Refer I2M Manuals for systema$end and ta#e appropriate action ,ou

    may need to analyse program%data to fi5$ased on type of a$end

    System a$ends can $e environment (space%region) related or program

    related(logic%data driven logic) Fi5ing a program related a$end is comparativelycomplicated than enviroment related system a$ends or user a$ends

    !he usual process to solve a system a$end is:

    1Refer the S,S/6! of the Qo$ and get the ne5t se3uential instruction to $e e5ecuted

    (/ffset)&ompile the program "ith 'IS! option if the compiled one is not "ith either 'IS! or

    /FFS+! option

    =&hec# for the offset in the compilation list and Bet the respective statementnum$er

    KIdentify the statement !his "ould $e a numeric operation on non-numeric dataAIdentify the source of the non-numeric data and correct it

    !hough the process loo#s simple and this "ill "or# O> percent of the cases8 the

    3uestions are:

    In case offset and the a$ending module is not displayed in the sysout8 ho" toproceed]

    In case of data-e5ception #ind of a$end8 if the particular statement referred

    more than one field8 ho" do you conclude "hich field have pro$lem "ithout displayand rerun]

    If the source for the field in pro$lem is in file8 ho" do you #no" "hich recordof this field in the file]

    ump Reading e5posure "ill help you in all these cases s dump reading #no"ledge

    is important for any maintenance % support proQect8 let us study "ith a simplee5ample:

    Simple Program

    CB ISTI!E#TIFIC+TIO# !IVISIO#'PROGR+M.I!'S+#SOFT'*E#VIRO#ME#T !IVISIO#'*!+T+ !IVISIO#'-ORKI#G.STOR+GE SECTIO#'

  • 8/11/2019 REfreresher All Mainframes

    41/204

  • 8/11/2019 REfreresher All Mainframes

    42/204

    Mainframe Refresher Part-1 Page:42

    0000&1 MOVE0003, !&05 &012 +0B! MVC &&(,%&)%1,(10) (B-=0)&& PGMIT +T 1,

    000022 COMP"TE0003E F&45 !0F, &01E P+CK &4,(%13)%30(,%&) TS&=0 -S.EMP.BO#"S000324 !&0F !0E, +0,! MVC &3&(12%13)%141(10) TS1=0 PGMIT +T 13500036A FA54 D0F2 D0F8 AP 242(6,13),248(5,13) TS1=10 TS2=0

    000350 40F !0F3 #I &43(13)%X0F TS1=11000354 F,44 !0F3 !0F3 D+P &43(%13)%&43(%13) TS1=11 TS1=1100035+ F354 &0&2 !0F3 "#PK 3,(,%&)%&43(%13) -S.EMP.CTC TS1=11

    0000&3 !ISP+

    =A+-=F $elongs to the &/MP6!+ statement that is in line >>>>

    7o" loo# for line >>> in compilation listing

    0000&1 MOVE 20000 TO -S.EMP.S+000022 COMPUTE WS-EMP-CTC = (WS-EMP-SAL * 12) + WS-EMP-BONUS

    0000&3 !ISP+ S+#SOFT COMPETE!

    So one of this field referred in this statement has Qun# in it ust $efore compute "e

    populated 0S-+MP-S' and so there is a pro$lem "ith 0S-+MP-2/76S If you gothru the code8 you "ill find the developer missed to populate%initialie 0S-+MP-

    2/76S and that has caused data e5ception

    If these fields are from file8 "e cannot easily confirm li#e a$ove So "e have to givedisplay for these t"o fields in the program and rerun the program or loo# for Qun#s in

    the source file for these t"o fields using FI'+ I% I7S,7& !he other approach "ill$e loo# into data division map in the compilation listing

    0S?u:e $>e;:67 ;@9 B;se $esA;:e8e@t+s8A !;t; !;t; !e>@eI! !;t; #;8e ?:;t? BA Stu:tue

    !e>@>t>?@ !;t; T7e +tt>utes& PROGR+M.I! S+#SOFT.........................................................*

    , 1 -S.V+RI+BES' ' ' ' ' ' B-=00000 000 !S 0C42 G?u & -S.EMP.#+ME ' ' ' ' ' B-=00000 000 0 000 000 !S 10C !>sA;710 & -S.EMP.+GE' ' ' ' ' ' B-=00000 00+ 0 000 00+ !S &C !>s.#u811 & -S.EMP.CIT ' ' ' ' ' B-=00000 00C 0 000 00C !S 10C !>sA;71& & -S.EMP.S+' ' ' ' ' ' B-=00000 012 0 000 012 !S ,C !>s.#u813 & -S.EMP.BO#"S' ' ' ' ' B-=00000 01E 0 000 01E !S ,C !>s.#u814 & -S.EMP.CTC' ' ' ' ' ' B-=00000 0&2 0 000 0&2 !S ,C !>s.#u8

    0S-+MP-S' is in 2'0-> offset 1 "hereas 0S-+MP-2/76S in offset >1+

    In the dump8 loo# for "or#ing-storage dump 2'0-> maps to OJO>2Jaddress

    -ORKI#G.STOR+GE ? S+#SOFTB-.0 &5,0B,

    000000 &5,0B, !4E4E3C, E4404040 4040F&F E3!CC3C,E,4040 4040F0F0 F0F2F0F0 F0C00000M"T$" &TRIC$ 0002000'''

    0000&0 &5,0!, 00000000 00000000 00000000 0000000000000000 00000000 00000000 00000000''''''''''''''''''''''''''''''''

    B-.0 &5,0B,000000 &5,0B, !4E4E3C, E4404040 4040F&F E3!CC3 C,E,4040 4040F0F0 F0F2F0F0 F0C00000 M"T$" &TRIC$ 0002000'''0000&0 &5,0!, 00000000 00000000 00000000 00000000 00000000 00000000 00000000 00000000 ''''''''''''''''''''''''''''''''

  • 8/11/2019 REfreresher All Mainframes

    43/204

    Mainframe Refresher Part-1 Page:43

    0S-+MP-7M+ is 1> $ytes starting at > - K>K>K>K>; "hich is

    nothing $ut 11J> is O>11J>8 O>11J>-O>>+1> C =>

    is the offset8 from the compilation listing one instruction Qust $efore => is =)

    PS-''''' 05,!1000A!01180

    T;:e;:

    !S+ +99 P?H;8 "@>t P" +99 P" Oset E@t7 E +99 E Oset

    0001!1&0 CEE$!SP 055,0F0 00003C34 CEE$!SP 055,0F0 00003C340001!01, S+#SOFT &500E10 +0000036A S+#SOFT 2!00E10 0000032+

    St;te8e@t ?;9 M?9 Se>:e St;tus

    CEEPPK+ "K0012 C;AAS+#SOFT E?@

    Su$mission of o$ from &/2/' Program

    0rite the o$ statements to a output file and route the file to I7!RR insteadof cataloguing I7!RR-Internal Reader

    /2: %%S!+P1 +4+& PBMCMI7PBM

    %%1 S7CM6!.6!+S!8ISPCS.R %%&' S,S/6!C(?8I7!RR)

    PR/BRM:MI7PBM

    S+'+&! &'FI'+ SSIB7 !/ &'Z (+nvironment ivision) F &'FI'+

    >1 &'-R+& PI& 4(J>) (File Section)/P+7 /6!P6! &'FI'+ (/pen in output and "rite &' statements)

    M/+ Y%%!+S!/2 /2 1111Y !/ &'-R+&

  • 8/11/2019 REfreresher All Mainframes

    44/204

    Mainframe Refresher Part-1 Page:44

    M/+ Y%%S!+P>1 +4+& PBMCI+F2R1KY !/ &'- R+&

    &'/S+ &'FI'+ (!+S!/2 "ill $e su$mitted automatically)

    Su$mission of o$ from &I&S Program

    &' can $e su$mitted from &I&S $y SP//' /P+78 SP//' 0RI!+ and SP//'&'/S+ commands !his needs SP//'C,+S entry in SI! ta$le Refer &I&S section for

    more details

    Storage Management Su$systemIt is optional feature of the operating system that manages user datasets !he

    SMS parameters apply only to the ne" datasets and the system ignores for e5istingdatasets8 ? or ! datasets8 /2&! and /2'I2 statements8 and

    S,S/6! datasets

    !he follo"ing data classes esta$lish various default values for catalogueddatasets n administrator assigns a name to each group of default values8 and then

    you reference this name on your statements to use the values

    S!/R&'S N efines 67I! and /' parameters

    !&'S - efines R+&FM8 'R+&'8 BR+&8 SP&+8 R+!P%+4!P8 S7!,P+8*+,'+78 R+&/RB8 *+,/FFetc

    MBM!&'S N Migration8 $ac#up8 releasing unused space in a dataset

    If you "ant to override any one of the values of default8 you can do that

    %%PS S7C2PMI7M6!.6S/6R&+8ISPC(7+08&!'B)8%% S!/R&'SCS/7+8SP&+C(8(88A>))8!&'SC&/2

    /verrides the directory space defined for &/2 data class

    &' for SR-I7-2!&.

    !he production o$ logs are usually routed to one of the third party productsSR is one such product !he other products are &-I+0 and I+0-IR+&!

    !he follo"ing &' is used to 3uery the SR in $atch

    //O+!OG EXEC PGM=S+RBC$//STEPIB !! !S#=SSP'C+I'C+IIB%!ISP=S$R//SSPRI#T !! SSO"T=*//REPORT !! !S#=CORP'!BS&KT'JOBRPT%!ISP=MO!//O+!!! !! !S#=CORP'!BS&KT' O+!OG%!ISP=O!//SSI# !! !S#=CORP'!BS&KT'"TIS(CCC+R!-)%!ISP=S$R

    !o load the complete log (/2 PR/2*6P of generation KOK1) into a datasetnamed as '/8 use the follo"ing card:%'/ 7M+C'/ ICPR/2*6P B+7CKOK1

    !o get run-date8 run-time8 return code and generation of all the prior runs of

    a Qo$8 use the follo"ing card !he result "ill $e stored in the dataset named asR+P/R!

    %'IS! IC/27M+

  • 8/11/2019 REfreresher All Mainframes

    45/204

    Mainframe Refresher Part-1 Page:45

    &' for &-I7-2!&.

    & is a scheduler product 0e $rief a$out the product in the ne5t section!his &' is used to 3uery & in $atch

    %%6&&2!I PR/& IC>8P//'CY1-JY8S7PF4C8/P!C8PBCSSS2S!R

    %%2!+RM +4+& PBMCSS2S!R8%% PRMCY>8P//'C(1-J) Y

    %%S!+P'I2 ISPCS.R8S7C&I&'/'I2%%6&&&MS ISPCS.R8S7C&I&&/MMS

    %%S,SPRI7! S,S/6!C?8&2C2'*SIU+C1==%%+RR/RS S,S/6!C?8&2C2'*SIU+C1==

    %%S,S66MP S,S/6!C?%%S,SI7 ?

    &ode the & commands%?

    &' F/R 4&-I7-2!&.

    !here may $e a need to read the run details of a Qo$ log inside the R+44!his can $e done using the /6!P6! command of !S/ !he follo"ing &' captures the

    complete log information of the Qo$ &+77+F "ith I /2>J>O into

    !ISPM6!.6(!+S!1)

    %%R67!S/ +4+& PBMCI*+F!>1%%S,S!SPR! S,S/6!C?

    %%S,S!SI7 ?

    /6!P6! &+77+F(/2>J>O) PRI7!(Y!ISPM6!.6(!+S!1)Y)%?

    %%?

  • 8/11/2019 REfreresher All Mainframes

    46/204

    Mainframe Refresher Part-1 Page:46

    &ommon 2usiness /riented 'anguage

    &/2/'

  • 8/11/2019 REfreresher All Mainframes

    47/204

    Mainframe Refresher Part-1 Page:47

    &/2/' (COmmon %usiness Oriented Language)

    .istory

    eveloped in 1OAO $y a group called &/nference on ta Systems 'anguage(&/S,') First &/2/' compiler "as released in 1O>

    First 7SI approved version N 1OJ

    Modified 7SI approved version N 1OK (/S%S &/2/')Modified 7SI approved version N 1OJA (S &/2/' )

    !his $oo# is "ritten $ased on I2M &/2/' for /S%=O> R

    Speciality

    1 First language developed for commercial application development8 "hich can

    efficiently handle millions of data Procedure /riented 'anguage - Pro$lem is segmented into several tas#s

    +ach tas# is "ritten as a Paragraph in Procedure ivision and e5ecuted in alogical se3uence as mentioned

    = +nglish 'i#e language N +asy to learn8 code and maintain

    &oding Sheet

    1 1 J>

    &/'- &/'6M7-2

    1 Se3uence num$er N Should $e in se3uence $ut need not $e consecutive-6sually (1-=) columns identify page num$er and (K-) columns identify line

    num$er &ontinuity (-)8 &omment (?)8 Starting a ne" page (%) and e$ugging lines ()

    J-11 &olumn Nivision8 Section8 Paragraph8 >18 declarations must $egin here1 &olumn 2 Nll the other declarations%statements must $egin here

    =-J> Identification field It "ill $e ignored $y the compiler $ut visi$le in the sourcelisting

    'anguage Structure

    &haracter igits (>-O)8 lpha$ets (-U)8 Space ($)8Special &haracters (L - ? % ( ) C H @ [ G 8)

    0ord /ne or more characters - 6ser defined or Reserved

    &lause /ne or more "ords It specifies an attri$ute for an entry

    Statement /ne or more valid "ords and clauses

    Sentence /ne or more statements terminated $y a period

    Paragraph /ne or more sentences

  • 8/11/2019 REfreresher All Mainframes

    48/204

    Mainframe Refresher Part-1 Page:48

    Section /ne or more paragraphs

    ivision /ne or more sections or paragraphs

    Program Made up of four divisions

    ivisions in &/2/'!here are four divisions in a &/2/' program and the data division is an optional one

    1Identification ivision

    +nvironment ivision=ata ivision

    KProcedure ivision

    Identification ivision

    !his is the first division and the program is identified here Paragraph PR/BRM-Ifollo"ed $y user-defined name is mandatory !hough => characters can $e entered

    for the program I8 compiler "ill consider only the first +IB.! characters and theremaining characters "ill $e ignored ll other paragraphs are optional and used for

    documentation

    I+7!IFI&!I/7 IISI/7PR/BRM-I PR/BRM 7M+

    6!./R &/MM+7! +7!R,I7S!''!I/7 &/MM+7! +7!R,

    !+-0RI!!+7 &/MM+7! +7!R,!+-&/MPI'+ &/MM+7! +7!R,

    S+&6RI!, &/MM+7! +7!R,

    Security does not pertain to the operating system security8 $ut theinformation that is passed to the user of the program a$out the security features of

    the program

    +nvironment ivision!his is the only machine dependant division of &/2/' program It supplies

    information a$out the hard"are or computer e3uipment to $e used on the program0hen a program is moved from one computer to another computer8 the only section

    that may need to $e changed is +7IR/7M+7! division

    &onfiguration Section

    It supplies information a$out the computer on "hich the program "ill $e compiled

    (S/6R&+-&/MP6!+R) and e5ecuted (/2+&!-&/MP6!+R) It consists of three

    paragraphs N S/6R&+ &/MP6!+R8 /2+&!-&/MP6!+R and SP+&I'-7M+S!his is /P!I/7' section from &/2/' JA

    S/6R&+-&/MP6!+R I2M-K=J1 (&omputer and model D supplied $y manufacturer) 0I!. +26BBI7B M/+ clause specifies that the de$ugging lines

    in the program (statements coded "ith

  • 8/11/2019 REfreresher All Mainframes

    49/204

    Mainframe Refresher Part-1 Page:49

    SP+&I'-7M+S !his paragraph is used to relate hard"are names to user-specifiedmnemonic names

    1 Su$stitute character for currency sign (&6RR+7&, SIB7 IS litearal-1) &omma can $e used as decimal point (+&IM'-P/I7! IS &/MM)

    = efault collating se3uence can $e changed It "ill $e e5plained laterK 7e" class can $e defined using &'SS #ey"ord (&'SS DI1I is [>\ thru [O\)

    Input-/utput Section

    It contains information regarding the files to $e used in the program andconsists of t"o paragraphs FI'+-&/7!R/' 9 I-/ &/7!R/'

    FI'+ &/7!R/' Files used in the program are identified in this paragraphI-/ &/7!R/' It specifies "hen chec# points to $e ta#en and storage areas that are

    shared $y different files

    ata ivisionata division is used to define the data that need to $e accessed $y the program

    It has three sections

    FI'+ S+&!I/7 descri$es the record structure of the files0/R*I7B-S!/RB+ S+&!I/7 is used to for define intermediate varia$les

    'I7*B+ S+&!I/7 is used to access the e5ternal data+5: ata passed from other programs or from

    PRM of &'

    'iterals8 &onstants8 Identifier8

    1 'iteral is a constant and it can $e numeric or non-numeric 7umeric literal can hold 1J digits and non-numeric literal can hold 1> characters

    in it (&/2/'K supports 1> characters only)

    = 'iteral stored in a named memory location is called as varia$le or identifierK Figurative &onstant is a &/2/' reserved "ord representing fre3uently used

    constants !hey are U+R/%U+R/S%U+R/+S8 V6/!+%V6/!+S8 SP&+%SP&+S8

    ''8 .IB.-'6+%.IB.-'6+S8 '/0-'6+%'/0-'6+S

    +5ample: >1 0S-7M+ PI& 4(>K) '6+ 1-KO or from one of the special level-num$ers JJ

    >1 level Specifies the record itself It may $e either a group item or an

    +lementary item It must $egin in rea >-KO levels Specify group or elementary items "ithin a record Broup level items

    must not have picture clause

  • 8/11/2019 REfreresher All Mainframes

    50/204

    Mainframe Refresher Part-1 Page:50

    level Identify the items that contain the R+7M+S clause

    level Identify independent data itemJJ level &ondition names

    aria$le name and Vualifier

    aria$le name can have 1-=> characters "ith at least one alpha$et in it.yphen is the only allo"ed special character $ut it cannot $e first or last letter of the

    name 7ame should $e uni3ue "ithin the record If t"o varia$les "ith same nameare there8 then use /F 3ualifier of high level grouping to refer a varia$le uni3uely

    +5: M/+ $alance $Frecord-1 !/ $alance $Frecord-

    FI''+R0hen the program is not intended to use selected fields in a record structure8 define

    them as FI''+R FI''+R items cannot $e initialied or used in any operation of theprocedure division

    PI&!6R+ &lause

    escri$es the attri$utes of varia$le

    7umeric O (igit)8 (Implied decimal point)8 S (Sign)8 P(ssumeddecimal point "hen the point lies outside the data item)

    7umeric +dited L (Plus Sign)8 - (Minus Sign)8 &R 2 (&redit e$it Sign) (Period)8 $ (2lan#)8 (Uero)8 % (Slash)

    2'7* 0.+7 U+R/ (Insert $lan# "hen data value is >)8U (U+R/ suppression)8 ? (S!+RIS*)8 H(&urrency Sign)

    7on 7umeric (alpha$et)8 2 (2lan# insertion &haracter)8 4(lpha numeric)8B(2&S)

    +5clusive sets 1 L - &R 2

  • 8/11/2019 REfreresher All Mainframes

    51/204

    Mainframe Refresher Part-1 Page:51

    L1C LC2 L=C& LKC LAC+ LCF LCB LJC. LOCI->CX8 -1C 8 -C *8 -=C'8 -KCM8 -AC78 -C/8 -CP8 -JCV8 -OCR

    7um$er !RI'I7B SIB7

    (efault)

    '+I7B SIB7 '+I7B

    S+PR!+

    -1A 17 A -1A

    L1A 1+ A L1A

  • 8/11/2019 REfreresher All Mainframes

    52/204

    Mainframe Refresher Part-1 Page:52

    Refreshing 2asics

    7i$$le >K 2its is one ni$$le In pac#ed decimal8 each ni$$le stores one digit2yte >J 2its is one $yte 2y default8 every character is stored in one $yte

    .alf "ord 1 2its or $ytes is one half "ord (MS)Full "ord = 2its or K $ytes is one full "ord (MS)

    ou$le "ord K 2its or J $ytes is one dou$le "ord (MS)

    6sage &lauseISP', efault 7um$er of $ytes re3uired e3uals to the sie of the data item

    &/MP 2inary representation of data itemPI& clause can contain S and O only

    SO(>1) N SO(>K) .alf "ordSO(>A) N SO(>O) Full "ord

    SO(1>) - SO(1J) ou$le "ordMost significant $it is /7 if the num$er is negative

    &/MP-1: Single "ord floating point item PI& &lause should not $e specified!he sign is contained in the first $it of the of the leftmost $yte and the

    e5ponent is contained in the remaining $its of the first $yte !he last= $ytes contain the mantissa

    &/MP-: ou$le "ord floating-point item PI& &lause should not $e specified

    $ytes are used for mantissa and hence used for high precisioncalculation

    &/MP-=: Pac#ed ecimal representation /ne digit ta#es half $ytePI& O (7) comp-= data item "ould re3uire (7 L 1)% $ytes !he sign is

    stored separately in the rightmost half-$yte regardless of "hether S is

    specified in the PI&!6R+ or not& N Signed Positive N Signed 7egative F-6nsigned Positive

    I7+4 It is used for preserve the inde5 value of an array It ta#es K $ytesPI& &lause should not $e specified 0hen the clause is specified for a

    group item8 it applies to all elementary items contained in it .o"ever8

    the group itself is not an inde5 data itemP/I7!+R K 2yte elementary item that can $e used to accomplish limited $ase

    addressing It can $e used only in N S+! statement8 Relation condition8

    6SI7B phrase of a &'' statement8 an +7!R, statement or theprocedure division statement value clause for a pointer data item

    can contain only 76'' or 76''S

    S+! identifier-1 !/ address of identifier-S+! R+SS /F identifier- !/ identifier-1

    Identifier-1 is P/I7!+R data item and identifier- is lin#age section

    item

  • 8/11/2019 REfreresher All Mainframes

    53/204

    Mainframe Refresher Part-1 Page:53

    S,7& &lause and Slac# 2ytes

    S,7& clause is specified "ith &/MP8 &/MP-1 and &/MP- items !hese items aree5pected to start at half%full%dou$le "ord $oundaries for faster address resolution

    S,7& clause does this $ut it may introduce slac# $ytes (unused $ytes) $efore the$inary item

    &onsider the follo"ing declaration in the 0/R*I7B-S!/RB+ S+&!I/7:

    >1 M,-!>A !-/7+ PI& 4()

    >A !-!0/ PI& O() &/MP S,7&>A !-!.R++ PI& SO(K)OO &/MP-=

    !he Starting address of Full-"ord should end "ith >8K8J or & and that of half-"ord

    should end "ith >88K88J88&8+ If !-/7+ starts at >8 it "ill occupy >-A $ytes inmemory !-!0/ - a sync item of full "ord cannot start at So $y S,7& rule8 it

    starts at Jthposition th9 th$ytes are unused So M,-! occupies 1 $ytes

    R++FI7+S!he R++FI7+S clause allo"s you to use different data description entries to

    descri$e the same computer storage area Redefining declaration should immediately

    follo" the redefined item and should $e done at the same level Multiple redefinitionsare possi$le Sie of redefined and redefining need not $e the same It cannot $e

    done at and JJ levels

    +5ample:

    >1 0S-!+ PI& O(>)>1 0S-R++F-!+ R++FI7+S 0S-!+

    >A 0S-,+R PI& O(>)>A 0S-M/7 PI& O(>)

    >A 0S-, PI& O(>)

    R+7M+SIt is used for regrouping of elementary data items in a record It should $e declared

    at level It need not immediately follo"s the data item8 "hich is $eing renamed2ut all R+7M+S entries associated "ith one logical record must immediately follo"

    that recordYs last data description entry R+7M+S cannot $e done for a >18 8 JJor another entry It cannot $e done for occurrences of an array

    >1 0S-R+PS/7S+>A 0S-&.R1K= PI& 4(>=)

    >A 0S-&.RK PI& 4(>K) -R+PS/7S+ R+7M+S 0S-&.R1K=

    &/7I!I/7 nameIt is identified "ith special level 1 S+4 PI& 4 JJ M'+ '6+

  • 8/11/2019 REfreresher All Mainframes

    54/204

    Mainframe Refresher Part-1 Page:54

    6S!IFI+ RIB.!!his clause can $e specified "ith alphanumeric and alpha$etic items for right

    Qustification It cannot $e used "ith and JJ level items

    /&&6RS &lause/&&6RS &lause is used to allocate physically contiguous memory locations to

    store the ta$le values and access them "ith su$script or inde5 etail e5planation isgiven in !a$le .andling section

    'I7*B+ S+&!I/7

    It is used to access the data that are e5ternal to the program &' can sendma5imum 1>> characters to a program thru PRM 'in#age section M6S! $e coded

    "ith a half "ord $inary field8 prior to actual field If length field is not coded8 the firstt"o $ytes of the field coded in the lin#age section "ill $e filled "ith length and so

    there "ill $e last $ytes data truncation in the actual field>1 '*-!

    >A '*-'+7B!. PI& SO(>K) &/MP >A '*-RI2'+ PI& 4(>J)

    'I7*B+ section of su$-programs "ill $e e5plained later

  • 8/11/2019 REfreresher All Mainframes

    55/204

    Mainframe Refresher Part-1 Page:55

    Procedure ivision!his is the last division and $usiness logic is coded here It has user-defined sections

    and paragraphs Section name should $e uni3ue "ithin the program and paragraphname should $e uni3ue "ithin the section

    Procedure division statements are $roadly classified into follo"ing categories

    Statement !ype Meaning

    Imperative irect the program to ta#e a specific action

    +5: M/+ +4I! B/ !/

    &onditional ecide the truth or false of relational condition and $ased onit8 e5ecute different paths

    +5: IF8 +'6!+

    &ompiler irective irects the compiler to ta#e specific action during compilation

    +5: &/P, S*IP ++&!+5plicit Scope

    terminator

    !erminate the scope of conditional and imperative statements

    +5: +7- +7-IF +7-+'6!+

    Implicit Scope

    terminator

    !he period at the end of any sentence8 terminates the scope of

    all previous statements not yet terminated

    M/+ StatementIt is used to transfer data $et"een internal storage areas defined in either file section

    or "or#ing storage section

    Synta5:

    M/+ identifier1%literal1%figurative-constant !/ identifier (identifier=)Multiple move statements can $e separated using comma8 semicolons8 $lan#s or the

    #ey"ord !.+7

    Numeric mo2e rules:

    numeric or numeric-edited item receives data in such a "ay that thedecimal point is aligned first and then filling of the receiving field ta#es place

    6nfilled positions are filled "ith ero Uero suppression or insertion of editingsym$ols ta#es places according to the rules of editing pictures

    If the receiving field "idth is smaller than sending field then e5cess digits8 tothe left and%or to the right of the decimal point are truncated

    Al3.anumeric Mo2e %ules:

    lpha$etic8 alphanumeric or alphanumeric-edited data field receives the data

    from left to right ny unfilled field of the receiving filed is filled "ith spaces0hen the length of receiving field is shorter than that of sending field8 then

    receiving field accepts characters from left to right until it is filled !he

    unaccomodated characters on the right of the sending field are truncated0hen an alphanumeric field is moved to a numeric or numeric-edited field8

    the item is moved as if it "ere in an unsigned numeric integer mode&/RR+SP/7I7B can $e used to transfer data $et"een items of the same

    names $elonging to different group-items $y specifying the names of group-items to"hich they $elong

  • 8/11/2019 REfreresher All Mainframes

    56/204

    Mainframe Refresher Part-1 Page:56

    M/+ &/RR+SP/7I7B group-1 !/ group-

    1rou3 Mo2e rule0hen M/+ statement is used to move information at group level8 the

    movement of data ta#es place as if $oth sending and receiving fields are specified asalphanumeric items !his is regardless of the description of the elementary items

    constituting the group item

    Samples for understanding M/+ statement (M/+ !/ 2)

    Picture of alue of Picture of 2 alue of 2 after

    Move

    PI& OOOO 1=A PI& OOOOO >1=A

    PI& OOOO 1=A PI& OOOOOOOO >>1=A>>

    PI& OOOOO 1=KA PI& OOO =K

    PI&O(>A)O(>=) AK=1AK= PI& O(>=)O(>=) =1AK=PI& O(>K)O(>) =K PI& UUUOOO =

    PI& OOOO >>=K PI& HHHOO H=K

    PI& 4(>K) M6S 424242 M 6 S

    RI!.M+!I& +R2S

    ll the possi$le arithmetic operations in &/2/' using 8 S62!R&!8M6'!IP', and II+ are given $elo":

    rithmetic /peration 2 &

    !/ 2 L2

    2 & !/ 2 & L2L&L

    2 & BII7B 2 & L2L& !/ 2 & L2 L&

    S62!R&! FR/M 2 2-

    S62!R&! 2 FR/M

    &

    2 &-(L2)

    S62!R&! 2 FR/M

    & BII7B

    2 & &-(L2)

    M6'!IP', 2, 2 ?2

    M6'!IP', 2, 2BII7B &

    2 ?2

    II+ I7!/ 2 2%

    II+ I7!/ 2

    BII7B &

    2 2%

    II+ 2, 2

    BII7B &

    2 %2

    II+ I7!/ 2

    BII7B &

    R+MI7+R

    2 Integer (2%) Integer

    remainder

    BII7B is used in the follo"ing cases:

    1!o retain the values of operands participating in the operation

  • 8/11/2019 REfreresher All Mainframes

    57/204

    Mainframe Refresher Part-1 Page:57

    !he resultant value of operation e5ceeds any of the operand sie

    R/67+ option0ith R/67+ option8 the computer "ill al"ays round the result to thePI&!6R+ clause specification of the receiving field It is usually coded after the field

    to $e rounded It is prefi5ed "ith R+MI7+R #ey"ord /7', in II+ operation 2 BII7B & R/67+

    II+R/67+ R+MI7+R&aution: on;t use for intermediate computation

    /7 SIU+ +RR/RIf C> (PI& O(>)) and 2CO> (PI& O(>))8 !/ 2 "ill result 1> in 2

    "here the e5pected value in 2 is 11> /7 SIU+ +RR/R clause is coded to trap such

    sie errors in arithmetic operationIf this is coded "ith arithmetic statement8 any operation that ended "ith SIU+

    error "ill not $e carried out $ut the statement follo"s /7 SIU+ +RR/R "ill $ee5ecuted

    !/ 2 /7 SIU+ +RR/R ISP',

  • 8/11/2019 REfreresher All Mainframes

    58/204

    Mainframe Refresher Part-1 Page:58

    >A 1 PI& O(A)

    >A PI& 4(K)I7I!I'IU+ R+P'&I7B 76M+RI& ! 2, A> "ill initialie only 1 $y A>

    &&+P!

    &&+P! can transfer data from input device or system information contain inthe reserved data items li#e !+8 !IM+8 ,

    &&+P! 0S-R1 (FR/M !+%!IM+%,%/!.+R S,S!+M RS)If FR/M &lause is not coded8 then the data is read from terminal t the time

    of e5ecution8 $atch program "ill 2+7 if there is no in-stream data from &' andthere is no FR/M clause in the &&+P! clause

    !+ option returns si5 digit current date in ,,MM

    , returns A digit current date in ,,!IM+ returns J digit R67 !IM+ in ..MMSS!!

    ,-/F-0++* returns single digit "hose value can $e 1- (Monday-Sundayrespectively)

    ISP',

    It is used to display data 2y default display messages are routed to S,S/6!

    Synta5: ISP', identifier1T literal1 (6P/7 mnemonic name)

    S!/P R678 +4I! PR/BRM 9 B/ 2&*S!/P R67 is the last e5ecuta$le statement of the main program It returns

    control $ac# to /S

    +4I! PR/BRM is the last e5ecuta$le statement of su$-program It returnscontrol $ac# to main program

    B/2&* can $e coded in main program as "ell as su$-program as the laststatement It Qust gives the control $ac# from "here it received the control

    '!+R statement!he alter statement is used to modify the targets of B/ !/ statements

    "ritten else"here in the procedure division

    '!+R PR/&+6R+-7M+-1 !/ PR/&++ !/ PR/&+6R+-7M+-

    PR/&+6R+-7M+-= !/ WPR/&++ !/X PR/&+6R+-7M+-K

    +ach of the PR/&+6R+-7M+-18 PR/&+6R+-7M+-= is the name of theparagraph that contains only one sentence !his sentence must consist of a single

    B/ !/ statement "ithout the depending clauseuring the e5ecution each of the PR/&+6R+-7M+-18 PR/&+6R+-7M+-=8

    "ill $e replaced $y PR/&+6R+-7M+-8 PR/&+6R+-7M+-K respectively

    &ollating Se3uence!here are t"o famous &ollating Se3uence availa$le in computers I2M and

    I2M &ompati$le machine use +2&I& collating se3uence "hereas most micro andmany mainframe systems use S&II collating se3uence !he result of arithmetic and

    alpha$etic comparison "ould $e same in $oth collating se3uences "hereas the sameis not true for alphanumeric comparison

    +2&I& (scending /rder) S&II (scending /rder)

  • 8/11/2019 REfreresher All Mainframes

    59/204

    Mainframe Refresher Part-1 Page:59

    Special &haracters Special &haracters

    a- >-O

    -U -U

    >-O a-

    efault collating se3uence can $e overridden $y an entry in /2+&!-&/MP6!+R andSP+&I' 7M+S paragraphs

    1 &ode the PR/BRM &/''!I7B S+V6+7&+ &lause in the /$Qect computerparagraph PR/BRM &/''!I7B S+V6+7&+ IS alpha$et-name

    Map the alpha$et-name in the SP+&I'-7M+S paragraph as follo"s:

    'P.2+! alpha$et-name is S!7R-1 T 7!I+7!I+ stands for computer;s o"n collating se3uence "hereas S!7R-1 stands

    for S&II collating se3uence

    IF%!.+7%+'S+%+7-IF!he most famous decision ma#ing statement in all language is

  • 8/11/2019 REfreresher All Mainframes

    60/204

    Mainframe Refresher Part-1 Page:60

    IF identifier is P/SI!I+%7+B!I+%U+R/

    &'SS test is used to chec# the content of data item against pre-defined range of

    values It can $e done as follo"s - IF identifier is 76M+RI&%'P.2+!I&%'P.2+!I&-.IB.+R%

    'P.2+!I&-'/0+R0e can define our o"n classes in the special names paragraph 0e have defined a

    class IBI! in our special names paragraph It can $e used in the follo"ing "ayIF identifier is IBI!

    7egated conditions

    ny simple8 relational8 class8 sign test can $e negated using 7/!