IDMS/SQL News 10.1

Vol 10.1   Technical Information for Mainframe and IDMSâ Users    April 2001


IDMS and IDMS/SQL : The future?

IDMS/SQL is flooded with questions from users about the future of IDMS, comparison between IDMS and DB2, benchmarks figures on IDMS (now?) , IDMS/SQL as a relational database and the conversion successes, failures and suggestions around IDMS. Similar issues surfaced recently many times in IDMS-L newsgroup too. We think all these are meaningless and is coming at a time which is too late!

Enough has been said already! Let's start with SQL. The SQL implementation of IDMS when it was given in 1992 was NOT inferior to the then status of DB2 (which was 4.3 on a release level, though many were still on earlier versions). But this did not have any impact on the product's usage. You may wonder : how can it be true? how can a product born in 1992 be superior to a product which was almosta decade old by then? The reason is simple. Though IDMS release 12.0 came out in 1992, the SQL option within Release 12.0 was already in shape in 1988. This was the SQL implementation from the VAX Database product from Cullinet, which again was based on Esvel prototype. Both Esvel and DB2 are based on IBM's original System-R research!

Inertia of the client base and the lack of positioning from the vendor hurt IDMS's usage of SQL. IDMS's own network (CODAYL) veterans always compared performance figures at minute level and de-recommended the SQL usage! This was pathetic. Because the same clients who sidelined SQL within IDMS ended up converting to eother DB2 or one of the Unix databases. SQL implementation of neither of these were superior to IDMS. They all carred the same + and - of IDMS/SQL! Peformance concerns of the 'veteran' programmers impacted only on the decision making of IDMS vs IDMS/SQL, but not when the management at the same clients chose a 'new' relational database which indeed was nowhere near the performance figures of IDMS!

Benchmarks doesn't help! Benchmarks are required for (and used by) only new products which have to prove in the market. IDMS being a 20 old product doesn't fall into this category. Technically all benchmarks including the one certified by the TPC (Transaction Processing Council) are cooked up and have nothing to do with the reality. IDMS/SQL knows vendors who have used special tapes which does not do locking and journalling to fool the benchmark figures. In the case of IDMS vs the 'xyz' database, the comparison always hurts IDMS; if IDMS loses the benchmark it is bad. if it wins, then that it becomes a 'non-issue' and the new vendor always find a new excuse to convert! TPC itself is an organization of vendors!

Today it is possible to do Web Access against IDMS. A variety of tools support it (Vegasoft, Inner Access to name a few). A properly written Web application against IDMS can support many more concurrent suers than any Unix databases in the market today! But users are not moved.

An application written using interpreted Java code (or half-compiled Java code) and a third rate Unix database can never support OLTP. Repeated disasters have appeared in the press even after Year 2000. The most recent collapse of dot.com companies whose sole investement had been 'young' (and often imported) programmers and all the code in the world using the buzzwords should be a lesson for the corporate customers.

 

OLQ and CALC Key on multiple elements

If the CALC key is a group item, specify all subordinate fields in ck-value separated by commas. For alphanumeric values, this might be a little confusing.

Let's take an example where the record TRANS has a calc key based on two fields f1 and f2.
For example for F1=AB25 and F2=544, if we use :

GET TRANS WHE CALC='AB25,544'

we get an error!

OLQ 093032 08 The compound value given does not specify the same # of values as in the group.

HELP MESSAGE 093032

The WHERE clause contains a group field with associated subordinate values. The number of values specified exceeds the number of values defined for that group in the current subschema view.

The correct format is to give as follows:
GET TRANS WHE CALC='AB25','544'


OLQ vs DMLO

Recently a question came up in IDMS-L about the pros and cons of OLQ vs DMLO. Here are some responses from our experienced IDMS Users:

David Lorenzen:The best advantage for OLQ is that developers cannot update the
database. We use both products for developers in a test environment. However,
only the DBA staff have DMLO authority in production.

Bob Ratcliffe: OLQ - can be run in batch , is read only .
DMLO - includes use of Clists , macros , user profiles .

Curt Wilson:
We run OLQ against production all the time. No worries about locking out any users. OLQ also allows sorting and some basic sub-totaling. We also use it for ad-hocs if they are simple enough.
A nice time saver in OLQ is that you can save report definitions and re-run them later
We have one specific user ID for production DMLO. That ID is restricted from logging in during peak production hours and can't be used to access the application. We also prevent the use of Clists, macros and profiles in production.

Richard ALice:
OLQ allows query only from both the word driven version and
the menu driven version. It has it's own, unique syntax.
DMLO allows update and uses standard COBOL DML syntax

Jim Ritterbusch
In addition to the previous comments, OLQ can be used as a report writer, either
on-line or batch. It has a menu mode to simplify construction of reports. OLQ
also supports (at least some) SQL syntax, regardless of the installation or not
of the SQL option.

Jim Moore gave the 'verdict' (which we agree with): DMLO is "conversational". That is, DMLO can hold locks for long periods of time. [Think of a TSO/ISPF user sitting in an hour's long ISPF edit session on a piece of JCL---> This is conversational. The edit user holds the equivalent of a DISP=OLD enqueue on the data being edited.]
Now, think of a DMLO user, in shared update, retrieving a highly accessed OOAK record in a production database. Locks that should be released won't be, as the DMLO user peruses the record in "human" time. Imagine what might happen if a DMLO user left for lunch in this situation.

OLQ, being read-only, is preferred for simple reporting.

Jim Ritterbusch echoes these sentiments: It is up to us to ensure that the tools which have such power are used in a way that respects that power.
1) When signing on to DMLO, use the 'R' option to ready the areas in Retrieval mode instead of Update mode. Encourage all of the Development staff who have access in the Development region to do the same.
2) Set the DMLO task resource interval in SYSGEN to some value much shorter than a lunch hour.

