Sei sulla pagina 1di 62

CA-GENER/OL Basics

Prepared By: Deepak Bajaj


CA-Gener/OL: Way to Go

Why GENER/OL

CA Gener/OL is a powerful and flexible 4-GL development tool for CICS that helps decrease the growing application backlog by simplifying a number of labour-intensive tasks and facilitating quick response times. CA Gener/OL addresses the challenge to flexibly create and update online reports without complex programming languages.

It offers interactive screen development, incremental compilation builds and access to a number of database management systems.
CA Gener/OL supports z/OS

Table Of Content
1. 2. 3. 4. 5.

Library Structures Basics Commands

Programming Concept
Reserved Words Debugging Facility

Library Structure

MOTOR

HOUSE

SGTLIB1

SGTLIB2

Transaction DEV1 to logon to SGTLIB1 Transaction DEV2 to logon to SGTLIB2 SGTLIB7 & SGTLIB8 are Production Libraries

Library Structure

Library Structure

Library Structure

Basic Commands & Conventions


command line

COPY MOVE RENAME DELETE A -> autmatic editing Related to maps B -> Browse C -> Copy D -> Delete

Line Commands

E -> edit
G -> GO ( This for debugging the memeber) I -> Inventory( takes lot of time for big pgms) M ->Move N -> Rename O -> Map modelling P -> print R -> Run Z -> Clear

Programming Concept

FILE Storage

Records/Segment Working

MAPS

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

CICS FCT entries

by the System Administrator

FILE

FILE

FILE

Records/Segment

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

Records/Segment

Records/Segment

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

Records/Segment

Name- Specifies the field name Starts- Specifies the Start position Length- Specifies the field length Type Specifies the data type (C or A- Alphanumeric, N-Numeric, P-Packed, B-Binary) Mask -??

Records/Segment
Data Char Hexadecimal Numeric Packed Binary Floating Point Max Length 32766 32766 15 8 7 4 Type of Data C or A H N P B F 9 9 Decimals

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

Working Storage

Indexes

can be used in a loop for fast access

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

MAPS

MAPS

MAPS

MAPS

MAPS

MAPS

MAPS

MAPS

MAPS

MAPS
PF Key PF1 PF2 Function Continues to the next map item Adds a blank line after the line where the cursor is positioned

PF3 PF4 PF5 PF6

Inserts a Blank line where the cursor is positioned Adds a identical line Displays the help screen Deletes the line

MAPS

MAPS

MAPS

MAPS

MAPS

Programming concept

Program Code Branching

Expressions
File Access Data manupulation

Structured
Mapping Linkage

Existing Utilities

Programming Concept
Programming

Program name and description HANDLE command - CLEAR,ASRA,QIDERR Record name , filename , prefix Work name , prefix , share Logic =LAB/@

BRANCHING.

GOTO

LABEL

GOSUB / RETURN FOR .. break .. NEXT ENDJOB IS ON YES/NO GOTO LABEL

Programming Concept
MAPPING.

MAP MAPNAME,NOSEND,NOWAIT

for setting attributes

.MAPATTR fname,occ,ATTR=BRT,CURSOR RWMSG will contain the error message when .MAPATTR has failed and can be hprinted GETMAP MAPNAME receives map

LINKAGE.

GXCTL
GLINK

program, COMMAREA=fname
program ,COMMAREA=fname,SHARE=(WORK1,REC1,etc)

RETRIEVE fn NEWPROG . RWMSG

XCTL
LINK

(program),fn
(program),fn

File Handler and internal Commands

Programming Concept
FILE ACCESS.

READ,WRITE,CHANGE,DELETE,READHOLD,RELEASE READ RECNAME,KEY=W1KEY ON NOT GOTO LABEL SKIP=fn , FIRST , FWD , BWD , LAST , NODATA, AGAIN

NEWFILE RECNAME,FILE=FILENAME

DATA MANIPULATION.

COMP FLDA = FLDB + 2


DEC INC RWI1 RWI1

