ca generol

62
CA-GENER/OL Basics CA-GENER/OL Basics Prepared By: Deepak Bajaj CA-Gener/OL: Way to Go

Upload: apurva-kapoor

Post on 29-May-2017

238 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: CA Generol

CA-GENER/OL BasicsCA-GENER/OL Basics

Prepared By: Deepak Bajaj

CA-Gener/OL: Way to Go

Page 2: CA Generol

Why GENER/OLWhy GENER/OL► CA Gener/OL is a powerful and flexible 4-GL development tool for CICS CA Gener/OL is a powerful and flexible 4-GL development tool for CICS

that helps decrease the growing application backlog by simplifying a that helps decrease the growing application backlog by simplifying a number of labour-intensive tasks and facilitating quick response times. number of labour-intensive tasks and facilitating quick response times.

► CA Gener/OL addresses the challenge to flexibly create and update CA Gener/OL addresses the challenge to flexibly create and update online reports without complex programming languages.online reports without complex programming languages.

► It offers interactive screen development, incremental compilation builds It offers interactive screen development, incremental compilation builds and access to a number of database management systems.and access to a number of database management systems.

► CA Gener/OL supports z/OSCA Gener/OL supports z/OS

Page 3: CA Generol

Table Of Content1. Library Structures2. Basics Commands3. Programming Concept4. Reserved Words 5. Debugging Facility

Page 4: CA Generol

Library Structure

MOTOR HOUSE

SGTLIB1 SGTLIB2

Transaction DEV1 to logon to SGTLIB1

Transaction DEV2 to logon to SGTLIB2

SGTLIB7 & SGTLIB8 are Production Libraries

Page 5: CA Generol

Library Structure

Page 6: CA Generol

Library Structure

Page 7: CA Generol

Library Structure

Page 8: CA Generol

Basic Commands & Conventionscommand linecommand line► COPY COPY ► MOVE MOVE ► RENAME RENAME ► DELETEDELETELine CommandsLine Commands► A -> autmatic editing Related to mapsA -> autmatic editing Related to maps► B -> BrowseB -> Browse► C -> Copy C -> Copy ► D -> DeleteD -> Delete► E -> edit E -> edit ► G -> GO ( This for debugging the memeber)G -> GO ( This for debugging the memeber)► I -> Inventory( takes lot of time for big pgms)I -> Inventory( takes lot of time for big pgms)► M ->MoveM ->Move► N -> RenameN -> Rename► O -> Map modelling O -> Map modelling ► P -> print P -> print ► R -> Run R -> Run ► Z -> ClearZ -> Clear

Page 9: CA Generol

Programming Concept

► FILE FILE ►Records/SegmentRecords/Segment►Working StorageWorking Storage► MAPSMAPS

Page 10: CA Generol

FILE► File Definition Process makes CA-Gener/OL aware of File Definition Process makes CA-Gener/OL aware of the FCT entries that CICS uses to access and process the FCT entries that CICS uses to access and process files.This step establish a link between CA-Gener/OL and files.This step establish a link between CA-Gener/OL and CICS.CICS.►Matches CICS FCT entriesMatches CICS FCT entries►Done by the System AdministratorDone by the System Administrator

Page 11: CA Generol

FILE►

Page 12: CA Generol

FILE►

Page 13: CA Generol

FILE

Page 14: CA Generol

Records/Segment

Naming convention:Naming convention:XARECN – MQREC1 M-Motor, Q-QuotesXARECN – MQREC1 M-Motor, Q-QuotesX- Major system, A-minor system, N-=w/s no X- Major system, A-minor system, N-=w/s no RECN- Record layout noRECN- Record layout no

Page 15: CA Generol

Records/Segment

Page 16: CA Generol

Records/Segment

Page 17: CA Generol

Records/Segment