Jim Phillips: The latter point makes DML/O useful for debugging since you can key the exact content of the program in and look for return codes, or odd currencies, for which the application doesn't allow. OLQ is too "clever" for
that. Since DML/O holds locks it can also be useful for reproducing locking problems or demonstrating them to a class. If there's no new licensing cost why not provide both in development ?

Douglas Woods-Ledet: Apples and Oranges,
DMLO is for manually making changes to the database, primarily to setup unit test conditions and by DBAs to correct some of our most embrassing programming mistakes.
OLQ can be used for "canned" reporting, quickly viewing large amounts of data in lists, etc.

IDMS/SQL Comments:

OLQ is read only. DMLO can update. That's a big difference. DMLO uses a syntax closer to what we use in embedded programming. OLQ has a menu mode as well as Command Mode. Both are useful. In fact, experienced programmers can switch from Command Mode to Menu Mode with PF9 and do some operations easier in menu mode (edit, pic changes, header changes etc).

OLQ has a very good help menu. HELP OLQ will give you a list of commands. Help REC will give you a list of records available in the subschema you are signed on to. Even better and easier is the record format display you get by giving something like 'help rec employee'. COBOL like easy to read record display.

In the most unlikely event of someone storing a record with a huge element (say PIC X(5000)) , OLQ cannot display this. Record buffers will be usually only 4K. Besides X(5000) is undisplayable on any line or screen. If you try to use SUBSTRING BIF that too will fail on such an element. Here DML will split the element and display all line by line. This is a very extreme case and one can barely call such a record, a database record!

Though many sites (as well as the vendor who wants to sell DMLO too) have sidelined OLQ in favour of DMLO, in reality, OLQ can do many things which DMLO cannot!

OLQ supports SQL - both 10.2 SQL emulation as well as pure SQL against relational tables and network databases (SET ACCESS IDMS). One can use QFILES to make ready made reports. On top of everything QFILES can take parameters as input (keys can be given as parameters). Parameters are also supported in QFILES in IDMS (SQL) Mode [OLQ Manual is flatly wrong here when it states that IDMS Mode does not support parameters in QFILEs].

OLQ supports all built-in functions (except REPLACE) available in ADS. These functions can be used in COMPUTE statements or in 10.2 SELECT statements. ADS BIFS cannot be used in IDMS/SQL SELECTs, but can be used on the result columns later using COMPUTE.

OLQ supports OLQBATCH (CV as well as Local Mode). OLQ used in this way (either with QFILes or run with commands in batch) is a very good report writer . Though there are no branching commands several useful reports can be made with OLQ even in production environments.

OLQ can also save the reports which can be recalled later. There is a retention period after which the reports will be deleted (they are kept in QUEUE).

OLQ results (reports) can be saved as SQL Tables rightaway. This way you get the table definitions 'free'. Later these definitions can be displayed and even enhanced in OCF. The tables can be updated via SQL in OCF or using ADS/COBOL programs.

DMLO is much heavier than OLQ. In a heavy system one can see messages like:

DCMT D ACT TASK gives

00189095 DMLO USDTPIF2 L0027 175 WAIT 0283 0E78A608 PTERECB

Later in the log one see messages like:

DC001003 V15 T188363 TASK:DMLO PROG:USDTPIF2 STALLED WAITING FOR PTERM P0042

Last, but not least, OLQ can be linked from ADS/COBOL programs. OLQ is a grossly under-estimated and under-utilized product. Having seen many query tools in other databases and wonderful Windows based query systems, IDMS/SQL still rates OLQ as one of the superior and integrated product. IDMS/SQL tried to see the help facility on the query tool of three well known Unix Databases and all of them were inferior to the help we get from OLQ on the database source!

An OLQ Sample Session
HELP REC DEPARTMENT 

DEPARTMENT PAGE 1.1 LINE 1 
(LEVEL) (FIELD NAME) (USAGE) (PICTURE) 

02 DEPT-ID-0410       DISPLAY 9(4) 
02 DEPT-NAME-0410     DISPLAY X(45) 
02 DEPT-HEAD-ID-0410  DISPLAY 9(4) 
 

A simple SELECT * FROM DEPARTMENT will give:

DEPT-ID-0410 DEPT-NAME-0410         DEPT-HEAD-ID-0410

5300         BLUE SKIES             321
5100         BRAINSTORMING          15
2000         ACCOUNTING AND PAYROLL 11

By switching to menu mode using MENU PIC we get

CA-OLQ *** Report Format - Picture *
-> 137000 Specify pictures and press  the ENTER key. 

Disp Select Options or Alter Seq Å , 0 Picture 
DEPARTMENT 
X DEPT-ID-0410               1 _ _ _   9999 
X DEPT-NAME-0410             2 _ _ _   X(45) 
X DEPT-HEAD-ID-0410          3 _ _ _   9999 

Change the pic to x(20) on dept-name and switch to header

