After ist run program got abended at 120th record and O/P file was written 100 recs onto it. When I resubmitted the job from the failed step it again failed at same (i.e. 120th) record and it still have 100 records.
I am not able to understand how o/p file has 100 recs only and why not 200 records when the dispostion is MOD and I am opening it in Extend mode in program. AS per my observation the dataset should be appended each time after running the same step.
When you post the JCL (or pretty much anything) please use the CODE button, to put the code tags around your data. You have lost all your spacing. You have no comma after the DISP, so you have invalid JCL, which you have presumably typed, so you are not showing the actual JCL. Why not try to copy/paste it, then it saves you work and gets the information you are seeing into the forum as well.
Why would you want duplicate records? If you back-out everything, that should include your PCSFEEOP, if you don't back-out everything you shouldn't be doing the first 100 records again. I don't know about having EXTEND and MOD, I don't think you need both. Personally, I'd go with MOD. The JCL default for only specifying MOD would not delete your file in the case of an abend.
Where are you specifying your blocksize? If you have 100 records from your first run, yet your program abended without correctly closing the file, I'd not expect you to have 100 records, but for the last block (most of your file) to be missing. Is your blocksize 500? I think then you'd get 100 records, but you are doing a lot more actual IO than would be necessary if blocked reasonably.
We'd need more information for the particular problem. Did you look at the messages part of your output and see if there is anything there relating to the file?
Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix
I'm having a long morning. . .
If you omit the status subparameter, the default is NEW.
If you omit the normal termination disposition subparameter, the default is DELETE for a NEW data set or KEEP for an existing data set.
If you omit the abnormal termination disposition subparameter, the default is the disposition specified or implied by the second subparameter. However, if the second subparameter specified PASS, the default abnormal termination disposition is DELETE for a NEW data set or KEEP for an existing data set.
If you omit the DISP parameter, the default is a NEW data set with a disposition of DELETE for both normal and abnormal termination disposition. Thus, you can omit the DISP parameter for a data set that is created and deleted during a step.
Has it been confirmed whether the dataset exists or is being newly created?
DISP=MOD, so exists. TS writing to it 100 records at a time. Job fails at 120 input record, TS finds 100 output records on dataset. TS runs job again, fails again, again finds 100 records on dataset. TS wonders why 100, not 200.
Curiously, despite the TS knowing the number of records on the file, Jose thought it might have been deleted.
Joined: 03 Oct 2009 Posts: 1775 Location: Bloomington, IL
The manual I linked to is a bit ambiguous as to whether the data set is deleted if it is new (i.e,, not pre-existing) or only if it is NEW (i.e., allocated with DISP=NEW). As Mr. Woodger says, however, the data set exists after the step is run.
At this point it is perhaps not inappropriate to ask that the TS provide some evidence that the step actually did abend; as we all know from sorry experience, "abend" is a term frequently misused by querents on this board.
The JCL snippet could be either, it looks like it was initially used to define the dataset, then edited down. Could now be MOD,DELETE,DELETE if the dataset doesn't exist, but then how to know how many records...
We need the TS back. He is telling us stuff, and not telling us stuff, so we can only speculate.
For instance, if he says there are 100 records on the dataset, maybe he's just looking at a record count in the dump, or a display after the records are written? I tried asking what his blocksize is, but no response. Unless the blocksize=lrecl I don't see how there would be 100 records on the dataset if the file hasn't been closed (because the current buffer would not have been written). If effectively unblocked, he'd see 100, otherwise fewer.
Perhaps he's just looking at counts, and Jose was right.
Joined: 29 Oct 2010 Posts: 111 Location: Puerto Rico
Like Dick mentioned that the first time the default will be DISP=(NEW,DELETE,DELETE), in this case the disposition is DISP=(MOD). If the file doesn't exist it will create the file but if you don't put a termination disposition it will be deleted at normal or abnormal termination. When you run again the job it will try to create the file but if it doesn't have a termination disposition of KEEP it will be deleted again.