Discussion:
ChatGPT - Joke about OpenVMS and Linux walking into a bar
(too old to reply)
Slo
2022-12-31 18:41:46 UTC
Permalink
1. Two operating systems, OpenVMS and Linux, walk into a bar.
The bartender looks up and says, "What can I get you?"
OpenVMS says, "I'll have a VMSCoffee, please."
Linux says, "I'll have a LinuxLatte."
The bartender pauses for a moment and then says, "I'm sorry, but I don't think I've heard of those drinks before. What are they?"
OpenVMS says, "Oh, VMSCoffee is a rich, robust blend of legacy code and modern features. It's been around for decades and has a loyal following."
Linux says, "LinuxLatte is a light, open-source coffee with endless customization options. It's a newer option, but it's gaining popularity quickly."
The bartender nods and says, "Well, I'll see what I can do. But I have to warn you, I'm not sure I know how to make either of those."
OpenVMS and Linux just laugh and say, "Don't worry, we'll help you out. We're both pretty good at adapting to new environments."

2. OpenVMS and Linux walk into a bar, and the bartender looks at them and says "What can I get for you guys?"
OpenVMS says "I'll have a whiskey neat, please."
Linux says "I'll have a whiskey neat too, but I'll also need a virtual machine to run it on."
The bartender looks at them and says "Well, I can't really give you a virtual machine, but I can give you a separate glass to put your whiskey in."
OpenVMS looks at Linux and says "Well, at least I don't have to worry about compatibility issues."

3. OpenVMS and Linux walk into a bar. The bartender asks, "What can I get for you guys?"
OpenVMS says, "I'll have a whiskey neat, please."
Linux says, "I'll have a vodka neat, please."
The bartender asks, "So, what brings you two together?"
OpenVMS says, "Oh, we're just trying to get away from all the updates and patches on Windows."
Linux says, "Yeah, me too. I'm sick of always being told to 'apt-get upgrade'."
The bartender says, "Well, you've come to the right place. We don't have any updates or patches here."
OpenVMS and Linux both sigh in relief and say, "Ahh, finally some peace and stability."
Slo
2022-12-31 18:45:54 UTC
Permalink
$! This DCL procedure adds the first 20 integers and sends the result to ***@vsi.com
$! Declare variables
$ integer = 0
$ sum = 0
$! Loop through the first 20 integers and add them to the sum
$ do i = 1, 20
$ sum = sum + i
$ enddo
$! Use the MAIL command to send the result to ***@vsi.com
$ mail/subject="Sum of the first 20 integers" ***@vsi.com "The sum of the first 20 integers is: " sum
$! End the procedure
$ exit
Simon Clubley
2022-12-31 20:39:25 UTC
Permalink
Post by Slo
$! Declare variables
$ integer = 0
$ sum = 0
$! Loop through the first 20 integers and add them to the sum
$ do i = 1, 20
$ sum = sum + i
$ enddo
Oh, I wish. :-) Oh, I really, really, wish. :-)

I wonder where it got that from ?

A suggestion: try asking it to do something with associative arrays in
DCL and see what it comes up with. :-)
Post by Slo
$! End the procedure
$ exit
Simon.
--
Simon Clubley, ***@remove_me.eisner.decus.org-Earth.UFP
Walking destinations on a map are further away than they appear.
Slo
2022-12-31 21:03:33 UTC
Permalink
Post by Simon Clubley
A suggestion: try asking it to do something with associative arrays in
DCL and see what it comes up with. :-)
I asked for a recursion example in DCL and it showed this:

Recursion in DCL is a programming technique in which a function
or procedure calls itself repeatedly until a certain condition is met.
This allows for the repetition of a task without the need for a loop.

Here is an example of a DCL procedure that uses recursion to calculate the factorial of a number:
$! Declare the procedure and a variable to hold the result
$ procedure factorial
$ integer result
$! Check if the input number is 0 or 1
$ if $1 .eqs. 0 .or. $1 .eqs. 1 then
$ result = 1
$ else
$ ! Recursively call the procedure with the input number - 1
$ result = $1 * factorial($1 - 1)
$ endif
$! Return the result
$ return result
$! End the procedure
$ end

To use this procedure, you would simply call it with the number you want to find the factorial of
Slo
2022-12-31 21:21:00 UTC
Permalink
This is much better, beats reading the docs and googling for someone new to OpenVMS:

1. Code VAX C program to add the first 20 integers
--------------------------------------------------------------------------------
Here is a VAX C program that adds the first 20 integers:
#include <stdio.h>
int main() {
int i;
int sum = 0;
// Loop through the first 20 integers and add them to the sum
for (i = 1; i <= 20; i++) {
sum += i;
}
// Print the result
printf("The sum of the first 20 integers is: %d\n", sum);
return 0;
}

2. compile link and run
------------------------------------