CA-OLQ *** Report Format - Picture 
-> header Page 1 of 
137000 Specify pictures and press the ENTER key. 

Disp Select Options or Alter Seq Å , 0 Picture 
DEPARTMENT 
X DEPT-ID-0410                1 _ _ _ 9999 
X DEPT-NAME-0410              2 - - - X(25) <----
X DEPT-HEAD-ID-0410           3 _ _ _ 9999 

And change the headers

134000 Specify column headers and press the ENTER key. 

Underline character: - Disp Seq Header 
DEPARTMENT 
X DEPT-ID-0410              1 DEPTID
X DEPT-NAME-0410            2 DEPTNAME 
X DEPT-HEAD-ID-0410         3 DEPTHEAD 

Now the display is more readble

DEPARTMENT REPORT 01/24/01 

DEPTID DEPTNAME                DEPTHEAD 
------ ----------------------- --------  
5300   BLUE SKIES              0321 
5100   BRAINSTORMING           0015 
2000   ACCOUNTING AND PAYROLL  0011 
1000   PERSONNEL               0013 

One can create an SQL Table out of this readily.
Change the access Mode to SQL

SET ACCESS IDMS

OLQ 092032 00 Processing mode changed to IDMS.

SEND TABLE IDMSSQL.DEPIUA

OLQ 102020 00 The APPENDing, REPLACing or CREATing of an SQL table has been successful.

OLQ 102021 00 A total of 10 rows have been inserted into the named SQLtable.

You can see the table in OCF-
OCF 14.1 ONLINE IDMS PAGE 1 LINE 1 DICT=TESTDICT
SELECT * FROM IDMSSQL.DEPIUA
*+
*+ DEPTID DEPTNAME DEPTHEAD
*+ ------ -------- --------
*+ 5300 BLUE SKIES 321
*+ 5100 BRAINSTORMING 15
*+ 2000 ACCOUNTING AND PAYROLL 11
*+ 1000 PERSONNEL 13
*+ 3100 INTERNAL SOFTWARE 3
*+ 3200 COMPUTER OPERATIONS 4
*+ 4000 PUBLIC RELATIONS 7
*+ 100 EXECUTIVE ADMINISTRATION 30
*+ 5200 THERMOREGULATION 349
*+

*+ 10 rows processed
You can also view the definition of the table from the SQL Catalog.
DIS TABLE IDMSSQL.DEPIUA AS SYN
+ Status = 0 SQLSTATE = 00000
CREATE TABLE IDMSSQL.DEPIUA
*+ DEFINITION TIMESTAMP 2001-01-24-16.12.48.852307
*+ DATE CREATED 2001-01-24-16.12.48.852307 BY SQLNEWS1
*+ DATE LAST UPDATED 2001-01-24-16.12.48.852307 BY SQLNEWS1
( DEPTID UNSIGNED NUMERIC(4) NOT NULL,
DEPTNAME CHARACTER(45) NOT NULL,
DEPTHEAD UNSIGNED NUMERIC(4) NOT NULL
) IN SQLDB.TESTAREA1
ESTIMATED ROWS 10
*+ DEFAULT INDEX ON DBKEY
;

 

BOM Processing -Possible only in OLQ Command Mode

Here we look at the source of a QFILE called BOMEX02. The first line is a parameter default.

&P1=0471
SIGNON SS EMPSS01 SCHEMA EMPSCHM ( 100)
OPTIONS ALL HEADER ECHO NOFILLER FULL WHOLE INTERRUPT NOOLQHEADER
-NOPATHSTAT NOSTAT COMMENT VERBOSE NODBKEY NOPICTURE NOCODETAB NOSYN
DEFINE PATH
FIELDS FOR EMPLOYEE ARE NONE
FIELDS FOR EMPLOYEE ARE ALSO EMP-ID-0415
FIELDS FOR EMPLOYEE ARE ALSO EMP-LAST-NAME-0415
GET FIRST EMPLOYEE WHERE CALC=&P1
FIND ALL STRUCTURE IN MANAGES
GET OWNER EMPLOYEE IN REPORTS-TO
END PATH
EXEC PATH
PAGE HEADER -
LINE 1 ' MANAGER EMPLOYEE REPORT'
PAGE FOOTER
DISPLAY SPREAD EVEN COLUMNS = EMPLOYEE(1).EMP-ID-0415
-EMPLOYEE(1).EMP-LAST-NAME-0415 -
EMPLOYEE(2).EMP-ID-0415 -
EMPLOYEE(2).EMP-LAST-NAME-0415
END OF REPORT

Let's execute this by simply giving BOMEX02 or BOMEX02 471 in OLQ


BOMEX02

SIGNON SS EMPSS01 SCHEMA EMPSCHM ( 100)
OLQ 100021 00 Ready to retrieve data from subschema EMPSS01
OLQ 100022 00 Schema: EMPSCHM Version: 100
OLQ 100025 00 Dictionary name: TSTDICT
EXEC PATH
OLQ 098006 00 3 whole lines and 0 partial lines in report.
OLQ 098007 00 7 records read. 7 records selected.

MANAGER EMPLOYEE REPORT
EMP-ID-0415 EMP-LAST-NAME-0415 EMP-ID-0415 EMP-LAST-NAME-0415
----------- ------------------ ----------- ------------------

