Modify PRIMCOB1 to work with gnuCOBOL

I ported the PRIMCOB1 (Sieve of Eratosthenes) COBOL program included with MVS 3.8j in the TK4- package to gnuCOBOL V3. The old COBOL program can generate prime numbers up to 32767. The gnuCOBOL version doesn’t have that limitation, and I modified it to generate primes up to one million.

One of the reasons I did this is because I was watching a YouTube video titled “The Worst Programming Language Ever – Mark Rendle – NDC Oslo 2021” and of course the first language he mentioned was COBOL. As one of the very first compiled languages, isn’t it strange that it wasn’t near perfect? It had so many other languages to look to for better ideas. Right? Wrong! And he said they benchmarked another terrible language doing the Sieve of Eratosthenes and it took 17 hrs. Compared to a FORTRAN program that took .5 sec. Now I don’t know how long ago this was, but Fortran (Formula Translator) is a math programming language. So you would expect it to do good. But little 60+ year old business language, COBOL (Common Business Oriented Language) also doing it in less than a second is pretty cool…I think.

It generated these in less than a second. Here are the last few lines using the Linux time command…

999091 999101 999133 999149 999169 999181 999199 999217 999221 999233 999239 999269 999287 999307 999329 999331 999359 999371 999377 999389
999431 999433 999437 999451 999491 999499 999521 999529 999541 999553 999563 999599 999611 999613 999623 999631 999653 999667 999671 999683
999721 999727 999749 999763 999769 999773 999809 999853 999863 999883 999907 999917 999931 999953 999959 999961 999979 999983

78498 primes up to 1000000 found.

real 0m0.193s
user 0m0.146s
sys 0m0.000s

Slow project year

It’s been just over a year since I complained about not having an interesting project to play with. OK I added interesting. I’ve had a few ideas but it’s been a slow year for good ideas. The most recent one of reading a IBM client tape using Basic-Plus in RSTS/E using the simh emulator, was very enjoyable to me. This is something we (our company) did on a daily basis, because we received client tapes which were mostly…actually it might have been totally in an IBM tape format.

Now emulation is very cool to me. However I see no need to put endless hours, honing my RSTS/E or TK4- (MVS) skills, because what will it get me? I use Python for most everyday problems, is there ever a Time where I think IBM Cobol or Basic-Plus would be a better choice to solve everyday problems? NO! Even the tools I use to help me do things on TK4-, are usually written in Python or Go. I think gnuCOBOL is very cool. But is it better than Python or Go for just about any project today? NO!

When I first learned about TK4- (MVS) I thought…cool. But i don’t want to create a test database of 20 or 100 records. How realistic is that? So for me it was very important to figure out how to process larger more realistic datasets. And I did that! I talk about it here, here and here. And probably a few more places. So I proved to myself that MVS running in TK4- was up to the task of handling real world data. At least in simple batch jobs. However in real world use you need to be able to put data in a database. At one time VSAM was very familiar to me. But today I look at it and it just looks confusing. And I don’t want to re-familiarize myself with it.

Now if a real IBM database, DB2 was available I would jump at the chance to learn and use that. Because it’s based on SQL, which I’m fairly familiar with. But that would just lead to wanting to be able to access that data on a terminal. And I have little interest in KICKS that runs in VM (CMS). Jay Mosley has also written an interesting article on it. However in writing this paragraph I learned that KICKS also runs in TSO, which I guess has been true, but for some reason it just flew over my head. So perhaps that would be a great project to look into. As a matter of fact Jay Mosley’s article is about installing it in MVS. The current version of KICKS is 1.5.0 from 2014…almost 10 years ago.

Install new Linux Mint

Went from 20.3 to 21.2. And yes I can now play OpenArena. I can also play Nexuiz but it has the same problem as on the Laptop where clicking Quit does nothing. Both of these are old style FPS but still a lot of fun for an old slow guy like me.

Start reinstalling packages.

OpenArena

Seriously thinking of installing the newest Linux Mint on my desktop so I can play this again. Installed it on the Laptop and it plays. I think I read about an issue with it playing on the Ubuntu version this is based on. Installed a similar style game…Nexuiz which mostly works. The cursor is trapped within the bounderies of the game and Quit doesn’t work. I can Ctrl+Alt+Tab to leave then kill darkplaces in the System Monitor.

