View previous topic :: View next topic
|
Author |
Message |
sandip_datta
Active User
Joined: 02 Dec 2003 Posts: 150 Location: Tokyo, Japan
|
|
|
|
We're writing some records in a file, closing it and then submitting a job from the program. The job is transferring the file using NDM. We are dynamically allocating the file in the program using SETENV. Now the NDM process is failing giving an error "Resource Not available".
Why it is happenning even though we're closing the file before file transfer?
Regards,
Sandip. |
|
Back to top |
|
|
Robert Sample
Global Moderator
Joined: 06 Jun 2008 Posts: 8697 Location: Dubuque, Iowa, USA
|
|
|
|
Closing a file does not free the allocation of it. |
|
Back to top |
|
|
sandip_datta
Active User
Joined: 02 Dec 2003 Posts: 150 Location: Tokyo, Japan
|
|
|
|
Thanks for the quick reply.
Then how we can FREE the dataset in the program when we are using SETENV?
I know a process to FREE the dataset using BPXWDYN. I tried to CALL BPXWDYN to ALLOC a DDNAME against the file and then tried to FREE the dataset. But during ALLOC, BPXWDYN gives Return-code = 2. Can SETENV and BPXWDYN be used simultaneously in the same program?
Regards,
Sandip. |
|
Back to top |
|
|
vitorperin
New User
Joined: 12 Jul 2012 Posts: 2 Location: Brazil
|
|
|
|
hi,
i'm facing the same problem in my environment.
I have a cobol programa allocating several files dynamicly (using SETENV).
The thing is my cobol program never stops (It's a TASK). It calls an assembly program to stay in a 'stand by' status for some minutes, then it run again and start to allocate some other files. The cobol program runs 24/7. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello and welcome to the forum,
Is there some reason this code cannot be submitted by the scheduler periodically (if it is not already running)? If the code was submitted and there was "nothing to do" this iteration, the code simply ends.
When the code executes, it would service whatever needed to be processed and end.
Writing custum "standby" code is usually Not a good thing to do. My clients will not permit people to write their own. |
|
Back to top |
|
|
vitorperin
New User
Joined: 12 Jul 2012 Posts: 2 Location: Brazil
|
|
|
|
thanks for the greetings!
so, the reason this can't be scheduled is this way it would use more mips than running around the clock (this is my client's words, not mine).
Anyway, is there a way to free the allocation?
I heard something about 'deallocate' but I'm still searching about it. |
|
Back to top |
|
|
|