Sunday, October 22, 2006

A cautionary tale about tape labels

I recall that in the 1980s, at a Texas credit reporting company (then, Chilton), we had gotten used to coding a label parameter to save tape datasets as LABEL=EXPDT-99000 to assume catalog control. That is, the tape could not be written over unless uncatalogued. We had used a third party vendor tape management system.

In 1988 I took a new job in a small shop in Washington DC that had a 4341 and 4381, which at the time were the small mainframe computers that could run MVS (or VM, which actually emulated a PC on the mainframe). I had created and saved a lot of data tapes and coded them the same way. Lo and behold, one summer evening in 1989 (after a small data center move) I find out that all of the tapes are unprotected. Fortunately, none of them had yet been written over. But if they had been, a whole business could have been lost. My career could have ended right then and there.

The new shop used IBM's own standard only, which at the time were EXPDT=yyddd, where 99365 or 99366 kept the tape indefinitely.

It appears that all of this changed with Y2K. The correct way to code is yyyy/ddd (1999/365 or 1999/366 still gives permanent retention).

The lesson is, if you are a consultant and work in a shop where you have some responsibility for manually managing data resources, be very sure that you know the exact rules for your shop. And know the official IBM standards, which may appear on certification quizzes.

Wednesday, October 18, 2006

A sample DB to illustrate some joins (WIP)

The example here supposes that we are building a database of political theory. We are trying to classify the arguments that people try to make to support their political or social positions. This could be build up into a social studies learning tool.

We may have to tinker with the basic setup from time to time to make some of the examples applicable. For example, outer joins wouldn’t make sense if you had already enforced referential integrity with foreign keys.

Future blog entries may refer to this setup.

DECLARE TABLE(DB01.ARGUMENTS)
LIBRARY(DB01.DCGLGENS(ARGUMENT))
ACTION(REPLACE)
LANGUAGE(COBOL)
STRUCTURE(ARGUMENT-ROW)
QUOTE

EXEC SQL DECLARE DB01.ARGUMENT TABLE
(TOPIC CHAR(8) NOT NULL,
SUBTOPIC CHAR(8) NOT NULL,
BIBID CHAR(8) NOT NULL,
ARGDATE DATE,
ARGID SMALLINT,
COUNTERARGID SMALLINT,
ARGTEXT VARCHAR(1024))
PRIMARY KEY (ARGID),
FOREIGN KEY ITEMID (BIBID)
REFERENCES DB01.BIBLIO
ON DELETE CASCADE)

(Varchar should normally be at the end of a table)

DECLARE TABLE(DB01.BIBLIO)
LIBRARY(DB01.DCGLGENS(ARGUMENT))
ACTION(REPLACE)
LANGUAGE(COBOL)
STRUCTURE(ARGUMENT-ROW)
QUOTE

EXEC SQL DECLARE DB01.BIBLIO TABLE
(ITEMID CHAR(8) NOT NULL,
AUTHOR CHAR(32) NOT NULL,
TITLE CHAR(32) NOT NULL,
SERIES CHAR(32) NOT NULL,
URL CHAR (64) NOT NULL,
PUBDATE DATE
PRIMARY KEY (ITEMID))

Imagine the tables to contain these entries:

ARGUMENT

1amend,Internet,00000001,2006-01-01,11,12, “Children should be protected on the Internet”
1amend,Internet,00000002,2006-01-01,12,11, “filters will protect children”
1amend,Internet,00000003,2006-01-01,13,11, “content labeling will protect children”
service,draft,00000011,2006-02-28,21,22, “military service is am obligation of citizenship”
service,draft,00000012,2006-02-28,22,21, “the draft is involuntary servitude”

BIBLIO

00000001,”Bill Boushka” “DADT” “DADT”, “http://www.doaskdotell.com”, 1997-07-11
00000002, “John Doe” “Autobiography of John Doe”,,2001-01-01
00000003, “John Smith”, “Auto JS”, ,2001-01-01
00000011, “Mary Smith”, “Auto MS”, ,2002-01-01
00000012, “Ellen Smith”, “Auto ES”, ,2003-01-01
00000013, “Jerry Smith”, “Auto KS”, ,2002-01-01
00000014, “Dan Smith”, “Auto DS”, ,2003-01-01

An inner join:

SELECT AUTHOR ARGTEXT
FROM DB01.BIBLIO
INNER JOIN DB01.ARGUMENT
ON ITEMID = BIBID
Produces arguments where there are matching authors, and only names the authors that have arguments.

An outer join is useful, in practical terms, in identifying potential future matches. For this example, pretend that there is no foreign key clause forcing every argument to have an author.

SELECT A.AUTHOR, B.ARGTEXT
FROM DB01.BIBLIO A
LEFT JOIN DB01.ARGUMENT B
ON A.ITEMID = B.BIBID

This join would return all authors as potential matches but only the arguments authored by matched authors. If you coded “right” you would get the same result if the tables were switched in the select statement. Full outer joins allow only an equality operation, but left and right joins can use any comparison operator.

A good reference is this:

Tuesday, October 10, 2006

Review topic: DB2, date and time

Some quizzes on DB2 programming may test knowledge of date formats. Sometimes there is confusion about character and numeric representations.

A DATE data type in DB2 is represented in character format in Y2K chronological: “yyyy-mm-dd”. That is 10 characters in COBOL. The order will always be in logical chronological sequence.

In a similar fashion, a TIME data type is simply hh-mm-ss, 8 characters in COBOL.

