« March 2020 | Main | May 2020 »

April 17, 2020

Sorting Strategies for COBOL

By Shawn Gordon

Newswire Classic

How many times have you just had some simple data in a table in your program that you wanted to sort? It seems like a waste of time to go through and write it to a file and sort the file and read it back in. COBOL has a verb to allow you to sort tables.

I’ve actually gotten a few e-mails recently asking me about this verb and sorting strategies, so I thought I would go over it. What I have this month is both a simple bubble sort, as well as a more complex but efficient shell sort. The bubble sort in Figure 1 only requires that we have two counters, one save buffer, and one table max variable, on top of the table data.

Screen Shot 2020-04-18 at 2.26.56 PM

Here's the code in text, if you want to copy and paste, and apply your own formatting.

WORKING-STORAGE SECTION.
01 SAVE-CODE PIC X(04) VALUE SPACES.
01 S1 PIC S9(4) COMP VALUE 0.
01 S2 PIC S9(4) COMP VALUE 0.
01 TABLE-MAX PIC S9(4) COMP VALUE 0.
01 CODE-TABLE.
03 CODE-DATA PIC X(04) OCCURS 100 TIMES.
PROCEDURE DIVISION.
A1000-INIT.
*
* Do whatever steps are necessary to fill CODE-TABLE with the values
* you are going to use in your program. Make sure to increment
* TABLE-MAX for each entry you put in the table.
*
* Now we are going to perform a bubble sort of the table.
*
PERFORM VARYING S1 FROM 1 BY 1 UNTIL S1 = TABLE-MAX
PERFORM VARYING S2 FROM S1 BY 1 UNTIL S2 > TABLE-MAX
IF CODE-DATA(S2) < CODE-DATA(S1)
MOVE CODE-DATA(S1) TO SAVE-CODE
MOVE CODE-DATA(S2) TO CODE-DATA(S1)
MOVE SAVE-CODE TO CODE-DATA(S2)
END-IF
END-PERFORM
END-PERFORM.

As you can see, this is a pretty trivial and easy to implement solution for simple tables.


What we have in Figure 2 is a macro that does a shell sort. I got this originally from John Zoltak, and the following text is his, with some slight edits from me.

He says, “When I want to sort the array I use

