IDMS/SQL News 9.3

Vol 9.3       Technical Information for CA-IDMSâ Users                       Dec 2000


newyear.jpg (15011 bytes)

As you all know, IDMS/SQL News tried to support and promote the usage of SQL within IDMS for the last 9 years. Though we did have some success, by and large the IDMS Community did not resort to SQL usage. The main reason for this failure was the lack of positioning and support from the vendor. The product itself was good to start with, but very little happened in the last 5-8 years or so! IDMS Customers though proud of their existing systems, are beginning to wind up the product finally. This is not because they were unhappy with the applications or systems, but again   proper guidelines to go forward were missing! The fate of the product at many sites is not decided by the technical strength, but by industry and market factors. Though there had been spectacular failures in conversion from IDMS to other products on mainframe as well as UNIX databases, though there have been recent failures even in Web/Dot.com corner, though mainframe has made a tremendous comeback and is here to stay, the vendor and the product failed to capitalize on these stories.

IDMS/SQL News will continue to be published, but the frequency will be reduced to just 3 issues an year. Also we will devote less and less for IDMS and more for the new technologies!

0966 Error Code revisited

One can get 0966 error code typically in a local mode batch program when you try to ready the area in update mode and the area is already in update mode in CV.  0966 only means that area is not available to you.  The manual says :

0966 READY: The area specified is not available in the requested usage mode. If the 0966
status code is ignored, subsequent attempts to access the area will return an 01 or 09 minor code. Probable causes for the return of this status code are:

° If running in local mode, the area is locked against update.

° If running under the central version, either the area is offline to the central version, or an update
usage mode was requested and the area is in retrieval mode to the central version.

This means that you can get this error code even in CV.  If the area is not available in CV (either in RET or OFL) then one can get 0966 for CV jobs, ADS dialogs and OLQ.  We reproduce the error in OLQ as follows:

1. First  make the area offline

DCMT V SEGMENT EMPDEMO OFL
---------- Area ----------- Lock Lo-Page Hi-Page #Ret #Upd #Tret #Ntfy
EMPDEMO.EMP-DEMO-REGION Ofl 7400001 7400050 0 0 0 0
Stamp: 1996-09-19-10.06.47.707946 Pg grp: 0 Stat: 0 Pnd Lock:

EMPDEMO.INS-DEMO-REGION Ofl 7401001 7401025 0 0 0 0
Stamp: 1996-09-19-10.06.47.829352 Pg grp: 0 Stat: 0 Pnd Lock:

EMPDEMO.ORG-DEMO-REGION Ofl 7402001 7402025 0 0 0 0
Stamp: 1996-09-19-10.06.47.850026 Pg grp: 0 Stat: 0 Pnd Lock:

2.   OLQ SIGN SS EMPSS01 DBNAME EMPDEMO

OLQ 100021 00 Ready to retrieve data from subschema EMPSS01
OLQ 100022 00 Schema: EMPSCHM Version: 100
OLQ 100023 00 Database name: EMPDEMO
OLQ 100025 00 Dictionary name: TESTDICT

3. GET FIRST SEQ DEPARTMENT

OLQ 095001 08 CA-IDMS problem - database status = 0966
OLQ 095002 08 - Error record name =
OLQ 095003 08 - Error set name =
OLQ 095004 08 - Error area name = EMP-DEMO-REGION
OLQ 095035 08 Error in DML sequence = 00016



DCMT V SEGMENT EMPDEMO ONL  will make the area again available to you.


 1201  vs 1221 Error Code

The issue was simple.  A record was being updated with a STORE command.  The area in which the record resides has been READied in update mode.

But at run time the Batch COBOL gave an error  1201.
The same statement in ADS/OnLine gave error    1221.

Minor Code 01  means "An area has not been readied, or an IF operation has determined that the set is
not empty or that the current record of run unit is not a member of the set. "

Minor code 21 alongwith major code 12  means 
"Not all areas being updated have been readied in an update usage mode, or not all records, sets, and areas affected have been included in the subschema."

The problem came because there was a system-owned index  for the record which was in its own area. You need to READY the index area too in UPDATE Mode. This is very often overlooked by newcomers, because in the test EMPLOYEE database the indexes are normally stored in the data area itself and this problem is not encountered in the education and training.

But why did COBOL and ADS give two different minor codes?