ComputerLand

In early computer history you often read about ComputerLand. As a resident of Miami…back in the day, I thought I remembered going to ComputerLand in Coral Gables. So I googled and found a August 28, 1985 Sun Sentinel article, that confirmed my memory…”5 COMPUTERLAND STORES ARE CLOSED”, it continues…”Dynamation’s stores are located in Fort Lauderdale, Sunrise, Coral Gables, Kendall and North Miami Beach, and their closings leave at least 40 to 50 employees indefinitely laid off…”. For some reason I wasn’t aware of the one in North Miami Beach, it should have been closer. I would drive there and look at interesting computer products. I wasn’t a big spender and mostly remember buying a computer magazine often Creative Computer and sometimes some TRS-80 software.

VT100 emulation

A little note to myself. Because I may need this to attach more terminals to simh/RSTS

If you type man screen…it begins…

SCREEN(1) General Commands Manual SCREEN(1)
NAME screen – screen manager with VT100/ANSI terminal emulation
SYNOPSIS
screen [ -options ] [ cmd [ args ] ]
screen -r [[pid.]tty[.host]]
screen -r sessionowner/[[pid.]tty[.host]]

DESCRIPTION
Screen is a full-screen window manager that multiplexes a physical ter‐
minal between several processes (typically interactive shells). Each
virtual terminal provides the functions of a DEC VT100 terminal
and, in
addition, several control functions from the ISO 6429 (ECMA 48, ANSI
X3.64) and ISO 2022 standards (e.g. insert/delete line and support for
multiple character sets). There is a scrollback history buffer for
each virtual terminal and a copy-and-paste mechanism that allows moving
text regions between windows.

sim> help dz
DZV11 Terminal Multiplexer (DZ)

The DZV11 is a 4 line terminal multiplexor.  Up to 32 DZV11's (128 lines) are
supported.  The default number of lines is 16.  The number of lines can
be changed with the command

   sim> SET DZ LINES=n            set line count to n

The line count must be a multiple of 4, with a maximum of 128.

The DZV11 supports three character processing modes, 7P, 7B, and 8B:

  mode    input characters    output characters
  =============================================
  7P  high-order bit cleared  high-order bit cleared,
                  non-printing characters suppressed
  7B  high-order bit cleared  high-order bit cleared
  8B  no changes      no changes

The default is 8B.

The DZV11 supports logging on a per-line basis.  The command

   sim> SET DZ LOG=n=filename

enables logging for the specified line(n) to the indicated file.  The command

   sim> SET DZ NOLOG=line

disables logging for the specified line and closes any open log file.  Finally,
the command:

   sim> SHOW DZ LOG

displays logging information for all DZ lines.

Once the DZV11 is attached and the simulator is running, the DZV11 will listen for
connections on the specified port.  It assumes that the incoming connections
are Telnet connections.  The connection remains open until disconnected by the
simulated program, the Telnet client, a SET DZ DISCONNECT command, or a
DETACH DZ command.

Other special DZ commands:

   sim> SHOW DZ CONNECTIONS           show current connections
   sim> SHOW DZ STATISTICS            show statistics for active connections
   sim> SET DZ DISCONNECT=linenumber  disconnects the specified line.


All open connections are lost when the simulator shuts down or the DZ is
detached.

DZ Multiplexer Attach Help

DZ multiplexer lines may be connected to terminal emulators supporting the
Telnet protocol via sockets, or to hardware terminals via host serial
ports.  Concurrent Telnet and serial connections may be mixed on a given
multiplexer.

Modem Control signalling behaviors can be enabled/disabled on a specific
multiplexer line with:

   sim> ATTACH DZ Line=n,Modem
   sim> ATTACH DZ Line=n,NoModem

A Telnet listening port can be configured with:

   sim> ATTACH DZ {interface:}port

The -U switch can be specified on the attach command that specifies
a listening port.  This will allow a listening port to be reused if
some prior connections haven't completely shutdown.

Line buffering for all 16 lines on the DZ device can be configured with:

   sim> ATTACH DZ Buffer{=bufsize}

Line buffering for all 16 lines on the DZ device can be disabled with:

   sim> ATTACH DZ NoBuffer

