I like Donna's plan; This is a strategy that will also help whenever you
want similar functionality on a NON-MPE platform. Also, althought COBOL
is very able, an external script might be a better tool. You don't
always need a hammer ;-)
This is hypothetical, trying to make a point. From your MPE CI prompt,
type "HELP FINFO", you should be able to set some variables (SETVAR
FILEA "XXX"), and using finfo add some more variables. Then from COBOL
using HPCIGETVAR, string together a BUILD command (with a bigger LIMIT
maybe), and call "HPCICOMMAND". You could string the build command from
a command, into a sigle var, then COBOL only needs to HPCIGETVAR once.
You can also write a script to do everything you want, and call
HPCICOMMAND to run the script, pass it parms.... Its pretty cool, and it
makes your COBOL application more portable. (Same program, different
script).
For example: On MPE I once wrote (using COBOL) a small utility to CALL
DBINFO, extract ALL the meta-data from any IMAGE database, and then
create, and write to the NEW KSAM COPYLIB, ending up with all the COBOL
copylib modules needed for all datasets for any database, including call
statements and working storage. My point is that I used CI scripting to
create and write to the copylib. I actually used ECHO to write the
copylib ksam file from a CI script. Now, seeing how I work more on HPUX
& Linux, Using OpenCOBOL and Eloquence I should be able to compile this
same program on Linux with minimal modifications, only changing the
external script.
I use this method to access SQL databases, and much more, using
OpenCOBOL & Tcl/Tk. This way I can run the same program, same script
almost anywhere, no matter, Windows, Mac, or Unix.
--
Mike.
On 06/19/2012 10:38 AM, donna hofmeister wrote:
> You might want to use the link Francois just gave and get a copy of the
> "Using KSAM XL and KSAM 64" manual (or google for it...)
>
> Chapters 3 and 4 seems to cover the areas you have questions about.
> Listfile,5 seems to be a rightly nifty thing ;-)
>
> Rather than beat yourself silly trying to get devise a pure cobol solution,
> you might be well advised to *augment* what you're doing with some CI
> scripts that you call from your program. - d
>
>
> Donna Hofmeister
> Allegro Consultants, Inc.
> 408-252-2330
>
>
> -----Original Message-----
> From: HP-3000 Systems Discussion [mailto:[log in to unmask]] On Behalf
> Of John Pollard
> Sent: Tuesday, June 19, 2012 8:08 AM
> To: [log in to unmask]
> Subject: Re: [HP3000-L] Cobol: Cobol and HPFOPEN
>
> Thanks for the response.
>
> The reason I need the intrinsics is that Cobol requires that the file be
> correctly defined in order to use Cobol to open it.
>
> To open a KSAM file, for example, you must define all the keys for the file
> in the Cobol program.
>
> I want to be able to open any input file (or almost any file) without the
> program knowing any of the file characteristics until it is opened.
>
> Then I want the Cobol program to be able to create a new output file from
> scratch, using only the characteristics of the input file.
>
> So I can't build the file characteristics into the program using Cobol
> constructs.
>
> Think of it as similar to what FCOPY does.
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
>
> * To join/leave the list, search archives, change list settings, *
> * etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|