03-09-2010 02:04 AM
Thanks for the MACRO - I don't understand it but I linked it in with a COBOL and BASIC program and it worked! I also tried adding the attributes (just for COBOL) and they worked as well.
Not sure now which solution to go with: -
Hein's - as I can understand it and maintain but seems to use an undocumented 'hack'
Richard's - can't understand at all (and I won't say anything about the code ;-)
John's - easier to understand than Richards and simple to use (but not maintain)
03-09-2010 03:50 AM
Why Coutts would be using BASIC is an absolute mystery to me and, having had to code basic a few years ago, is one I'm happy to ignore.
As far as understanding my code goes, I could strip it down to bare bones but I left in some of the following validation that you may or may not find useful. The code checks: -
1) The length of the input file string is not greater than the maximum
2) The output FID address is non-zero
3) The filename does not contain a node-name as the code won't work over the network
4) Your file-spec does not contain a wildcard character or a search list that might lead to an ambiguous result
5) The DID from the $parse is not null
6) The device is in fact a disk and not a tape, mailbox etc
Now I'd personally put in about 1/2 doz more checks but I'm happy to take them out if you find the code confusing.
Also the code returns the FID and Expanded File-Spec as well as the output creation date. These can be removed also.
As far as additional output attributes goes, uhmmm. . . it's an item-list, yeh? Add more items to the list get more items? If you want you could have just 2 arguments, one the input filespec and the second the input item-list that you configure as you see fit.
As far as Hein's solution being a "hack" IIRC you/we already invested in a hack with EXTERNAL FDs in COBOL and overlaying RMS FABs and RABs in Macro on VAX. And we all know that went tits-up with Alpha which brought us to those crappy DCOB$ routines.
Anyway, I still vote for Hein's cunningly clever solution worthy of a Baldrick Turnip or two. The context is a FAB as Hein says, there's no one left to break it?
If you like to see a minimalist version of my code then let me know. Otherwise just go with Hein's and if it ever does break then you have a solution at hand.
Cheers Richard Maher
PS. Friday night *and* Saturday, that's gotta good for double time! Just like Y2K eh :-)
I bet Adam and Weirdo were in as well "monitoring". What did you do, log on? Make an enquiry?
Don't know weather it's better or worse that the tax-payer is now footing the bill over there :-)
PPS. Pepall was over the other week for a holiday
03-09-2010 03:58 AM
Why don't you post your minimilist code and I'll give that a go THEN I can use whatever I want (and not tell anyone) so all will be happy with providing a solution to my question?
PS No BASIC code in the COIN application just an executable to view/monitor the overnight
PPS Over where - Oz or UK
PPPS 'whether' NOT 'weather'
PPPPS Just standard Costa Del rates
03-09-2010 02:51 PM
Can't believe I spent over 3hrs on a Sunday and just under an hour sitting in my cruds here this morning just to paint your fence. Disbelief!
Anyway see attached for the Jenny Craig version of the code. Look, I'm all for Macro and don't have a problem with maintenance issues but if this is the *only* Macro code you've got then KISS and go with Hein's.
Mark was here on hols, he still lives over there and survived the take-over at Meryll's. Doesn't get to Swan Lane much any more and most of his time is in Croydon. Denever Technology were getting big in HP Open View and other Enterprise Management stuff so he might be worth a call?
Cheers Richard Maher
PS. I've got a sexy bit of recursive C# that populates a TreeView control from and Oracle CONNECT BY. . .PRIOR if you want to see it :-)
Good to have an excuse to do MACRO for a change!
03-10-2010 03:15 PM
I've attached a new version of the code to this. (No code changes just a some more useful comments.)
But I got to thinking about something noboby bothers with in IT anymore and that's performance. The internet is a sewer and ITRC is certainly not immune from sloppy ineficient code :-)
So for curiosity's sake (it involves getting off your bum and doing something so probably won't happen) why don't you run the different options through a couple of tests and compare the results. 1000 iterations with one file and another with 1000 filenames (perhaps across different disks?)
I believe Hein maintains that RMS's $DISPLAY references a cache and doesn't have to do lookups and should be faster. I seem to do both lookup and attribute retrieval in a single $qio to the device driver. Looks good to me; is it functionally equivalent? Does the inner-mode switch to RMS and Exec hurt performance? Is sys$display redundant?
All good questions.
Cheers Richard Maher
03-11-2010 07:55 PM
>and it worked!
Don't sound so surprised ;-)
MACRO32 isn't rocket science, it's just another programming language. In some ways it's simpler than most, but I suppose it's a bit cryptic to the uninitiated.
I've attached an annotated version of my code, with some explanation of the syntax and semantics of the language.
Hopefully it will make more sense...
03-12-2010 12:42 AM
Thanks for the commented version - I had a quick peek and it makes more sense. I've printed it out and will try to understand a bit more - maybe tonight when there's a few quite moments during another upgrade.
03-15-2010 01:46 AM
Thanks for you responses to my original query - much more than I expected.
I've gone with one of the solutions (personal choice rather than 'best of breed') and will not divulge my choice as all solutions are viable.
I'll now close this 'thread'
Thanks and regards,
03-15-2010 01:51 AM