Record – Record – Displays the member name assigned to the Displays the member name assigned to the record layoutrecord layoutPrefix – Prefix – Displays 2 char code placed before each field Displays 2 char code placed before each field name. Format is alpha/alphanumeric. RW is the reserved name. Format is alpha/alphanumeric. RW is the reserved word.word. Residency-Residency- Y or N ?? Y or N ??TSQ are automatically written for Resident areas and TSQ are automatically written for Resident areas and when the control comes back from the operator the when the control comes back from the operator the resident w/s will be restored from TSQs while the non resident w/s will be restored from TSQs while the non res w/s data will be lostres w/s data will be lost..

Page 18: CA Generol

Records/Segment

Name- Specifies the field nameName- Specifies the field nameStarts- Specifies the Start positionStarts- Specifies the Start positionLength- Specifies the field lengthLength- Specifies the field lengthType – Specifies the data type (C or A- Alphanumeric, N-Numeric, P-Packed, Type – Specifies the data type (C or A- Alphanumeric, N-Numeric, P-Packed, B-Binary) B-Binary) Mask -??Mask -??

Page 19: CA Generol

Records/SegmentData Max Length Type of Data Decimals

Char 32766 C or A

Hexadecimal 32766 H

Numeric 15 N 9

Packed 8 P 9

Binary 7 B

Floating Point 4 F

Page 20: CA Generol

Working Storage

Same as we define the layout this time select the Same as we define the layout this time select the work option.work option.Naming convention:Naming convention:XANNNZN – MQ110R1 M-Motor, Q-QuotesXANNNZN – MQ110R1 M-Motor, Q-QuotesX- Major system, A-minor system, NNN-pgm X- Major system, A-minor system, NNN-pgm number, Z= R or N, N- w/s no within the pgmnumber, Z= R or N, N- w/s no within the pgm

Page 21: CA Generol

Working Storage

►Indexes can be used in a loop for fast accessIndexes can be used in a loop for fast access

Page 22: CA Generol

MAPS

Same as we define the layout this time select the Same as we define the layout this time select the MAP option.MAP option.Naming convention:Naming convention:XANNNMNN – MQ110M03 M-Motor, Q-XANNNMNN – MQ110M03 M-Motor, Q-QuotesQuotesX- Major system, A-minor system, NNN-pgm X- Major system, A-minor system, NNN-pgm number, M=Map no within the pgmnumber, M=Map no within the pgm

Page 23: CA Generol

MAPS

Page 24: CA Generol

MAPS

Page 25: CA Generol

MAPS

Page 26: CA Generol

MAPS

Page 27: CA Generol

MAPS

Page 28: CA Generol

MAPS

Page 29: CA Generol

MAPS

Page 30: CA Generol

MAPS

Page 31: CA Generol

MAPS

Page 32: CA Generol

MAPS

PF Key Function

PF1 Continues to the next map item

PF2 Adds a blank line after the line where the cursor is positioned

PF3 Inserts a Blank line where the cursor is positioned

PF4 Adds a identical line

PF5 Displays the help screen

PF6 Deletes the line

Page 33: CA Generol

MAPS

Page 34: CA Generol

MAPS

Page 35: CA Generol

MAPS

Page 36: CA Generol

MAPS

Page 37: CA Generol

MAPS

Page 38: CA Generol

Programming concept► Program Code► Branching► Expressions► File Access► Data manupulation► Structured► Mapping ► Linkage► Existing Utilities

Page 39: CA Generol

Programming ConceptProgrammingProgramming► Program name and descriptionProgram name and description► HANDLE command - CLEAR,ASRA,QIDERR =LAB/@HANDLE command - CLEAR,ASRA,QIDERR =LAB/@► Record name , filename , prefixRecord name , filename , prefix► Work name , prefix , shareWork name , prefix , share► LogicLogic

BRANCHING.BRANCHING.► GOTO LABEL GOTO LABEL ► GOSUB / RETURNGOSUB / RETURN► FOR ….. break ….. NEXTFOR ….. break ….. NEXT► ENDJOBENDJOB► IS IS ……… ON YES/NO GOTO LABEL……… ON YES/NO GOTO LABEL

Page 40: CA Generol