The default buffer size is 32k bytes, the max buffer size is 1024k bytes

The outbound traffic for the lines of the DZ device can be logged to files
with:

   sim> ATTACH DZ Log=LogFileName

The log file name for each line uses the above LogFileName as a template
for the actual file name which will be LogFileName_n where n is the line
number.

Multiplexer lines may be connected to serial ports on the host system.
Serial ports may be specified as an operating system specific device names
or using simh generic serial names.  simh generic names are of the form
serN, where N is from 0 thru one less than the maximum number of serial
ports on the local system.  The mapping of simh generic port names to OS 
specific names can be displayed using the following command:

   sim> SHOW SERIAL
   Serial devices:
    ser0   COM1 (\Device\Serial0)
    ser1   COM3 (Winachcf0)

   sim> ATTACH DZ Line=n,Connect=ser0

or equivalently:

   sim> ATTACH DZ Line=n,Connect=COM1

Valid line numbers are from 0 thru 15

The data rates for the lines of the DZ device are set
programmatically within the running simulator.  When connected
via telnet sessions, a speed increase factor can be specified with
a SPEED=*factor on the ATTACH command.

Some simulated systems run very much faster than the original system
which is being simulated.  To accommodate this, multiplexer lines 
connected via telnet sessions may include a factor which will increase
the input and output data delivery rates by the specified factor.
A factor is specified with a speed value of the form "*factor"
Factor values can range from 1 thru 32.
Example:

   sim> ATTACH DZ 1234,SPEED=*8
   sim> ATTACH DZ Line=2,SPEED=*4

If an attach command specifies a speed multiply factor, that value will
persist independent of any programatic action by the simulated system to
change the port speed.

An attachment to a serial port with the '-V' switch will cause a
connection message to be output to the connected serial port.
This will help to confirm the correct port has been connected and
that the port settings are reasonable for the connected device.
This would be done as:

   sim> ATTACH -V DZ Line=n,Connect=SerN

Line specific tcp listening ports are supported.  These are configured
using commands of the form:

   sim> ATTACH DZ Line=n,{interface:}port{;notelnet}|{;nomessage}

Connections to the specified port, by default, will be unrestricted.
Connections from particular IPv4 or IPv6 addresses can be restricted
or allowed based on rules you can add to the "{interface:}port"
specifier on the attach command.  You can add as many rules as you need
to the attach command specified with ";ACCEPT=rule-detail" or
";REJECT=rule-detail" where rule-detail can be an IP address, hostname
or network block in CIDR form.  Rules are interpreted in order and if,
while processing the list, the end is reached the connection will be
rejected.

Direct computer to computer connections (Virutal Null Modem cables) may
be established using the telnet protocol or via raw tcp sockets.

   sim> ATTACH DZ Line=n,Connect=host:port{;notelnet}|{;nomessage}

Computer to computer virtual connections can be one way (as illustrated
above) or symmetric.  A symmetric connection is configured by combining
a one way connection with a tcp listening port on the same line:

   sim> ATTACH DZ Line=n,listenport,Connect=host:port

When symmetric virtual connections are configured, incoming connections
on the specified listening port are checked to assure that they actually
come from the specified connection destination host system.

A line on the DZ device can be attached in LOOPBACK mode:

   sim> ATTACH DZ Line=n,Loopback

A line on the DZ device can be specifically disabled:

   sim> ATTACH DZ Line=n,Disable

When operating in LOOPBACK mode, all outgoing data arrives as input and
outgoing modem signals (if enabled) (DTR and RTS) are reflected in the
incoming modem signals (DTR->(DCD and DSR), RTS->CTS)

All connections configured for the DZ device are unconfigured by:

   sim> DETACH DZ

A specific line on the DZ device can be disconnected with:

   sim> SET DZ DISCONNECT=n

This will cause a telnet connection to be closed, but a serial port will
normally have DTR dropped for 500ms and raised again (thus hanging up a
modem on that serial port).

Any lines connected to serial port can be manually closed by unplugging
the serial cable from the host computer.  Dynamically adding or removing
a serial port from a mux while the simulated operating system is running
is guaranteed to have an inconsistent state between the running OS and
the simulated port state.  Restart the simulator without the serial port
attached.