CONNECT TO and Related SQL  Errors

1.   Wrong DBNAME

SELECT NAME FROM SYSTEM.SCHEMA
*+ Status = -6 SQLSTATE = 60002 Messages follow:
*+ DB002000 T163977 C1M6001: DB error in Module:IDMSDDAM at Offset:000016CE
*+ DB001031 T163977 C-6M6009: DB error 1492; Tbl: , Area:
*+ ErrSet: , ErrTbl: , ErrArea:

In this case, no dbname was 'CONNECTED' and the systen used defualt DBNAME which did not include an SQL Catalog.  IDMSDDAM tried to read the SQL Catalog and failed.


Commit - Implicit, Explicit and triggered

Effect of teleprocessing statements
FINISH TASK COMMIT RELEASE on all nonsuspended
SQL sessions and database transactions
Normal task termination ROLLBACK RELEASE on all nonsuspended
SQL sessions
Abnormal task termination ROLLBACK RELEASE on all SQL sessions

Effect of CA-ADS application termination: The termination of a CA-ADSapplication causes a ROLLBACK RELEASE to be issued on all SQL sessions.
Together they imply that you need to have an explicit COMMIT for SQL in ADS .

This is not so. During a normal task termination in ADS an implicit FINISH task is issued, which will result in a COMMIT Release as explained above.

COBOL

COBOL programs need explicit EXEC SQL COMMIT . In online DC-COBOL programs a FINISH TASK will trigger an SQL COMMIT.

SQL Course Material from CA (Page 12-28) implies that FINISH TASK will also work for batch.
This is not so in batch. FINISH TASK gave 1477. If we try to BIND TASK then it expects a subschema name which is not relevant for SQL.

Some tests were carried out using CV Batch Jobs:

If A002 does not issue SQL COMMIT, the transaction will be rolled back in IDMS:
Though job ends with CC=0. The same result even if access modules are combined into one.

FINISH TASK from a OSLQA002 pgm does commit SQL transaction.
Implicit or explicit finish from an ADS dialog will also commit the SQL in the called COBOL pgm.

ADS Process Source:

MOD                                                          
     PROCESS NAME IS PSQL023-RP1 VERSION IS 1                
         PUBLIC ACCESS IS ALLOWED FOR ALL                    
         MODULE SOURCE FOLLOWS                               
€                                                            
MOVE 2 TO WL-DEPTID.                                         
LINK  PROGRAM 'PSQLA002' USING (WS-LINK).                    
€                                                            
€ ROLLBACK TASK.                                             
€ THE ABOVE WILL ROLLBACK THE SQL OF THE CALLED COBOL PGM    
€ COMMIT  TASK.IS ALSO IMPLICIT COMMIT IS DONE ON DISPLAY    
€                                                            
DISPLAY TEXT 'LINK AND BACK FROM A NO FINISH COBOL PGM'.     
         MSEND                                               
         .
PSQLA002 COBOL source

*DMLIST                                                           
*DMLIST                                                           
 IDENTIFICATION DIVISION.                                         
                                                                  
 PROGRAM-ID. PSQLA002.                                            
 AUTHOR.     IDMSSQL                                         
                                                                  
*_______________________________________________________________  
*!                                                             !  
*!    : SQL test program                                       !  
*
*!_____________________________________________________________!  
******************************************************************
 ENVIRONMENT DIVISION.                                            
                                                                  
 CONFIGURATION SECTION.                                           
 SOURCE-COMPUTER. S/390.                                        
 OBJECT-COMPUTER. S/390.       
                                 
 IDMS-CONTROL SECTION.                                            
 PROTOCOL. MODE IS IDMS-DC.                                       
 DATA DIVISION.                                                         
 FILE SECTION.                                                     
 WORKING-STORAGE SECTION.                                         
 COPY IDMS SUBSCHEMA-CTRL.                                        
 EXEC SQL    BEGIN DECLARE SECTION        END-EXEC                