471       PAPAZEUS         349 WILCO
471       PAPAZEUS         321 MOON
471       PAPAZEUS          15 MAKER
END OF REPORT
What you see is a list of employess working for PAPAZEUS (empid 471).

 

IDMSDMLC Abends - Misleading Messages

A user got the following abend while compiling (rather pre-processing) an IDMS-Cobol program.

+IDMS DC208001 IDMS job abending with abend code CAB0
+IDMS DC208001 ÆABEND from Module IDMSDMLC at Location 00006D70 Offset 07545A
+IDMS DC208001 SYSTEM mode registers at entry to ÆABEND
+IDMS DC208001 R0/R8 R1/R9 R2/R10 R3/R11 R4/R12
+IDMS DC208001 00000000 0007C1D8 0007C1D8 00000018 00000006 0
+IDMS DC208001 0007C138 000A2480 00099050 0007A7C7 0E70039C 0
+IDMS DC208001 USER mode registers at entry to ÆABEND

IEA995I SYMPTOM DUMP OUTPUT
USER COMPLETION CODE=3134
TIME=10.23.24 SEQ=61676 CPU=0000 ASID=00E3
PSW AT TIME OF ERROR 078D1000 800913F0 ILC 2 INTC 0D
ACTIVE LOAD MODULE ADDRESS=00089890 OFFSET=000
NAME=RHDCOMVS
DATA AT PSW 000913EA - 00181610 0A0DE2C8 E4E3C4D5
GPR 0-3 80000000 80000C3E 8E70FFEC 00000018
GPR 4-7 00006D70 000A3B5C 0007545A 00080290
GPR 8-11 0007C1D8 000A2480 00099050 000A286C
GPR 12-15 0E70FD24 000A296C 8E7100B8 000912F8
END OF SYMPTOM DUMP

************** ABORTING - IDMSDMLX, 0229, RCDCOPY-063
PROGRAM NAME ------ IDMSDMLX
ERROR STATUS ------ 0229
ERROR RECORD ------ RCDCOPY-063
ERROR SET --------- PROG-RCDCOPY
ERROR AREA -------- DDLDML
LAST GOOD RECORD -- RCDCOPY-063
LAST GOOD AREA ---- DDLDML
DML SEQUENCE ------ 311


A 3134 abend doesn't mean much. The IDMS Error Messages give a clue. The real error is, while activity logging in IDD, there was a deadlock.
02 - ERASE
29 - deadlock

DMLC was done with activity logging in IDD. Program entry in IDD has records copied entry. DMLC deletes all existing entries every time and create new ones again. This is rather heavy and in a system with very many users on IDD, can result in deadlocks.

This doesn't happen very often in a normal system. If it does, then try to compile the COBOL program with logging turned off.

 

COBOL Batch CV Job and FINISH!

It is a well known fact that every IDMS/COBOL program must have a FINISH. Otherwise all the update will be rolled back. But many people still think that they will get some kind of error message from the Batch COBOL run. In fact, if FINISH is not exected, the program will end normally from MVS's viewpoint. YOu do not see any error message in the JOB Log. The following is an example:

MVS JOB Log:
JOBNAME STEPNAME PROCSTEP RC EXCP CONN TCB SRB
JOB4455  S010             00 636   933 .00 .00 
IEF404I JOB4455 - ENDED - TIME=19.12.31 
JOB4455 ENDED. NAME-XXX/YYYY TOTAL TCB CPU TIME

As you can see the return code from the Job is 00!
But the program didn't execute FINISH and if there had been any update, it would have rolled back the whole thing!

On the CV Log you see the consequence. CV External Run Unit for this Batch Job has been 'killed' by Check User Task of CV. This appears as the abend on Task RHDCNP3S with program name=cobolpgm. This seems to be a read only job, so there are no rollback messages. Still it is annoying to see such ABRT messages in the log.

V12T1 CV-Status BE-TaskID Pri FE - ID1 FE - ID2 FE TaskCD FE UserID 
V12T1 ABRT CKUR 55514 100 BATCBULK JOB4455 P002A501 USER654 
V12T55514 TASK:RHDCNP3S PROG:P002A501 ABENDED WITH CODE ABRU 
V12T55514 DTS Event: TD0T - Begin ABEND event handling 
V12T55514 DTS Event: TD0T - Disconnecting connection(s) to server(s) 
V12T55514 DTS Error: TD0C - Connection is being forced to disconnect 
V12T55514 DTS Event: TD0T - Connection(s) to server(s) disconnected 
V12DNS Processing error, Function is RECEIVE_AND_WAIT, Status is XMIT Error
V12T55514 DNS error rc = -45 
V12T55514 DTS Event: TD0T - End ABEND event handling 


Back to Basics!

A Quick Introduction to ADS/OnLine

Why now? Because people are still using it! Applications designed and made in the mid 80s are still running clocking millions of transactions every day. Most of them are barely maintained though some are continuously enhanced.

ADS/OnLine entered the scene with IDMS Release 5.7 and has been rightly classified as a 4GL. Though definitions of 4GL differs greatly, at least all agree that COBOL is not a 4GL.

