Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

PUTENV UTILITY How to reopen previously allocated files

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
SVazifdar

New User


Joined: 21 Apr 2006
Posts: 14

PostPosted: Sat Mar 07, 2009 3:09 am    Post subject: PUTENV UTILITY How to reopen previously allocated files
Reply with quote

I used the PUTENV example to dynamically allocate files and it works fine. However I would like to enhance the program to do the following and would like know if it is possible.

I have a file that has header records for several customers and detail records. However the header and details for the same customer appear at different places in the file. At the present time I do not want to sort the file.

Customer1
Details
Customer2
Details
Customer1
Details
Customer3
Details
Customer1
Details
Customer4
Details


I have a program that dynamically allocates files and writes records to the files.

I allocate the file for customer1, write records, and close the file for customer1. That works fine. Next I allocate file for customer2, write records, and close the file. That works fine.

Now I would to process customer1 again so I want reopen the previously allocate file for customer1 and append records to it. Is that possible and how could it be done. Please help.

Thanks

S. Vazifdar
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Sat Mar 07, 2009 3:23 am    Post subject:
Reply with quote

Hello,

Quote:
Is that possible and how could it be done.
It can in assembler. . . Most organizations do not want to increase the amount of assembler code they must maintain. I don't know about PUTENV. Sorry.

You might consider initially reading the file as it is, making a copy of the records needed for your process and sorting those copied records. The originial file would remain as it is and the copy would be in the order needed for your process.
Back to top
View user's profile Send private message
mmwife

Super Moderator


Joined: 30 May 2003
Posts: 1592

PostPosted: Sat Mar 07, 2009 10:04 am    Post subject:
Reply with quote

Hi,

You might try to use a MOD disposition. If that doesn't work, a FREE=CLOSE along with the MOD might do the trick.
Back to top
View user's profile Send private message
Douglas Wilder

Active User


Joined: 28 Nov 2006
Posts: 305
Location: Deerfield IL

PostPosted: Mon Mar 09, 2009 9:15 pm    Post subject:
Reply with quote

If you do not close nor free the file for customer1 and use a different ddname for customer2, you could just write to the customer1 and customer2 files as needed. Otherwise you would need to free the ddname and re-allocate customer1 with disp=mod. This will add a lot of overhead to the process, and I believe that it would save resources to sort the file so that this is not needed.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts TAPE VERIFY utility?? MrExtraordinare JCL & VSAM 3 Fri Dec 09, 2016 10:57 pm
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 15 Thu Dec 01, 2016 8:28 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
This topic is locked: you cannot edit posts or make replies. How to use 2 input files in control c... Gunapala CN DFSORT/ICETOOL 23 Thu Oct 13, 2016 3:42 pm
No new posts Best IMS DB Unload Utility jjabez10 IMS DB/DC 12 Thu Sep 22, 2016 11:15 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us