Vous êtes sur la page 1sur 38

CICS Q1: What is meant by Handle Condition Ans-1.

It is used to transfer control to the para when the exceptional condition occurs for which it is designed Q2: What is meant by Ignore Condition Ans-2. The IGNORE CONDITION command causes no action to be taken if the condition specified occurs in the program.No more than 12 conditions are allowed in the same program.Once any IGNORE or HANDLE command is executed for a condition, the specification remains effect until the program ends or another HANDLE or IGNORE command is executed. Q3: What is meant by PUSH and POP commands Ans-3. These are used to suspend and reactivate respectively all HANDLE CONDITION currently in effect. Q4: What is meant by Ignore Condition Ans-4. The IGNORE CONDITION command causes no action to be taken if the condition specified occurs in the program.No more than 12 conditions are allowed in the same program.Once any IGNORE or HANDLE command is executed for a condition, the specification remains effect until the program ends or another HANDLE or IGNORE command is executed. Q5:What are alternatives to HANDLE CONDITION Ans-5. There are two alternatives namely NO HANDLE and RESP condition. NO HANDLE will cause no action to be taken for any exceptional condition occuring during execution of program.This should only be a special purpose command.RESP option helps CICS place a response code at a completion of the command.The application program can check this code and proceed to the next level.when this is coded HANDLE CONDITION does not have any effect. Q6:What is meant by Basic locator for linkage (BLL) Ans-6. The Base Locator for linkage (BLL) is an addressing convention used to address storage outside the Working storage section of the program. If the BLL is used for the input commands,it will improve the performance, since the program would be accessing directly the input buffer outside the program. Also if BLL is used for dynamic table loading, it will save the size of the application program,since there is no requirement for any space reservation for the table in the program. Q7:What is meant by SERVICE RELOAD statement Ans-7. This is used to ensure addressability to a particular area defined in the linkage section. Q8:What is meant by ADDRESS command

Ans-8. This is used to access information in the CICS system areas.This can be used in one of the four ways CSA To access the common System area , which is the CICS system area defined by the system. CWA To access the common work area which is a CICS system work area defined by the system programmer in SIT TCTUA To access the Terminal control table user area (TCTUA) , which is a work area associated with a terminal. TCTUA is defined as per terminal in TCT. TWA To access the Transaction work area (TWA), which is a work area associated with a task,TWA is defined as one per task in PCT Q9:What is meant by ASSIGN command Ans-9. The ASSIGN command is used to access the system value like date , time ,userid etc and store in a variable. Q10.:What is meant by EIB Ans-10.. EIB stands for EXEC interface block.Some commonly used EIBs are as follows... EIB Examples EIBAID EIBCALEN EIBDATE EIBFN EIBRCODE EIBTASKN Attention-id (1 byte0 length of DFHCOMMAREA (S94 COMP) Date when this task started (S9(7) COMP-3, 000yyddd+) Function code of the last command (2 bytes) Response code of the last command (6 bytes) Task number of this task (S9(7) COMP-3) Q11: What do you know about GETMAIN command? Ans-11. It is used to obtain a certain amount of storage.This is possible by the storage control program SCP.When the use of the available storage is over the FREEMAIN command should be used. Q12: What is difference between LINK and XCTL Ans-12. LINK : It is the command used to pass control from one program to another where the calling program expects the control to be passed back from the called program. XCTL :Over here the calling program does not expect the control to be passed back to it. Q13: What is meant by Reentrant program? Ans-13. It is a program which does not modify itself so that it can re-enter to itself.This is very much required for multithreading environment.

Q14: What is the significance of EIBCALEN Ans-14. EIBCALEN is used to check if any data has been sent by the calling program, this is done by checking COMMAREA.If this is zero and there has been a program which called another program then it can be assumed that there has been error in calling. Q15:What is meant by LOAD command? Ans-15. It is used to load a program / table dynamically. Q16:What is meant by PPT, PCT and KCP Ans-16. PPT It is called Processing program table.This is used to register all CICS application programs and BMS maps. PCT This is called program control table which is used to register the control information of all CICS transactions. KCP This is known as task control program and is used for identifying and initializing transactions. Q17:What is meant by READ command with GENERIC option Ans-17. This is used to read a nonspecific record with a GENERIC key.This is helpful when you do not have the complete information about the key. Q18:What is meant by READ with UPDATE command Ans-18. When this is specified then the program reads the record and maintains exclusive control over the record until the record is updated by a REWRITE command or the transaction is normally or abnormally completed.If after reading the record it is found that the update is not required then an unlock command is used to unlock the dataset to remove the exclusive control of the record. What is the difference between a conversational and pseudo-conversational program ? A conversational program sends a map or message and continues executing as it waits for a response. A pseudo-conversational program does not wait for a response, it ends after SENDing a map or message together with a RETURN command. What is the effect of including the TRANSID in the RETURN command ? The next time the end user presses an attention key, CICS will start the transaction specified in the TRANSID option (a new task is initiated). How does CICS use the PCT table ? After a user enters a trans-id, CICS goes to the Program Control Table(PCT) and finds that trans-id in the table. The table entry also contains the name of the program that executes when that trans-id is entered. How does CICS use the PPT table ? After finding the program in the PCT, CICS goes to the Program Processing Table. It finds the program name in the table. Associated with the program name is the location of

the program; on disk or in storage. If the program is already in storage, CICS starts the task. If not, CICS gets the program(load module), loads it into storage and starts the task. The PPT entry is changed from on disk to in storage. What is the system transid CEMT ? CEMT is the master terminal transaction that lets you display and change the CICS environment How do you load a new version of your program or mapset ? CEMT Set PROGram(programname) NEwcopy How do you close a VSAM file in CICS ? CEMT Set DA(filename) CLOsed How about disabling a transaction so no one can use it ? CEMT Set TRANS(transid) Disabled What happens if you are testing a transaction and it goes into a loop or is running too slow, how do you cancel it so you can re-logon and re-test it again after the program logic is fixed ? Go find another terminal and after identifying the task associated with your test transaction, issue this command: CEMT Set TAsk(tasknumber) FOrcepurge You can further disable the transaction so no one can use it until the program is fixed. If a user erases a field (ERASE-EOF), the flag field is reset from LOW-VALUES to HEX 80 when a RECEIVE MAP is issued. How can this present a problem and how can it be avoided ? The flag field is a redefines of the attribute byte field. When you issue a SEND MAP, the attribute is set to HEX 80 which will present problems. This can be avoided by always moving LOW-VALUES to the symbolic map. What is the EIBAID and where is it stored ? EIBAID identifies which PF or AID key was pressed by the user. It's stored in the execute interface block (EIB). What's the difference between accessing linkage section fields using COBOL and COBOL II ? COBOL uses the ADDRESS command to load the address of a field into a BLL cell and then issues a SERVICE RELOAD command which identifies the name of the field the BLL cell is pointing to. COBOL II uses ADDRESS OF to set the address of the field. Explain how a program receives data from the terminal.

The user enters data and presses a PF key. The program issues a RECEIVE MAP command which retrieves the data and places it in the format defined by the symbolic map. What is the difference between the XCTL and LINK commands ? The LINK command passes control to another program at the next lower logical level and expects to return control back (using a RETURN command) to the LINKing program. The XCTL command transfers control to another program at the same logical level and does not expect control back. What happens to the resources supplied to a transaction when an XCTL command is executed ? How about LINK ? With an XCTL, the working storage and the procedure division of the program issuing the XCTL are released. The I/O areas, the GETMAIN areas, and the chained Linkage Section areas (Commarea from a higher level) remain. All existing locks and queues also remain in effect. With a LINK, however, program storage is also saved, since the transaction expects to return and use it again. How is LINK different from a CALL statement ? The CALL statement is faster because CICS is not involved, however a LINK has its advantages: It automatically provides addressability to the EIB and you don't have to link-edit the subprogram together with the invoking program (STATIC Linkage) using OS COBOL. With COBOL II, you can dynamically invoke a subprogram that's not link-edited to the main program. In this case, LINK and CALL are almost the same except for the addressability problem when resolving abends. What will happen if you issue an XCTL or a LINK and the called program cannot be found ? If found, what other problems might occur ? You will get a PGMIDERR condition. When a program is found, you might encounter a NOTAUTH condition which means security was not properly set up for your ID to access that program. What CICS table must be updated before running a CICS program accessing DB2 data ? The Resource Control Table (RCT) must be updated with the CICS transaction and its DB2 application plan. In a CICS program that uses DB2, do you use the COMMIT/ROLLBACK commands or SYNCPOINT commands ? SYNCPOINT. CICS takes control. Describe the function of the SYNCPOINT command ? SYNCPOINT alone makes all updates permanent. However, SYNCPOINT ROLLBACK reverses all updates.

What 2 CICS commands will cause DB2 to commit updates ? RETURN and SYNCPOINT. Explain 3 ways to position the cursor on a screen. 1) Static positioning: Code the IC (Insert Cursor) option in the DFHMDF field attribute in the BMS macro together with a SEND MAP. 2) Symbolic positioning: Move -1 or high-values to it's field length in the symbolic map together with a SEND MAP using the CURSOR option. 3) Relative positioning: With the SEND MAP command using the CURSOR option followed by a number equal to (row-1)*80 + (column-1) enclosed in parenthesis. A program is invoked without a communication area, what does that mean ? It means that this is the first time the program is executed. The first thing a program should check for is if EIBCALEN is equal to zero (first time entry). What is the advantage of defining a one-byte dummy field on a map with the attributes: DRK, PROT, FSET ? Avoids receiving a map with no data. The map will always have at least one byte of data. This avoids a MAPFAIL condition on a RECEIVE MAP when no data has been entered and a ENTER or PF key is pressed. Of the following keys, which transmit data ? ENTER, PF, PA, ERASE-EOF ? The ENTER and PF keys transmit data while the PA and ERASE-EOF keys do not. What are the advantages of using EIBAID over HANDLE AID when determining which key was pressed by the user ? EIBAID follows structured methodology while HANDLE AID forces the use of sections and GO TOs. If data from the map is not needed (the user pressed PF3 to exit), you don't have to issue a RECEIVE MAP command with EIBAID usage but you must with HANDLE AID. What are Modified Data Tags (MDT) ? The last bit in the 8-bit attribute byte which indicates whether the user has modified the field with a value of 1. What do you have to do to determine if screen data was sent from a specific field ? You have to check if the MDT is turned on in that field's attribute byte. Name 3 ways the MDT can be turned on. 1-When the user enters data into the field. 2-When the application program moves the DFHBMSFSE (MDT on) to the attribute byte. 3-By defining it as part of the DFHMDF attribute in the BMS macro definition.

