300 likes | 445 Views
Intro to Program Development. Develop complete program specs Design the program Create required CICS table entries Create the BMS mapset Code the program Compile and Test the program Document the program. Program Specifications. Usually “Up to You!” Program overview (Narrative)
E N D
Intro to Program Development • Develop complete program specs • Design the program • Create required CICS table entries • Create the BMS mapset • Code the program • Compile and Test the program • Document the program CICS-Dev
Program Specifications • Usually “Up to You!” • Program overview (Narrative) • Screen layout for each map (usually 1) • COPY members needed (if any) • Editing rules, Decision Tables • Files, DB/2 Tables read/updated CICS-Dev
Program Design • Critical! Can save hours (days!) • PSEUDO-CONVERSATIONAL (different!) • Event Driven - Major Functions • Processing Summary • Details processing for each response • Structure Chart, or ‘Table’ CICS-Dev
Create CICS Table Entries • PCT = Program Control Table • TRANS-ID assigned to Program • PPT = Processing Program Table (2) • COBOL Program • Mapset - Assembler Program • FCT = File Control Table • FILE(s) used by Program • Usually done by Systems Programmer CICS-Dev
Create the BMS Mapset • Defines the MAP(s) used by program • MAP provides for screen formatting • MAPSET is group of screens (1 or more) • Normally only one MAP per MAPSET • Only three macro’s used to create MAP • Usually a ‘Screen Generator’ is used CICS-Dev
Code the Program • Uses standard COBOL code (almost!) • Also uses CICS Commands • To include a CICS Command: • EXEC CICS • CICS Command (with PARAMETERS) • END-EXEC CICS-Dev
Compile Program • Special CICS Pre-compiler • CICS command-level translator • Converts CICS commands to COBOL • Creates listing with possible errors • Changes CICS lines to comments • Compiled by standard COBOL Compiler • Another listing with possible errors CICS-Dev
Test Program • Create test plan (Possible inputs) • Sign on to CICS (CESN) • Verify MAP is working (with CECI) • Test all conditions of program (CEDF) • NEWCOPY if changes made (CEMT) • Sign off of CICS (CESF) CICS-Dev
Document Program • Specifications and Listing (Sometimes!) • Every shop has set of ‘Standards’ • Some shops require both: • SYSTEM Documentation (for Maintenance) • USER Guide (Instructions for use) • ‘HELP’ screens sometimes used for user • Should not be last step! CICS-Dev
Creating a BMS MAPSET • 3270 is FIELD oriented display • Screen divided into user defined fields • Each field has CHARACTERISTICS • Determined by ATTRIBUTE BYTES • (First character of each field!) • Displayed as a space, but NOT available CICS-Dev
Creating a BMS MAPSET • Field starts at position after attribute • Attribute Byte determines the fields characteristics • Basic Attributes are: • Protection – allows user to key data • Intensity – normal or high • Shift – numeric or alphanumeric CICS-Dev
Protection Attribute • Protected – user can’t key data in field • Unprotected – user allowed to key data • Auto-Skip – cursor skips to next field • Used to mark end of data entry field • Cursor automatically moves to next field CICS-Dev
Intensity Attribute • Normal – shown normal intensity • Bright – shown in high intensity • No-display – not shown (background) • Used for password entry • Also used to ‘hide’ data on screen CICS-Dev
Shift Attribute • Alphanumeric – allows most characters • Numeric – only numeric characters • Not usually used – (CICS level error) • Multiple periods can be entered – error • Use Alpha and test in program! CICS-Dev
Attribute Byte Format 0 1 2 3 4 5 6 7 Bit Function Values 0-1 Depends on bits 2 - 7 See ATTR copylib 2-3 Protection and Shift 00 – Unprot alpha 01 – Unprot numeric 10 – Protected 11 – Protected skip 4-5 Intensity 00 – Normal 01 – Normal 10 – Bright 11 – No display 6 Reserved Must be 0 7 Modified Data Tag 0 – Field not modified 1 – Field was modified CICS-Dev
Extended Attributes • Allow Extra Colors: • Blue, Red, Pink, Green, • Turquoise, Yellow and White • Highlighting • Blinking, Reverse Video, Underlining • Validation • Must fill, Must enter, Trigger • Symbols • Up to six alternate character sets CICS-Dev
More terminology • PHYSICAL MAP – load module • Result of Assembly • Contains table of screen locations of data • Also contains attributes of each field • SYMBOLIC MAP – Copy library member • Result of Assembly • Usually used in COBOL program • You can create your own – if careful! CICS-Dev
Coding a BMS Mapset • Only need two Assembler commands • PRINT NOGEN (Not for AS400) • END • And three BMS MACRO Instructions • DFHMSD – Map Set Definition • DFHMDI – Map Definition • DFHMDF – Field (Attribute byte) Definition CICS-Dev
PRINT NOGEN and END • PRINT NOGEN should be the first line • Assembler will NOT print generated code • If omitted, you get much longer listing! • END – must be the last line of MAPSET • Informs Assembler – no more lines CICS-Dev
DFHMSD Macro VISnqq DFHMSD TYPE=&SYSPARM, X LANG=COBOL, X MODE= INOUT, X TERM=3270-2, X CTRL=FREEKB, X STORAGE=AUTO, X DSATTS=(COLOR,HILIGHT), X MAPATTS=(COLOR,HIGHLIGHT), X TIOAPFX=YES CICS-Dev
DFHMDI Macro VIDSnM1 DFHMDI SIZE=(24,80), X LINE=1, X COLUMN=1 CICS-Dev
DFHMDF Macro FLDNM DFHMDF POS=(line,col), X LENGTH=nn, X ATTRB=(unPROT), X COLOR=BLUE, X INITIAL=‘init value’ CICS-Dev
ATTRB Parameter • BRT High intensity display • NORM Normal intensity • DRK Not displayed (Hidden) • PROT Protected – no data keyed • UNPROT Data may be keyed in • IC Initial cursor position • FSET MDT set ON for field CICS-Dev
The Symbolic Map • Copy member created by Assembly • Use COPY statement in COBOL • Maximum of 7 character field names • MAPGEN adds the 8th (last) character • Fine for Assembler–Marginal in COBOL • You can code your own – if careful! CICS-Dev
Symbolic Map Suffix List • I The INPUT data field • O The OUTPUT data field (Same loc I) • L Binary Halfword-S9(4) COMP Nbr chars data returned in input field • F Char w/’80’ if field was cleared • A Char w/attrb for output (Same loc F) • C/H Used for Color and/or Highlighting CICS-Dev
Pseudo-Conversational • An on-line program that actually ended while appearing to wait for a response. • Single-user systems are ‘conversational’ • System waits for operator to enter data • Single user system - nothing else to do • Multi-user system can’t waste the time • 3270 screen handles operator activity CICS-Dev
Pseudo-Conversational • Conversational program remains in storage during entire interaction. • Pseudo-conversational program only in storage for a few seconds each action. • Many more users can be processed • Storage used more efficiently • Minor complication to programs! CICS-Dev
Pseudo-Conversational • Terminal handles operator entry • Attention Key signals CICS screen ready • Enter, PF, PA, or Clear Key - (Event) • CICS reloads program (Virtual Storage) • Program start at BEGINNING every time • You must keep up with where user is • User unaware that program restarted CICS-Dev
Sample CICS Scenario • Transaction ID Entered • Looked up in PCT - Program loaded • Program displays initial map and ends • User enters data and hits ‘Enter’ key • Program reloaded (from CICS storage) • Receives data from screen • Processes data • Sends response back to screen • Returns to CICS CICS-Dev
CICS Input/Output • CICS handles all I/O • Treat screen as simple file (one record) • Can Read Screen – RECEIVE MAP • Can Write Screen – SEND MAP • Can Return to CICS with ID of Program to execute next time user keys AID key • Return without TRANS-ID, Exits to CICS CICS-Dev