Programming ConceptMAPPING. MAPPING. ► MAP MAPNAME,NOSEND,NOWAIT for setting attributesMAP MAPNAME,NOSEND,NOWAIT for setting attributes► .MAPATTR ‘fname’,occ,ATTR=BRT,CURSOR.MAPATTR ‘fname’,occ,ATTR=BRT,CURSOR► RWMSG will contain the error message when .MAPATTR has failed and can be hprintedRWMSG will contain the error message when .MAPATTR has failed and can be hprinted► GETMAP MAPNAME receives mapGETMAP MAPNAME receives map

LINKAGE. LINKAGE. ► GXCTLGXCTL ‘program’, COMMAREA=fname ‘program’, COMMAREA=fname► GLINK ‘program’ ,COMMAREA=fname,SHARE=(WORK1,REC1,etc)GLINK ‘program’ ,COMMAREA=fname,SHARE=(WORK1,REC1,etc)► RETRIEVE fnRETRIEVE fn► NEWPROG …. RWMSGNEWPROG …. RWMSG► XCTL (program),fnXCTL (program),fn► LINKLINK (program),fn(program),fn► File Handler and internal CommandsFile Handler and internal Commands

Page 41: CA Generol

Programming ConceptFILE ACCESS.FILE ACCESS.► READ,WRITE,CHANGE,DELETE,READHOLD,RELEASEREAD,WRITE,CHANGE,DELETE,READHOLD,RELEASE► READ RECNAME,KEY=W1KEY ON NOT GOTO LABEL READ RECNAME,KEY=W1KEY ON NOT GOTO LABEL ► SKIP=fn , FIRST , FWD , BWD , LAST , NODATA, AGAIN SKIP=fn , FIRST , FWD , BWD , LAST , NODATA, AGAIN ► NEWFILE RECNAME,FILE=FILENAMENEWFILE RECNAME,FILE=FILENAME

DATA MANIPULATION. DATA MANIPULATION. ► COMP FLDA = FLDB + 2COMP FLDA = FLDB + 2► DECDEC RWI1RWI1► INC INC RWI1RWI1► MOVE MOVE FLDA TO FLDB FLDC FLDD etcFLDA TO FLDB FLDC FLDD etc

Page 42: CA Generol

Programming ConceptMAPPING. MAPPING. ► MAP MAPNAME,NOSEND,NOWAIT for setting attributesMAP MAPNAME,NOSEND,NOWAIT for setting attributes► .MAPATTR ‘fname’,occ,ATTR=BRT,CURSOR.MAPATTR ‘fname’,occ,ATTR=BRT,CURSOR► RWMSG will contain the error message when .MAPATTR has failed and can be hprintedRWMSG will contain the error message when .MAPATTR has failed and can be hprinted► GETMAP MAPNAME receives mapGETMAP MAPNAME receives map

LINKAGE. LINKAGE. ► GXCTLGXCTL ‘program’, COMMAREA=fname ‘program’, COMMAREA=fname► GLINK ‘program’ ,COMMAREA=fname,SHARE=(WORK1,REC1,etc)GLINK ‘program’ ,COMMAREA=fname,SHARE=(WORK1,REC1,etc)► RETRIEVE fnRETRIEVE fn► NEWPROG …. RWMSGNEWPROG …. RWMSG► XCTL (program),fnXCTL (program),fn► LINKLINK (program),fn(program),fn► File Handler and internal CommandsFile Handler and internal Commands

Page 43: CA Generol

Programming ConceptFile HandlerFile Handler

Different for different file (Associated with each file being read):Different for different file (Associated with each file being read):

Page 44: CA Generol

Programming ConceptAccessing ULU records:Accessing ULU records:Commands like .RINT,.MINT,.HINT, .GENLOOK,.INTLOOK are used to access the ULU Commands like .RINT,.MINT,.HINT, .GENLOOK,.INTLOOK are used to access the ULU

records. ULU is a universal look up records and associated with different rating records. ULU is a universal look up records and associated with different rating factors in control of Insurance Services.factors in control of Insurance Services.

Following is an example used in one of the program:Following is an example used in one of the program:

Following are the imporatant parameters to read a ULU recordFollowing are the imporatant parameters to read a ULU recordINTALPHA,INTLCODE,INTDATE must be given to access a ULU recordINTALPHA,INTLCODE,INTDATE must be given to access a ULU record