A RECEIVE MAP is issued while both HANDLE AID and HANDLE CONDITION are in effect. A MAPFAIL condition occurs as a result. Which one is processed if an AID key is pressed ? The HANDLE AID command has priority and is processed and the HANDLE CONDITION is ignored. In a BMS macro, what are the 3 macro instructions ? DFHMSD - (MSD-mapset definition) defines a mapset which is a collection of BMS maps link-edited together. DFHMDI - (MDI-map definition individual) identifies each map within a mapset. DFHMDF - (MDF-map definition field) identifies each field/literal and it's characteristics within a map. What is the difference between a physical map and a symbolic map ? The physical map is a load module defined in the PCT that defines how the screen looks; headings, field locations, attributes, etc. You have to do a NEWCOPY every time you do a BMS macro assembly to pick up all map changes. The symbolic map is a COBOL copy member that enables you to access the fields, attribute bytes, field length on the map through your program. What 3 commands can be used to transfer program control ? XCTL, RETURN and LINK. What is the difference between PROT and ASKIP attributes ? PROT and ASKIP make the field protected so that data cannot be entered. ASKIP causes the cursor to skip over the field and proceed to the next field. What's the difference between specifying FSET on a field and just turning the MDT bit ON by the program ? None. Both methods enable data to be transmitted back to the program whether or not the field was changed preventing a MAPFAIL condition. What is a MAPFAIL ? When an application program issues an RECEIVE MAP and there is no data sent back from the terminal. On a data entry screen, what attributes are given to a field that's in error ? BRT to highlight the field in error and moving -1 to the field length to position the cursor to the field for correction. Name 6 other ways to start a CICS transaction other than by keying in the Transaction ID at the terminal ? 1-by coding a START in the application program. 2-by coding the trans id and a trigger level on the DCT table. 3-by coding TRANSID in the RETURN command. 4-by associating an attention key with the Program Control Table.

5-by embedding the TRANSID in the first 4 positions of a screen sent to a terminal. 6-by using the Program List Table which records the set of application programs tha will be executed at CICS start-up time. What is the difference between the XCTL and START commands ? The XCTL command transfers control to another application (having the same Transaction ID). The START command initiates a new Transaction ID (therefore a new task number). The XCTL continues the task on the same terminal while a START can initiate a task on a different terminal. What CICS command do you need to obtain the user logon-id ? The ASSIGN with the USERID option. How about the current time and date ? How do you read it ? Issue an ASKTIME. Using the ABSTIME option, you get a 15-digit packed-decimal number that represents the elapsed milliseconds since midnight, Jan. 1, 1900. You then issue the FORMATTIME ABSTIME(absolute-time-field) followed by one of these options and its (working storage field name): YYDDD - 6-byte julian date in YY/DDD format TIME - 8-byte time in HH:MM:SS format YEAR - binary fullword containing the 4-digit year DAYOFWEEK - binary fullword that corresponds to a 1-digit numbered week (Sunday is 0 etc.) What is a resident program ? A program or map loaded into the CICS nucleus so that it is kept permanently in main storage and not deleted when CICS goes "short on storage". What are some of the information available in the EIB area ? EIBCPOSN - Most recent physical cursor address in the map EIBTRNID - Transaction ID EIBTRMID - Terminal ID EIBTASKN - Task number EIBCALEN - Length of the communication area EIBDATE - Task start date EIBTIME - Task starting time EIBAID - Most recent AID key pressed EIBRCODE - CICS response code as a result of the last executed CICS command What is the function of the HANDLE CONDITION command ? To specify the paragraph label to which control is to be passed if the "handled condition" occurs. How many conditions can you include in a single HANDLE CONDITION command ?

No more than 16 in a single handle condition. If you need more, then you must code another HANDLE CONDITION command. What is the difference between an HANDLE CONDITION and an IGNORE command ? A HANDLE CONDITION command creates a "go to" environment while the IGNORE command does not. Instead, it gives control back to the next sequential instruction following the command causing the condition. They are opposites. What happens when a CICS command contains the NOHANDLE option ? No action is going to be taken for any exceptional condition occuring during the execution of this command. The abnormal condition that occurred will be ignored even if an EXC CICS HANDLE condition exists. It has the same effect as the IGNORE condition except that it will not cancel the previous HANDLE CONDITION for any other commands that follow. What happens when a CICS command contains the RESP option ? No action is going to be taken for any exceptional condition occurring during the execution of this command. When an abnormal condition occurs, the CICS response code is a field in the program work area and can be checked later (usually at the next sequential instruction). This is the better than HANDLE CONDITION because exception handling is isolated to where a condition occurred thus making the program easier to read and maintain. What's the difference between using HANDLE CONDITION and RESP to handle exceptional conditions ? The HANDLE CONDITION command must be issued before the CICS command is executed. The DFHRESP commands are issued right after the CICS command is executed. What is the HANDLE ABEND command ? It allows the establishing of an exit so cleanup processing can be done in the event of abnormal task termination. When a task suspends all the handle conditions via the PUSH command, how does the task reactivate all the handle conditions ? By coding a POP HANDLE command. What is the difference between the INTO and the SET option in the RECEIVE MAP command ? The INTO option moves information in the TIOA (terminal I/O area) into the reserved specified area, while the SET option simply returns the address of the TIOA to the specified BLL cell or "address of" a linkage section. Define the functions of Basic Mapping System (BMS).