4GLs are made for certain environments and most of them run under a 'run time' system of some kind. In this way it is not just a language but a working online environment. The difference between COBOL and ADS is not much in the syntax of statements you use, but in the structure of what we call a program. Statements themselves look very much like that of COBOL (MOVE, COMPUTE, ADD, SUBTRACT, IF .. ELSE etc). IDMS DML commands too are mostly the same. Where it differs from COBOL it follows languages like PL/1 (REPEAT .. END and DO .. END and CALL subroutines). One major, but simple, fearure of the language is that every statement ends with a '.'. ADS/Online is the most readable 4GL of the 80s (if one compares with NATURAL, IDEAL, CSP etc).

If the language is like this, what about teh structure? Ther structure of ADS/OnLine is built around the entity called dialog, which basically means the program. Dialog is centered around a MAP (usually, though one can have mapless dialogs) and processes which contain the real statements. !). Maps are defined using the Mapping compiler MAPC and the dialogs using the ADS Compiler ADSC. The processes are connected to the dialog following the event-driven paradigm (followed in Visual Basic etc). ie Each PF Key + Enter Key can have one process. Working storage as we see in COBOL do not exist. Instead we connect the records to be used while defining the dialog. Database records are copied into the structure when you specify the database schema/subschema during the dialog definition process. All these definitions are done within or using the tools built around IDD - the one and only one Intergrated Data Dictionary in the market on mainframe (or any frame for that matter!). Process source is also defined and stored within IDD.

If one has to make a simple 'Hello World' dialog (without database access), it si easier done than all this explanation and takes less time than the the time taken for writing the last two paragraphs!

ADD PROCESS HELLO-WORLD-PM LANGUAGE IS PROCESS
MODULE SOURCE FOLLOWS
DISPLAY TEXT 'HELLO WORLD!'.
MSEND.

That's all! In fact there is only one line source here (in blue).

The rest is the header part of the code for storing this in IDD - the dictionary. Since ADS is a language heavily based on online, you need a map to run this process. One create a map called SHELLO using mapping compiler MAPC. Then create the dialog DHELLO using the compiler ADSC. Note that steps like compilation are needed for any language (C++, Java alike). Also MAPS are needed for Visual Basic etc. [Source taken from A Qucik Introduction to IDMS/ADS - with author's permission]

You may say "This was silly!". But no one says so while reading C, C++ or Java book when they see the "Hello World". It was simple, but not silly! It was a complete working multi-user ADS dialog, in fact.

Corresponding Code in Java follows:

public class Hello1 {
public static void main (String args[]) {
System.out.print("Hello World! "); }
}

ADS Dialogs vs ADSA Application

When ADS was introduced in IDMS 5.7 around 1983, there was only dialogs, ie there was no such thing as ADSA. So initial online systems made in ADS were using just dialogs. Even so it was far more easier to write an online system in ADS than implementing one in CICS (where you implement using CICS/COBOL or PL/1) or even in IDMS-DC. Control commands like LINK, INVOKE and TRANSFER were used to connect dialogs which constitute the total applications. Data has to be transferrred across dialogs using work records or using SCRATCH area.

Then with IDMS Relase 10.0 in 1984, ADSA was introduced as an umbrella over ADS dialogs. ADSA introducded a new entity called FUNCTION., which was in a way connected to a dialog(s) or DC Cobol program. ADSA handled the transfer across dialogs at a global level. Besides it supported a very powerful facility called Global Records. This made it possible for applications (or rather dialogs within an application) to share /transfer data even when the control command was TRANSFER (at the same level). ADSA also allowed one to define some global functions like QUIT, RETURN or HELP.

ADSA also introduced a new command within ADS process language - EXECUTE NEXT FUNCTION.

This way one could change the flow of dialogs without changing or compiling the process code, but by just by adjusting the function definitions and valid responses within ADSA. One can say that EXEC NEXT FUNCTION exhibited some properties of 'method overloading' as they call it in modern Java terminology! Because depending upon the context and values of certain things the same command (EXEC NEXT) will give control to different dialogs.

Though this facility was very good, it took some time for programmer community to digest the possibilities. Some experienced programmers and typically Consulting Companies had already written large applications without using ADSA. "Inertia" took precedence over spending a few bucks and time in modifying existing systems to incorporate ADSA.

Some applications never used ADSA. This was alright. What was worse is the fact the same programmers refused to admit the benefits ot ADSA and continued to advocate against this even during the 90s. This was a fatal mistake. But by then there was no Cullinet, no more development of new systems in ADS.

An Example from Employee Database

D100

Department

Dialog


D200

Employee

Dialog

Here we try to see a simple of example of displayind a DEPARTMENT and its emlpoyees.

We do it in two ways:

1). Using two dialogs connected each other by means of ADS control commands

2). Using the same two dialogs but connected via an ADSA umberlla.

The first map looks like:

S100 NEXT:             DEPARTMENT/EMPLOYEE INFORMATION SYSTEM    
     
        
                                                                        
        WS-DEPT-ID   : 0000                                             
                                                                       
        WS-DEPT-NAME :                                                  
                                                                        
                                                                         
                                                                        
                             PF4: LIST ALL EMPLOYEES IN THIS DEPARTMENT
PLEASE NETER DEPT ID       

S123A100 NEXT:          DEPARTMENT/EMPLOYEE INFORMATION SYSTEM    

The simple output for a department is as follows:

S100     NEXT:          DEPARTMENT/EMPLOYEE INFORMATION SYSTEM            
                                                                           
                                                                            
         WS-DEPT-ID   : 1000                                   
                                                                           
         WS-DEPT-NAME : PERSONNEL                                      
                                                     
                                                                           
                               PF4: LIST ALL EMPLOYEES IN THIS DEPARTMENT  
