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: 3053
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top