Page 2 of 2

Re: sort:count

PostPosted: Tue Mar 19, 2013 10:23 pm
by dick scherrer
Hello,

Why do you believe your code goes into an infinite loop?

I suspect it more likely that there is a Reply of some kind outstanding that has not been satisfied.

Re: sort:count

PostPosted: Wed Mar 20, 2013 6:30 am
by BillyBoyo
Is your input PDS(E) the same as your output PDS(E). If so, I'd not do that.

Re: sort:count

PostPosted: Wed Mar 20, 2013 8:36 am
by steve-myers
Actually, that's perfectly safe; a PDS can have an unlimited number of readers, but just one writer. SORTIN is a reader, only SORTOUT is a writer. Not only that, the DISP=(NEW on the SORTOUT DD statement ensures Pearl's job has exclusive control of the data set for the life of the job.

I sort of agree with Mr. Scherrer; something else is going on here, and based on Pearl's obvious lack of experience based on previous posts here, I would not trust his initial diagnosis.

Re: sort:count

PostPosted: Wed Mar 20, 2013 10:22 pm
by pearl
enrico-sorichetti wrote:
thankx alot...your code is working. but, i am yet to find the error in mine.


should not be that difficult... did You read my comment about the EXTRA comma ???


Yes. I had removed the comma but got the same error.

Re: sort:count

PostPosted: Wed Mar 20, 2013 10:23 pm
by pearl
BillyBoyo wrote:Is your input PDS(E) the same as your output PDS(E). If so, I'd not do that.


Yes. Is it wrong to do so?

Re: sort:count

PostPosted: Thu Mar 21, 2013 7:18 am
by steve-myers
pearl wrote:[... Yes. Is it wrong to do so?
Actually, yes. You specify DISP=(NEW,CATLG) on your SORTOUT DD statement. What happens depends on whether the output data set is SMS managed or not.

If the output data set is SMS managed, the system will want to catalog the data set immediately. It can't do this because it has the same name as another data set, so the allocation will be aborted and the step won't run.

Now if the data set is not SMS managed, the data set will be allocated but not cataloged - yet - and the step will run. When the step completes, the system will attempt to catalog the data set. It can't because the name already exists in the catalog. The system will leave the uncataloged data set where it is, write a diagnostic message and continue.

Which action is the "best" action is debatable. The not SMS approach permits the step to run, but you have this uncataloged data set that must be manually corrected. Sadly, the need to correct the situation is frequently not done. The SMS approach does not leave an orphaned data set behind, but the job must be corrected before it can be run. Your call, not mine.