Friday, February 28, 2025

OpenVMS IF-THEN-ELSE Maximum Depth, Levels

Up to what depth or level can you do for OpenVMS IF-THEN-ELSE?


Just the other day, I found out (for good!) that OpenVMS IF-THEN-ELSE has a limit on the depth or level that will work properly. What is the meaning of this?


Simply, if you have many conditions to check, and you do a multiple IF-THEN-ELSE, or what we would also call a NESTED IF in Object-Oriented Programming (OOP), the limit of level or depth that you can do in OpenVMS is?


15.


Yes, 15.


I found out about this the hard way. I have been running a script for many days already, actually months, and I had no clue whatsoever. I just know that some checks, especially those recently added, well, they don't seem to work. I thought they do, and the error is happening intermittently. And that would be harder to troubleshoot.


But one fine day, as I was requested to run the same OpenVMS script more and more, like it was every week, then daily, and recently, many times in a day.


That gave me more chance to see why the script is 'intermittently ' -- or so I thought -- failing. When I scrolled the screen back up, I saw some 'invalid IF' error. I put some 'write sys$output' on each check to know where the failure is happening.


Before that (the 'write sys$output'), I was having a hard time scrolling back and forth, up and down, what could be causing the 'invalid IF', but found none.


Finding none, I thought of putting the 'write sys$output' line on each check, before each check is done.


Et voila!


The check continues to print the check, but I found that after the 15th IF under ELSE, the 'invalid IF' error is thrown. That gave me the idea, so I split the IF-THEN-ELSE clauses into different sets.


First set is up to 15 IF-ELSE, then a check is added to verify the placeholder if having a value, which is supposed to be populated when a match is found. So if no value is assigned, the second set of 15 IF-THEN-ELSE clauses is entered.


I don't have more than 30 conditions to check, so if I have, it will be from 31 to 45 IF-THEN-ELSE clauses.


So there you have it. 15.


How many levels of IF-THEN-ELSE clauses can you nest together? Up to 15 only.


I hope that this helps all fellow OpenVMS enthusiasts out there, encountering the same issue as I did, but found the fix in time.


Thank you and till then!


Friday, May 17, 2024

Back to VMS-PROMIS

After 10 years doing many other things, I am back to PROMIS running in VMS. At the start of the year I am doing a total recall, and muscle memory kicks in now and then, starting with my account name, which is one letter different. Had to get used to it ASAP, and all the other scripts that I used to run I had to recreate.

This time around, I will need to really document my learning. Will do it.

Till then.


Monday, May 11, 2015

Questions in PROMIS? Ask Me!

English: The logo of Oracle Corporation de:Bil...
English: The logo of Oracle Corporation de:Bild:Oracle-Logo.svg he:תמונה:Oracle Logo.jpg (Photo credit: Wikipedia)
English: This chart represents several constit...
English: This chart represents several constituent components of the SQL language in a single SQL Update (SQL) statement Ελληνικά: Γλωσσικά στοιχεία σε ένα statement SQL (Photo credit: Wikipedia)
12-May-2015


Hi guys!

Been some time since I posted in my blog. I am doing online business now, and I find that this is taking a lot of my time, even at home. I can't concentrate anymore on my blogs.

Not the full concentration I had then.

I ask therefore, that if you have anything you want to know about PROMIS, please drop me a comment, a question.

Then I will post the answer.

That is actually how I started in VB6 and SQL, and Oracle 10. I didn't know, but the opportunity to learn was there, and there were expert colleagues - who were not selfish nor stingy - and answered patiently every question that I raised, and even more...

Database Normalization eBook

Then my boss gave me a huge project, which I built slowly and steadily, asking even more and more questions, until I had to decide to buy an e-book, which gave me more idea, leading to more questions, and so on and so forth, until I was already designing and building applications and systems - alone.

Okay, so I believe I have put the message across: please ask me questions, and I will try to answer as objectively as possible.

Till then, thank you!

Thursday, October 30, 2014

Coming up...

Inner view of a Seagate 3.5 inches hard disk d...
Inner view of a Seagate 3.5 inches hard disk drive Medalist ST33232A model manufactured in Malaysia in 1998. Parallel ATA interface, ultra DMA mode 2, I/O data-transfer rate 33.3 MB/s max, 3,227 MB, 3 platters, 6 physical read/write heads, spindle speed 4,500 RPM, cache buffer 128 kB, MTBF 300,000 hours, dimensions 146.8 x 102.4 x 26.2 mm, weight 540 grams. (Photo credit: Wikipedia)
30-October-2014


