I have to find some logic from an old legacy code. My manager says is COBOL, I'm not sure about it. I have tried to find some keywords on cobol tutorials without any luck.
Here are some code snippets:
PROC(&QPROG);
VERIFY OFF PROC;DECLARE &MSG1 AS A75;
/* DON'T CALL SCREEN IF IT'S FROM */
IF &QPROG NE 'YUITG' THEN DO;
CALL QAAF;
SCREEN QUERY LOADED QAAF OTW DO;
PRINT 'SCREEN WILL NOT LOAD';
EXIT;
END;
END;
ON ERROR DO;PRINT &&RC;EXIT; END;
IF LENGTHB(&P_WHAT) = 4 THEN DO; &P_WHATT = SUBSTR(&P_WHAT,1,1) CAT
', ' CAT SUBSTR(&P_WHAT,2,1) CAT ', ' CAT SUBSTR(&P_WHAT,3,1) CAT
' & ' CAT SUBSTR(&P_WHAT,4,1);
END;
DECLARE &KEYWORDD_A(0) AS A1;
DECLARE &KEYWORDD_F(0) AS 99L;
&KEYWORDD_A=
(SUBSTR(&KEYWORDD,1,1),SUBSTR(&KEYWORDD,2,1),SUBSTR(&KEYWORDD,3,1),
SUBSTR(&KEYWORDD,4,1),SUBSTR(&KEYWORDD,5,1),SUBSTR(&KEYWORDD,6,1),
SUBSTR(&KEYWORDD,37,1),SUBSTR(&KEYWORDD,38,1),SUBSTR(&KEYWORDD,39,1),
SUBSTR(&KEYWORDD,40,1));
&KEYWORDD_F = FINDEX(&KEYWORDD_A = ' ',ALL);
IF &PROG EQ &NAV THEN DO;
&ALLPROG = 'YES';
&PROG = 'PR2';
END;
-TOP_PROG
CMS FILEDEF QAA2 DISK QAA2 NOMAD A6 (LRECL 100;
WRITE '/* REPORT */' ON QAA2;
WRITE '&GRP = ''' CATB &GRP CATB ''';' ON QAA2;
WRITE '&MGTRPT = ''' CATB &QPROG CATB ''';' ON QAA2;
IF &RFROM NE &NAV THEN DO;
WRITE '&RFROM = ''' CATB DISPLAY(&RFROM) CATB ''';' ON QAA2;
END;
CLOSE QAA2;
EDIT:
This has been bugging me. Reasoning that it was not EXEC and not Rexx, but was clearly running in CMS, that left EXEC 2.
However, I now believe it is NOMAD itself. Difficult to confirm, but here, http://www.tallant.com/portfolio/webpages/web/nomad/nomad2.html, are examples of some of the code.
Whether it runs from/alongside EXEC 2, I don't know. It may just operate in a similar manner, or just have support for "shelling out" to CMS or CP as necessary to perform "system functions".
So, it is probably not...
It is EXEC2.
There are two "old" command languages with VM/CMS, the oldest, and most limited, is EXEC. Rexx was the "new" command language.
If you think that this is bad, imagine what EXEC is like. EXEC and EXEC2 have similarities to CLIST, but I don't know if they have a joint ancestor.
So, it is what is these days "a shell-scripting language" to do with IBM's VM operating system, which is the original "Virtual Machine" and which includes the ability to run multiple copies of a "single-user operating system" called CMS (Conversational Monitor System, I believe) which only runs on VM and which is where the "CMS FILEDEF" comes in (it is "shelling out" to CMS), as well VM can run, as single or multiple instances, full-blown IBM operating systems such as DOS/VSE, MVS, VM (again, which can then run other "Guest" operating systems) and these days z/OS, z/VSE and, I don't know, but probably Linux.
Edit. It is very bad practice that it includes the "/" "/" comment. If the first line of a file starts and ends like that, then the contents are assumed the be Rexx. VM supports all three "languages" but runs different interpreters depending on how the program starts.
From memory, EXEC starts with an * (comment), EXEC2 does not need that, and Rexx with the /* to */, which on CMS can span more than one line.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With