MOVE FLDA TO FLDB FLDC FLDD etc

Programming Concept
MAPPING.

MAP MAPNAME,NOSEND,NOWAIT

for setting attributes

.MAPATTR fname,occ,ATTR=BRT,CURSOR RWMSG will contain the error message when .MAPATTR has failed and can be hprinted GETMAP MAPNAME receives map

LINKAGE.

GXCTL
GLINK

program, COMMAREA=fname
program ,COMMAREA=fname,SHARE=(WORK1,REC1,etc)

RETRIEVE fn NEWPROG . RWMSG

XCTL
LINK

(program),fn
(program),fn

File Handler and internal Commands

Programming Concept
File Handler

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

Programming Concept
Accessing ULU records: 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 factors in control of Insurance Services. Following is an example used in one of the program:

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

Programming Concept
Existing Commands
The first 3 bytes of the output field should be checked for NOT (not found).

.GDAYADD DATE1

GDAYPASS (15C field redefined as below) DAYS No. of days to be added 6N 3N DATE2 (YYMMDD) returned date 6N (YYMMDD)

.Gdayadd will add the number of days in field DAYS to DATE1, returning the computed date in DATE2.
.GREGADD DATE1 (DDMMCCYY) 8N , MONTHS , No. of months to be added 4N , DATE2 , (DDMMCCYY) , returned date ,8N

Programming Concept
.GREGCHR DATE (DDMMCCYY) 8N .Gregchr will return the full date description e.g. 21121989, 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 the second byte).

,DESCRIPTION ,returned desc. , 29C

.GREGJUL

DATE (DDMMCCYY) 8N

, JULDATE , (CCYYDDD) 7N , RC ,0 , 1N

.Gregjul will return the Julian date for a valid Gregorian date.

.GREGVAL

DATE (DDMMCCYY) 8N

.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.

N.B.

All other date handling commands assume that a valid date is being passed .

Programming Concept
STRUCTURED

IF ELSE ENDIF

DO WHILE . ENDDO REPEAT UNTIL VARYING ..

ENDVARY

CASE VALUE OTHERWISE ENDCASE

Programming Concept
EDITOR

Ispf like SYNTAX CHECKING SELF COMPILING

Utilities & Reserved Words


Log

on Through TSOLU option

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 areas expanded to ISPF TTLU.BDBC.JCL(GOLP) change the job card and Pgm name.

Reserved Words
RWAID

PF1 PF2 PF3 PF4 PF5 PF6 PF7

F1 F2 F3 F4 F5 F6 F7

PF13 PF14 PF15 PF16 PF17 PF18 PF19

C1 C2 C3 C4 C5 C6 C7

PF8
PF9 PF10 PF11 PF12

F8
F9 7A 7B 7C

PF20
PF21 PF22 PF23 PF24

C8
C9 4A 4B 4C

CLEAR PA1 PA2 ENTER PA3

6D 6C 6E 7D 6B

Reserved Words
RWABEND
Contains the Abend Code Spaces 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.

RWALPHA To test whether a field is made up of Alphanumeric Characters of Blank RWBLANK To test whether a field for blanks or Move all blanks to a field RWCLEAR To test a field for all binary zeros or move binary zeros RWDATE Has the date in MM/DD/YY format

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 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.

Debugging Facility
Type DE or Debug to debug a program. Quite similar to the Xpeditor.

Debugging Facility

Debugging Facility

Keys

Data Area

Debugging Facility

Debugging Facility

Debugging Facility
Changing Default options:

Questions Please!!!

Thanks!

Assignment

Create a Screen having Following fields :


1.

2.
3. 4.

NAME : SEX : DOB: AGE: - Hidden

Take the input and Calculate his Age and Display the message
HI Name You are NN years OLD! Wish you a very Happy Bday

If its his bday today display the message this time AGE should be displayed and above message should also be displayed. Else Hi Name you are NN years old !! You next bday will be on Day After NN months 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 program.

Thanks!

Potrebbero piacerti anche