However, these types have the implicit ability to generate durations (when two different items are “subtracted”) and to be modified by adding and subtracting durations. DB2 regards as date duration as DEC(8,0) which would be hosted by COBOL in a variable as PIC S9(8) COMP-3. Time duration would be regarded as DEC (6,0) and have a COBOL picture of PIC S9(6) COMP-3. (The pictures could obviously be S9(9) COMP-3 and S9(7) COMP-3., to fit within EBCDIC)

By the way, here is a good Ascii-EBCDIC chart.

Review topic: CICS file types; the RIDFLD option

CICS transactions reference data either through a commercial database package (DB2, IMS, Adadbas, IDMS, Datacom DB) or through VSAM itself. Some commercial packages, like Vantage for life insurance and annuities (or the older and much less successful VLN) access VSAM through their own proprietary I/O modules, with which application programmers in a shop using these packages must become very proficient.

Nevertheless, recruiters for mainframe jobs always expect proficiency in VSAM.

A good reference book for VSAM programming is a red paperback, Practical VSAM for Roday’s Programmers, by James G. Janossy and Richard E. Guzik, published by Wiley in 1988, ISBN 0-471-85107-8. The book gives a lot of historical background and “philosophy” behind VSAM in connection with both the old DOS and MVS as it developed throughout the 1970s and 1980s.

Technical interviewers are likely to expect a body of technical knowledge on how to access various VSAM formats from CICS transactions. In many shops, however, programmers often use only a portion of the technical knowledge that recruiters and certification tests may expect the applicant to demonstrate. This is particularly true of maintenance programmers.

For example, consider VSAM formats. By far the most common is the Key Sequenced dataset, the KSDS. But older formats include the Entry Sequenced Data Set, essentially a sequential file, and the Relative Record Data Set, RRDS, related to the old BDAM. With an ESDS, the Delete command cannot be used, and neither can the START, since an ESDS can only be accessed sequentially from the beginning of the file. These are available for the RRDS.

An important concept will be the RIDFLD, the “record ID field.” Applicants may need to be familiar with the RRN (relative record number) or RBS (relative byte address) options, that may occur on some CICS commands, in connection with the RIDFLD.

When RRN is specified, the RIDFLD specifies a relative record number, and the file must be a RRDS.

When RBA is specified, the file is an ESDS, and the RIDFLD is a relative-byte address.

With the KSDS, however (again, by far the most common), the RIDFLD must give the name of the field that contains the key value for the record (it could be an alternate index).

When you want to read a KSDS sequentially, you must use a STARTBR command (like the COBOL START, which is optional in batch COBOL if you want to start at the “beginning” of the file.)

Monday, October 09, 2006

Review topics: Change Control

I am starting to summarize a few mainframe review questions that could come up in phone interviews or in technical quizzes given by recruiters. This is all part of a review process that may lead to my own recertification in a job search.

Topic: Change Control

The skill most often requested is Endeavor. I am familiar with ChangeMan and CA-Librarian.

I became familiar with ChangeMan in the mid 1990s at ReliaStar. The package automatically stages components of an elevation (source, link decks, parmlibs, procs, JCL, etc) into various stages of Test, QA, and production. The package will not let you compile and link without linking the source. This automatically guarantees that when a package is moved to production, the source matches the load modules (a security issue). That to me sounds like a good concept for an interview question.

I first had CA-Librarian in 1990. At the time, one had to "process" a module to freeze, and it was possible to produce load modules that could be elevated without freezing the source. On the other hand, a source module itself could not be elevated without being frozen individually. This does sound like it could expose an installation to security problems, and I don't know whether this has been changed since then. I suspect that it has.

More review topics will follow.

Monday, October 02, 2006

Can techies sell?

Bob Weinstein’s Tech Watch column (one place is The Washington Times, Recruitment Times, Oct. 2, 2006) discusses “companies need techies who can sell.” Indeed they do. It is easier to budget a position that is at least partially compensated by commissions, particularly as the economy just starts to uptick..

As a partially retired “baby boomer” from the largely mainframe IT market, I have been asked why I am not willing to “sell” what I worked on. Become a life insurance agent. Or a software salesman. That sounds like a very natural thing as you age out of the fast paced geeky coder market.

A short answer is that sales for sales sake is against my temperament. I am a Myers-Briggs blue, the artist. I like to create the content and get it published. I like to find the truth, disseminate it, and get people to deal with what the truth means.

Of course, in sales, you are paid to represent in public just one point of view about something. It is a Faustian deal, where you give up all pretense of objectivity that you learned in school. I see many want ads for salespeople, for people who have proved that they can sell anything. No technical experience in the hiring company’s products or services needed. Sales culture is its own mindset, as so well demonstrated in the little art film “100 Mile Rule.” (My review is here.) It does seem to be predicated on socializing for its own sake, and on manipulating people and their perceptions and on hiding the truth. From my perspective it sounds cheesy, but that’s relativistic. Always be closing!

A couple of points, here, though. Artists still need sales and people skills to sell their own work – just read all the success stories about Hollywood in the popular fashion magazines. And it is perfectly all right to help someone else’s work if that person’s work has a connection to your own, and you can work in synergy. That’s a good and necessary strategy.

Furthermore, technology sales people have to keep as current as the coders. They have to help non-technical business executives solve technology problems. There is a legitimate place for this, even if it doesn’t fit my own temperament. I think, though, that for a lot of ex-techies, selling someone else’s content and not your own represents a major psychological challenge.