----- REXXCMS FORUM appended at 14:43:55 on 90/11/09 GMT (by TSGSH at GFORD1) - Subject: Performance of 'Address' commands Ref: Append at 08:04:47 on 90/11/09 GMT (by MSLADE at WINVMB) An answer, but not quite to the question you asked. Its a long answer because the speed depends primarily on where in the search order your command is to be found, and the command search order is complicated, but easy to use when you know it. For Address CMS, the search order is ... 1. Search for an EXEC with the name (but not if SET IMPEX is OFF) a) in storage b) on disk 2. Search for a translated command or synonym (but not if SET TRANSLATE or SET SYNONYM are OFF) if found, replace the command name, and try 1a and 1b again, using the translated name/synonym 3. Try CMSCALLing the command (with original name) ie. a) a Nucleus Extension loaded with the original name b) a Module loaded in the transient area with the original name c) a Nuclues resident CMS command with the etc. d) a MODULE that is an open file e) a MODULE on disk 4. Try step 2. again, if found, try 3a-3e again with the translated name/synonym 5. Try a CP command but not if SET IMPCP is off So to run an EXEC, "Address CMS execname" is fast, but for a CMS command, it is slower, especially if there are a lot of disks with EXECs on them accessed. "Address CMS 'EXEC' execname" is slow for the same reason. If you're concerned about performance, you don't really want the search order above (its complex, slow to find modules, has three occurences of "but not if SET xxxx is OFF", and it employs language translation and synonyming). Address CMS is designed for the beginner - issuing a command from an EXEC is just like doing it from the command line. For a program complex enough to have "performance considerations", you want Address COMMAND which is designed for EXECs where the programmer knows what he's doing. This does just steps 3a-3e and 4. to run an EXEC you use Address COMMAND 'EXEC' execname for a CP command Address COMMAND 'CP' cpname This makes your EXEC much more predictable, and so for any EXEC other than a trivial one, its a very good idea to do an Address COMMAND at the top of the EXEC, to make it a default for the rest of the EXEC. All you have to do is remember to put the 'EXEC's and 'CP's at the front of the commands. for CALL func orfunc(), there are two flavours CALL func or func() searches for 1. Internal labels 2. Built-in functions eg. pos() 3. Extenal functions a. DBCS functions (Release 6+ ??) b. Try CMSCALL for RXfunc (see 3a. in the Address CMS order above) c. Look through REXX's function packages in the order i. RXUSERFN ii. RXLOCFN iii. RXSYSFN if a package recognises the function, load it and do step 3b (which will work) d. If the filtetype of the issuing program is not EXEC, look for a program with filename func and the same filetype i. In storage (EXECLOADed) ii. On disk e. Look for func EXEC i. In storage (EXECLOADed) ii. On disk f. Try CMSCALL for func (see 3a. in the Address CMS order above) g. give up A look-aside buffer of function names is used for performance reasons. CALL 'FUNC' or 'FUNC'() This format bypasses internal functions and the look-aside buffer. So, "CALL func" or "func()" is faster than "CALL 'FUNC'" or "'FUNC'()", but not for the first invocation. If the function has a name like RXSETVAR MODULE, then it is *much* faster to use "CALL setvar" than CALL rxsetvar Steve Hayes UKIIS VM Systems Support, Greenford PS. One little usage note: some commands, notably ESTATE and ESTATEW (the preferred versions of STATE(W) for EXECs) behave slightly differently (and very usefully so) with address COMMAND viz. Address CMS 'ESTATE NON- EXISTENT *' gives RC 28, and an error message if NON- EXISTENT does not exist Address COMMAND 'ESTATE NON- EXISTENT *' doesn't give an error message for RC 28 - its the sort of error you probably expected anyway, so eg. Address COMMAND : : 'ESTATE' outfile; if RC = 0 then 'ERASE' outfile gets rid of an old output file quietly, but if you just did the ERASE, you'd get an error message if it didn't exist.