IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Using Dynamic file handler in the File-Control section.


IBM Mainframe Forums -> COBOL Programming
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
pepeo_2k3

New User


Joined: 04 Nov 2023
Posts: 6
Location: Azerbayjan

PostPosted: Tue Nov 07, 2023 8:00 pm
Reply with quote

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
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 3075
Location: NYC,USA

PostPosted: Thu Nov 09, 2023 8:29 am
Reply with quote

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
View user's profile Send private message
pepeo_2k3

New User


Joined: 04 Nov 2023
Posts: 6
Location: Azerbayjan

PostPosted: Sat Nov 11, 2023 2:16 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> COBOL Programming

 


Similar Topics
Topic Forum Replies
No new posts how to eliminate null indicator value... DB2 7
No new posts Dynamically build sort control statem... SYNCSORT 18
No new posts Format Binary file to EBCDIC JCL & VSAM 4
No new posts Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
Search our Forums:

Back to Top