MOVE number-of-elements to N-SUB.
%SORTTABLE(TABLE-NAME#, HOLD-AREA#).

“Figure 2 below uses the shell sort, faster than a bubble. Also since it’s a macro, I can sort on any table. The only real constraint is that it compares the whole table element, so you just have to arrange your table element so it sorts the way you want.”

Screen Shot 2020-04-18 at 2.27.20 PM

Again, here's the text from the routine for you to copy and paste

* SHELL SORT ROUTINE
*
* This macro expects parameter 1 to be the element of the
* table to be sorted. This sort compares the entire element.
* Parameter 2 is the element hold area. Can be a higher
* element of the table if you wish.
*
* To use this sort macro, you must COPY it into your program
* in the 01 LEVEL area. Four (4) variables will be declared
* and the $DEFINE for %SORTTABLE will be defined.
*
* Before invoking this macro you must set N-SUB to the
* highest table element to be sorted.
01 I-SUB PIC S9(4) COMP.
01 J-SUB PIC S9(4) COMP.
01 M-SUB PIC S9(4) COMP.
01 N-SUB PIC S9(4) COMP.
$DEFINE %SORTTABLE=
IF N-SUB > 1
MOVE N-SUB TO M-SUB
PERFORM TEST AFTER UNTIL M-SUB = 1
DIVIDE 2 INTO M-SUB
ADD 1 TO M-SUB GIVING I-SUB
PERFORM UNTIL I-SUB > N-SUB
MOVE !1(I-SUB) TO !2
MOVE I-SUB TO J-SUB
SUBTRACT M-SUB FROM J-SUB GIVING TALLY
PERFORM UNTIL J-SUB <= M-SUB OR
!1(TALLY) <= !2
MOVE !1(TALLY) TO !1(J-SUB)
SUBTRACT M-SUB FROM J-SUB
SUBTRACT M-SUB FROM J-SUB GIVING TALLY
END-PERFORM
MOVE !2 TO !1(J-SUB)
ADD 1 TO I-SUB
END-PERFORM
END-PERFORM
END-IF#

02:24 PM in Hidden Value, Homesteading | Permalink | Comments (0)

April 14, 2020

Do Your Bit for the Pandemic Emergency

Keep calm and carry on
HP 3000 managers have ample experience with COBOL. The language built the business world, but newer-tech owners tend to hoot at the venerable tool. COBOL experts found themselves in high demand during another crisis point. Y2K may represent the high water mark for COBOL hiring.

In the thick of the COVID-19 pandemic, COBOL is proving once again it is an essential IT tool.

COBOL's roots hail from the 1960s. It has been a crucial part of legacy computing ever since MPE servers took their roles in enterprises. Now we learn that COBOL is at the heart of business systems at the IRS. You know, the organization that's trying to send up to $1,200 to every adult in the US right now.

In the middle of a pandemic, where the emergency funds are flowing to checking accounts, COBOL is the conduit. Some databases at the Internal Revenue Service hail from 1962. Nobody could anticipate that the COBOL that runs those databases would need modifications. Addresses of taxpayers are now different. Some bank accounts, like the temporary ones from H&R Block tax services, kicked back 300,000 of those IRS deposits.

COBOL is being called an ancient language. As it turns out, the expertise is still available. The state of New Jersey is running employment ads that ask for COBOL experts. Many are retired, but like doctors around the world, some are returning to duty.

In the MPE community, one significant customer is still using COBOL. At Boeing Corp., 17 COBOL programs serve on a virtual HP 3000. The air travel industry is under siege, but aircraft are still being sold and built.

COBOL college training is in short supply, to the point of being a mystery to find. Out on the Udemy training website, however, a $59 course promises students can "become an expert on COBOL programs by coding." The training says the course teaches how to "run COBOL programs with JCL."

Job Control Language is essential to lots of legacy computing. It also seems to be essential to getting up to speed using the Udemy course. "You should know at least the basics of TSO/ISPF and JCL," the description says. "I have provided a few basic TSO/ISPF commands and some amount of JCL as well. If you are not comfortable, you can take my courses on TSO/ISPF and JCL first before taking this course."

In the world's time of greatest need, so are servers like those using PA-RISC, and mainframes. When trouble arrives, the proven tools take a leading role. It's survival IT. Legacy owners should be proud of doing their bit, as the British say about wartime.

Image by Prawny from Pixabay

01:22 PM in Homesteading, Web Resources | Permalink | Comments (0)

April 08, 2020

Tips on Using FTP on MPE/iX Systems

By Bob Green

Newswire Classic

Starting with MPE/iX 6.0, it has been very easy to enable the File Transfer Protocol server on your HP 3000. Once enabled, the FTP server makes it possible for you to deliver output to your own PCs, Linux servers, MPE boxes or Unix boxes, even to servers across the world. These can be your servers in other parts of your company, or of your suppliers, or of your customers.

MPE File Attributes

When transferring files from one HP 3000 to another there is no need to specify the attributes of the file, such as ;rec=-80,1,f,ascii

MPE keeps track of that for you. When transferring a file to an MPE system from a non-MPE system, or transferring through a non-MPE system, you will need to specify the file attributes on the target MPE system as in:

put mympefile myfile;rec=-80,1,f,ascii;disc=3000

The default file attributes can be specified for a file transferred to your MPE system by changing the corresponding line in the file BLDPARMS.ARPA.SYS which is shown below:

;REC=-80,,F,ASCII;DISC=204800
;REC=-256,,V,BINARY;DISC=204800
;REC=,,B;DISC=16384000

Only the first three lines are read; everything after is ignored.

You may modify the first three lines as long as you keep the same syntax, i.e., you may change the numbers, or F to V, but don’t add anything bizarre. Anything after a space is ignored, so don’t insert any spaces. If the file is missing (or any line in it), the old hard-coded defaults will be used as a backup. These are:

;REC=-80,,F,ASCII;DISC=204800 for ASCII mode,
;REC=-256,,V,BINARY;DISC=204800 for binary mode.
;REC=,,B;DISC=16384000 for byte stream mode.

Also, if either the REC= part or the DISC= part of either line has bad syntax, the default for that part will be reverted to.

Users may make local copies of this file and set their own defaults via a file equation:

:file bldparms.arpa.sys=myfile

Host Commands

You can execute commands on your local 3000 by putting a colon in front of your command such as:

ftp> :listf ,2

You can find out what commands you can do remotely with the remotehelp command:

Typically we just stream jobs on the remote system with FTP’s site command by doing the following in the FTP client:

ftp> site stream robelle.job.robelle

200 STREAM command ok.

Site is a standard FTP command, but what host commands the FTP server at the other end supports varies from server to server.

In fact the Qedit for Window Server installation has its own FTP client which FTPs the server and streams the “robelle” job to set the attributes of the Robelle account.

Filenames

On MPE the default namespace for a given file is typically the MPE namespace. For example if you put a file to your MPE system with the following FTP command:

put myfile mympefile

The file will go to the group you are currently logged into.

If you want to put files into the HFS namespace then you can just specify using the typical Posix notation:

put myfile /MYACCOUNT/MYGROUP/mydirectory/myhfsfile

12:40 PM in Hidden Value, Homesteading, Newswire Classics | Permalink | Comments (0)

April 06, 2020

SSD devices head for certain failures

Western Digital SanDisk
A solid-state storage device is not usually a component of HP 3000 configurations. However, with the onset of virtualizing MPE servers, those drives that do not move, but still store? They are heading for absolute failures. HP is warning customers.

The problem is surfacing in HP storage units. It's not limited to HP-brand gear, though. SanDisk devices cause these failures. One fix lies in HP Enterprise firmware updates.

HP Enterprise disk drives face a failure date of October 2020, unless administrators apply a crucial firmware patch. Notices from HP Enterprise warn the owners of some disks about failures not earlier than October. Other Solid State Drive (SSD) disks are already in danger of dying.

Some SanDisk SSD drives have already rolled past a failure date of last fall, for those that have operated constantly since late 2015. The failure of the drives is being called a data death bug.

For some, HPD7 firmware is a critical fix. HPE says that Western Digital told the vendor about failures in certain Serial Attached Storage (SAS) models inside HPE server and storage products. Some SAS SSD drives can use external connections to HPE's VMS Itanium servers.

The drives can be inside HPE's ProLiant, Synergy, and Apollo 4200 servers. Some of these units could serve as hardware hosts for virtualized 3000 systems. The SSD problem also exists in HP's Synergy Storage Modules, D3000 Storage Enclosure, and StoreEasy 1000 Storage. If the disks have a firmware version prior to HPD7, they will fail at 40,000 hours of operation (i.e., 4 years, 206 days, 16 hours). Another, even larger group of HP devices will fail at 3 years, 270 days 8 hours after power-on, a total of 32,768 hours.

The numbers mean that the failures might have started as early as September of last year. The first affected drives shipped in late 2015. HP estimates the earliest date of failure based on when it first shipped the drives. Another batch of HP drives shipped in 2017. They are also at risk. These are the drives looking at an October 2020 failure date without a firmware update.

Beyond HP gear

The devices are Western Digital's SanDisk units, according to a report on the website The Register. Dell has a similar support warning for its enterprise customers. Dell lists the SanDisk model numbers:

LT0200MO
LT0400MO
LT0800MO
LT1600MO
LT0200WM
LT0400WM
LT0800WM
LT0800RO
LT1600RO

RAID failures will occur if there is no fault tolerance, such as RAID 0. Drives will fail even in a fault tolerance RAID mode "if more SSDs fail than are supported by the fault tolerance of the RAID mode on the logical drive. Example: RAID 5 logical drive with two failed SSDs."

Adding to the complexity of the SSD failures, firmware to fix the issue has two different numbers. HPD7 repairs the 40,000-hour drives. HPD8 repairs a bigger list of devices. Leaving the HPD7 firmware inside drives among the larger list of disks — which have a death date that may arrive very soon this year — will ensure the failures.

Full details from HP's bulletins for the 40,000-hour and for the 32,768-hour drives are at the HPE website. There are also instructions on how to use HP's Smart Storage Administrator to discover uptime, plus a script for VMware, Unix, and Linux. These scripts "perform an SSD drive firmware check for the 32,768 power-on-hours failure issue on certain HPE SAS SSD drives."

A list of 20 HPE disk units falls under the 32,768-hour deadline. Four other HPE devices are in the separate 40,000-hour support bulletin.

11:51 AM in Homesteading, Migration, News Outta HP, Newsmakers | Permalink | Comments (1)

April 02, 2020

Essential services: 3000-MPE/iX computing

Is You Trip Necessary
HP 3000 and MPE customers have long felt they were unique. It may have been a feeling that flowed from HP's special treatment of the 3000. The server that earned HP's place at the business computing table was under-served during its final years. That felt special in a troubling way. 

Now, with the COVID-19 crisis changing the world, the 3000 and MPE have a confirmed position. These servers, built for legacy datacenters, are essential services. You can look it up at a US government website.

The 15 pages of the Department of Homeland Security advisory memorandum on "Identification of essential critical infrastructure workers during COVID-19 response" includes an extensive section on Information Technology.

The document comes from the DHS Cybersecurity and Infrastructure Security Agency (CISA). It's got an Essential Critical Infrastructure Workforce advisory list. Other federal agencies, state and local governments, as well as the private sector all advise the CISA about which jobs are essential.

One paragraph covers nearly everyone who works in IT.

"Suppliers, designers, transporters and other workers support the manufacture, distribution and provision and construction of essential global, national and local infrastructure for computing services. This includes cloud computing services and telework capabilities, business infrastructure, financial transactions/services, web-based services, and critical manufacturing."

In another spot are also "datacenter operators, including system administrators. IT managers and purchasers." There are "engineers for data transfer solutions, software, and hardware." Don't forget "database administrators for all industries (including financial services)."

If you're on the road to work toward these jobs, be certain your driving is essential. However, the HP 3000 and MPE/iX are even more essential. Servers running MPE/iX usually host historical data and track sales and inventories. Manufacturing is managed by legacy. That's infrastructure. 

And the HP 3000 and MPE/iX are more essential now because they require fewer resources. Legacy computing has already proven itself and had its bugs ironed out. It needs fewer IT staff hours. For any MPE/iX system that can be moved to a virtual instance, using Stromasys Charon, the footprint can be even lighter. Newer Intel servers and blades demand less power and take up less space.

Long ago, HP 3000 advocate Wirt Atmar called the server a peaceful device. "It creates invoices, tracks receivables, records contracts," he said. "When those things are in the air, being exchanged, we stay away from war." Wirt started his IT career developing government calculations for nuclear attack throw-weights, plus estimating projected casualties.

It's a war-like feeling in our world as we battle our way back to health. Most IT datacenter work doesn't have to be conducted on the site of the computers. But there are times when travel to a physical location is required. You can feel certain that trip is necessary.

12:58 PM in Homesteading, Newsmakers | Permalink | Comments (0)