*    THE FOLLOWING IS REQUIRED ONLY IF SEPARATE SESSIONS 
*    ARE NEEDED IN THE CALLED PROGRAMS 
 01  IDMS-SESS-ID    USAGE SQLSESS.                              
 01  WS-DBNAME              PIC X(8).                            
 01  WS-DEPT.                                                    
     02 WS-DEPTID          PIC 9(4).                             
     02 WS-DEPTNAME        PIC X(45).                            
     02 WS-DEPTHEAD        PIC 9(4).                             
 EXEC SQL    END   DECLARE SECTION           END-EXEC.           
                                                                 
                                                                 
 01  ARBEIDSFELTER.                                              
     02  J1                           PIC S9(4) COMP.            
 01  WS-SQLDBUG.                                                 
     02  ERROR1                       PIC X(8) VALUE '*ERROR*'.  
     02  WS-SQLCODE                   PIC 9(8) VALUE 0.          
     02  WS-SQLSTATE                  PIC X(5) VALUE SPACE.      
     02  FILLER                       PIC X(50) VALUE SPACE.     
     02  WS-DBUG-END                  PIC X     VALUE SPACE.     
                                                                 
                                                                 
*****************************************************************
 LINKAGE       SECTION.                                          
 EXEC SQL    BEGIN DECLARE SECTION        END-EXEC               
 01  WS-LINK.                                                    
     02  WL-DEPTID                    PIC 9(4).                  
 EXEC SQL    END   DECLARE SECTION        END-EXEC.              
 PROCEDURE DIVISION USING  WS-LINK .                             
                                                                 
 A-MAIN SECTION.                                                 
****************                                                 
                                                                 
 A-START.                                                        
     MOVE 'SQLDICT1' TO WS-DBNAME.                                
     EXEC SQL                                                    
        CONNECT TO :WS-DBNAME                                    
     END-EXEC.                                                   
     IF SQLSTATE NOT = '00000'                                   
       MOVE  SQLSTATE    TO WS-SQLSTATE                          
       MOVE  SQLCODE     TO WS-SQLCODE                           
       WRITE LINE TERMINAL NOWAIT NEWPAGE
       FROM WS-SQLDBUG TO WS-DBUG-END                
      END-IF                                          
      EXEC SQL                                        
        UPDATE IDMSSQL.DEPT_V                         
        SET DEPTNAME='UPDATE PSQLA002'                
         WHERE DEPTID=:WL-DEPTID                      
      END-EXEC.                                       
 *    FINISH TASK                                     
 *    EXEC SQL                                        
 *      COMMIT RELEASE                                
 *    END-EXEC.                                       
      .                                               
  A-EXIT.                                             
      GOBACK.                                         
  COPY IDMS IDMS-STATUS.                              
  IDMS-ABORT  SECTION.                                
      EXIT.


CALC Key Length?

What is the maximum length of a CALC Key. Yes, it is given in the manual - 256 bytes. But can you prove it using the IDMS terminal alone. Here we go:

Create a table in OCF(ISQL) with a column with length of 257 bytes. Try creating CALC on that column.

CREATE TABLE IDMSSQL.CALC1
( C1 CHARACTER(257) ) ;
CREATE CALC ON CALC1(C1);
*+ Status = -4 SQLSTATE = 50002 Messages follow:
*+ DB002116 T179008 C-4M6004: Total sort column length too long

If you change the length to 256 it works.

CREATE TABLE IDMSSQL.CALC1
( C1 CHARACTER(256) ) ;
*+ Status = 0 SQLSTATE = 00000
CREATE CALC ON CALC1(C1);
*+ Status = 0 SQLSTATE = 00000

Since the CALC algorithm used is the same for SQL or non-SQL  the findings are valid for non-SQL databases as well.


Element name and Element Synonym

Note that one can display by ELEMENT name as well as ELEMENT SYNONYM. In simple cases these will be same. But if you are using record synonyms the results may be different!

ADD
ELEMENT NAME IS X1 VERSION IS 1
DATE CREATED IS 12/28/00
PREPARED BY X32567
PUBLIC ACCESS IS ALLOWED FOR ALL
PRIMARY
PICTURE IS 9
USAGE IS DISPLAY
ELEMENT LENGTH IS 1

ADD REC R1 REC NAME SYNONYM IS WS-R1 PREFIX WS-.
REC ELE X1.