The terminal lines perform input and output through Telnet sessions connected
to a user-specified port.  The ATTACH command specifies the port to be used:

   sim> ATTACH {-am} DZ {interface:}port      set up listening port

where port is a decimal number between 1 and 65535 that is not being used for
other TCP/IP activities.  The optional switch -m turns on the DZV11's modem
controls; the optional switch -a turns on active disconnects (disconnect
session if computer clears Data Terminal Ready).  Without modem control, the
DZV11 behaves as though terminals were directly connected; disconnecting the
Telnet session does not cause any operating system-visible change in line
status.

sim> 

New Bluetooth headphones

I ordered/received Ankor A20i Bluetooth headphones. My old JLAB Bluetooth headphones wouldn’t pair with my laptop. And they would discharge in the charging case if not connected to power. I was hoping these new Bluetooth headphones connect to the laptop. I’ve had good luck with Ankor products. Except for the first Bluetooth speaker I bought whose old style USB connector became loose and I had to play games with the cable to get a connection to charge it. This was definitely an Ankor problem because I had a old LG phone that I used as a music player and it required frequent charges and I never had a connection problem with it. And there was much less wear and tear on the speaker USB connector, because I had to charge it infrequently (much less often than the phone) because the battery was so good. It was a good speaker with a very long battery life, but finally I could no longer get a USB connection to charge it with. I finally bought Ankor Soundcore 3 speaker that has a USB C connection. It also has a log battery life. So far that’s worked great.

The new Bluetooth headphones wouldn’t connect to the laptop either. The computer didn’t even see them. However a firmware update was available through the Soundcore phone app. The app downloaded and installed the update…and then it connected!

Linux laptop

I’ve wanted a Linux Laptop for a long time but assumed I’d have to spend a lot of money to get one. I assumed it was risky just buying a off the shelf laptop and hoping Linux might work on it. The cheapest laptop I can find today from System 76 is the $999 Galago Pro 14″.

The laptop my daughter gave me as I said here is the $699 (from Amazon) HP laptop, model 15-DY1023DX. 15.6″

The HP is $300 cheaper has a bigger screen and 4GB more memory. HP is a known respected brand. Also the HP is touchscreen. In a brief look I couldn’t find anywhere that says the Galago Pro 14″ is touchscreen. Now the Galago Pro 14″ can be upgraded with more memory and a larger hard drive. But that will only increase the price. And you can’t upgrade the screen size!

In addition they sell laptop bags from $149-$179. Now I’m guessing a lot of people might be tempted to get a bag for their shiny new laptop at time of purchase. Let me get this bag so everyone will know what I have! I bought a perfectly nice Amazon Basic bag for $16. Albeit, unlike the System 76 bag…it’s may not be “made with consciously-sourced materials from around the world”. But it works for me.

I had zero problems installing the latest Linux Mint. And it runs fine.

This makes me think that a large part of the System 76 appeal is perceived status…which I don’t care about. These high prices seems to go against the Linux philosophy to me.

All this makes me wonder how many other laptops would work fine with Linux.

Looking for something to put gfortran through it’s paces

Something above my abilities and Fortran experience. I found SOFA (Standards of Fundamental Astronomy) there are 250 Fortran 77 programs.

The web page says…

The SOFA Collection consists of two libraries of routines, one coded in Fortran 77 (the one I downloaded) the other in ANSI C. There is a suite of vector/matrix routines and various utilities that underpin the astronomy algorithms, which include routines for the following:

  • Astrometry
  • Calendars
  • Time Scales
  • Ecliptic Coordinates
  • Earth Rotation and Sidereal Time
  • Ephemerides (medium precision)
  • Fundamental Arguments
  • Galactic Coordinates
  • Geocentric/Geodetic Transformations
  • Precession, Nutation and Polar Motion
  • Star Catalog Conversion

After running Make. I ran…

bill@bill-MS-7B79:/Fortran/Programs/sofa/20210512/f77/src$ make test
mkdir -p /home/bill/lib/
cp libsofa.a /home/bill/lib/libsofa.a
gfortran -O -Wall t_sofa_f.for -L/home/bill/lib/ -lsofa -o t_sofa_f
./t_sofa_f
T_SOFA_F validation successful
bill@bill-MS-7B79:/Fortran/Programs/sofa/20210512/f77/src$