BMS allows the application to be device-independent. It translates the formatted data stream, thus enabling the application to reference data by symbolic labels. Suppose you have a field in a map named ACCTID, and you want it bright. Explain how you can do this during the execution of the application. By moving either DFBMBRY (bright only) or DFHBMASB (askip bright) to the ACCTIDA field in the symbolic map. Reducing the data traffic is a very important factor in an on-line environment. Explain the difference between the MAPONLY and DATAONLY options in the SEND MAP command. A vast majority of maps are defined as input/output. Therefore, to reduce data transmission the first a map is sent, you should use MAPONLY because this will set up the initial template on screen. After that, the application needs to send only the variable data in the symbolic map using DATAONLY. If you're issuing a SEND MAP command to display edited data, do you use the MAPONLY or DATAONLY option ? You use the DATAONLY option to display data from the symbolic map. What happens if neither MAPONLY nor DATAONLY are specified ? Constant data from the physical map combined with the variable data from the symbolic map are both sent, causing an increase in data transmission. When you are sending your first data screen to the terminal, it is recommended that you also specify the ERASE option. Why ? If you do not include the ERASE option, the data sent will be combined with previous material from the terminal. An ERASE will clear the screen first before sending your data thus doing a fresh screen overlay. What happens if ERASEAUP was used instead of ERASE ? Four things happen: 1-all MDTs are cleared. 2-the keyboard is unlocked. 3-all unprotected fields are erased. 4-the cursor is positioned at the first unprotected field. How do you specify in your program which fields are not to be sent to a map (terminal) ? By moving low-values to those fields before doing a SEND MAP command. What is the function of the Terminal Control Table (TCT) ? The TCT defines the characteristics of each terminal with which CICS can communicate. What are the differences between a Temporary Storage Queue (TSQ) and Transient Data Queue (TDQ) ?

1-Temporary Storage Queue names are dynamically defined in the application program, while Transient Data Queues must first be defined in the DCT (Destination Control Table). 2-When a TDQ (intrapartition) contains a certain amount of records (trigger level), a CICS transaction can be started automatically using ATI (automatic transaction initiation) while a TSQ cannot. This type of TDQ is actually a VSAM file called DFHNTRA. 3-TDQ (extrapartition) may be used by batch applications while TSQ cannot. This type of TDQ is actually a QSAM file. 4-You may update an existing item in a TSQ while a TDQ cannot. 5-TSQ records can be read randomly. TDQ records can only be read sequentially. 6-TSQ records can be read more than once while TDQ records cannot. With TDQs, it is "one read" only and once read it is deleted from the destination. What will happen if a task issues a DELETEQ TD against an Extrapartition Transient Data Queue ? An invalid request exceptional condition will occur. The default action is that the task will be terminated. In an on-line environment, how can you prevent more than one user from accessing the same Transient Data Queue at the same time ? By issuing an ENQ against the resource. When processing is completed, a DEQ should be executed. Is there any way of releasing a resource previously enqueued by a task other than by issuing a DEQ command ? You can issue a SYNCPOINT command. You can also RETURN control to CICS, as CICS automatically releases a resource when a task is terminated. When an application is invoked via the START command with the FROM option, how does it gain access to the common area ? By issuing a RETRIEVE command, it will access the common area. What happens when a SYNCPOINT is issued ? The Logical Unit of Work (LUW) is terminated. Everything on the Deferred Work Element (DWE) chain is cleaned up. If Dynamic Transaction Backout (DTB) is on, everything is committed. GETMAIN areas are freed. File locks are released. I/O areas and linkage sections are released. Browsers are terminated. Working storage is not affected. What is a Logical Unit of Work ? It is all the processing that takes place between 2 "sync points".

The DFHCOMMAREA is used to pass information from one application to another. What are some other ways that this function can be accomplished ? You can also pass information in the following ways : 1-Temporary Storage Queue 2-Intrapartition TDQ 3-Task Work Area 4-TCTUA 5-using a "file" How do you define a Task Work Area ? By defining it in the PCT (Program Control Table). What is stored in the Temporary Storage Table ? The TST contains the names of the Temporary Storage Queues that are to be recovered in the event of an abend. What information do you get when an ASSIGN STARTCODE is issued ? You will be able to determine if the application was started by : 1-a transient data trigger level (QD), 2-a START command (S, SD), 3-user (U) or terminal input (TD), or 4-Distributed Program Link (D, DS). Which CICS command must be issued by the application in order to gain access to the Common Work Area (CWA) ? The ADDRESS command with the CWA option. When a data table is loaded into memory using the LOAD command, how does the application free that memory when the table is no longer needed ? By coding the RELEASE command with the PROGRAM option. What is the function of the HOLD option in the LOAD command ? When a program is loaded from the CICS DFHRPL concatenation library (CICS load libraries) into main storage, the HOLD option will result in the program remaining in memory after the task terminates. When this option is not specified, main storage is automatically released by CICS. If an application has a KSDS VSAM file READ command with the UPDATE option and it finds that the update is no longer required, how does it release the exclusive control of the record read ? By issuing an UNLOCK command with the FILE or DATASET option. A SYNCPOINT will also release the exclusive lock. Is it accurate to say that only the record read was locked ? Why ? No. It is the control interval containing the record read (not just the record itself) is locked.

What is a deadlock ? Deadlock (also known as a "deadly embrace") occurs when a task is waiting for a resource held by another task which, in turn, is waiting for a resource held by the first task. What happens when an application issues a GETMAIN command to obtain main storage and the SHARED option is specified ? There is no automatic release of the obtained storage at the end of the task which requested it. How can an application release main storage acquired by a GETMAIN command ? BY coding a FREEMAIN command with the data. SYNCPOINT will also release the storage area. How do you release page buffers ? By issuing a FREEMAIN command. What is the function of the REQID in the STARTBR command ? When you have multiple browse operations at the same time on the same file, the REQID must be coded on the READ Next/Prev command to distinguish one browse from the other. Which command must the application program issue to terminate a browse ? An ENDBR command. SYNCPOINT also ends the browse. What is the function of the RESETBR command ? To reposition the browse (with VSAM files this can be done just by altering the RIDFLD) and to change the characteristics specified on the STARTBR command without ending the browse. When debugging a CICS application, why would you use the CEBR transaction ? To view the contents of the TSQ or TDQ. What is the function of the CEDA transaction ? Its is used to perform the Resource Definition On-line operation (RDO). It adds, deletes, and changes table entries. What command is used to update an existing record in a KSDS VSAM file ? REWRITE. How about updating a TS queue record ? Use the WRITEQ TS command with the ITEM option followed by the item number together with the REWRITE option. What is the purpose of the BIF DEEDIT command ?

To remove all characters other than digits from an alphanumeric field. Remaining digits will be right-justified and padded with zeros as necessary. What is the Base Locator for Linkage (BLL) used for ? It is used to address storage outside of the working-storage section of the application program. A set of BLL cells is also known as the parameter list. It is used (explicitly) in COBOL II, although the BLL cells can be found in the TGT of a COBOL II program. Explain the term "transaction routing". It is a CICS mode of intercommunication which allows a terminal connected to a local CICS to execute another transaction owned by a remote CICS. Explain the term "function request shipping". It is one of the CICS modes of intercommunication which allows an application program in a local CICS to access resources owned by a remote CICS. Explain the term "MRO" (multi-Region Operation). It is a mechanism by which different CICS address spaces within the same CPU can communicate and share resources. If, when executing a "READ INTO" command, the length of the actual variable length record exceeds the length specified in the LENGTH option, what will happen ? You will get a LENGERR. When a second READ with the UPDATE option is given against the same file in the same task prior to releasing the file, what will happen ? An INVREQ will take place. How could you prevent such an error ? After the first READ with UPDATE, and prior to the second one, you could do one of these: 1-Issue an UNLOCK 2-Execute a DELETE 3-Execute a REWRITE 4-Execute a SYNCPOINT. Name one condition that would result in the inability to execute a backward browse. If you issue a STARTBR with a generic key, a backward browse will not work. You have duplicate keys and you have loaded an alternate index into RIDFLD. What would happen if you issued a READNEXT after switching from a direct retrieval READ ? You would get the same record twice. You are doing a mass delete using a generic key. What could you do to determine the number of records that have been deleted ?