DIS REC R1
*+ ADD
*+ RECORD NAME IS R1 VERSION IS 1
*+ DATE CREATED IS 12/28/00
*+ TIME LAST UPDATED IS 15241906
*+ PREPARED BY X32567
*+ RECORD LENGTH IS 1
*+ PUBLIC ACCESS IS ALLOWED FOR ALL
*+ RECORD NAME SYNONYM IS R1 VERSION 1
*+ RECORD NAME SYNONYM IS WS-R1 VERSION 1
*+ PREFIX IS WS-
*+ .
*+ RECORD ELEMENT IS X1 VERSION 1
*+ LINE IS 000100
*+ LEVEL NUMBER IS 02
*+ PICTURE IS 9
*+ USAGE IS DISPLAY
*+ ELEMENT LENGTH IS 1
*+ POSITION IS 1

DIS REC SYN R1
*+ MOD
*+ RECORD NAME IS R1 VERSION 1
*+ RECORD NAME SYNONYM IS R1 VERSION 1
*+ .
*+ 02 X1
*+ PICTURE IS 9
*+ USAGE IS DISPLAY
*+ ELEMENT LENGTH IS 1
*+ POSITION IS 1
DIS REC SYN WS-R1
*+ MOD
*+ RECORD NAME IS R1 VERSION 1
*+ RECORD NAME SYNONYM IS WS-R1 VERSION 1
*+ PREFIX IS WS-
*+ .
*+ 02 WS-X1
*+ PICTURE IS 9


*+ USAGE IS DISPLAY
*+ ELEMENT LENGTH IS 1
*+ POSITION IS 1
*+ .


DIS ELE SYN X1.
*+ MOD
*+ ELEMENT NAME IS X1 VERSION 1
*+ ELEMENT NAME SYNONYM IS X1
*+ WITHIN RECORD SYNONYM R1 VERSION 1
*+ .
DIS ELE SYN WS-X1
*+ MOD
*+ ELEMENT NAME IS X1 VERSION 1
*+ ELEMENT NAME SYNONYM IS WS-X1
*+ WITHIN RECORD SYNONYM WS-R1 VERSION 1
*+ .


What happens when a dialog load module is deleted while in use?

If you go to IDD and delete a dialog load module while someone is in psudo-converse with the same dialog, you get the following message (upon wakeup from pseduo-converse)

PREVIOUS TASK ABENDED WITH ABEND CODE D002 AND MESSAGE CODE 021007
IDMS DC021007 V15 T165460 8EB3EED6 TASK:ADS2; MODULE DLGA400 NOT FOUND ON DICTIONARY--DISABLED


BACKSCAN=YES - Beware !

Mapping Manuals says:

BACKSCAN YES/NO Indicates whether trailing blanks are to be eliminated from the field prior to display:

° YES specifies that the contents of the field are displayed without trailing blanks (if any). Old data may remain in the field after operator alterations if NEWPAGE is set to NO in either the ADS/OnLine sysgen statement or the DML statement that issues the mapout.

° NO (default) specifies that the contents of the field are displayed with trailing blanks (if any).

Impact?:

Well, normally everything works OK. There are some combination of field editing features which might end up in confusing results.

Here is a situation where the user has a numeric field, and the data old 
remains there though the process is moving zeros to the field.
                      Map Read/Write Options               Page  2 of  7    
Map name:  S657A100   Version:   1                                            
    Element name  BACKEND-NR                         Subscript                  
      In record     WM657A100-2                        Version      1             
Map Read      Transmit data entry (/) . . . . . . . . /                         
options       Zero when null (/). . . . . . . . . . . /                         
              Translate to upper case (/) . . . . . . _                         
              Justify data. . . . . . . . . . . . . . 2 1. Left  2. Right     
               Pad character format  . Display . . . . 0                         
                                       Hexadecimal . . F0                        
 
Map Write     Blank when zero (/) . . . . . . . . . . /     
options       Underscore blank fields (/) . . . . . . _                         
 
               Display without trailing blanks . . . . /                         
               Set modified data tag (/) . . . . . . . _                         
              Transmit. . . . . . 1 1. Data and attribute byte  3. Erase field
                                      2. Attribute byte only      4. Nothing    
DC366404 Select input/output edit options                                       
1.1        S657A100 v 1
Batch Decompile gives :
MFLD OLMPF-0437                      
DFLD BACKEND-NR OF WM657A100 VER      1         
        HELP SOURCE NONE 
         OPTIONAL                        
         REVERSE NUMERIC IS NO           
         EXTERNAL PICTURE IS 'Z(11)9' 
         ZEROED WHEN NULL  
         FOR INPUT                           
         JUSTIFY RIGHT                   
         PAD WITH X'F0'                  
         DATA YES                        
         UPPER NO                        
         FOR OUTPUT                          
         DATA YES                        
         BACKSCAN YES.                   
        SPACE 2                         
