View previous topic :: View next topic
|
Author |
Message |
pepeo_2k3
New User
Joined: 04 Nov 2023 Posts: 6 Location: Azerbayjan
|
|
|
|
Hi all,
I want to write a program in COBOL to traverse a hierarchical database and extract each specific segment type in a separate file. Since it has to be a generic stub code to extract different databases , there will be an unknown number of files that the program has to open ,write and close calling BPXWDYN.
The problem raises when I have to keep more than one file descriptor at a given time because each database has to be read in a pre-order manner (Root,Left and then Right),
I don't want to define a restriction and think of considering a maximum FD entry . So is there any way to define a single file handler through The Select statement and also a single FD entry , but use it for different external files with out opening and closing the files repeatedly? |
|
Back to top |
|
|
Rohit Umarjikar
Global Moderator
Joined: 21 Sep 2010 Posts: 3076 Location: NYC,USA
|
|
|
|
Well you know what’s the max segment size in current IMS DB , then define double that size as remaining fillers ..
You can write multiple segments with headers and in one dataset and later using SORT SPLIT TO multiple datasets . |
|
Back to top |
|
|
pepeo_2k3
New User
Joined: 04 Nov 2023 Posts: 6 Location: Azerbayjan
|
|
|
|
Thanks for your reply.
In this way, the operation department involves in separating different record types from the only generated output file and they have to negotiate with DBADMIN to know what types of records are included in the extracted database
which increases data lost risks, Either it needs development department to involve in writing specific jobs for each database on demand. It wouldn't be a generic solution I mean ... |
|
Back to top |
|
|
|