Page 45: CA Generol

Programming ConceptExisting CommandsExisting Commands

The first 3 bytes of the output field should be checked for ‘NOT’ (not found).The first 3 bytes of the output field should be checked for ‘NOT’ (not found).► .GDAYADD.GDAYADD GDAYPASSGDAYPASS (15C field redefined as below) (15C field redefined as below)

DATE1DATE1 DAYS DAYS DATE2DATE2(YYMMDD)(YYMMDD) No. of days No. of days (YYMMDD) (YYMMDD) to be addedto be added returned datereturned date 6N6N 3N3N 6N6N

.Gdayadd will add the number of days in field DAYS to DATE1, returning the computed date in DATE2..Gdayadd will add the number of days in field DAYS to DATE1, returning the computed date in DATE2.

► .GREGADD.GREGADD DATE1DATE1 , MONTHS, MONTHS , DATE2, DATE2(DDMMCCYY)(DDMMCCYY) , No. of months, No. of months , (DDMMCCYY), (DDMMCCYY) to be addedto be added , returned date, returned date 8N8N 4N 4N ,8N,8N

Page 46: CA Generol

Programming Concept..GREGCHRGREGCHR DATEDATE ,DESCRIPTION,DESCRIPTION (DDMMCCYY) ,returned desc.(DDMMCCYY) ,returned desc.

8N8N ,, 29C29C

.Gregchr will return the full date description.Gregchr will return the full date description

e.g.e.g. 21121989,21121989,

returns, THURSDAY 21ST DECEMBER 1989.returns, THURSDAY 21ST DECEMBER 1989.

(N.B. Tuesday, Wednesday, Thursday & Saturday are returned in the first byte of the DESCRIPTION field. All others start in (N.B. Tuesday, Wednesday, Thursday & Saturday are returned in the first byte of the DESCRIPTION field. All others start in the second byte). the second byte).

► .GREGJUL.GREGJUL DATEDATE , JULDATE, JULDATE

(DDMMCCYY)(DDMMCCYY) , (CCYYDDD), (CCYYDDD)

8N8N 7N 7N

.Gregjul will return the Julian date for a valid Gregorian date..Gregjul will return the Julian date for a valid Gregorian date.► .GREGVAL.GREGVAL DATEDATE , RC, RC

(DDMMCCYY)(DDMMCCYY) , 0, 0

8N8N , 1N, 1N

.Gregval will validate a Gregorian date and should be passed the date 8 byte numeric and 0 in the Return code field..Gregval will validate a Gregorian date and should be passed the date 8 byte numeric and 0 in the Return code field.

The return code will contain 0 on a successful call.The return code will contain 0 on a successful call.► N.B.N.B. All other date handling commands assume that a valid date is being passedAll other date handling commands assume that a valid date is being passed. .

Page 47: CA Generol

Programming ConceptSTRUCTUREDSTRUCTURED► IF ………IF ………

ELSEELSE

ENDIFENDIF► DO WHILE ….DO WHILE ….

ENDDOENDDO► REPEATREPEAT

UNTIL ……UNTIL ……► VARYING ….. VARYING …..

ENDVARYENDVARY► CASE ……CASE ……

VALUE VALUE

OTHERWISEOTHERWISE

ENDCASEENDCASE

Page 48: CA Generol

Programming ConceptEDITOREDITOR► Ispf ‘like’ Ispf ‘like’ ► SYNTAX CHECKINGSYNTAX CHECKING► SELF COMPILINGSELF COMPILING

Page 49: CA Generol

Utilities & Reserved Words Log on Through £TSOLU option Log on Through £TSOLU option

Page 50: CA Generol

UtilitiesSelect the option G or I for Generol utilities:Select the option G or I for Generol utilities:

Following Job can be used to transfer the Gener/Ol pgm with all the records and work Following Job can be used to transfer the Gener/Ol pgm with all the records and work areas expanded to ISPFareas expanded to ISPF