You would use the NUMREC (data area) option with the generic key. Upon completion of the mass delete, the data area would contain a count of the number of records that were deleted. How should the data area used with the NUMREC option be defined ? S9(4) COMP which is a 2-byte halfword binary field. Which command will terminate a VSAM mass insert operation ? UNLOCK. Which command(s) will deblock DAM files ? DEBKEY will deblock by key. DEBREC will deblock by relative record number. What could cause you to get an INVREQ when building a logical message to a screen ? You have changed the disposition specified while building a logical message. What command would you use if you wanted to discontinue building a logical message ? You would issue a PURGE MESSAGE command. What does the BMS ROUTE command do ? It initiates the building of a logical message that will be scheduled for delivery to one or more terminals. Can you intermix a SEND TEXT and a SEND MAP when building portions of a logical message ? No. What do you have to do to determine if data was sent from a specific field in a screen ? Check the MDT of the attribute byte for that field. What would happen if you issued a READNEXT TS command and there were no more data in the queue ? You get an ITEMERR. You have a DL/I file and you want to issue a READPREV. Will it work correctly ? You can only issue a READPREV against a VSAM file. Can you issue a BROWSE command in a CICS program that is pseudo-conversational ? Yes, but the BROWSE will terminate at the end of each task in the session (it will not carry over). What are 2 ways to setp up a browse starting with the first record in the file ? 1-set the complete key equal to hex zeros or low-values (the default is GTEQ). 2-You can specify KEYLENGTH(0) and GENERIC options.

In a VSAM file, when you want to do a mass delete, the file has to be unprotected. How can you specify to the system that a file is unprotected ? In the FCT, you set LOG=NO. Which key, if depressed by the terminal operator, will set the screen size to its default size ? CLEAR key. What has happened if you abend with an "APCT" ? The program tried to execute a program that was either : 1-not defined in the PPT or active RDO group 2-Disabled What happens to the exception (HANDLE CONDITION, HANDLE ABEND, HANDLE AID) condition settings in a called routine once control has been transferred to the called routine ? Once in the called routine, all condition settings are deactivated.

JCL Describe the required JCL statements in a job. JOB statement; EXEC statement; DD card What are the functions of the JOB card ? The JOB statement identifies characteristics about the job such as job name, accounting information, restart instructions, job class, holds a job for later execution and set time limits. What are the functions of the EXEC statement ? The EXEC statement identifies the beginning of each job step; states the program to be executed; the name of the job step; gives conditions for bypassing or executing a job step; sets cpu time limits and passes parameters to to the program What are the functions of the DD statement ? The DD statement assigns a DD name; identifies a dataset name; may specify the volume the dataset is stored on; the format of the records in the data set; whether a data set is old or new and the record length and block size of newly created data sets. When would you use a catalogued PROC ? A PROC is used when the same set of JCL statements are used repeatedly with little or no change. Describe the three values of the DISP (disposition)parameter for an existing dataset. SHR means the dataset is shared by multiple jobs. OLD means only one job can access the dataset. MOD means data written to the dataset is appended. What does the second and third subparameter of the DISP parameter mean ? The second would be what to do with the dataset after the step normally ends while the third would be what to do with the dataset after the step abends. If the DISP parameter is left out, what would be the default ? The default DISP would be (NEW,CATLG,CATLG). If the third subparameter of the DISP parameter is left out, what would be the default ? It would default to the second subparameter. How do you start a job at a specific job step rather then at the beginning ? Indicate RESTART on the JOB statement and the name of the job step to begin execution. What if the step you want to restart is inside a PROC ? Code RESTART=Jobstepname.Procstepname, wherein the Jobstepname is found within the job and EXECs the procedure and the Procstepname is found within the PROC.

What are the 4 keywords used with DCB ? DCB stands for data control block. The keywords associated with the DCB parameter are LRECL(record length), RECFM(record format), BLKSIZE(block size) and DSORG(sequential or partioned data set). What is the purpose of the PARM keyword in the EXEC statement ? The PARM keyword passes data to the executing program What is the TIME keyword and where is it used? Indicates the maximum CPU time allocated for a particular job or job step. If TIME is in the JOB card, it relates to the entire job; if in the EXEC statement, it relates to the job step. Explain the SYSOUT parameter. Specifies the output device you want your output written to. How do you concatenate datasets ? Specify more than one dataset on the same DD statement like so: //ddname DD dsn=dataset1,disp=shr // DD dsn=dataset2,disp=shr // DD dsn=dataset3,disp=shr Given the example shown below: //ddname DD dsn=dataset1,disp=shr // DD dummy // DD dsn=dataset3,disp=shr What happens here ? dataset3 is skipped as a result of coding the DUMMY parameter in the middle. How do you assign default and specific values to a symbolic parameter ? Default values are specified by assigning values in the procedure on the PROC statement. Specific values are assigned on the EXEC statement of the calling procedure. When should you use a symbolic parameter ? When a parameter in a procedure varies each time the procedure is called. If you want to include run instructions/documentation in your job, what do you do ? Enter the instructions as comments by preferencing them with //* What does RLSE mean on the following: SPACE=(TRK,(25,25),RLSE) ? The system will release any unused tracks after allocating the requested space. Explain what will happen to a dataset with this DISP parameter upon completion of the job: DISP=(NEW,CATLG,DELETE)?

If the job runs successfully, the dataset will be created and cataloged. If the job abends, the dataset will be deleted. What are the DD names of the DD statements used to specify where the load modules are stored for a job step ? //STEPLIB DD DSN=... right after the EXEC PGM= card For the entire job ? //JOBLIB DD DSN=... right after the JOB card If both are coded, which one takes effect ? The load module found in the load library coded on the STEPLIB statement. How do you suppress reading or writing a dataset without making program changes ? By coding the DUMMY parameter on the DD statement of the dataset. What utility do you use to copy a sequential dataset? IEBGENER or IDCAMS with the REPRO option. "SORT" will also do the job with the exception of a sorted output dataset. What utility do you use to delete or catalog a dataset ? IEFBR14 Please elaborate. IEFBR14 does nothing so the subparameter values of the DISP parameter on the DD statement are used to delete or catalog the dataset. Describe a GDG generation data group. A group of datasets with the same base name that have chronological occurrences called generations. Each generation is referenced by it's base dataset name followed by the generation number. Example: SYS3.MASTER.G0101V00 and SYS3.MASTER.G0102V00 where SYS3.MASTER is the base name followed by a chronological generation number. What is the difference between an absolute and a relative generation ? GDG datasets can be referred to by using its absolute or relative generation number. Absolute generation or G0000V00 number (by its naming format) would give you the complete GDG dataset name. Relative generation is exactly what it says (0-current,-1-previous,+1-next one to be created). After a job completes or abends, the absolute generation numbers would be resolved. How can you prevent repeatedly changing the generation numbers in a job that executes daily? It reads the current and previous generations and creates a new generation of SYS3.MASTER ? By referencing them using their relative generation numbers: Name the current generation: SYS3.MASTER(0) Name the previous generation: SYS3.MASTER(-1) Name the newly created generation: SYS3.MASTER(+1)