1.2       S657A100 Version 2
Here we get the correct BACKSCAN=NO

MFLD OLMPF-0437
    
DFLD BACKEND-NR                       
     OF WM657A100-2 VER      1          
         HELP SOURCE NONE                     
         OPTIONAL                          
         REVERSE NUMERIC IS NO             
        
EXTERNAL PICTURE IS 'Z(11)9'         
         ZEROED WHEN NULL                  
         BLANK WHEN ZERO
                  
     
FOR INPUT                              
         JUSTIFY RIGHT                     
         PAD NO                              
         DATA YES                          
         UPPER NO                          
      FOR OUTPUT                              
         DATA YES      
                    
           BACKSCAN  NO.                     
        


Attached Task and ADS Dialog

The following DC COBOL code will attach a task within IDMSDC.

MOVE  'D100'  TO WL-TASK-CODE.
ATTACH TASK CODE WL-TASK-CODE
PRIORITY 100 NOWAIT
ON ANY-ERROR-STATUS GO TO A-ERROR.

The invoked task can be anything including a mainline ADS/OnLine dialog, ADSA Task, COBOL or Assembler Program.

If it is an ADS Dialog the dialog must be defined as a task invoking ADSORUN1.

DCMT V DYN TASK D100 INV *.ADSORUN1 NOINP .

But sometimes you still don't get the attach working! In the log you may see a message like

DC171028 APPLICATION NOT EXECUTED. DIALOG LOAD MODULE D100 MISSING

If the automatic debugging of ADS Tools (ex DBMS Tools) are active, you may see another message

DC466014 V7 Abort occurred in dialog D100 process version 0000
DC082004 V7 T26488 TASK:D100 PROG:USGANIM; INVALID LINE I/O REQUEST PTERM **NONE**

But you execute the dialog from your terminal, it works! Where is the mystery?

The problem is that in order to get the ATTACH working, the attached dialog must be available in the DEFAULT dictionary, and not in the secondary dictionary. Attached tasks runs in the background as a non-terminal task and there is no way to start a background task from a secondary dictionary!  You can punch the dialog load module and linkedit it into the load library. This is a wayout for dialogs lying in seondary dictionary.


Java World

What Is a Servlet?

In generic terms, a servlet is any class that can be invoked and executed on a server, most likely on behalf of a client. Unlike applets, which do their work on the client, servlets do their work on the server and are often used to replace Common Gateway Interface (CGI) or other server-side programming models. Another way of phrasing what servlets do is "server-side Java." Since servlets are written in Java and are part of the J2EE specification, they have access to all the functionality and cross-platform portability of the Java programming language.

HTTP servlet?

An HTTP servlet is a Java class that handles an HTTP request and delivers an HTTP response. HTTP servlets live in an HTTP server and must extend the javax.servlet.http.HttpServlet class, so that they can run in a generic servlet engine framework.

What is JSP?

JavaServer Pages (JSP) is a JavaSoft specification for combining Java with HTML to provide dynamic content in web pages. JSPs are more convenient to write than HTTP Servlets because they allow you to embed Java code directly into your HTML pages, in contrast with HTTP servlets where you embed HTML inside of Java code. JSP is part of the Java Two Enterprise Edition (J2EE).

JSP allows you to separate the dynamic content of a Web page from its presentation. It caters to two different types of developers: HTML developers, who are responsible for the graphical design of the page, and Java developers, who handle the development of software to create the dynamic content. Although similar to WebLogic JHTML, a proprietary WebLogic API, JSP facilitates development of dynamic Web pages through the use of higher level control tags and JavaBeans.


Small Thing matters!: Arianne-5 and Ada Compiler- Revisited

On 4 June 1996, the maiden flight of the Ariane 5 launcher ended in a failure. Only about 40 seconds after initiation of the flight sequence, at an altitude of about 3700 m, the launcher veered off its flight path, broke up and exploded. IDMS/SQL News 5.3 (Aug 96) had carried the news about Arianne-5 rocket failure. We had commented that it was due to software error which sent wrong signals to the rocket such that it took wrong course. Here we take second look at this disaster.