HERE IS THE DEPARTNENT INFO                                                    
   

Now we see how this is programmed in ADS:

ADD 
PROCESS NAME IS P123A100-PM VERSION IS 1 
USED BY PROGRAM DA100 VERSION 1 
TEXT IS PREMAP 
MODULE SOURCE FOLLOWS 
DISPLAY TEXT 'PLEASE NETER DEPT ID'. 


ADD 
PROCESS NAME IS PA100-RP1 VERSION IS 1 
PUBLIC ACCESS IS ALLOWED FOR ALL 
MODULE SOURCE FOLLOWS 
IF WS-DEPT-ID = 0 
DISPLAY TEXT 'PLEASE ENTER A VALID DEPT ID'. 
MOVE WS-DEPT-ID TO DEPT-ID-0410. 
OBTAIN CALC DEPARTMENT. 
IF DB-ANY-ERROR 
DISPLAY TEXT ERROR-STATUS. 
MOVE DEPT-NAME-0410 TO WS-DEPT-NAME. 
DISPLAY TEXT 'HERE IS THE DEPARTNENT INFO'. 

Now let's see the process for PF4:

MOD                                                
     PROCESS NAME IS PA100-RP2 VERSION IS 1     
         PUBLIC ACCESS IS ALLOWED FOR ALL          
         MODULE SOURCE FOLLOWS                     
IF WS-DEPT-ID = 0                                  
DISPLAY TEXT 'PLEASE ENTER A VALID DEPT ID'.       
MOVE WS-DEPT-ID TO DEPT-ID-0410.                   
FIND CALC DEPARTMENT.                            
IF DB-ANY-ERROR                                   
DISPLAY TEXT   ERROR-STATUS.          
INVOKE 'DA200'.                                 
         MSEND.          

Here, if the department is found, then we give control to the next dialog for listing all the employess in this department.

S200                 EMPLOYEE INFORMATION              
                                           
DEPT-ID: 1000     DEPT-NAME: PERSONNEL    

                 
EMP-ID            EMP-NAME                 EMP-CITY        
0081              TOM FITZHUGH             MANSFIELD MA    
0051              CYNTHIA JOHNSON          WALPOLE MA      
0091              MADELINE ORGRATZI        KENDON MA       
                                                            
                                                            
                                                            
ENTER DEPT-ID FOR NEW LIST                                
HERE WE HAVE THE EMPLOYEE LIST    

Here is the process code of this dialog (PM)

ADD PROCESS NAME IS PA200-PM VERSION IS 1 
PUBLIC ACCESS IS ALLOWED FOR ALL 
*+ TEXT IS PREMAP 
MODULE SOURCE FOLLOWS 
! MOVE 'EMPDEMO' TO DB-NAME. 
OBTAIN CURRENT DEPARTMENT ALLOWING (DB-ANY-ERROR). 
IF (DB-ANY-ERROR) DISPLAY TEXT 'DEPARTEMENT CURRENCY FAILURE'. 
! 
! SINCE THIS IS PAGEABLE MAP DIALOG, WE NEED TO CLEAR THE OLD MAP 
! THIS IS DONE BY LINKING TO A DUMMY DIALOG WITH A RETURN in the PM 
! THIS DUMMY HAS NO PROCESS CODE, BUT USES THE SAME MAP 
LINK TO 'DA201'. 
MOVE DEPT-ID-0410 TO WS-DEPT-ID. 
MOVE DEPT-NAME-0410 TO WS-DEPT-NAME. 
! 
WHILE DB-STATUS-OK 
REPEAT. 
! 
OBTAIN NEXT EMPLOYEE WITHIN DEPT-EMPLOYEE. 
IF DB-END-OF-SET EXIT. 
MOVE EMP-ID-0415 TO WS-EMP-ID. 
MOVE CONCAT (EXT(EMP-FIRST-NAME-0415), ' ', EMP-LAST-NAME-0415) 
TO WS-EMP-NAME. 
MOVE CONCAT (EXT(EMP-CITY-0415),' ', EMP-STATE-0415) 
TO WS-EMP-CITY. 
PUT DETAIL. 
END. 
DISPLAY TEXT 'HERE WE HAVE THE EMPLOYEE LIST'. 
MSEND . 

One executes this dialog by giving ADS D100.


ADSA Implementation

Supposing we have to connect these two dialogs within an ADSA Application, we need to define the applicaton, functions and responses under ADSA. For our simple dialogs it takes about 10-15 minutes to do this. We also define task codes for the main dialog. ADSA applications are started using specific task codes.
The following are some exmaple screen shots from ADSA definition.

  
                        CA-ADS Application Compiler              
                                                                 
                    Computer Associates International, Inc.       
                                                                
                                                            
                                                                    
    Application name . . . .    SAPPL1                            
    Application version  . .       1                              
    Dictionary name  . . . .    APPLDICT                          
    Dictionary node  . . . .    ________                         
                                                               
    Screen . . . . . . . . .    3   1. General options             
                                    2. Responses and Functions     
                                    3. Global records               
                                    4. Task codes                  
                                                               
                                                               
 DC450103 Application SAPPL1 version    1 suspended session restarted
                                                             