If a job abends and a (+1) generation that was created previously will be used in the next subsequent step(s), what do you do before you restart ? Change your JCL to refer to this as a (0) generation because it is now the current generation. This is assuming that the (+1) generation created was the most current and there was no (+2) created etc. If you defined a GDG with a limit of 90, what happens when the 91st generation is created ? Generation one rolls off and is automatically deleted. Identify the 2 uses of the TYPRUN parameter on the JOB statement ? TYPRUN=HOLD will submit the job in the queue but suspend it's execution until it is released. TYPRUN=SCAN allows the JCL in the job to be checked for syntax errors without executing the job. What is a procedure ? A JCL stream called by the executing job by specifying it's name on the EXEC statement. What is the difference between a catalogued and an instream procedure ? A catalogued PROC name would be in the EXEC statement, but the actual procedure resides in a different dataset library. This gives added flexibility as far as being able to make changes to just the PROC without touching the job since this PROC can be used in more than one job. An instream PROC would be found inside the job itself preceded by the word, PROC, and ends with the word, PEND (the EXEC statement should be after the PEND). How do you specify where catalogued procedures reside ? By using the PROCLIB statement which specifies what libraries to search before executing the PROC (the new way of doing this is by using the JCLLIB ORDER=(lib1,lib2,...) statement). Can you have instream data inside a catalogued procedure ? How do you resolve this ? No. You can read instream data by doing an override to the DDname inside the PROC. This override would be coded inside the job itself after the EXEC PROCname statement: //DDname DD * followed by instream data in subsequent lines. What utility would you use to print a sequential dataset ? IEBGENER with the output directed to SYSOUT=*. This assumes that the MSGCLASS parameter on the JOB statement is pointing to a proper output class. What is a S322 abend ? The executing job has run out of time.

What is the difference between a S222 and S322 abend code ? A S222 abend code means the job was cancelled by the operator. A S322 means that the job needs more time to run. How do you fix a SB37 abend ? Increase the primary and/or secondary space specified on the SPACE parameter of the DD statement for the dataset specified in the error message. What is a S013 abend code ? DCB conflict; often LRECL specified does not match the record length of the file in the COBOL program What is a S806 abend code ? How do you resolve this ? Program module specified in the EXEC PGM= statement could not be found. First, check if a STEPLIB is coded and all concatenated libraries for this program. Second, check the JOBLIB statement and all concatenated libraries for this program. Last, check the system linklist if the program is there. How do you resolve a S80A or S804 abend ? Increase the REGION specified on the JOB and/or EXEC statement(s). What is a S913 abend code ? How do you resolve this ? You lack the authority to read or update the dataset. Talk to the security administrator so your ID has the necessary authority. What is the difference between a system and a user abend ? A system abend is issued by the operating system while a user abend is issued by an application program and starts with the letter, U, followed by a number. Usually an application program displays a message before issuing a user abend to help the on-call programmer diagnose the problem. How do you change the return code ? How is this different from a user abend ? In the COBOL program, move a 4-digit number to RETURN-CODE before issuing the GOBACK statement. This is different from a user abend because it does not abend, but issues a non-zero return code which can be used to affect subsequent steps. What parameter do you use to execute the next job step even though the preceding job step was unsuccessful ? COND=EVEN coded in subsequent steps. What parameter do you use to execute the next job step only if the preceding job step was unsuccessful ? COND=ONLY coded in subsequent steps. What parameter do you use to execute a job step only if the preceding job step has zero return codes ?

COND=(0,NE) coded in subsequent steps. What if the highest permissible condition code is 4, how do you code this ? COND=(4,LE) coded in subsequent steps. Q1:How many levels of nesting is allowed in PROCs? Ans-1. 15 Q2:If the "DISP=" keyword is not coded for an existing dataset, what default values will be used for "DISP="? Ans-2. If the "DISP=" keyword is not coded ,then the DEFAULT Values are : DISP=(NEW,DELETE,DELETE) Q3:If the "DISP=" keyword is not coded for a new dataset, what default values will be used for "DISP="? Ans-3. If the "DISP=" keyword is not coded ,then the DEFAULT Values are : DISP=(NEW,DELETE,DELETE) Q4:What does COND=ONLY mean? Ans-4. - It means that job step will be executed only if previous steps abnormally terminate Q5:What does COND=EVEN mean Ans-5. It means that job step will be executed even if one of the previous steps abnormally terminates

VSAM What are the 3 types of VSAM files ? 1-ESDS (Entry sequenced dataset). DB2 uses a special type of ESDS. 2-RRDS (Relative record dataset). Records are accessed using a relative number. 3-KSDS (Key sequenced dataset) is the most common type encountered. The record sequence is determined by a unique key field. How do you create a VSAM file ? You use the IDCAMS utility with the DEFINE CLUSTER option. How do you copy to a VSAM cluster ? You use the IDCAMS utility with the REPRO option. What is an alternate index ? An alternate index is another file related to the cluster, but sorted using an alternate key that can have duplicates. How do you create an alternate index ? You use the IDCAMS utility with the DEFINE AIX option after you build the cluster and then do another IDCAMS with the BLDINDEX option to populate the alternate index. What parameter in the DEFINE AIX option is used to determine the maximum number of duplicate keys allowable ? The RECORDSIZE parameter. There are 2 numbers that follow this: the 1st is the average and the 2nd is the maximum. The values are equal to 5 + (cluster key length) + N*(alternate key length), where N is the allowable number of duplicates. Name a few common VSAM status codes. 00-OK 02-READ a duplicate alternate key 10-end of file reached while doing a READ 22-trying to WRITE a duplicate primary key 23-record not found while doing a READ 97-file integrity verified, do an IDCAMS VERIFY What is buffering and how does it apply to VSAM files ? When large blocks of data are used, more main storage is required than when smaller blocks are used, but large blocks save CPU time and disk space. Additionally, extra buffers may save elapsed time since the program does not have to wait for an I/O to complete for it to continue processing. In the JCL, you specify BUFNI (number of index buffers) and BUFND (number of data buffers) as subparameters of the AMP parameter. For random access, the BUFNI is one more than the number of index levels and a BUFND of 2 is fine. For sequential access, a BUFNI of 1 and a minimum of 5 for BUFND is fine. For dynamic access, the values of each is the higher of the numbers for either random or sequential.

COBOL Name the differences between COBOL and COBOL II ? COBOL II offers the following features: in-line PERFORMs: permits 'do' constructions, explicit scope terminators, the EVALUATE statement: permits 'case' constructions, SET field TO TRUE statement, TEST BEFORE and TEST AFTER in the PERFORM statement: permits 'do while' and 'do until' constructions, 'above the 16 Meg line' processing. What is an explicit scope terminator ? When is it used ? A scope terminator terminates its preceding verb. Example: IF .. END-IF. A verb executes all statements between the verb and its scope terminator. It is used with READ, WRITE, DELETE, REWRITE, PERFORM, EVALUATE, SEARCH, IF and STRING. What is an in-line PERFORM ? An in-line PERFORM statement executes all statements between the PERFORM and END-PERFORM commands. Eliminates the necessity of placing the statements to be executed in a separate paragraph and then performing that paragraph. When used with a IF..END-IF statement what is the difference between NEXT SENTENCE and CONTINUE ? NEXT SENTENCE gives control to the verb following the next period (.) while CONTINUE gives control to the next verb after the END-IF. What is the significance of 'above the line' and 'below the line' ? A program's virtual storage is 'below the line' when it is limited to 16 MB and 'above the line' when it can exceed 16MB. Programs compiled with a 24-bit mode can only address 16 MB of space. With COBOL II, a program can be compiled with a 31-bit mode which allows it to address more than 16MB of space. Thus COBOL II programs can do more processing and access larger amounts of data. Name the statements no longer valid in COBOL II ? REMARKS, CURRENT-DATE, CURRENT-DAY, TIME-OF-DAY, EXAMINE, READY TRACE, POSITIONING, "report writer statements" like RD, INITIATE, GENERATE, TERMINATE. What does the INITIALIZE statement initialize values to ? What fields does it ignore ? INITIALIZE moves spaces to alphabetic fields and zeros to numeric fields. It doesn't initialize filler fields. How is INITIALIZE advantageous when initializing tables ? The INITIALIZE statement initializes the entire table so it's no longer necessary to initialize each occurrence of a field in a table by using a PERFORM..VARYING.

