This action might not be possible to undo. Are you sure you want to continue?
JES3 allocates datasets for all the steps before the job is scheduled. In JES2, allocation of datasets required by a step are done only just before the step executes. JES3 = Job Entry Subsystem 3 An MVS subsystem that receives jobs into the system,converts them to internal format, selects them for execution, processes their output, and purges them from the system. In complexes that have several loosely coupled processing units, the JES3 program manages processors so that the global processor exercises centralized control over the local processors and distributes jobs to them via a common job queue. JES2 = Job Entry Subsystem 2 An MVS subsystem that receives jobs into the system, converts them to internal format, selects them for execution, processes their output, and purges them from the system. In an installation with more than one processor, each processor's JES2 subsystem independently controls job input, scheduling, and output processing. Some principle differences between the two JES systems include: In a mainframe installation that has only one processor, JES3 provides tape setup, dependent job control, and deadline scheduling for users of the system, while JES2 in the same system would require its users to manage these activities through other means. In an installation with a multiprocessor configuration, there are noticeable differences between the two, mainly in how JES2 exercises independent control over its job processing functions. That is, within the configuration, each JES2 processor controls its own job input, job scheduling, and job output processing. In cases where multiple z/OS® systems are clustered (a sysplex), it is possible to configure JES2 to share spool and checkpoint data sets with other JES2 systems in the same sysplex. This configuration is called Multi-Access Spool (MAS). In contrast, JES3 exercises centralized control over its processing functions through a single global JES3 processor. This global processor provides all job selection, scheduling, and device allocation functions for all of the other JES3 systems. With JES3, installations may decide whether the global JES3 or z/OS base control program will handle device allocation. With JES2, only the z/OS base control program handles device allocation.
what is the difference between plan and package? why package is not a executable? what is the advantages of the paln and disadvantages of the packages?
package cantains one r more DBRMs.packages are obtained by passing DBRMs through bindpackage.package ia not executable because it does not contain any acess path. plan is obtained by binding DBRMs r packages.plan is executable as it contains the acess path. it is advantageous to use packages because it reduces the cost of bind it reduces rebound time if there r modifications in the sub program its just enough to crete a package 4 that sub pgm. lock options and various bind options can b controlled even in the subpgm level itself. If you've 5 programs, you create 5 distinct PACKAGEs and then club them together using a PLAN. So, in your case, you will have to update (re-bind) the PACKAGE that represents the changed program and your PLAN will automatically take the latest one. You don't have to rebind the other unchanged programs.
Creating a package version
If you want to run different versions of a program without needing to make changes to the associated application plan, use package versions. This technique is useful if you need to make changes to your program without causing an interruption to the availability of the program. You can create a different package version for each version of the program. Each package has the same package name and collection name, but a different version number is associated with each package. The plan that includes that package includes all versions of that package. Thus, you can run a program that is associated with any one of the package versions without having to rebind the application plan, rename the plan, or change any RUN subcommands that use it.
To create a package version: 1. Precompile your program with the option VERSION( version-identifier). 2. Bind the resulting DBRM with the same collection name and package name as any existing versions of that package. When you run the program, DB2® uses the package version that you specified when you precompiled it. Example: Suppose that you bound a plan with the following statement:
BIND PLAN (PLAN1) PKLIST (COLLECT.*)
The following steps show how to create two versions of a package, one for each of two programs. Step number 1 2 For package version 1 Precompile program 1. Specify VERSION(1). Bind the DBRM with the collection name COLLECT and the package name PACKA. Link-edit program 1 into your application. For package version 2 Precompile program version 2. Specify VERSION(2). Bind the DBRM with the collection name COLLECT and package name PACKA. Link-edit program 2 into your application.
Run the application; it uses program 1 Run the application; it uses program 2 and PACKA, VERSION 1. and PACKA, VERSION 2.
How DB2 identifies packages at run time
The DB2® precompiler or DB2 coprocessor identifies each call to DB2 with a consistency token. The same consistency token identifies the DBRM that the SQL statement processor produces and the plan or package to which you bound the DBRM. When you run the program, DB2 uses the consistency token in matching the call to DB2 to the correct DBRM. Usually, the consistency token is in an internal DB2 format. You can override that token if you want. You also need other identifiers. The consistency token alone uniquely identifies a DBRM that is bound directly to a plan, but it does not necessarily identify a unique package. When you bind DBRMs directly to a particular plan, you bind each one only once. But you can bind the same DBRM to many packages, at different locations and in different collections, and then you can include all those packages in the package list of the same plan. All those packages will have the
same consistency token. You can specify a particular location or a particular collection at run time.
what is the purpose of //systsin dd *
It's the DD name used by TSO to enter in-stream TSO commands. The reason you see it in DB2 jobs is that IBM uses TSO as one of the techniques for running DB2 jobs in batch mode.
in the IKTEF01 utility (terminal monitor program) for bind,run a COBOL-DB2 Program,we use this card //BIND EXEC PGM=IKJEFT01,DYNAMNBR=20,COND=(4,LT) //STEPLIB DD DSN=DSN710.SDSNLOAD,DISP=SHR //DBRMLIB DD DSN=E02619.DBRMLIB,DISP=SHR //SYSTSPRT DD SYSOUT=* //SYSPRINT DD SYSOUT=* //SYSUDUMP DD SYSOUT=* //SYSOUT DD SYSOUT=* //SYSTSIN DD * DSN SYSTEM(DSNY) BIND PLAN(DB2PROG)MEMBER(PROG1) ACT(REP) LIB('E02619.DBRMLIB') ISOLATION(CS) /*
The SYSTSIN DD statement is used to specify that the data to follow consists of executable commands and/or subcommands. For example, to indicate to the system that all data following this statement is to be used as input, until the system encounters an input delimiter, such as the characters /* or the DLM operand, specify:
//SYSTSIN DD *
If any of the input statements start with the characters //, use the DD DATA statement instead.
To indicate to the system that all data following this statement is to be used as input, including statements that start with the characters //, until an input delimiter (/* or DLM) is found, specify:
//SYSTSIN DD DATA
To indicate to the system that all the input data can be found in data set PREFIX.INPUT.DATA, specify:
//SYSTSIN DD DSNAME=PREFIX.INPUT.DATA
SYSTSIN DD Statement The SYSTSIN and SYSTSPRT DD statements can refer to a sequential data set or a member of a partitioned data set. It is recommended that the SYSTSIN DD be defined as a fixed block format data set, with an LRECL of 80. If SYSTSIN is a fixed length data set (FB), the last 8 bytes of the record will be treated as a sequence number and ignored. If SYSTSIN is a fixed length data set with ASA control characters (FBA), the first byte of the record will be treated as a carriage control character and ignored. If SYSTSIN is a variable length data set (VB), the first 8 bytes of the record will be treated as a sequence number and ignored. If SYSTSIN is a variable length data set with ASA control characters (VBA), the first 9 bytes of the record will be treated as a sequence number, followed by a carriage control character and ignored. You cannot refer to concatenated data sets on the SYSTSIN DD statement. Each command or subcommand must begin on a separate statement. What is check pending and copy pending status in DB2, how do you resolve it? If the table is loaded with ENFORCE NO option then the table space get into check pending status. That means table space is loaded without enforcing constraints. CHECK utility needs to be run on table space. If table is loaded with LOG NO option then it get's into cpoy pending status. The meaning is image copy is needed on table space. Following utilities set the CHECK-pending status
• • •
LOAD with ENFORCE NO RECOVER to a point in time CHECK LOB
Check and correct referential integrity constraints using the CHECK DATA utility. In Copy pending status the table is available only for query processing. It means the load utility didn't perform constraint checking. an Image Copy on a table needs to be taken. you take an image copy or use REPAIR utility.1. then you can use REPAIR utility or execute following db2 command to bring the status of tablespace to RW Code: -START DATABASE(dbname) SPACE(tablespace-name) ACESS(FORCE) . In this status.... COPY PENDING A state in which. Take an image copy of the affected object.. You cannot update this table.not update If the tablespace is in Copy pending status and you dont want to take image copy . The solution of copy pending status is take an image copy or use repair utility. the table is available only for queries. you cannot edit a table. 2. Check pending status happens only when the table is loading with ENFORCE NO option.. If a table space is in both REORG-pending and CHECK-pending status (or auxiliary CHECK-pending status) run REORG first and then use CHECK DATA to clear the respective states. To remove the COPY PENDING status.. In copypend status. This command will reset all the pending states and change the status of the tablespace to RW . CHECK PENDING 6 . COPY-pending (COPY) restrictive status indicates that the affected object must be copied 3..only u can run queries on that table.
New with DB2 V8.. The Status RW (READ/WRITE) means that the database is ready to do database processing.Run the Dummy image copy job and the Tablespace status changes from copy pending to RW 2) Check Pending staus . Please rebind your program in the correct instance and make sure you give the correct DBRM library name so that your bind JCL picks up DBRM from there SQLCODE Overview • • • • If SQLCODE = 0.. a FETCH statement returned no data because the cursor was positioned after the last row of the result table. execution was successful. It means that the LOAD utility did not perform constraint checking. execution was successful with a warning. • 7 . If SQLCODE = 100.When a table is LOADed with ENFORCE NO option. The following option will overcome the problem. while in Check pending status. execution was not successful.Run the Check data for those tablespace and the Tablespace status changes from chkp to RW. -805 shows Bind problem. the contents of SQLCODE is set to +100 if the last row in the table has been returned with the set of rows. "no data" was found. For example. when DB2 processes a multiple row FETCH statement. you can edit or load table by giving ENFORCE NO option. then the table is left in CHECK PENDING status. 1) Copy Pending status . If SQLCODE < 0. If SQLCODE > 0.
Suggestion: If expecting data. Suggestion: Verify DCLGEN host variable definitions are current with DB2 catalog table/view attributes. OR TRANSITION TABLE FOR WHICH THE REQUESTED OPERATION IS NOT PERMITTED. SQLCODE . DELETE. from which no values can be fetched. OR THE RESULT OF A QUERY IS AN EMPTY TABLE. Suggestion: Correct SQL statement to provide only one value for each column in the table. SQL Return Code +304 A VALUE WITH DATA TYPE data-type1 CANNOT BE ASSIGNED TO A HOST VARIABLE BECAUSE THE VALUE IS NOT WITHIN THE RANGE OF THE HOST VARIABLE IN POSITION position-number WITH DATA TYPE data-type2. verify WHERE clause for accuracy and completeness. POSITION position-number. UPDATE OR DELETE. SQL Error Code -150 THE OBJECT OF THE INSERT.Unsuccessful SQL Execution SQL Error Code -117 THE NUMBER OF VALUES ASSIGNED IS NOT THE SAME AS THE NUMBER OF SPECIFIED OR IMPLIED COLUMNS. SQL Return Code +231 CURRENT POSITION OF CURSOR cursor-name IS NOT VALID FOR FETCH OF THE CURRENT ROW. SYSTEM-MAINTAINED MATERIALIZED QUERY TABLE.Successful SQL Execution SQL Return Code +100 ROW NOT FOUND FOR FETCH. Suggestion: Be certain to FETCH to position on a row after opening a cursor. SQL Return Code +802 EXCEPTION ERROR exception-type HAS OCCURRED DURING operation-type OPERATION ON data-type DATA. If cursor is declared SENSITIVE STATIC SCROLL. Suggestion: Be certain to specify base DB2 table/view names for INSERT statements. OR UPDATE STATEMENT IS A VIEW. SQL Return Code +117 THE NUMBER OF INSERT VALUES IS NOT THE SAME AS THE NUMBER OF OBJECT COLUMNS. the row may be a hole. 8 .SQLCODE . Suggestion: Check arithmetic operation for divide by zero or result to exceed size of host variable. Suggestion: Verify predicate in the SQL WHERE clause of the form "counter_col < constant" or "counter_col < :hostvar". SQL Return Code +347 THE RECURSIVE COMMON TABLE EXPRESSION name MAY CONTAIN AN INFINITE LOOP. Suggestion: Provide one value for each column in the table.
SQL Error Code -227 FETCH fetch-orientation IS NOT ALLOWED. AFTER. Suggestion: Use FOR UPDATE statement in your cursor. BECAUSE CURSOR cursor-name HAS AN UNKNOWN POSITION (sqlcode. Suggestion: Correct DB2 CREATOR or OBJECT NAMEs located in SQL statements. or ABSOLUTE) to establish valid position. Suggestion: Change the program to DELETE CHILD table row before DELETE of row on PARENT table. 9 . SQL Error Code -532 THE RELATIONSHIP constraint-name RESTRICTS THE DELETION OF ROW WITH RID X'rid-number'. TIME OR TIMESTAMP VALUE value IS INVALID. SQL Error Code -503 A COLUMN CANNOT BE UPDATED BECAUSE IT IS NOT IDENTIFIED IN THE UPDATE CLAUSE OF THE SELECT STATEMENT OF THE CURSOR.SQL Error Code -180 THE DATE. Suggestion: Ensure that INSERT row for DB2 PARENT table is completed before INSERT row in CHILD table. BEFORE. Suggestion: Correct logic in application program to OPEN the cursor before the FETCH or CLOSE statement. Suggestion: Add null indicator variable to SELECT statement in the format of "column:hostvarind". Suggestion: Correct logic in application program to CLOSE the CURSOR before the OPEN statement. SQL Error Code -204 name IS AN UNDEFINED NAME. SQL Error Code -305 THE NULL VALUE CANNOT BE ASSIGNED TO OUTPUT HOST VARIABLE NUMBER position-number BECAUSE NO INDICATOR VARIABLE IS SPECIFIED. LAST. Suggestion: Verify data format with the SQL Reference Guide. SQL Error Code -502 THE CURSOR IDENTIFIED IN AN OPEN STATEMENT IS ALREADY OPEN.sqlstate). SQL Error Code -501 THE CURSOR IDENTIFIED IN A FETCH OR CLOSE STATEMENT IS NOT OPEN. SQL Error Code -530 THE INSERT OR UPDATE VALUE OF FOREIGN KEY constraintname IS INVALID. Suggestion: Verify the data value is in the correct range and value type. For scrollable use (FIRST. Suggestion: CLOSE and re-OPEN the cursor. SQL Error Code -181 THE STRING REPRESENTATION OF A DATETIME VALUE IS NOT A VALID DATETIME VALUE.
SQL Error Code -818 THE PRECOMPILER-GENERATED TIMESTAMP x IN THE LOAD MODULE IS DIFFERENT FROM THE BIND TIMESTAMP y BUILT FROM THE DBRM z. Suggestion: Recompile and BIND the DB2 program. Consider adding additional COMMITs to program holding the DB2 resource. Suggestion: -811 is often detected after program check for DB2 data existence.consistency-token NOT FOUND IN PLAN plan-name.dbrmname. SQL Error Code -811 THE RESULT OF AN EMBEDDED SELECT STATEMENT OR A SUBSELECT IN THE SET CLAUSE OF AN UPDATE STATEMENT IS A TABLE OF MORE THAN ONE ROW. 10 .SQL Error Code -551 auth-id DOES NOT HAVE THE PRIVILEGE TO PERFORM OPERATION operation ON OBJECT object-name. Check DB2 Master Log for more details on the resource name – contact DBA. SQL Error Code -913 UNSUCCESSFUL EXECUTION CAUSED BY DEADLOCK OR TIMEOUT. Suggestion: -904 is usually caused because a database utility job has started the desired DB2 object in utility mode. AND RESOURCE NAME resource-name. Suggestion: Review DB2 Master Log to find process holding DB2 locks. Consider adding additional COMMITs to program holding the DB2 resource. OR THE RESULT OF A SUBQUERY OF A BASIC PREDICATE IS MORE THAN ONE VALUE. TYPE OF RESOURCE resourcetype. RID OF EXISTING ROW IS Xrid. SQL Error Code -911 THE CURRENT UNIT OF WORK HAS BEEN ROLLED BACK DUE TO DEADLOCK OR TIMEOUT. TYPE OF RESOURCE resource-type. if needed. Verify correct LOAD library is being used. Consider using new DB2 V8 FETCH FIRST ROW ONLY feature instead. TYPE OF RESOURCE resource-type. Suggestion: Verify DB2 INDEX and. REASON CODE reason-code. AND RESOURCE NAME resource-name. Suggestion: Ensure COLLECTION name is in DB2 PLAN. change the statement to an UPDATE. REASON reason-code. REASON reason.collection-id. SQL Error Code -904 UNSUCCESSFUL EXECUTION CAUSED BY AN UNAVAILABLE RESOURCE. Suggestion: Review DB2 Master Log to find process holding DB2 locks. SQL Error Code -805 DBRM OR PACKAGE NAME location-name. Suggestion: Contact the support DBA to GRANT the needed privilege. SQL Error Code -803 AN INSERTED OR UPDATED VALUE IS INVALID BECAUSE THE INDEX IN INDEX SPACE indexspace-name CONSTRAINS COLUMNS OF THE TABLE SO NO TWO ROWS CAN CONTAIN DUPLICATE VALUES IN THOSE COLUMNS. Recompile and BIND the DB2 program. REASON reason-code. Verify correct LOAD library is being used. AND RESOURCE NAME resource-name.
Contact DBA to check DB2 authorizations. Every JCL member must begin with a '"Job Card" that specifies the job name and other information about how the job will execute.SQL Error Code -922 AUTHORIZATION FAILURE: error-type ERROR. a space character indicates no continuation and a non-space character indicates the next statement will be a continuation of the current statement. Position 72 is reserved for continuation. The JCL specifies a jobname and can contain one or more steps. The records (or JCL statements) are written using positions 1-71. JCL functions are the interface between the programs and the operating system. REASON reason-code. Each step will execute a program or procedure (PROC). A JCL statement starts with two slashes in positions 1 to 2. Without the need for re-compiling. Comments statements may be added to the JCL using //* in positions 1 to 3. The Job Statement (or Job Card) 11 . the same program may be used to access different data sets and behave differently based on parameters specified in JCL JCL Statement Syntax A JCL source member consists of a file of 80-byte. fixed-length records. SQL Error Code -927 THE LANGUAGE INTERFACE (LI) WAS CALLED WHEN THE CONNECTING ENVIRONMENT WAS NOT ESTABLISHED.. Suggestion: Connection to DB2 has failed due authority for USER or PLAN. Introduction Job Control Language (or JCL) specifies how programs are executed on the mainframe. Since JCL has the ability to define data set names. parameters and system output devices the individual programs can be flexible in their use because these items are not hard coded in the programs. The JCL is completed by using '//' in positions 1 and 2 or when the last statement is processed. THE PROGRAM SHOULD BE INVOKED UNDER THE DSN COMMAND.
1...3.4.:.MSGCLASS=0.... // MSGLEVEL=(1..... The following is a sample JOB statement....:. in this example the job name will be SIMOJOB1.. If the job 12 . It ha a 20 characters maximum length. The cost center information varies from site to site and may be used to do charge-backs to individual departments for usage of the system....5.:.:. The job name is specified first..... a non-space in position 72 indicates a continuation.:...2. This must be the first statement in each job.. The job class is specified by using "CLASS=" key word.:.1). The key-word JOB is specified to indicate this is the JOB statement or Job Card... The job name should be in positions 3-n (for a maximum of eight characters) followed by a space. Since the JOB card is a JCL statement it must start with a '//' (two slashes) in positions 1-2..CLASS=A... It is optional but can very useful..:. The length of the text is 72 bytes..'comment'. This may be an accounting cost center..7... //SIMOJOB1 JOB (ACCTINFO)..... .NOTIFY=USERID Note: The preceding JOB statement is continued across two statements. Jobs will be scheduled and will run under control of a predefined class as determined by the job initiator.. Remember.Every JCL member (or JOB) you write will require a JOB statement (or JOB card) to identify the job.6.. This information is used to tell the system how the job is to be run. The (ACCTINFO) is accounting information and is a required... The 'comment' is an identifying or explanatory field.. The job class may determine the priority of the job and how long it will be allowed to run..
2 The system prints only JCL statements and JES2 and JES3 control statements. If you want to be notified when the job has finished then use the "NOTIFY=" key word. A Normal system printing and all output listings sent to the default system printer. 0 Hold output in the queue and allow job output to be viewed on-line through the TSO outlist facility. 1 The system prints all JCL statements.y) is used as follows. The following is an example of a JCL comment statement. A Comment Statement (Next) (Previous) (Table-of-Contents) A comment statement is defined by a "//*" in positions 1-3. x 0 The system prints only the JOB statement. and IEF653I messages which show the values assigned to symbolic parameters in procedure statements. The output classes are predefined and vary from site to site. The MSGLEVEL=(x. y 0 The system prints only JCL messages. The NOTIFY parameter must specify a valid userid. 1 The system prints JCL messages and any JES and operator messages. JES2. or JES3 control statements. the procedure statements. It prints JES and operator messages only if the job abnormally terminates.initiator is already running a job then the current job request may be placed in a job queue and have to wait until the initiator is free. Two are the normal defaults are as follows. 13 . The MSGCLASS=x is used to specify where the job output will be directed.
The "EXEC" keyword identifies the statement as a job step definition. a Data Set Name (or DSN) and a Disposition (or DISP) keyword.//* THIS IS A JCL COMMENT STATEMENT. The following is an example of a JCL statement that defines a step within a job and executes a program. The next parameter specifies the PROC (or procedure) to be executed. The EXEC Statement (or Defining a Job Step) (Next) (Previous) (Table-of-Contents) A job step defines the program to run and is created by using the EXEC statement.. 14 . //STEPID02 EXEC procname The preceding example defines the step name as STEPID02. Defining Data Sets (Next) (Previous) (Table-of-Contents) Defining the Data Sets used by a job step requires a Data Definition (or DD) statement. The program to be executed is IEFBR14. A simple DD statement requires a DDNAME.e. a nonspace in position 72 indicates a continuation. Remember. There may be one step or many steps within a job.. (i. The step name should be in positions 3-n (for a maximum of eight characters) followed by a space. EXECute ProGraM). //STEPID01 EXEC PGM=IEFBR14 The preceding example defines the step name as STEPID01. The "EXEC" keyword identifies the statement as a job step definition. The "PGM=" keyword and parameter specifies the program to be executed. Note: The text for the comment should not go past position 71.
name.DISP=(status..abnormal-termination-disp) In the preceding example the ddname in the JCL DD statement corresponds to the name used in the COBOL SELECT statement. SHR The dataset exists and other users and jobs can access the dataset. CATLG Places the entry in the system catalog or user catalog. NEW The dataset does not exist and will be created. //ddname DD DSN=data. The DSN= keyword and parameter specifies the fully-qualified MVS Data Set Name. normal-termination-disp Description DELETE Deletes the data set at the end of the step KEEP Keeps the data set.normal-terminationdisp. Description abnormal-termination-disp DELETE Indicates that the data set is to be deleted at the end of a job step. For a NEW data set this is the default.//* A Sample format for a DD statement .set. this is the default MOD The dataset should be kept and new records will be appended to the end of the dataset. The DISP= keyword and parameter specifies the disposition as follows. The dataset may or may not exist. CATLG catalog.. UNCATLG Deletes the entry from the system catalog or user catalog. Indicates that the system should place an entry in the system or user 15 . DISPostion status OLD Description The dataset exists and this job step has exclusive use of the dataset. KEEP Indicates that the data set is to be kept. If it does not exist then a data set will be created.
QSAM0080). The important items on the following is the DISP and DCB information. The following is an example of a DD statement followed by a COBOL SELECT statement with an ASSIGN clause.QSAM0080.DISP=(NEW. //* A sample JCL DD statement for an existing data set. with COBOL the name defined by the ASSIGN clause of the SELECT statement..CATLG. The DD Statement for a New Data Set (Next) (Previous) (Table-of-Contents) The following is an example and will vary at each mainframe location depending on the system hardware and software configuration.DATA.DISP=SHR The following is an example of a COBOL SELECT statement with an ASSIGN clause.DATA. 16 . The DDNAME should correspond to the name defined in the program.UNCATLG catalog.SQADB512. * A COBOL Select Statement... //QSAM0080 DD DSN=SIMOTIME. //SQADB512 DD DSN=SIMOTIME.. SELECT QSAM0080-FILE ASSIGN to QSAM0080 In the preceding example the COBOL program will read QSAM0080 and the DD statement will map to the file specified in the DSN parameter (SIMOTIME.DELETE).DATA. For example. Indicates that the system is to delete the entry in the system or user The DD Statement for an Existing Data Set (Next) (Previous) (Table-of-Contents) The DD name should be in positions 3-n (for a maximum of eight characters) followed by a space.
SPACE=(TRK.DISP=SHR // // DD DSN=SIMOTIME. Record Length. //QSAM0080 DD DSN=SIMOTIME. CATLG DELETE Create a new catalog entry. The following describes the DCB options.DISP=SHR The following is an example of a COBOL SELECT statement. DCB Description Record Format.DISP=SHR DD DSN=SIMOTIME. Block Size. If request abnormally terminates then delete the data set if it exist.LRECL=512. DCB=(RECFM=FB.5).// // // STORCLAS=MFI.DATA. in this example the record format is Fixed Block (FB).DSORG=PS) The following describes the DISP options.FILE0002. Data Set Organization.FILE0001. 17 .DATA.FILE0003.BLKSIZE=5120. DISPostion Description NEW Specifies a new data set. RECFM LRECL BLKSIZE DSORG Data Set Concatenation (Next) (Previous) (Table-of-Contents) It is possible to process more than one data set as a single data set by concatenating the DD statements.DATA.
The program's initial read will get the first record from FILE0001 and will not get an End-of-File condition until the last record of FILE0003 is processed.SELECT QSAM0080-FILE ASSIGN to QSAM0080 ORGANIZATION is SEQUENTIAL ACCESS MODE is SEQUENTIAL FILE STATUS is QSAM0080-STATUS. If MSGCLASS=0 then REPORT2 output will be directed to SYSOUT=0 which is usually placed in the JES Output Queue for a specified period of time (such as 3 days) before being purged.. if the ddname is SYSOUT (i. If MSGCLASS=0 then REPORT2 output will be directed to SYSOUT=0 which is usually placed in the JES Output Queue for a 18 . //SYSOUT .e. The REPORT2 output will be directed to the location specified in the MSGCLASS of the JOB statement. In the preceding example the COBOL program will read QSAM0080 and the DD statements will map the three files (FILE0001. Directing System Output (Next) (Previous) (Table-of-Contents) The DD statement with a SYSOUT parameter is used to assign an output class to an output data set. Since the ddname is SYSOUT the DISPLAY in a COBOL program will be directed to the location specified in the MSGCLASS of the JOB statement. FILE0002 and FILE0003) as one file..) and SYSOUT=* then the job class will be the same as that specified in the MSGCLASS in the job statement. The form of this parameter is: //REPORT1 DD SYSOUT=A //REPORT2 DD SYSOUT=* In the preceding example the REPORT1 output will be directed to SYSOUT=A which is usually the system printer.
//QSAM0080 DD DUMMY The following is the COBOL SELECT statement.specified period of time (such as 3 days) before being purged.' In the preceding example the text string "This is a test. //SYSOUT DD SYSOUT=* The following is a sample COBOL statement that uses DISPLAY DISPLAY 'This is a test. 19 . The DUMMY Data Set (Next) (Previous) (Table-of-Contents) The use a a DD statement with a DUMMY parameter will allow a program to run if a data set does not exist. The following is a sample JCL statement with SYSOUT as the DD name." will be routed to the JES output queue.. The following example show a DD DUMMY statement.... SELECT QSAM0080-FILE ASSIGN to QSAM0080 ORGANIZATION is SEQUENTIAL ACCESS MODE is SEQUENTIAL FILE STATUS is QSAM0080-STATUS.
. The following two section describe parameter-passing in more detail. The COBOL program requires an "ACCEPT parameter from SYSIN" to be coded in the COBOL program.The following shows the COBOL statements for the open.. The COBOL program requires a LINKAGE SECTION. the first READ will return an End-of-File return code and the close will be successful.. sequential file). Passing a Parameter to a Program (Next) (Previous) (Table-of-Contents) The two techniques use to pass information (a Parameter) from JCL to a program are as follows.e. via SYSIN This technique requires SYSIN statement followed by the parameter to be placed in the JCL... open input QSAM0080-FILE . Passing a Parameter via PARM= (Next) (Previous) (Table-of-Contents) 20 . close QSAM0080-FILE In the preceding example the OPEN will be successful. read QSAM0080-FILE. To avoid this it will be necessary to use a "//SYSIN DD DUMMY" statement in the JCL when a parameter is not being passed. Simply click on one of the following items to learn more or download a set of sample programs that describe how to pass a parameter string from JCL to a COBOL program. read and close of the QSAM0080 data set (i. Technique Description via PARM= This technique uses a PARM=parameter keyword on the EXEC statement in JCL. If the SYSIN statement is missing in the JCL the ACCEPT will ABEND with a "File not found" message.
Execute the COBOL program with a parameter. Execute the COBOL program without a parameter. 21 . //* ******************************************************************* //* Step 2 of 2. When technology complements business' Passing a Parameter via SYSIN (Next) (Previous) (Table-of-Contents) To pass a parameter from SYSIN to a program requires the use of DD statement for SYSIN. Execute the COBOL program without a parameter.To pass a parameter from JCL to a program requires the use of the "PARM=" keyword with the EXEC statement. // PARM='SimoTime. The parameter following the "PARM=" keyword requires the apostrophes if the text string contains space characters. //* ******************************************************************* //* Step 1 of 2. The following JCL statement shows an EXEC statement without a parameter defined. Notice the comma immediately after the program name. //* //CBLPARS2 EXEC PGM=CBLPARC1. The following JCL statement is required if no parameter is passed. //* //CBLPARS1 EXEC PGM=CBLPARC1 The following JCL statement shows an EXEC statement with a parameter defined by using the "PARM=" keyword. //* ******************************************************************* //* Step 1 of 2.
//* The following shows the COBOL statement required. ACCEPT variable-name FROM SYSIN JCL Procedures or PROC's (Next) (Previous) (Table-of-Contents) JCL defines how a job is executed on the mainframe. Instream Proc (Next) (Previous) (Table-of-Contents) 22 . There are two approaches to defining and using PROC's.. A job may perform many steps or execute many programs in order to produce the requested information or output.//* //SYSIN DD DUMMY The following JCL statements show what is required to pass information via SYSIN. //* ******************************************************************* //* Step 2 of 2. //* //SYSIN DD * Parameter from SYSIN. If a segment of JCL is used repeatedly it may be coded once as a PROC (or JCL Procedure) and then used by many different steps within the job.. Execute the COBOL program with a parameter.
The job step that calls the instream PROC will provide the name of the PDS to be created via the &DSNAME substitution value.CATLG).com * * * * * //* ******************************************************************* //* //* Subject: Define a PDS using the IEFBR14 with a DD Statement //* Author: SimoTime Enterprises //* Date: //* //* The JCL member executes the instream PROC called PDSCRTP3 and //* passes a fully qualified data set name (DSN) via the symbolic name //* called DSNAME and referenced in the PROC as &DSNAME.ACCOUNT.The following is an example of an instream PROC that is used three times when the JOB is executed. //PDSCRTJ4 JOB SIMOTIME.DSN=&DSNAME. //* //PDSCRTP3 PROC //PDSCRTS1 EXEC PGM=IEFBR14 //TEMPLIB1 DD DISP=(NEW. The Data Set Name (&DSNAME) //* is provided by the job step that calls the PROC.com e-mail: email@example.com.NOTIFY=CSIP1 //* ******************************************************************* //* //* //* //* //* //* This program is provided by: SimoTime Enterprises. LLC (C) Copyright 1987-2010 All Rights Reserved * Web Site URL: http://www.CLASS=1.MSGCLASS=0. January 1. // STORCLAS=MFI. //* //********************************************************************* //* The instream PROC for creating a PDS.1998 23 .
TEMP02 //* //* ******************************************************************* //* Step 3 of 3 Create a PDS using EXEC and DSNAME substitution //* //STEPJ43 EXEC PDSCRTP3.TEMP01 //STEPJ41 EXEC PDSCRTP3 //* //* ******************************************************************* //* Step 2 of 3 Create a PDS using EXEC and DSNAME substitution //* //STEPJ42 EXEC PDSCRTP3.DEMO.LRECL=80.HTM document.DSNAME=SIMOTIME.50)). JCL Substitution Parameters JCL substitution is mainly used when a repeatable process is used many times but needs the ability to behave differently based on variable information passed from the job that is excuting the process.DSORG=PO) PEND //* ******************************************************************* //* Step 1 of 3 Create a PDS using SET and EXEC //* // SET DSNAME=SIMOTIME.(45. DCB=(RECFM=FB.DSNAME=SIMOTIME.DEMO.// // // //* SPACE=(TRK.15.DEMO. Simply click on one of the following items to learn more or download sample JCL that describe how to use variable substitution within JCL. 24 .BLKSIZE=800.TEMP03 //* Additional information about the use of JCL and PROCs may be found in the JCLPRC01.
DISP=(MOD.DELETE).TESTFILE.DELETE).DELETE.DELETE.The SET Statement The SET statement lets you set the values of symbolic parameters within a JCL or PROC member. .. 20 //* 21 //* ******************************************************************* 22 //* 23 // JCLLIB ORDER=SIMOTIME. SUBSTITUTION .DISP=(MOD. JCL.INC Member..&HLQ02.DSN=SIMOTEST. The following from the JES output shows the statements and the substituted values. 25 hex-dump file.TEMP.JCLINC 24 // INCLUDE MEMBER=JCLINCI1 ##* ##* ******************************************************************* ##* ## ## SET Values from the JCLINCI1.TESTFILE. SET HLQ01=SIMOTEST SET HLQ02=TEMP 25 //* ******************************************************************* 26 //* Step 1 of 2 This job step will delete a previously created 27 //* 28 //* 29 //TAKEAWAY EXEC PGM=IEFBR14 30 //TESTFILE DD DSN=&HLQ01. INCLUDE and JCLLIB Statements This section provides examples of how to use INCLUDE and JCLLIB statements in JCL. Simply click on one of the following items to learn more or download sample JCL that describes the SET statement.PDS.
if program are located in a private library or a test library then use STEPLIB and/or JOBLIB to tell the system the location of the programs. The STEPLIB must be specified after the EXEC PGM statement of the job step. SPACE=(TRK.DEVL. A JOBLIB statement must be specified after the Job statement and before any job steps (or EXEC statements). For example. DCB=(RECFM=V. //SIMOJOB1 JOB (ACCTINFO). the JOBLIB statement applies to the whole job. If you specify both then the STEPLIB statement will override what is specified by the JOBLIB statement but only for the individual step.LOADLIB1. As the names imply the STEPLIB statement applies only to an individual job step. Specifying the Location of Programs If programs are not stored in the libraries predefined for the operating systems then it will be necessary to specify the location of the programs.MSGCLASS=C.5).NOTIFY=USERID //JOBLIB DD DSN=SIMOTIME.LRECL=80. STEPLIB and JOBLIB require a DD statement that defines the names of the Load Libraries that are searched to find and load the program.DISP=SHR //* //STEP0100 EXEC PGM=PROGRAM1 //* //STEP0200 EXEC PGM=PROGRAM2 //* 26 .31 // 32 // 33 // 34 //* STORCLAS=MFI.CLASS=A.DSORG=PS) Simply click on one of the following items to learn more or download a sample set of programs.
DEVL. THEN.DEVL.TEMPLIB1 that is specified in the STEPLIB statement that overrides the JOBLIB statement. PROGRAM2 of STEP0200 and PROGRAM4 of STEP0400 will run from the library SIMOTIME. 27 . THEN.//STEP0300 EXEC PGM=PROGRAM3 //STEPLIB DD DSN=SIMOTIME. the second JCL example has additional information displayed when there is a difference between the actual and expected return code.. Let us assume we are writing a cobol program to read EMPLOYEE table and get the details of employee with the name XXXXXXX. Both JCL examples accomplish the same task. Let us go in step wise.DEVL. Conditional JCL (Next) (Previous) (Table-of-Contents) This suite of programs provides an example of how mainframe JCL can do conditional processing.DISP=SHR //* //STEP0400 EXEC PGM=PROGRAM4 In the preceding example PROGRAM1 of STEP0100. ELSE and ENDIF statement construct. The first JCL example will focus on the approaches used by JES/2 using the "COND=" parameter on the JOB or EXEC statement. However. The use of the COND parameter can be very difficult to code and understand. COBOL DB2 PROGRAMMING Writing a COBOL DB2 Program. create the following table in db2 or assume it is there in db2 database. The second JCL example will focus on the IF. PROGRAM3 of STEP0300 will run from the library SIMOTIME. With JES/3 the conditional processing was improved to use "IF" statements.TEMPLIB1. I would recommend the use of the IF.LOADLIB1 that is specified in the JOBLIB statement. ELSE and ENDIF statement construct if you have a choice.
2) NOT NULL. DECIMAL(10..EMPLYEE EMPID 1000 1001 1002 EMPNAME XXXXXXX YYYYYYY ZZZZZZZ DEPARTMENT XX YY ZZ SALARY 10000 9000 20000 DESIGNATION SE SE MA STEP 1. < copybookname > STEP 2. PIC S9(8)V99 COMP-3. it will automatically creates this structure also along with table declaration specified in step1. For EMPLOYEE table. host variable declaration is look like as 01 EMPOYEE-RECORD.EMPLOYEE ( EMPID EMPNAME DEPARTMENT SALARY DESIGNATION END-EXEC. We need to declare the table structure in the WORKING-STORAGE SECTION or LINKAGE SECTION.A host variable is a data item declared in cobol it in embedded SQL. Use following sntax to include EXEC SQL INCLUDE END-EXEC. 05 HV-EMPID 05 HV-EMPNAME 05 HV-DEPARTMENT 05 HV-SALARY 05 HV-DESIGNATION PIC X(10). CHAR(30) NOT NULL. EXEC SQL DECLARE DSNXXX.. If you use db2 tool DCLGEN. CHAR(4) NOT NULL ) we can use DB2 tool called DCLGEN to generate this declaration for us and can include that copy book here. PIC X(2). if you create a copybook using DCLGEN. PIC X(30). PIC CHAR(4). follows. to use Declare host variables in WORKING-STORAGE SECTION. HOST VARIABLES . 28 . CHAR(10) NOT NULL. CHAR(2) NOT NULL.
29 . Hence we are displaying the HV-SALARY into the spool.STEP 3. When a SQL statement executes. sql ran sucessfully without any issues. ' .. SQLCA contains a declartion of fields like SQLCODE. What is SQLCA? ... SQLCA STEP 4.. EXEC SQL INCLUDE SQLCA END-EXEC.SQL communication area. based on the values in these variables we can know whether sql ran sucessfully or not. DISPLAY ' PROGRAM STARTED ... DB2 places a value in SQLCODE AND SQLSTATE host variables or any other fields of SQLCA.. IF SQLCODE = 0 DISPLAY ' SQL EXECUTED SUCESSFULLY ' DISPLAY ' EMPLOYEE SALARY IS ' ELSE DISPLAY ' SQL FAILED ' DIAPLY ' SQL CODE ' END-IF.....SQLSTATE and SQLERRD etc... Add a sql statement in procdure division to get the details of employee with the name XXXXXXX. EXEC SQL SELECT SALARY INTO :HV-SALARY FROM EMPLOYEE WHERE EMPNAME = 'XXXXXXX' END-EXEC. Include SQLCA as follows in WORKING-STORAGE SECTION... DISPLAY ' PROGRAM ENDED'.. SQLCODE HV-SALARY Here SQLCODE = 0 means.. .. ...
Following are the 4 steps to compile a COBOL-DB2 program 30 . program needs to be precompiled before doing actual compilation of that program. there is issue in executing the sql statement.If SQLCODE NOT = 0 . DB2 Precompile-Compilation-Bind Process INTRODUCTION Static SQL . Now we have compeleted coding a cobol-db2 program.COBOL PRE-compile process For COBOL-Static SQL program. our next step is to compile the program.
all of the SQL statements are extracted from the program source and placed into a member called the DataBase Request Module. or DBRM. Finally.STEP 1 . it adds working storage areas and source code compatible statements that are used to invoke DB2.DB2 PRECOMPILE Process The DB2 Precompile performs three functions. First. it checks the SQL in the program for errors. 31 . Second. One of the working storage areas contains a literal "timestamp" called a consistency token. which also contains the consistency token.
32 . The packages for all DB2 programs executed under a Tran ID or batch job step must be included in collection bound into this plan. The QUALIFIER parameter of the bind is used to direct the SQL to the specific set of DB2 objects (tables. is stored in the DB2 catalog as a Package. How can I retrieve only duplicates? You could use SORTXSUM dataset and XSUM option in SUM FIELDS. and a compiled version of the code is created. EXECUTING COBOL-DB2 PROGRAM When COBOL-DB2 Program executes. a -805 SQLCODE is returned. views. For online CICS programs. aliases or synonyms) qualified by this name. STEP 3 - LINK-EDIT The compiled code is link-edited along with statically called source language and DB2 run-time modules to create a Load Module. 1) In JCL sort card sum fields = none for eliminating duplicates. Imbedded in this module is the same consistency token that was generated in the precompile. the plan name must be specified. If an exact match is not found. STEP 4 DB2 BIND The bind process reads the DBRM that was created in the precompile and prepares an access path to the data. Every Package is bound into a Package List. or Collection. The name of the Collection is specified by the PACKAGE parameter. The code is checked for errors. the plan name is specified by Tran ID in the Resource Control Table (RCT). When the first SQL statement of each program is executed.STEP 2 - COMPILE The modified source from the precompile is then compiled. If multiple DB2 programs are statically linked together. For a batch program. This access path. DB2 searches the collections within the plan using the package name and consistency token from the load module. the plan name is specified in the SYSTSIN input DD. the resulting load module contains a consistency token for each one. A Collection is a group of Packages that are included in one or more Plans. along with the consistency token.
z from emp where x=y for fecth 1 row only.(200.50)) //SORTWK03 DD UNIT=WORK. 4) I have a sort requirement like 5 records.emp from emp1 where city="london".YYY.SPACE=(CYL.CCC. In that 4 are same and 1 is different. Using primary key in the where statement of the select would give only one row.50)) //SORTWK04 DD UNIT=WORK.DISP=SHR .SPACE=(CYL.DISP=SHR //SORTOUT DD DSN=AAA.(200.CCC1. 3) DISTINCT is used for eliminating duplicate rows in DB2.has duplicates alone //SORTWK01 DD UNIT=WORK.50)) //SORTWK02 DD UNIT=WORK.6. //SORT1 EXEC PGM=SORT //SORTIN DD DSN=XXX.50)) //SORTWK05 DD UNIT=WORK. How? Anyone have an idea about "EQUALS" in sort card? Using sum fields = none in sort.2. this serves the purpose.C'AB?).EQ.ZZZ. //SORTXSUM DD DSN=AAA.ch) alldups discard(nondups) /* dups--duplicate elements nondups--non duplicate elements 2) How will you make sure that your SELECT query retrieves only one row always? it will possible by the cursor exec sql declare x cursor select empname.it will possible by the icetool //toolin dd * select from(in) to(dups) on(1.SPACE=(CYL.(200.has distinct data?. Anyone have an idea about "EQUALS" in sort card? INCLUDE COND=(1.BBB.(200. would take only records with ?AB? in the first two positions in the input file.50)) 33 .DISP=SHR .SPACE=(CYL.(200. ex: declare cursor x for select y. How can retrieve all the duplicates (A sample query is highly appreciated)? select col1 from tbname where count(col1) > 1. I want to get only that 1 record.BBB.SPACE=(CYL.CH.
collection id.SYSPACKAGES for that program then you will get ?805. or if u r not certain abt the load module.CH. along with which plan u r using .//SYSOUT DD SYSOUT=* //SYSOUD DD SYSOUT=* //SYSIN DD * SORT FIELDS=(1. and the bind of the prog . -805 will occur when you run your program without binding it properly in to your test region.. And when you try to run this program you will hit by ?805. Some times it may happen that you compiled your program but there are still some SQL errors which compiler cant locate that time during binding it fails. The other common reason is that when you compile your program but forget to bind it.XSUM // 5) What would be your first approach after getting -805? One of my manual says: Bind the program 'program name' as the member part of the application plan 'plan name' or * Correct the collection id in the PKLIST and bind the application plan 'plan name' or * Set the current package set special register correctly or * Put the correct 'location name' in the CURRENTSERVER of the BIND command and bind the application plan 'plan name' or * Connect to the correct RDB name or * Correct the location id in the PKLIST and bind the application plan 'plan name' or * Bind the DBRM of the version of the application program to be executed well this error comes when there is mismatch b/w the Load of a prog. If you want to check the time stamp just go to your LOADLIB library and check for the time stamp.. so its better to check whether which load module u r using in ur job . Explaination : An attempt was made to execute the application program 'location name. then while execution it will fetch the old edition and due to time stamp mismatch you get ? 805. Now if this time stamp not matches with the timestamp in SYSIBM.consistency token' (this token can be 'location name.2. better do a compile bind again .A) SUM FIELDS=NONE.program 34 .program name.
Will it work or throw any error? for eighth when the program name in pds and the id if they are not same then i think it will give an error. ADD. Saved this particular program in a PDS as member name TEST. * Bind the program 'program name' as the member part of the application plan 'plan name' * Correct the collection id in the PKLIST and bind the application plan 'plan name' * Set the current package set special register correctly * Put the correct 'location name' in the CURRENTSERVER of the BIND command and bind the application plan 'plan name' * Connect to the correct RDB name * Correct the location id in the PKLIST and bind the application plan 'plan name' * Bind the DBRM of the version of the application program to be executed 6) How can I know my particular program is using particular "PLAN"? sysibm. ?PROGRAM-ID. the programmer can perform the following operations to correct the error. Resolution : Based on the above reasons.syplan would have the data. *The application was not connected to the proper location *The location id in the package list was not correct when the application 'plan name' was bound *The DBRM of the version of the application program being executed was not bound.name. 9) I am compiling a COBOL db2 program suddenly my Db2 brought down what will happen? 35 . 8)I have written program.consistency token' if the current package set special register is blank for the local program execution) that has not been found due to one or more or the following reasons: *The program 'program name' has not been bound as the member part of the application plan 'plan name' *The 'collection id' in the PKLIST was not correct when the application plan 'plan name' was bound *The current package set special register was not set correctly *The 'location name' in the CURRENTSERVER was not correct when the application plan 'plan name' was bound.
GOT .Regarding The above Question. G get I insert R get and replace D get and delete A get..thats it ...can't read a segment while it was holding or updating by another pgm. GOTP. During compilation it will not check DB2 system Catlogues(sysibm. but it should be Dclgen. your compilation job will be fine but your bind job fails 10) What is Z-OS? for tenth question Z/OS is the operating system which is an advanced one like MVS.while reading a segment contains invalid pointers (due to access in the middle updation) returns 'GG' status code without abend... U will get "DB2 CONNECTION INTERNAL ERROR" and the error number is "-924" During compilation process it will check whether all the columns in the sql statements are present in Dclgen or not. During Bind process it will check as per DB2 Tables for example : you can use a column in sql statement which does not exist in Db2 at all. GO . GON. return GG instead must be specified as GON.Can read the segment holding or updating by another pgm. IMS . At compilation time Db2 is not at all required. or GOP N do not abend on invalid pointer. it tries again and retrieves the segment only if the updation commits or backed out.syscolumns).. insert. GONH. or GONP 36 . GOT. and delete P required if the D command code is to be used O do not perform integrity checks for read only processing must be specified as GO.. replace. GON .In the same situation above. GONP.PROCOPT G .
37 . R. R Your program can read and replace segments.T same as N but automatically retries before returning GG must be specified as GOT. you can use five options of the PROCOPT parameter (in the DATABASE macro) to indicate to IMS™ whether your program can read segments in the hierarchy. I. IMS Version 9: Utilities Reference: System. D Your program can read and delete segments. or whether it can also update segments. From most restrictive to least restrictive. GOTH.No parentage established. these options are: G Your program can read segments. Related Reading: For a thorough description of the processing options see. and D. or GOTP E enable exclusive use by online program L load GS get in ascending sequence (hsam only) LS load in ascending sequence (hidam or hdam only) H use high speed sequential processing Can i ISSUE GNP call first with out using GN OR GU call before? No you can't. I Your program can insert segments. It is equivalent to specifying G. Preventing a Program from Updating Data: Processing Options During PCB generation. A Your program needs all the processing options. It returns staus code as "GP" .
If no updates are performed. When using block-level or database-level data sharing for online and batch programs. but dynamic logging of database updates will be done. For more information on database and block-level data sharing. the root lock is held at update level until commit. 38 . If an update processing option (R. For HISAM. IMS locks the database record for that application. in the case of HDAM. the lock is released when the application moves to another database record or. but may be able to access segments that are not in the E program's PCB. The following locking protocol allows IMS to make this determination. When exiting the database record. Specifying only the processing options the program requires ensures that the program cannot update any data it is not supposed to. it is locked at update level. D. the D option need not be specified. and the overflow logical records are treated as dependent segments. you can use additional processing options. D. While the E program is running. I. I. if a program does not need to delete segments from a database. the primary logical record is treated as the root. the root segment is demoted to read level. R. No dynamic enqueue by program isolation is done. If PROCOPT=G is specified. If a dependent segment is updated. and A. The following topics provide additional information: • • • • • E option GO option N option T option GOx and data integrity Related Reading: • • For a special case involving HISAM delete byte with parameter ERASE=YES see. other programs cannot access that data. IMS Version 9: Administration Guide: Database Manager. For example. your program has exclusive access to the hierarchy or to the segment you use it with. the lock manager provides feedback indicating whether or not another program has the lock at read level. no other program can concurrently access the same database record. The E option is used in conjunction with the options G. to another anchor point. This determines if dependent segments will be locked when they are accessed.Processing options provide data security because they limit what a program can do to the hierarchy or to a particular segment. When an application program retrieves a segment and has any of the just-described processing options. see IMS Version 9: Administration Guide: System. or A) is specified. When a program enters the database record and obtains the lock at either read or update level. E option With the E option. other programs with the option can concurrently access the database record. If the root segment is updated.
it is not allowed to update the database. For calls to Fast Path DEDBs. but only if the updating program has reached a commit point or has had its updates backed out since you last tried to retrieve the segment. A GG status code is returned. Your program can then terminate processing. and the segment you are retrieving contains an invalid pointer. GON. This means that the program need not wait for segments that other programs are accessing. GOT.GO option When your program retrieves a segment with the GO option. The N option must be specified as PROCOPT=GON. If a segment has been deleted and another segment of the same type has been inserted in the same location. option T does not cause DL/I to retry the operation. 39 . and that program terminates abnormally before reaching the next commit point. The T option must be specified as PROCOPT=GOT. continue processing by reading a different segment. Pointers are updated during insert. the updated segments might contain invalid pointers. A read-without-integrity program can also retrieve a segment even if another program is updating the segment. delete and backout functions. IMS does not lock the segment. or access the data using a different path. it remains available to other programs. If an invalid pointer is detected. T option When you use the T option with GO and the segment you are retrieving contains an invalid pointer. the segment data and all subsequent data that is returned to the application may be from a different database record. N option When you use the N option with GO to access a full-function database or a DEDB. No dynamic enqueue is done by program isolation for calls against this database. If the retry fails. updates to the same data occur simultaneously. IMS returns a GG status code to your program. For calls to full-function databases. the T option causes DL/I to automatically retry the operation. This is because your program can only read the data (termed read-only). unless the N or T options were specified with GO. You can retrieve the updated segment. a GG status code is returned to your program. If a read-without-integrity program reads data that is being updated by another program. or GOTP. or GONP. the readwithout-integrity program terminates abnormally. While the read without integrity program reads the segment. the response from an application program depends on whether the program is accessing a full-function or Fast Path database. Serialization between the program with PROCOPT=GO and any other update program does not occur.
You can re-position yourself with a GU. For more information on the GOx processing option for DEDBs. The T option forces a re-read from DASD. Answer Always remember that IMS calls are based on POSITION. 05 FILLER PIC X VALUE ')'. gn call for the product segment. The first thing I would do is to load your key for the prod segment into the prod-cat-cid. using PROCOPT=GOT in an online environment on a full-function database can cause performance degradation. 05 FILLER PIC X VALUE ')'. I would then issue a GU . 05 PROD-CAT-CID PIC X(5).only forwards. negating the advantage of very large buffer pools and VSAM hiperspace for all currently running applications and shared data.. Behind the scenes .not a GN. However. 05 FILLER PIC X(9) VALUE 'ORD ('. IMS looks at the CI 40 . You can NEVER go backwards . gnp call for order segment CALL 'CBLTDLI' USING DLI-GNP DB-PCB-MASK ORDR-DB-AREA ORDR-ID-SSA. IMS reads each prod segment until it satisfies the loaded key. PROCOPT=GOx offers some performance and parallelism benefits.GOx and data integrity For a very small set of applications and data. 01 ORDR-ID-SSA.with a GN . 05 ORDR-PID-VALUE PIC 9(5). With a GU. 01 PROD-ID-SSA. 05 FILLER PIC X(9) VALUE 'PRODUCT ('.. 05 FILLER PIC X(10) VALUE 'ORDPID ='. see IMS Version 9: Utilities Reference: System.even a qualified. CALL 'CBLTDLI' USING DLI-GN DB-PCB-MASK PROD-DB-AREA PROD-ID-SSA. it does not offer application data integrity. For example. 05 FILLER PIC X(10) VALUE 'PRODCAID ='.
FILLER PIC X VALUE ')'. (Just in case you wanted to know). You need to explain what you are looking for. If you don't get it. FILLER PIC X(10) VALUE 'PRODCAID ='. I hope you are checking for successful call when you issue the call for the prod.. 01 ORDR-ID-SSA.or children. 01 05 05 05 05 PROD-ID-SSA. 05 FILLER PIC X VALUE ')'. Once you have the parent. 05 FILLER PIC X(10) VALUE 'ORDPID ='. ---------------------------you will need to make this spaces unless you know the order number. you will need to retrieve the child . 05 FILLER PIC X(9) VALUE 'ORD ('. 05 ORDR-PID-VALUE PIC 9(5). you should have some sort of error routine for the result of your call depending on what the status code is . IMS Status Codes 41 ..anything other the spaces or GE (not found) will be very bad. PROD-CAT-CID PIC X(5). gnp call for order segment CALL 'CBLTDLI' USING DLI-GNP DB-PCB-MASK ORDR-DB-AREA ORDR-ID-SSA.. FILLER PIC X(9) VALUE 'PRODUCT ('.... gn call for the product segment.splits to determine where the key may be. Do you have a key for the order? How do you know which order you are looking for? You cannot issue a qualified call under the root unless you know. It cannot and must not be a qualified call unless you know. Remember that the reason this is a child segment is that there can be 1 to many. CALL 'CBLTDLI' USING DLI-GN DB-PCB-MASK PROD-DB-AREA PROD-ID-SSA.
The following status codes may be returned after processing an IMS call blank call completed successfully AA the alternate PCB contains a transaction code instead of a logical terminal as a destination AB segment I/O area is missing from call statement AC hierarchical error on insert or get call AD function argument is not coded correctly AF size of variable length record is invalid for GSAM get access AH invalid SSA encountered on insert call AI error opening database AJ SSA specified for the call is invalid AK field name specified for qualified SSA is incorrectly coded AL batch program has issued a ROLS. ROLB. or SETS call and either the system log does not reside on disk or dynamic backout is not specified 42 .
AM function specified is not compatible with one of segment sensitivity. or PCB processing AO a physical I/O error has occurred AP a CHKP function issued a transaction oriented BMP or a message call has more than 4 parameters AT I/O area specified is too small AU length for SSAs specified exceeds the maximum allowed AY logical terminal name found in a response alternate PCB has more than one physical terminal assigned AZ a PURG or ISRT was ignored in a conversational program A1 logical terminal name specified incorrectly in I/O area for a CHNG call A2 PCB specified incorrectly for a CHNG call A3 PCB specified incorrectly for an ISRT or PURG call A4 security violation A5 parameter list specified incorrectly on ISRT or PURG call 43 . program type.
A6 ISRT function message length exceeds allowable length A7 ISRT function number of messages added exceeds maximum allowed A8 ISRT function issued to a response alternate PCB must follow ISRT to I/O PCB and these statements are reversed A9 ISRT function message to response alternate PCB ignored because SAMETRM=YES BA call not completed because data is not available. IMS returned one or more command responses CD program does not have authority to execute a command listed in this CMD function CE IMS rescheduled a message as a result of a call with the function GU since the last CMD call 44 . operations by current call up to this error have been backed out BB call not completed because data is not available. operations since last commit point have been backed out CA CMD function command verb invalid CB CMD function command from an AOI program not allowed CC after command completed successfully.
message scheduled before IMS was started. and message retrieved by GU originated from an AOI user exit CM exception response occurred when executing a command issued via CMD call CN value in PSBIOAZ field is incorrect DA REPL or DLET attempted to change segment key field DJ get hold issued after REPL or DLET DX 45 . current command not ignored CI IMS rescheduled a message as a result of a call with the function GU since the last CMD call and message scheduled before IMS was started CJ IMS rescheduled a message as a result of a call with the function GU since the last CMD call and message retrieved by GU originated from an AOI user exit CK message scheduled before IMS was started and message retrieved by GU originated from an AOI user exit CL IMS rescheduled a message as a result of a call with the function GU since the last CMD call.CF message scheduled before IMS was started CG message retrieved by GU originated from an AOI user exit CH Automated Operator Interface (AOI) encountered a system error.
DLET violated delete rule for segment FA arithmetic overflow error FC call type and segment type are incompatible FD resource deadlock FE FLD function received non blank status code in FSA FF MSDB did not contain free space when ISRT was issued FG FLD function received non blank status code in FSA and program has used all of buffer pool FH DEDB was not accessible when database call was issued or commit point was reached FI I/O area address not accessible to program FM randomizer did not return a DMAC address FN field name of FSA undefined in DBD and FLD function issued FP invalid hex or packed field in I/O area FS buffer limit for region exceeded 46 .
FT number of SSAs exceeds limit of 15 for DEDB or 1 for MSDB FV verify operation failed at commit point FW program has used all of buffer pool GA call completed successfully but higher level crossed for GN or GNP call GB end of database reached on GN call GC attempted to cross unit-of-work boundary GD position in database lost GE segment not found GG processing with procopt of GON or GOT and concurrent update activity is occurring GK call completed successfully but different segment type on same level retrieved for GN or GNP call GL LOG request has an invalid log code GP GNP issued but parentage was not previously established II 47 .
attempt to insert a segment with a duplicate key IX insert rule violation LB attempt to load a segment that already exists LC attempt to load a segment out of sequence LD attempt to load a segment whose parent does not exist LE hierarchical sequence in DBD does not match that in the segment to be loaded MR terminal name invalid on ISRT message call NA one or more databases not available NE during index maintenance. a segment was not found NI unique secondary index but duplicate key encountered NO physical I/O error NU information only. REPL DLET or ISRT may return BA status code QC GU message request failed QD 48 .
GN requested but no more message segments exist QE GN not followed by GU message request QF length of message segment is less than 5 bytes QH terminal symbolic error encountered RA token does not match any on an outstanding SETS call RC ROLS call was rejected RX replace rule violation SA storage space for I/O area unavailable on SETS call SB attempted to set 10 levels (only 9 are allowed) SC SETS call was rejected TA CICS command level failed because PSB is not defined TC PSB in use by previous request TE unable to initialize the specified PSB TG 49 .
a checkpoint record was written to the utility control facility (UCF) dataset UR 50 .no PSB scheduled for program TH no PSB scheduled for program TI path to segment is invalid TJ DL/I is not active TL encountered conflict in scheduling intent TN invalid system DIB was found TO path replace error found TP PROCOPT invalid TQ I/O PCB access not allowed in a local DL/I call TR CICS XDLIPRE exit cancelled a request TY database is not open TZ segment length longer than 64k UC during batch processing.
a GE status code is returned and the existing position remains unchanged. The last SSA must be for a segment that is below the established parent level. If some SSAs between the parent and the requested segment in a GNP call are missing. A GNP with a qualified SSA describes to IMS the segment you want retrieved or the segment that is to become part of the hierarchic path to the segment you want retrieved. If it is not. Multiple unqualified SSAs establish the first occurrence of the specified segment type as part of the path you want. 51 . a GP status code is returned. an IPL is halted UX during batch processing both checkpoint and program halted VI during an insert or update length of variable length segment is too long GNP call A GNP with an unqualified SSA sequentially retrieves the dependent segment occurrences of the segment type you have specified under the established parent. they are generated internally as unqualified SSAs. A qualified GNP describes a unique segment only if it is qualified on a unique key field and not a data field or a non unique key field. A GNP with multiple SSAs defines the hierarchic path to the segment you want. If they cannot be satisfied using the current position. IPL is restarted under UCF US during batch processing. those SSAs must be satisfied by the current position at that level. This means that IMS includes the first occurrence of the segment from the missing SSAs as part of the hierarchic path to the segment you have requested.during batch processing. If you specify SSAs for segments at levels above the established parent level.
This action might not be possible to undo. Are you sure you want to continue?
We've moved you to where you read on your other device.
Get the full title to continue reading from where you left off, or restart the preview.