Command ===>                                             


                                                              
Application name:  S       Version:    1                       
                                                                
         Record name                 Version     Drop record (/)     
  1.    ADSO-APPLICATION-GLOBAL-RECORD              1         _     
                                                                   
  2.    ________________________________         ____         _  
                                         


Select    Response    Assigned   Select    Function           Program/    
  (/)      name        key       (/)      name/type(1,2,3)*  Dialogname 
                                                                            
   _       DEP          _____      _       FA100 / 1         DA100  
                                                                 
   _       EXIT         PF03       _       QUIT     / _         ___  
                                                                  
   _       EMP          PF04       _       FA200 / 1         DA200  
                                                            
   _       HLP          PF01       _       HELP     / _         _    
                                                             
                                                         
   _       ________     _____      _       ________ / _         ________    
                                                                                
·	Type: 1. Dialog  2. Program  3. Menu

Application is started by ADSA Task code Application SAPPL1, say DT01 (one can also say ADS DT01). There are some global keys available, like PF3 quit, PF1 System Help. The following is the System Help screen which shows the valid responses available for a particular function, in this case the first function F100 (~ the dialog D100).

  

CURRENT FUNCTION: DATE: 10/03/01 NEXT PAGE:   


        
                   APPLICATION CONTROL FACILITY HELP SCREEN       
                                                     
        _ EXIT      (PF3)      GLOBAL                
             
        _ EMP       (PF4)      DIALOG  FOR BROWSING EMPLOYE   
           
        _ HLP       (PF1)      SYSTEM FUNCTION          
           
                                                  
                                   
 
                                                         
RESPONSE:         

From either of the dialogs PF3 will take you to Enter Next Task Code. Global Record fields are available within ADSA, though in this simple case we ahve not used any of them. ADSA gives a great deal of control and possibilities if properly defined. Switching from any dialog to any dialog is possible by defining valid responses for each dialog. Also control can be changed by making changes within ADSA definition and without modifying the process code.


                              Response Definition               
                                                                             
Application name:   S       Version:    1                        
Response name:      EXIT                                Drop response (/) _
Function invoked:   QUIT                                                    
Description . . . . GLOBAL                              Security class:   0
                                                                             
Response type. . . . . . . 1   1. Global      2. Local                      
                                                                             
Response execution . . . . 1   1. Immediate   2. Deferred                   
                                                                             
Assigned key . . . . . . . PF03                                             
Control command. . . . . .  0   1. Transfer               2. Invoke         


There are a few more screens like that of TASK CODE defintion, Menu definitions, Security tailoring etc. You may note that the existing dialogs are connected to FUNCTIONS here. Typically each dialog with process code and responses will be one function.

Dialog Process Code remains almost the same. There will be changes in the way inter-dialog control is done. Commands like INVOKE, LINK and TRANSFER will not be used usually, because such controls commands are realized by ADSA.

The changes are noted in red:

ADD 
PROCESS NAME IS PA100-RP1 VERSION IS 1 
PUBLIC ACCESS IS ALLOWED FOR ALL 
MODULE SOURCE FOLLOWS 
IF WS-DEPT-ID = 0 
DISPLAY TEXT 'PLEASE ENTER A VALID DEPT ID'. 
MOVE WS-DEPT-ID TO DEPT-ID-0410. 
OBTAIN CALC DEPARTMENT. 
IF DB-ANY-ERROR 
DISPLAY TEXT ERROR-STATUS. 
IF AGR-CURRENT-RESPONSE NE SPACES EXEC NEXT.       
MOVE DEPT-NAME-0410 TO WS-DEPT-NAME. 
DISPLAY TEXT 'HERE IS THE DEPARTNENT INFO'. 

Now let's see the process for PF4:

MOD                                                
     PROCESS NAME IS PA100-RP2 VERSION IS 1     
         PUBLIC ACCESS IS ALLOWED FOR ALL          
         MODULE SOURCE FOLLOWS                     
IF WS-DEPT-ID = 0                                  
DISPLAY TEXT 'PLEASE ENTER A VALID DEPT ID'.       
MOVE WS-DEPT-ID TO DEPT-ID-0410.                   
FIND CALC DEPARTMENT.                            
IF DB-ANY-ERROR                                    
DISPLAY TEXT   ERROR-STATUS.                                      
!INVOKE 'DA200'.                                 
EXECUTE NEXT FUNCTION.
         MSEND.      

Application is started by ADSA Task code Application SAPPL1, say DT01 (one can also say ADS DT01). There are some global keys available, like PF3 quit, PF1 System Help. The following is the System Help screen which shows the valid responses available for a particular function, in this case the first function F100 (~ the dialog D100).


   CURRENT FUNCTION: DATE: 10/03/01                         NEXT PAGE: 
                   APPLICATION CONTROL FACILITY HELP SCREEN   
                                         
        _ EXIT      (PF3)      GLOBAL                 
        _ EMP       (PF4)      DIALOG  FOR BROWSING EMPLOYE        
        _ HLP       (PF1)      SYSTEM FUNCTION               
                                                  
                   
 
                                   
RESPONSE:            

From either of the dialogs PF3 will take you to Enter Next Task Code. Global Record fields are available within ADSA, though in this simple case we ahve not used any of them. ADSA gives a great deal of control and possibilities if properly defined. Switching from any dialog to any dialog is possible by defining valid responses for each dialog. Also control can be changed by making changes within ADSA definition and without modifying the process code.


The New World and the Misuse of Words!