What additional functionality is given to the SET statement ? SET field TO TRUE sets the field equal to the value associated with it (88-level). Describe the EVALUATE statement The EVALUATE statement evaluates a field, literal, expression or a true/false condition and performs the statements indicated by the WHEN conditions. It reduces the use of Nested Ifs. TRUE or FALSE. WHEN conditions specified in the EVALUATE statement are executed in alphabetical order. False. WHEN conditions are executed top-down, the first condition stated is evaluated first. That is why you should arrange the conditions in the order you really intended. If EOF-FLAG is defined as an 88-level with a value of 'Y' State two ways to set the field equal to it's value. 1-Move 'Y' to it's group level data item. 2-Use the statement, SET EOF-FLAG TO TRUE. The INSPECT statement can replace all blanks with zeroes. What COBOL II statement achieves the same results ? INITIALIZE data item REPLACING ALPHANUMERIC DATA BY ZEROES What COBOL II statement functions like the EXIT PROGRAM statement in a called program ? GOBACK. It returns control back to the calling program and executes the next statement Accessing CURRENT-DATE and CURRENT-TIME is no longer supported, how does COBOL II access these features ? ACCEPT HOLD-DATE FROM DATE (The format is YYMMDD). ACCEPT HOLD-TIME FROM TIME (The format is HHMMSSMS). What is the TGT ? How is this listing produced and why is it useful ? The TGT is the Task Global Table found in every COBOL II compile listing. It is composed of 2 parts: 1-fixed-length portion which contains the number of fields that appear in every program (such as the register save area) 2-variable-length portion containing fields of varying lengths The TGT is produced when the compile options LIST and OFFSET are used. It contains a wealth of information about the program which can be used for abend resolution. Within the variable-length portion of the TGT, you will find these: INDEX CELLS - contains indexes stored as displacements (for a 1-dimensional table, to find out what is the table occurence an index is pointing to at abend time, divide the value of the INDEX CELL by the length of one table occurence and then add 1).

BASE LOCATORS - there are 3 types:BLF (File section fields), BLW (Working-storage section fields) and BLL (Linkage section fields). FCB CELLS - an FCB (File Control Block) and a File Information Block exist for each VSAM and non-VSAM file. At certain FCB displacements, you will find these: X'B3' - the file status code of the last I/O. X'AC' - the address of the current record. X'78' - the DCB (non-VSAM files) and ACB (VSAM files) information Q1: What is AMODE and RMODE? What does 24 or 31 mean to it? Ans-1. Addressing Mode/Access Mode AMODE(24) indicates 24-bit (three-byte) addressing - memory below the line. AMODE(31) indicates 31-bit addressing - memory above and below the line. AMODE=ANY indicates the program may use either of the addressing technique. Run Mode/Residency Mode RMODE(24) indicates that the program must be loaded into memory below the line RMODE(31) indicates that the program can be loaded either below or above the line. RMODE=ANY indicates that the program can be run in either 24 bit (below)or 31 bit memory(above). Q2: 1) What is the difference between a SEARCH and a SEARCH ALL statement? Ans-2. The first is a sequential search, the second is a binary search Q3: Explain difference between TEST and OPTIMIZE Compile directives Ans-3. Use TEST to produce object code that can be executed with VS COBOL II batch or interactive debug. When you specify TEST, the following options go into effect: RES, NOFDUMP, NOOPTIMIZE, and OBJECT. Use OPTIMIZE to reduce the run time of your object program; optimization may also reduce the amount of main storage your object program uses. Since OPTIMIZE increases compile time, it should not be used when debugging. The OPTIMIZE option is turned off in the case of a severe-level error or higher. OPTIMIZE and TEST are mutually exclusive. If you use both, OPTIMIZE is ignored. Q4: What is the difference between a subscript and an index? Ans-4. A subscript is an occurrence value. An index is a displacement value. For example if you have a list of month names each occupying 9 bytes, then the value of a subscript for the month of May would be 5, but the index would be 36. A formula to calculate index value when the occurrence and item length are known is: Index-Value = (Occurrence -1) * Item-Length

DB2 DB2 Explain how to prepare a DB2 program for execution. 1-The PRECOMPILER first checks for syntax errors and creates a source module and a DBRM (database request module). The source module contains no SQL code (converted to CALL statements) while DBRM contains information about each precompiled SQL statement. 2-The source code is processed by the COMPILER and converted to object code. 3-The object code goes in the LINKAGE-EDITOR creating a load module. 4-Finally, the BIND process creates an application plan (using all previous DBRMs). It validates the SQL statements in the DBRM(s) for valid table, view and column names, verifies that the OWNER (authid) is authorized to perform the functions in the program, selects all access paths and indexes and creates or replaces the plan. What commands are used to start and end SQL statements ? EXEC SQL and END-EXEC What is concurrency and how is it controlled ? Concurrency is when more than one program can access the same data at the same time. You control concurrency by establishing locks so that that no program can access uncommitted data that has been changed by another program. What is meant by isolation level ? Isolation level describes the method used to lock and unlock DB2 space. It is one of the parameters you specify when you do a BIND. Describe the different isolation levels in order of concurrency. CS (Cursor stability) - most concurrent. Each row/page is locked until another row/page is read or a commit point is reached. RR (Repeatable Read) - the same data can be retrieved with each read. Each row/page is locked until a commit point is reached. UR (Uncommitted Read) - has fastest data access, but may not have the most current rows. What kind of BIND is performed when the DBRMs SQL statements havent changed but you want to access a new index or change the locking options ? A REBIND is performed. What kind of BIND is performed which allows you to rebind a program using the same application plan name ? A REBIND REPLACE Name the 2 types of DB2 indexes

A clustering index which detemines the physical order the rows of the table are stored in, which is usually the sequential order the data is most frequently accessed. A unique index forces the table's rows to have unique values. When do you use a VIEW ? To access only the columns that you are authorized to read and to access one or more columns from one or more tables. What is a COMMIT ? A commit makes all updates permanent. It also releases it's locks so that other programs can access the data. What is a ROLLBACK ? The rollback returns the data to its original values since the last commit. Is a NULL value equal to a space, a zero or low-values ? Neither one. A NULL value has no value. An indicator variable would have a value of -1 if a SELECT retrieved a NULL value. What is an indicator variable ? It is an integer variable (2-byte binary) used to show whether its associated host variable has been assigned a null value. What is the SQL Communications Area ? It is a data area defined in working storage which tells your program whether SQL statements were executed successfully. It contains SQLCODE which indicates whether the SQL statement was successful or unsuccessful. SQLWARN0 which if set to W, means that at least one of the SQL warning flags are set. SQLERR(3) indicates the number of rows updated, inserted or deleted by DB2. Explain how a subquery works. DB2 substitues the value resulting from the subquery directly into the WHERE or HAVING clause of the main select. SQL statements that are defined and processed while the program is executing is considered static or dynamic SQL ? Dynamic. Static SQL statements are hard-coded in the program. What is the term used to describe COBOL fields defined in working storage or the linkage section that correspond to the columns in a DB2 table ? They are called host variables. When they are used in a SQL statement, they are preceded by a colon. What are the 3 types of locks ? The 3 types are Shared, Update and eXclusive: S locks allow programs to read but not change the locked space.