COMMENTS ON THE FAILURE SCENARIO

In the failure scenario, the primary technical causes are the Operand Error when converting the horizontal bias variable BH, and the lack of protection of this conversion which caused the SRI computer to stop.

It has been stated to the Board that not all the conversions were protected because a maximum workload target of 80% had been set for the SRI computer. To determine the vulnerability of unprotected code, an analysis was performed on every operation which could give rise to an exception, including an Operand Error. In particular, the conversion of floating point values to integers was analysed and operations involving seven variables were at risk of leading to an Operand Error. This led to protection being added to four of the variables, evidence of which appears in the Ada code. However, three of the variables were left unprotected. No reference to justification of this decision was found directly in the source code. Given the large amount of documentation associated with any industrial application, the assumption, although agreed, was essentially obscured, though not deliberately, from any external review.

  • The internal SRI software exception was caused during execution of a data conversion from 64-bit floating point to 16-bit signed integer value. The floating point number which was converted had a value greater than what could be represented by a 16-bit signed integer. This resulted in an Operand Error. The data conversion instructions (in Ada code) were not protected from causing an Operand Error, although other conversions of comparable variables in the same place in the code were protected.
  • The error occurred in a part of the software that only performs alignment of the strap-down inertial platform. This software module computes meaningful results only before lift-off. As soon as the launcher lifts off, this function serves no purpose.

More of this at http://www.esa.int/htdocs/tidc/Press/Press96/ariane5rep.html

Re-usable Component Error?

Today everyone is talking about re-usable component architecture. One example is the Javabeans in the Java world. But it will be interesrting to note that Arianne-5 disaster was caused by a reusable component error!

It is a reuse error. The SRI horizontal bias module was reused from a 10-year-old software, the software from Ariane 4.

But this is not the full story:

It turns out that an integer overflow raised an (Ada) exception which halted the machine (which was the specified behaviour).  In addition, the differences in object code between the tested and operational systems raise the issue of errors in the object code for the operational system. Such errors are most likely to occur due to an error in the compilation environment, although it is possible that other factors, such as human error (e.g. specifying the wrong version of a file when the code is recompiled) can be involved. For example, there are documented cases where Ada compilers generate the correct code when exceptions are not suppressed, but generate incorrect code (beyond the language's definition of "erroneous") when they are suppressed.

Today Java is introducing re-usable code in the form of JavaBeans. But read this:

It is regrettable that this lesson has not been heeded by such recent designs of Java (which added insult to injury by removing the modest assert instruction of C!), IDL (the Interface Definition Language of CORBA, which is intended to foster large-scale reuse across networks, but fails to provide any semantic specification mechanism), Ada 95 and ActiveX.

For reuse to be effective, Design by Contract is a requirement. Without a precise specification attached to each reusable component -- precondition, postcondition, invariant -- no one can trust a supposedly reusable component.

Just One more! What Units are you talking about?

On July 23, 1983 Flight 143 from Montreal to Ottawa, and on to Edmonton which was using one of the newest Boeing 767, ran out of fuel  in mid-air and glided and crash-landed on an unused air-strip at Gimli, Manitoba near Winnipeg. The problem arose because of the miscalculation of the needed fuel, an error caused by mixing metric and imperial units (kg vs pounds). Luckily the pilot was an gliding expert who managed to save all on board and the plane. As an added coincidence the Air Canada mechanics driving a van to Gimli to begin repairs ran out of gas in the backroads of Manitoba!


IDMS/SQL is published on behalf of IDMS WatchDog Group, Helsinki-Hørsholm-Oslo for free circulation among IDMS Users Worldwide. IDMS/SQL News is not a CA publication. CA-IDMS/DB, CA-IDMS/DC and CA-ADS are registered trademarks of Computer Associates International Inc. CICS, IMS-DB/DC and DB2 are registered trademarks of IBM Corporation. Technical examples are only guidelines and modification might be required in certain situations and operating systems. Opinion expressed are those of the authors and do not represent the views of IDMS clients or related vendors. © Permission is hereby granted to use or reproduce the information, only to IDMS Customers and Consultants, provided the material is distributed free of charge.


Comments to idmssql@oocities.com This page hosted by Get your own Free Home Page