COBOL is the acronym for COmmon Business Oriented Language. CODAYL stands for Conference on Data Systems and Languages. SQL had its origin in SEQUEL which stands for Structured English QUery Language. BASIC stands for Beginners Allpurpose Symbolic Instruction Code.. and so on. All these acronyms have been so established that they are treated as 'English' Words nowadays. These are all products or proud remnantsof a gone era. Those days and in the literature of those days the acronyms were carefully chosen.

But what is ahppening now? Every new product in the WWW and the PC World coins and uses acronyms left and right! Technical jargons are inveneted almost every day and are being used as if they have come all the way from Isaac Newton! On top of everything existing technical words are used in totally new contexts with 'new' meanings. You may ask: What is wrong with that?

The problem is that the computer literaure today uses 'words' with loose meanings. For example, in an article on XML (well, XML stands for Extensible Markup Language) it is said that the words 'entity', 'thing' and 'object' are all synonymous terms! Entity is a well established term in E-R Modelling and CODASYL database litertaure. XML document goes on to say that each entity can contain one or more logical elements and each of these elements can have certain attributes . True, but one cannot use object in the same situation. Object has different meaning especially in Object Oriented language/programming situations. And pbviously one cannot substitute 'thing' for an entity.

Another XML document found on the web refrerred to DTD as Document Type Description and Document Type Declaration on the same page ! Both are wrong. DTD is neither of them! Confused? Don't worry. Author Simon North admits in 'SAMS Teach XML in 21 Days' that "Even within established SGML circles there is a lot of confusion about Document Type Declaration and Document Type Definition. These are two completely different things!"

DTD really stands for Document Type Definition which is the XML description of the content model of an XML document. DTD describes the structure of the lements in an XML document. |Document Type Declaration on the other hand is just an XML statement that names the DTD file or statements.

Eg: <!DOCTYPE Employee_list SYSTEM "Employee_list.DTD" >

Loose Usage of Terminology

As one probes further it can be seen existing SQL 3GL, java doc contsructors

After talking about third generation languages, an article on object oriented programming and Java says "In these languages (4GL) you tell the computer what results you want rather than telling how to calculate those results. ... SQL is the most popular fourth generation language"

Obviously this is wrong!! SQL is not a 4GL at all. SQL is a database language - data manipulation language (DML) to be precise. (SQL also has DDL and DCL side of it, though that doesn't affect this discussion).

4GLs are NOT what our author claims. 4GLs like ADS, NATURAL and IDEAL evolved not as general purpose languages but platform dependent special purpose languages mainly making online application development easier. Mainly they all ran under a runtime system which did part of the interpreted code. Technically there indeed was no attempt to replace COBOL (for example in the batch), though some of the industry pundits wrongly made such claims in the beginning and wrote against the same later!

The same article and many books on Java say that constructors are special methods. But Sun's own documentation says 'Constructors are not methods'.


Windows and Word nightmares

Windows (and especially Word and Excel) creates a huge amount of temporary files in the C.\temp or C:\windows\temp directory. Some of them never cleaned up. Here follows a sample listing where it shows a total of 172 files have been accumulated!

21.12.00 08:48 51 988 ~WRC3180.tmp
21.12.00 08:48 151 040 ~WRF0000.tmp
Press any key to continue . . .
21.12.00 08:48 211 456 ~WRS0001.tmp
11.01.01 15:40 207 578 ~WRS0002.tmp
08.01.01 09:49 253 242 ~WRS0003.tmp
25.01.01 09:19 110 592 ~WRS0004.tmp
22.01.01 13:17 91 136 ~WRS0005.tmp
172 File(s) 15 386 879 bytes
14 206 981 120 bytes free
D:\OTHERS\T10>dir temp0.html

Volume in drive D is DATA11

Directory of D:\OTHERS\T10

24.01.01 13:47 0 temp0.html
1 File(s) 0 bytes


H:\OTHERS\T10>erasetemp0.html
H:\OTHERS\T10\temp0.html
The process cannot access the file becauseit is being used by another process.

Who the heck is using this file? No one other than the Windows hidden processes!

 

New Product Report:

Access CA-IDMS from Java

Vegasoft, Helsinki has announced Java Client Support for IDMS Database. Java applications can now exchange data with any application running under CA-IDMS/DC. The VG-Java Client communicates with the VG-Application Server running under CA-IDMS/DC/UCF . Communication protocol used internally is TCP/IP.

Vegasoft implementation does not need CA-Server or any other extra products on your PC or Network Servers. IDMS/SQL feels this is extremely important [We have some examples from well known big companies where one has to install million dollar products in all sorts of places to make your little program to function!] This makes implementation cleaner, easy to monitor and maintain, besides giving good performance. Integrity of the database is guaranteed by the proven code of IDMS/DB Central Version. IDMS Native DML; SQL, Stored Procedures, and Support for DB2 database etc are some of the features.

IDMS/SQL has no hesitation in recommending this product to our esteemed clients. A direct Java link to IDMS can give surprises to those who are desperately trying to convert mainframe data to other platforms.

More information please visit

http://www.vegasoft.com/javacli.htm

Back to Main Page
This page at http://geocities.datacellar.net/idmssql/idms101.htm


IDMS/SQL is published on behalf of IDMS WatchDog Group, Palo Alto-Helsinki-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@yahoo.com This page hosted by Get your own Free Home Page

1