X lock bars all other programs from accessing the locked space. U lock allows programs to acquire shared locks on the space. How do you retrieve multiple rows from a table and list the SQL statements required ? DB2 sequentially retrieves multiple rows through the use of a CURSOR. DECLARE defines the cursor using a SELECT statement. OPEN opens the cursor. This would be the slowest process since the data is built. FETCH retrieves each row one at a time until there are no more rows (SQLCODE = +100). CLOSE closes the cursor. How do you maintain a cursor that closes due to a COMMIT ? Use the WITH HOLD option in the DECLARE statement when the cursor is declared. What option is used in the DECLARE statement to enhance data retrieval performance ? Use the OPTIMIZE FOR 1 ROW to disable list prefetch for online applications that display data on a page-to-page basis. When list prefetch is used, DB2 acquires a list of RIDs from the matching index entries, sorts the RIDs, and then accesses data pages using the RID list. The overhead associated with list prefetch usually causes performance degradation in an online, paging environment. Otherwise, use OPTIMIZE FOR n ROWS, where n is the estimated maximum number of rows that will be retrieved. This influences the access path selection chosen by the DB2 optimizer. What is a foreign key ? A foreign key is a column (or combination of columns) in a table whose values are required to match those of the primary key in some other table. What is Referential Integrity or RI ? How is it enforced ? Means that foreign keys from one table references the primary key in another. The DBA (database administrator) uses referential constraints when creating tables using the FOREIGN KEY clause. A refential constraint consists of 3 components: 1-a constraint name 2-columns comprising the FOREIGN KEY 3-REFERENCES clause How can a insert of a new foreign key value threaten referential integrity ? The new foreign key value must reference or have a matching primary key value in the related table. What is a Check Constraint ? How is it enforced ? The DBA can implement these to place specific data value restrictions on certain columns using the CONSTRAINT clause. They consists of 2 components:

1-a CONSTRAINT name 2-a check condition What is the EXPLAIN statement ? How many ways can this be done ? Where does it get stored ? The EXPLAIN statement will show the access paths the DB2 optimizer uses to process the SQL statements in a program. There are 2 ways to do an EXPLAIN: 1-interactively using EXPLAIN ALL SET QUERYNO=n FOR sql statement... ; or 2-as part of the BIND process using the parameter EXPLAIN(YES) The results are stored in userid.PLAN_TABLE (which you should have already created with the preassigned columns). What is the use of the WHENEVER clause ? What conditions can it check ? The WHENEVER clause checks the values associated with an error in SQLCA each time a SQL statement is executed WHENEVER NOT FOUND - checks for data not found WHENVER SQLERROR - checks for a error code WHENEVER SQLWARN - checks SQLWARN for W It is bad practice to use WHENEVER, since it is analogous to a GO TO DEPENDING ON and does not tell you where the problem occurred. How do you display the names of the columns in a table ? Perform a select query on the SYSCOLUMNS catalog table. List the common SQLCODES. +100 = no more rows found, also means not found if trying to get first row -305 = NULL indicator variable is needed -407 = value is NULL and column cannot contain nulls -551 = unauthorized access on object -803 = attempt to INSERT a duplicate row -805 = DBRM or package name not found in plan, you also get this instead of -818 when using a package -811 = SELECT returned more than one row, use a cursor instead -818 = plan versus load module timestamp mismatch, do another BIND -904 = resource not available Examples: DB2 subsystem is down or RCT table in CICS not defined properly or NUMLKUS which is the maximum allowed page locks was exceeded during an update operation (issue COMMITS more often) -911 = deadlock or timeout, unit of work has been rolled back -913 = deadlock or timeout, unsuccessful execution -922 = connection authority failed, DBA has to grant you authority Explain the difference between the GROUP BY clause and the ORDER BY clause

ORDER BY clause presents all selected rows in sorted sequence. GROUP BY clause presents one row for each group (aggregate) of matching rows. How do you specify search conditions on groups ? The HAVING clause allows you to select specific groups (aggregate). What do you do when you receive a SQLCODE -911 or -913 ? This indicates a deadlock or timeout which occured when accessing locked data. This is resolved by re-executing the SQL statement until the lock is removed. If the lock isn't removed in a timely fashion, a ROLLBACK is issued since the unit of work cannot be completed. How do you find the number of unique values in a column called EMPNO? Indicate COUNT followed by DISTINCT and the column name enclosed in parentheses. SELECT COUNT(DISTINCT EMPNO) How do you determine the average, minimum and maximum value of a column called SKILLS ? SELECT AVG(SKILLS), MIN(SKILLS), MAX(SKILLS) What is the SQL syntax used to delete all COBOL skills from the SKILLS column on the KIT table ? EXEC SQL DELETE FROM KIT WHERE SKILLS = 'COBOL' END-EXEC What is the SQL syntax used to change all COBOL skills to DB2 in the SKILLS column on the KIT table ? EXEC SQL UPDATE KIT SET SKILLS = 'DB2' WHERE SKILLS = 'COBOL' END-EXEC What is the SELECT statement used to multiply the percentage column by 100 before it returns a value ? SELECT PERCENTAGE * 100 How do you specify a WHERE clause that retrieves GRADES >= 90 and GRADES <= 100 ? SELECT GRADES BETWEEN 90 AND 100 Specify 3 WHERE clauses that retrieves SKILLS = COBOL or COBOL II.

WHERE SKILLS = 'COBOL' OR SKILLS = 'COBOL II' WHERE SKILLS = 'COBOL%' WHERE SKILLS IN ('COBOL','COBOL II') Would I join data or specify UNION if I want to merge distinct rows from 2 tables ? What is required here ? UNION. The only requirement is that the 2 tables be "similar" (having the same number of columns with the same data types and lengths). How would you retain the duplicate rows ? UNION ALL. With the ALL option, all rows from the 2 tables will be retained. Without it, duplicate rows will be discarded. Would I join data or specify UNION if I want to merge columns from 2 tables ? "join" data by specifying in the WHERE clause matching column(s) from one table to another table. What is an Index ? It is a set of row identifiers (RIDs) or pointers that are logically ordered based on the values of indexed columns. Indexes provide faster data access and can enforce uniqueness on the row in a table. An index key is a column or set of columns in a table used to determine the order of index entries. What is an Index Scan? When an entire index (or a portion thereof) is scanned to locate rows, we call this an index scan. This type of access can be used, for example, to select all rows of a table in some order and avoid a sort for a query. What is dynamic SQL ? SQL statements that are prepared and executed within a program while it is executing. The SQL source is contained in host variables rather than being "hard coded" into the program. The SQL statement may change from execution to execution. What is a page ? It is a unit of retrieval data within a tablespace or indexspace, either 4K or 32K (depending on how the table is defined), containing user or catalog information. What is a pagespace ? It refers either to an unpartitioned table, to an index space, or to a single partition of a partitioned table of index space. What are data types ? They are attributes of columns, literals, and host variables. The data types are SMALLINT, INTEGER, FLOAT, DECIMAL, CHAR, VARCHAR, DATE, and TIME.

What is a Declarations Generator (DCLGEN) ? DCLGEN is a facility that is used to generate SQL statements that describe a table or view. These table or view descriptions are then used to check the validity of other SQL statements at precompile time. The table or view declares are used by the DB2I utility DCLGEN to build a host language structure, which is used by the DB2 precompiler to verify that correct column names and data types have been specified in the SQL statement. . What does DSNDB07 database do ? DSNDB07 is where DB2 does its sorting. It includes DB2's sort workarea and external storage. What is embedded SQL ? They are SQL statements that are embedded within an application program and are prepared during the program preparation process before it is executed. After it is prepared, the statement itself does not change (although values of host variables specified within the statement may change). What is meant by entity integrity ? It is when the primary key is in fact unique and not null. What will the FREE command do to a plan ? It will drop (delete) that existing plan. What will the GRANT command do ? It will grant privileges to a list of one or more users. If the GRANT is used in conjunction with PUBLIC, then all users will be granted privileges. It can also be done by objects and types. What is an image copy ? It is an exact reproduction of all or part of a tablespace. DB2 provides utility programs to make full-image copies (to copy the entire tablespace) or incremental image copies (to copy only those pages that have been modified since the last image copy). What is meant by locking ? It is a process that is used to ensure data integrity. It also prevents concurrent users from accessing inconsistent data. The data (row) is locked until a commit is executed to release the updated data. What is a "nonleaf" page ? This is a page that contains keys and page numbers of other pages in the index. Nonleaf pages never point to actual data. What is an object ? It is anything that is managed by DB2 (i.e., alias, column, stogroup, database, tablespace, table, view, index, synonym), but not the data itself.