I saved all my scripts and command files in a portable HDD, and the disk is not in very good condition after some years of heavy use. At any rate, I was able to still copy over 99.99% of my files, so coming up... the actual scripts I used.

Hope they help somebody, as it did me.

Till then!

Tuesday, October 28, 2014

PROMIS - Login

Wikipedia login page
Wikipedia login page (Photo credit: Wikipedia)
28-October-2014


Perhaps the most ignored and seemingly insignificant part of the PROMIS session is the login part. And why not? Just invoking the session, then typing in your username and password gets you in, then what you do after that is no longer needing or relating to log-in processes.

Perhaps.

But if you do a lot of scripts, and I mean not just simple scripts, but if you have multiple log-in privilege, or that the script you wrote is run by many users who log in to different terminals at the same time, and they can run the script at the same time, then this is needing the variables you use in your scripts to be singletons, or they should be user-based, or ID-based.

ID-based would sometimes be a problem, because the same script can be run by a multi-session user, and the data cannot be crossing over. Same idea as Microsoft's "sandbox" concept.

Thus, variables can be set in the login.com file. Some other files can be invoked. Messages, etc.

But most importantly, Host- or Instance-based variables can be detected and set, and this will determine what kind of session you will be having, running.

Machines are either transaction-serving or report-serving, so having that set in your login.com file will help you know right-away which session you are running, especially if you are like me, who opens 4 sessions, at the minimum. The flexibility and speed of PROMIS running in VAX-VMS is such that multi-session is no native, making you very productive.

It was just unfortunate that the time I started learning and using PROMIS, there was not much furor about SAP, which was way behind Oracle. Our company was using SAP back then, and I would have learnt it also, maybe. That was about 20 years ago.

A lot has changed since then - but not PROMIS and VMS. They remain. And while the company I now work in has decided to build their own MES by creating their own version of a Manufacturing Execution System, the concept and base knowledge I gleaned from my almost 2 decades of working in PROMIS is in such a magnitude and scope - I learned other software and programming languages in the course of time, especially when parallel dBase was introduced, and I was one of those who "qualified and stress-tested" the new system.

And even with native PROMIS datalink extraction method, my knowledge in Excel was enhanced, as there was a lot of data massaging afterwards - which all went away naturally when reports were generated using the parallel database, all running in Oracle. Which made me very comfortable navigating the tables because I know very well the structure of the ISAM files in native PROMIS, so switching to Oracle tables was a breeze, and that gave me the advantage of simply focusing on learning SQL.

I will stop here, before I digress too far away. I will present the login that make a native session come up with a unique idea that can be used as a variable for scripts that can be run at the same time by different users, or even the same user with multi-session privilege.

Till then!



Thursday, October 23, 2014

New work, new focus

JavaFX Mobile
JavaFX Mobile (Photo credit: Wikipedia)
23-October-2014


For about 5 months now, I have taken on a new job, and my focus now is more on engineering. Still, my experience as an IT practitioner is recognized, and capitalized on, from time to time.

Before I forget PROMIS, and the things that I did for the past 18 years or so, I would be documenting what I practiced, so I will have something to go back to.

Forget? Maybe not.

But it is actually the problem of forgetting the small, small things, not the major things, that causes the problem, especially as the years go by.

And, I am advancing in the years, and still learning a lot of new things: AutoCAD, Java SE 7 and 8, ASP.NET MVC, Entity Framework, C# in depth, and JavaFX. I may pick up F# soon.

Thanks to PROMIS, I learned a lot. I was forced to learn SQL, VB.NET, C#.NET and ASP.NET. So I picked up CSS and HTML in the process, and also XML. I made it good, simply because there was opportunity to learn and practice what I learned.

And what I am learning big in my new job is 'to get disturbed.'

I had to learn to stop and answer questions, or do other things, and resume what I was previously doing - seamlessly. This is one thing that I hated, and kept myself from until now.

It is, however, already a requirement of my new job, so again, given the opportunity and guidance to learn and practice this work method - I would make good at it.

New venture, and very exciting!

Till then...