To compile, link, and run a VAX C program on OpenVMS, you can follow these steps:

Compile the program using the CC command. For example:
$ CC MYPROG.C

Link the program using the LINK command. For example:
$ LINK MYPROG, SYS$SHARE:VAXCRTL/OPT

Run the program by typing the name of the executable file. For example:
$ MYPROG

Note: These steps assume that you have the necessary tools and libraries installed on
your OpenVMS system. You may also need to specify additional options or libraries
depending on your program's needs.
Arne Vajhøj
2022-12-31 21:30:10 UTC
Permalink
Post by Slo
1. Code VAX C program to add the first 20 integers
--------------------------------------------------------------------------------
#include <stdio.h>
int main() {
int i;
int sum = 0;
// Loop through the first 20 integers and add them to the sum
for (i = 1; i <= 20; i++) {
sum += i;
}
// Print the result
printf("The sum of the first 20 integers is: %d\n", sum);
return 0;
}
It seems to understand C.
Post by Slo
2. compile link and run
------------------------------------
$ CC MYPROG.C
$ LINK MYPROG, SYS$SHARE:VAXCRTL/OPT
$ MYPROG
But again it fails in DCL.

One not optimal (it is not necessary to specify extension .C) and
two not working on a standard VMS system (it is some time since I have
last seen VAX C as opposed to DEC/whatever C, but I do not recall a
SYS$SHARE:VAXCRTL.OPT file).

Arne
Dave Froble
2023-01-01 03:24:03 UTC
Permalink
Post by Slo
1. Code VAX C program to add the first 20 integers
--------------------------------------------------------------------------------
#include <stdio.h>
int main() {
int i;
int sum = 0;
// Loop through the first 20 integers and add them to the sum
for (i = 1; i <= 20; i++) {
sum += i;
}
// Print the result
printf("The sum of the first 20 integers is: %d\n", sum);
return 0;
}
2. compile link and run
------------------------------------
$ CC MYPROG.C
$ LINK MYPROG, SYS$SHARE:VAXCRTL/OPT
$ MYPROG
Note: These steps assume that you have the necessary tools and libraries installed on
your OpenVMS system. You may also need to specify additional options or libraries
depending on your program's needs.
Maybe even easier in Basic ...

S = S + I For I = 1 to 20
Print S

Oh, wait, no Basic on x86, yet, ....
--
David Froble Tel: 724-529-0450
Dave Froble Enterprises, Inc. E-Mail: ***@tsoft-inc.com
DFE Ultralights, Inc.
170 Grimplin Road
Vanderbilt, PA 15486
Johnny Billquist
2023-01-01 14:45:27 UTC
Permalink
Post by Dave Froble
Maybe even easier in Basic ...
S = S + I For I = 1 to 20
Print S
Oh, wait, no Basic on x86, yet, ....
BASIC2

s = s + i for i=1 to 20 \ print s


210

BASIC2

print date$(0);" ";time$(0)


01-Jan-23 15:45

BASIC2



(On a PDP-11, no less...)

Johnny
Arne Vajhøj
2023-01-05 01:45:20 UTC
Permalink
Post by Johnny Billquist
Post by Dave Froble
Maybe even easier in Basic ...
S = S + I For I = 1 to 20
Print S
Oh, wait, no Basic on x86, yet, ....
BASIC2
s = s + i for i=1 to 20 \ print s
 210
Basic has a pretty good LOC/FP ratio.

It has never had a great reputation among let us
call it "programming language gourmets", but lots
of business usage.

One will need to go to way newer languages to
get something similar.

Python:

print(sum(range(1,21)))

Groovy:

println((1..20).sum())

Even though one could argue that a more equivalent
code (being able to sum functions of i instead of
just i) would be Python:

print(sum([i for i in range(1,21)]))

because you can do:

print(sum([i*i for i in range(1,21)]))

Groovy would need to use a different approach like:

println((1..20).collect{it*it}.sum())

Arne

Arne Vajhøj
2022-12-31 21:00:24 UTC
Permalink
Post by Slo
$! Declare variables
$ integer = 0
$ sum = 0
$! Loop through the first 20 integers and add them to the sum
$ do i = 1, 20
$ sum = sum + i
$ enddo
$! End the procedure
$ exit
ChatGPT is not good at DCL.

My suggestion for the task:

$ sum = 0
$ i = 1
$ loop:
$ if i .gt. 20 then goto endloop
$ sum = sum + i
$ i = i + 1
$ goto loop
$ endloop:
$ fnm = f$unique() + ".txt"
$ open/write f 'fnm'
$ write f sum
$ close f
$ mail 'fnm' "SMTP%""***@vsi.com"""
$ del 'fnm';*
$ exit

Arne
Phillip Helbig (undress to reply)
2022-12-31 22:04:32 UTC
Permalink
The SMTP prefix hasn't been needed for a long time.
Loading...