What is an Alias ? It is an alternate name that can be used by everyone to refer to a table or view in the same or a remote DB2 subsystem. What is the difference between an alias and a synonym ? They are basically the same except that a synonym can only be used by the creator and stored in the SYSIBM.SYSSYNONYMS catalog table. What will the DB2 optimizer do ? It is a DB2 component that processes SQL statements and selects the access paths. What is a predicate ? It is an element of a search condition (part of the SELECT statement) that expresses a comparison operation. Example: WHERE STATUS_FLAG IN ('A','B','C') AND PAY_AMOUNT > 91.50 What is a recovery log ? It is a collection of records that describes the sequence of events that occur in DB2. The information is needed for recovery in the event of a failure during execution. What is a Resource Control Table (RCT) ? Describe its characteristics. It is a CICS table that is defined to a DB2/CICS region. It contains control characteristics which are assembled via the DSNRCT macros. It also matches the CICS transaction ID to its associated DB2 authorization ID and plan ID (CICS attachment facility). Where are plans stored ? Each plan is defined uniquely in the SYSIBM.SYSPLAN catalog table. What is a storage group (STOGROUP) ? It is a named collection of DASD volumes to be used by tablespaces and index spaces of databases. The volumes of a STOGROUP must be of the same device type. What is a tablespace ? It is a special ESDS VSAM dataset which is used to store one or more tables. The physical page can consist of 4K or 32K pages. What are the 3 types of tablespaces ? Simple, segmented, and partitioned. How would you move a tablespace (using STOGROUP) to a different DASD volume allocated to that tablespace ? 1-If the tablespace used is only allocated to that STOGROUP: ALTER STOGROUP - add volume (new) delete volume (old) REORG TABLESPACE or RECOVER TABLESPACE 2-Create a new STOGROUP that points to the new volume.

ALTER the tablespace and REORG or RECOVER the tablespace. What is the format of TIMESTAMP ? This is a seven-part value that consists of a date (YYMMDD) and time (HHMMSS and microseconds). What is a unit of recovery ? This is a sequence of operations within a unit of work (i.e., work done between commit points). After a table has been recovered, which flag is turned on ? Is the table available for use ? Copy Pending flag is set. No, it is not available for use. How do you reset this flag ? By running a DB2 utility, there are 2 ways: CHECK DATA - enforces referential constraints, or REPAIR SET TABLESPACE tsname NOCOPYPEND - not recommended What is the DB2 Catalog ? It is a set of tables (name starts with SYSIBM.) that contain information about all the DB2 objects (tables, views, plans, packages, etc.). In which column of which DB2 catalog would you find the length of the rows for all tables ? In the RECLENGTH column of SYSIBM.SYSTABLES. What information is held in SYSIBM.SYSCOPY ? It contains information about image copies made of the tablespaces. What information is contained in a SYSCOPY row ? Included is the name of the database, the tablespace name, and the image copy type (full, incremental, etc.), as well as the date and time each copy was made. What information can you find in SYSIBM.SYSLINKS ? It contains information about the links between tables created by referential constraints. Where would you find information about the type of database authority held by a user ? SYSIBM.SYSDBAUTH. How about the type of plan authority held by a user ? SYSIBM.SYSPLANAUTH. How about the type of package authority held by a user ? SYSIBM.SYSPACKAUTH. How about system privileges held by a user ?

SYSIBM.SYSUSERAUTH. Where could you look if you had a question about whether a column has been defined as an index ? SYSIBM.SYSINDEXES. Once you create a view, where would information about it reside ? SYSIBM.SYSVIEWS. If you need to know when a plan was bound and who did it last, where is the information ? SYSIBM.SYSPLAN. How about getting package information ? SYSIBM.SYSPACKAGE. What will the COPY utility do ? It will create an image copy of a tablespace or a dataset within a tablespace. There are 2 types of image copies: full and incremental. A full image copy copies all pages in a tablepsace or dataset. An incremental image copy copies only pages that have been modified since the last use of the COPY utility. What will the LOAD utility do ? It will load data into one or more tables in a tablespace or partition. It can also replace the contents of a single partition or of an entire tablespace using the REPLACE option (the default is to append data). What can the MERGECOPY utility do ? It can merge several incremental copies of a tablespace to make a single incremental copy, and it can merge incremental copies with a full image copy to make a new full image copy. What will the RECOVER utility do ? This recovers data to the current state or a previous state. The largest unit of data recovery is the tablespace; the smallest is a page. Data is recovered from image copies of a tablespace and database log change records. What will the REORG utility do ? It will reorganize a tablespace to improve access performance and reorganize indexes so that they are more efficiently clustered. What will the REPAIR utility do ? It will repair invalid data with valid data and/or reset (using the SET option) status flag conditions (NOCOPYPEND, NOCHECKPEND and NORCVRPEND).The data may be your own data or data you would not normally access: space map pages and index entries.

What will the RUNSTATS utility do ? It will scan tablespaces or indexes gathering information about utilization of space and efficiency of indexes. The information is tored in the DB2 catalog, and is used by the DB2 optimizer to select access paths to data during the bind process. What will the QUIESCE utility do ? It ensures table data consistency and referential integrity. It does this by recording log RBAs in the SYSIBM.SYSCOPY catalog table, which can later be used by the RECOVER utility. It is recommended to run QUIESCE before running a COPY because of this. What will the STOSPACE utility do ? This updates the DB2 catalog columns to tell how much space is allocated for storage groups and related tablespace and indexes. In a CICS program, if PGM-A with PLAN-A transferred control to PGM-B with PLANB, which plan would take effect ? Why ? PLAN-A of PGM-A is still in effect because a CICS SYNCPOINT was not done before transferring control to PGM-B. What is a two-phase commit? It is a process that synchronizes the commit and rollback of changes between 2 different environments (like CICS to DB2 or IMS to DB2). What can cause it to fail? How can you resolve this ? If a connection/communication failure or an environment crash in either environment occurs. When such a failure happens, the commit status of the thread established for that connection is in doubt. One can invoke the RECOVER INDOUBT command to commit or rollback any changes associated with an in-doubt thread. Q1: How do you find the second max and second min in a given table? Ans-1. SELECT MAX(COLA) FROM TABLENAME WHERE COLA < (SELECT MAX(COLA) FROM TABLENAME) ; SELECT MIN(COLA) FROM TABLENAME WHERE COLA > (SELECT MIN(COLA) FROM TABLENAME) ; Q2: What is Cursor Stability(CS)? Ans-2. A page lock is held only while the cursor is positioned on that page. When the cursor moves to another page, the lock is released. When a page is locked concurrent application programs cannot update or delete a row of the locked page. The current lock is not released until a new lock is acquired. If an application program updates or deletes

data, the lock is held until the data is committed. CS applies only to data that is read. All changed data remains locked until COMMIT or ROLLBACK Q3: What are the three lock types? Ans-3. The three types are shared, update and exclusive. Shared locks allow two or more programs to read simultaneously but not change the locked space.An exclusive lock bars all other users from accessing the space.An update lock is less restrictive; it allows other transactions to read or acquire shared locks on the space.

Vous aimerez peut-être aussi