
Quick Index
OpenVMS: Source Code in HTML
Click here to view a directory of my zipped files not yet converted
(a.k.a. "Compaq-BASIC for OpenVMS Alpha", "DEC-BASIC")
(should work with no modifications on VAX or Itanium)
| Topic | Revised Zip | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| BASIC "File Related" Demos (RMS) | |||||||||
| HP-BASIC for OpenVMS is one of many DEC languages with built-in support for RMS (Record Management Services) which is an ISAM (Indexed Sequential Access Method) technology. Although RMS is not as cool as SQL compliant databases like Oracle, RMS is small, fast and free. I've even used HP-BASIC and RMS to implement quite a number of web-based applications. Click OpenVMS Notes: RMS / Oracle-RDB / MySQL for more information. | |||||||||
| rms_relative_demo.bas demonstrates "RMS based" relative record access with modern error handling. | moved to HTML | ||||||||
| rms_indexed_demo.bas demonstrates "RMS based" indexed record access with modern error handling. | moved to HTML | ||||||||
| rms_test_fsp.bas demos opening an unknown file, then uses FSP$ to get more information about it. | moved to HTML | ||||||||
| rms_test_useropen.bas demos opening an unknown file via a USEROPEN function. | moved to HTML | ||||||||
| Download a BASIC program to fix "FTP induced SAVESET corruption". Click here for a brief explanation of why this happens. | 2001-01-12 | ||||||||
| sys_file_io_demo.bas demonstrates how to open, write, and read OpenVMS files using system calls like sys$open. | moved to HTML | ||||||||
| BASIC "File Related" Demos (Oracle-RDB) | |||||||||
| Download a zip
containing over 43 files which include: BASIC Oracle-RDB Demo 1 consists of two very simple BASIC applications to demonstrate how to call SQLMOD procedures to fetch individual RDB records via a cursor. One program uses SQLCODE while the other uses SQLSTATE. (Oracle recommends using SQLSTATE for all new program development) BASIC Oracle-RDB Demo 2 consists of a more complicated BASIC application to demonstrate how to use "Dynamic SQL" to fetch individual RDB records via a cursor. This program declares then uses SQLDA (SQL Descriptor Area). Programmatically creating and executing SQL statements on the fly is a very powerful tool. BASIC Oracle-RDB Demo 3 is a collection of programs which:
|
2006-06-27 | ||||||||
| BASIC Programs calling the I/P Stack (TCPware) | |||||||||
| TCPware-ftp-sample.bas demonstrates how to call TCPware FTP Library functions | moved to HTML | ||||||||
TCPware-telnet-sample.bas demonstrates how to call
TCPware
TELNET Library functions to do the following TCP activities:
Uses:
lib$get_ef lib$free_ef
sys$asctim sys$bintim sys$setimr sys$wflor (wait
for any one of these event flags) |
moved to HTML | ||||||||
| TCPware_smtp_demo.bas to demo TCPware calls for interfacing with an SMTP server on port 23 | moved to HTML | ||||||||
| TCPware_pop3_demo.bas to demo TCPware calls for interfacing with an POP3 server on port 110 | moved to HTML | ||||||||
| BASIC Programs calling the I/P Stack (TCP/IP Services for OpenVMS) (a.k.a. UCX Services) | |||||||||
These two programs demonstrate a
sys$qio
based TCP client/server application employing TCP/IP
Services for OpenVMS (formerly "UCX Services"):
|
moved to HTML | ||||||||
| BASIC Programs supporting requests from Apache (CSWS-1.3 and SWS-2.x) | |||||||||
| a CGI program (written in BASIC) which can be used to sit between Apache and your application. Note that the name of all HTML form objects will be prefixed with the string "FORM_FLD_" before being converted to DCL symbols. | moved to HTML | ||||||||
apache_demo.bas
is a quick
hack demo program that shows how to extract information from a web
page submitted to Apache for OpenVMS (CSWS/SWS) using CGI
(Common Gateway Interface). This program can run in four different
modes:
|
moved to HTML | ||||||||
New CGI
(Common Gateway Interface) programs which will allow very large
files to be uploaded from HTML forms like this:<form method="post" enctype="multipart/form-data" action="/scripts/upload_test_neil"> <input type="text" name="textline"> <input type="file" name="datafile"> <input type="submit" name="Send"> </form> |
coming soon | ||||||||
| www_password_change.bas is a program that allows OpenVMS passwords to be changed from a dynamically generated web page (HTML). This program will not work as-is until a small amount of code is removed (look for the word "chop"). Apache needs to be running with SYSPRV. (usually a bad thing unless your server is only exposed to a corporate intranet) | moved to HTML | ||||||||
| BASIC Data Conversion / Data Manipulation | |||||||||
| iso_8859_to_ascii.bas demos how to convert ISO-8859-1 (8-bit) string data to plain ASCII (7-bit) strings. | moved to HTML | ||||||||
| ebcdic_ascii.bas demos how to convert between EBCDIC and ASCII. | moved to HTML | ||||||||
| sort_demo.bas demos how to demo how to sort a sequential file using VMS system calls. | moved to HTML | ||||||||
| Article: Fun with Floating Point Data Types | moved to HTML | ||||||||
| BASIC "Miscellaneous Stuff" | |||||||||
| View a BASIC include (device_controls.inc) containing escape sequence definitions needed to controlling various devices (VT100, VT200, LA50). Normally you would do this by making calls to the terminal driver but there are times when this approach can be more efficient. | moved to HTML | ||||||||
| View a BASIC
program (population_sim.bas) to generate simple population models based upon selectable parameters like:
first age of reproduction, maximum age of population,
maximum reproductions per couple, etc. China's one-child
program will not shrink the size of their population as fast as many
people believe. Click here to view some sample runs. |
moved to HTML | ||||||||
| BASIC "Source Code Maintenance" | |||||||||
Can't download my "Source
Code Tools for OpenVMS BASIC" package which contains:
|
removed |
||||||||
| BASIC Programs "Demonstrating OpenVMS System Calls" | |||||||||
| Link to another page on this site: Hacking the OpenVMS Starlet library | moved to HTML | ||||||||
| View two
"include files" which will be necessary
only if one of my
demo programs will not compile on your system. |
moved to HTML | ||||||||
| dcl_symbols.bas a demo to
create/read DCL symbols. |
moved to HTML | ||||||||
| Programs to demo how to implement programmed time delays like 100 ms and 900 ms. |
moved to HTML | ||||||||
| vms_mail_send_demo.bas
demos how to send VMS MAIL programmatically without using DCL |
moved to HTML | ||||||||
| vms_mail_forward_demo.bas demos to how to inspect VMS MAIL forwarding | moved to HTML | ||||||||
Programs to demo how to manipulate logical names.
|
moved to HTML | ||||||||
| display_system_error.bas demos how to translate OpenVMS numeric return codes into "Message Text". | moved to HTML | ||||||||
| demo_lock_cef.bas demos how to use CEF (Common Event Flag) locks. | moved to HTML | ||||||||
View four programs
showing how to call DLM (Distributed Lock Manager)
|
moved to HTML | ||||||||
| peek_demo.bas is demo which uses a "BASIC function" to PEEK at memory (can be converted to POKE but I can't think why you'd want to). Great for exploring things like dynamic string structures, arrays, etc. Okay so in 2011 I needed to use BASIC to patch a linked-list and so wrote a POKE routine) | moved to HTML | ||||||||
| foreign_cmd.bas demos how to read command line parameters (similar to the way that "c" programs do) | moved to HTML | ||||||||
| getjpi_demo.bas a demo on calling lib$getjpi and sys$getjpi (note that sys$ calls require "more setup" than lib$ calls) | moved to HTML | ||||||||
View a pair of simple
client/server programs, to demo communication
through an OpenVMS memory device known as a "mail box".
|
moved to HTML | ||||||||
| download
a demo program which shows how to call to the terminal driver to
disable, then re-enable, the BROADCAST parameter. Can be used as a
template for changing any other terminal parameter settings. Uses: sys$qiow sys$assign sys$dassgn io$_sensemode io$_setmode tt$m_nobrdcst tty2$m_brdcstmbx |
moved to HTML | ||||||||
| download a demo on calling sys$getqui to do nested wildcard operations on queues. This program was my first attempt at writing a system health monitoring utility. The final version (which will not be put into the public domain) has many more features. | moved to HTML | ||||||||
| watchdog.bas iss an inactive terminal watchdog. This program was my first attempt at writing software using OpenVMS system calls. | moved to HTML | ||||||||
| password_search.bas
demos how to search SYSUAF for a lost password. Note: Please read the following 5 notes on system passwords. |
moved to HTML |
System Password Notes:
$set def sys$system
$run authorize
uaf>mod * /pwdminimum=8
exit
$
which results in the total number of possible candidate minimum length
passwords to be guessed changing from 38^6 (3.01e+9) to 38^8 (4.34e+12).
Of course you could always use a larger password and I think I'll do
this on my priv accounts. BTW, it might be a good idea to monitor
unusual access to SYSUAF using ACL's and $SET AUDIT
(a.k.a. "Compaq-BASIC for OpenVMS VAX", "Compaq-BASIC for VAX", "VAX-BASIC")
(a.k.a. "Compaq-CXX for OpenVMS Alpha", "Compaq-C++", "HP-C++")
(a.k.a. "Compaq-C for OpenVMS Alpha", "Compaq-C for OpenVMS VAX", "DEC-C")
Note: VAX-C was phased out prior to VMS 6.0 and replaced with DEC-C. Don't do any new program development with VAX-C.
Noteworthy "C" demos at other sites (my "C" hacks are nowhere near
professional quality):
Noteworthy "C" articles:
|
|
| Topic | revised |
|---|---|
| view four demo
programs to experiment with LDAP 1) one demo is meant to test an unauthenticated LDAP connection 2) one demo is meant to test an authenticated LDAP connection |
moved to HTML |
| Two demo
programs from Process Software Corporation 1) smtp-check.c is a demo used to "test an SMTP" connection 2) http-check.c is a demo used to "test an HTTP" connection |
moved to HTML |
| ebcdic-ascii-demo.c is a stub that demos data conversions from EBCDIC to ASCII and back | moved to HTML |
| getuai.c is a stub that calls SYS$GETUAI | moved to HTML |
| vms_lock_dlm.c is a DLM (Distributed Lock Manager) demo | |
| view two repaired versions of Compaq's QIO client/server examples (from TCPIP$EXAMPLES in OpenVMS-7.2). The originals crash when run. | moved to HTML |
Web Page Hit Counter (2.4 + 2.6)
|
| Topic | Revised |
|---|---|
| DECnet task-to-task communications | |
|
moved to HTML |
| Uncategorized Stuff (will be categorized soon) | |
|
The Name Game
! example 2a (written by a careless VAX programmer).
1000 a% = 3 ! the VAX complier produces CISC code to convert 3 from real to integer at runtime
b% = 4 ! the VAX complier produces CISC code to convert 4 from real to integer at runtime
print a% + b% ! end program 1 ! return -s- to DCL
! example 2b (written by a careful VAX programmer).
1000 a% = 3% ! both compilers generate code which represents an integer 3
b% = 4% ! both compilers generate code which represents an integer 4
print a% + b% !
end program 1 ! return -s- to DCL
! example 3 (why add the variables if you don't have to?)
1000 print "7" ! the compiler added 3 to 4 "at compile time" so only this I/O statement was required
end program 1 ! return -s- to DCL
1000 option type=explicit ! example 4 declare long i% ! for i% = 1 to 100 ! should be "1% to 100%" on VAX; Alpha doesn't care because long was declared print i% ! next i% ! end program 1 !
If you compile with optimization=level=4 and used a smaller loop, the Alpha complier might decide to just generate a series of PRINT statements. This is called "loop unrolling".
Back
to Home
Neil Rieck
Kitchener - Waterloo - Cambridge, Ontario, Canada.