TTLU.BDBC.JCL(TTLU.BDBC.JCL(GOLPGOLP) change the job card and Pgm name.) change the job card and Pgm name.

Page 51: CA Generol

Reserved WordsRWAIDRWAID► PF1PF1 -- F1F1 PF13PF13 -- C1C1► PF2PF2 -- F2F2 PF14PF14 -- C2C2► PF3PF3 -- F3F3 PF15PF15 -- C3C3► PF4PF4 -- F4F4 PF16PF16 -- C4C4► PF5PF5 -- F5F5 PF17PF17 -- C5C5► PF6PF6 -- F6F6 PF18PF18 -- C6C6► PF7PF7 -- F7F7 PF19PF19 -- C7C7► PF8PF8 -- F8F8 PF20PF20 -- C8C8► PF9PF9 -- F9F9 PF21PF21 -- C9C9► PF10PF10 -- 7A7A PF22PF22 -- 4A4A► PF11PF11 -- 7B7B PF23PF23 -- 4B4B► PF12PF12 -- 7C7C PF24PF24 -- 4C4C

CLEARCLEAR -- 6D6DPA1PA1 -- 6C6CPA2PA2 -- 6E6EENTERENTER -- 7D7D PA3PA3 -- 6B6B

Page 52: CA Generol

Reserved WordsRWABENDContains the Abend CodeSpaces should be moved into the reserved word RWABEND in the exit routines of all programs.A system message will be placed in RWABEND if any ‘errors’ are detected, such as EOF, or a NOT FOUND condition.

RWALPHATo test whether a field is made up of Alphanumeric Characters of Blank

RWBLANKTo test whether a field for blanks or Move all blanks to a field

RWCLEARTo test a field for all binary zeros or move binary zeros

RWDATE Has the date in MM/DD/YY format

Page 53: CA Generol

Reserved Words

RWDAY

Contains Day of the week

RWDAYNUM

Contains the number denoting the day of the week( Sunday =0)

RWFALSE

To test whether a expression is false

RWFILE

Updates the file name when file access commands are used

RWMSG RWMSG

length 40 can use used to pass the data b/w programs Using NEWPROG or GOXCTL data moved in length 40 can use used to pass the data b/w programs Using NEWPROG or GOXCTL data moved in this field will be available to next program and can be moved to working storage field.this field will be available to next program and can be moved to working storage field.

Page 54: CA Generol

Debugging Facility

► Type ‘DE’ or ‘Debug’ to debug a program.Type ‘DE’ or ‘Debug’ to debug a program.► Quite similar to the Xpeditor.Quite similar to the Xpeditor.

Page 55: CA Generol

Debugging Facility

Page 56: CA Generol

Debugging Facility► KeysKeys

► Data AreaData Area

Page 57: CA Generol

Debugging Facility

Page 58: CA Generol

Debugging Facility

Page 59: CA Generol

Debugging Facility

Changing Default options:

Page 60: CA Generol

Questions Please!!!

Thanks!

Page 61: CA Generol

Assignment Create a Screen having Following fields : Create a Screen having Following fields :

1.1. NAME :NAME :2.2. SEX :SEX :3.3. DOB:DOB:4.4. AGE: - HiddenAGE: - Hidden

Take the input and Calculate his Age and Display the message Take the input and Calculate his Age and Display the message

If its his b’day today display the messageIf its his b’day today display the message

‘‘HI Name You are NN years OLD! Wish you a very Happy B’day’HI Name You are NN years OLD! Wish you a very Happy B’day’

this time AGE should be displayed and above message should also be displayed.this time AGE should be displayed and above message should also be displayed.

ElseElse

‘ ‘ Hi Name you are NN years old !!’ You next b’day will be on ‘ Day ‘ After NN months’Hi Name you are NN years old !!’ You next b’day will be on ‘ Day ‘ After NN months’

this time too AGE should be displayed and above message should also be displayed.this time too AGE should be displayed and above message should also be displayed. Should be divided into two programs. Map should display in one program and Calculation of Age should be in Different Should be divided into two programs. Map should display in one program and Calculation of Age should be in Different

program.program.

Page 62: CA Generol

Thanks!