But it is giving different results every time when there is no data in the dataset.
For example it is giving proper result on Testing system (Which is correct):
Code:
IDC11462I REQUESTED RANGE END BEYOND END OF DATA SET.
IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 4
But on production system is giving 2 different results randomly (When there is no data in the dataset)
First Results: (Wrong result as there is no data)
Code:
LISTING OF DATA SET - CYC.PRODDAT.CYCVRINV.CVNSLTR
RECORD SEQUENCE NUMBER - 1
ORDRSP,........,IAUC6VMH,,,20040902103936,FTP
IDC0005I NUMBER OF RECORDS PROCESSED WAS 1
IDC0001I FUNCTION COMPLETED, HIGHEST CONDITION CODE WAS 0
IDCAMS SYSTEM SERVICES
Second Result (Job failed):
Code:
0IDC3302I ACTION ERROR ON CYC.PRODDAT.CYCVRINV.CVNSLTR
IDC3313I ** ,CYCVRINV,JSTEP025,378B,D,CHKLETTR,
GET ,WRNG.LEN.RECORD,00000032000E00,QSAM
0IDC0005I NUMBER OF RECORDS PROCESSED WAS 0
0IDC3003I FUNCTION TERMINATED. CONDITION CODE IS 12
Joined: 03 Dec 2002 Posts: 579 Topics: 1 Location: Iowa, USA
Posted: Thu Sep 02, 2004 9:46 am Post subject:
It looks like the old problem where a dataset gets allocated but the program never does OPEN/CLOSE so no valid EOF exists. Whatever records were in that spot before are showing thru. Check the job that creates the file.
You are right. When there is no record in the dataset, we are not performing any OPEN/CLOSE opertaion for this file.
But here I have one doubt: why it is giving 3 different results for same condition (For no data )e.g. on Test machine it is giving correct results while on production system it is giving 2 different results and unfortunately both are wrong results.
Just to restate Bill's point - if no EOF is written, you get whatever data was at that location before. This would be different for your production and devlopment files and would also change anytime the file was reallocated. You should expect the results to be different/random each time. To get this to work correctly you must write an EOF indicator after allocating the file.
Joined: 04 Dec 2002 Posts: 71 Topics: 0 Location: Little Falls, NJ
Posted: Fri Sep 03, 2004 10:20 am Post subject:
From the IBM "Using Data Sets" manual
" When the system allocates a new SMS data set with DSORG=PS or no DSORG,
the access methods treat the data set as being null, that is, having no
data. A program can safely read the data set before data has been written
in it. This means the first GET or first CHECK for a READ causes the EODAD
routine to be called.
For data sets other than system managed with DSORG=PS or null, the program
will receive unpredictable results such as reading residual data from a
prior user, getting an I/O error, or getting an ABEND. Reading residual
data can cause your program to appear to run correctly, but you can get
unexpected output from the residual data. You can use one of the following
methods to make the data set appear null:
1. At allocation time, specify a primary allocation value of zero; such
as SPACE=(TRK,(0,10)) or SPACE=(CYL,(0,50)). This technique does not
work with a VIO data set because creation includes the secondary space
amount.
2. After allocation time, put an end-of-file mark at the beginning of the
data set, by running a program that opens the data set for output and
closes it without writing anything. "
so a SMS-managed sequential dataset will get an automatic EOF. For non-SMS you must OPEN?CLOSE the dataset to get the EOF written. _________________ Bruce A. Black
Senior Software Developer
Innovation Data Processing
Joined: 15 Dec 2002 Posts: 637 Topics: 43 Location: Bengaluru, INDIA
Posted: Fri Sep 03, 2004 10:51 am Post subject:
Bruce/Mike,
Not getting an automatic EOF is also true for tape datasets when not closed?
That is the reason why tape datasets cannot be allocated using IEFBR14 (SR 15,15 and BR 14 instructions only) ? _________________ ALL opinions are welcome.
Debugging tip:
When you have eliminated all which is impossible, then whatever remains, however improbable, must be the truth.
-- Sherlock Holmes.
Joined: 04 Dec 2002 Posts: 71 Topics: 0 Location: Little Falls, NJ
Posted: Fri Sep 03, 2004 2:57 pm Post subject:
For tape it is even worse. A disk dataset will be created at step initiation time when you specify DISP=NEW, so it will be there even if it doesn't get OPENed.
But a tape dataset is not created until OPEN time, so if you don't OPEN it, the tape labels will not get created and any attempt to OPEN it for input will fail because it doesn't exist. actually, I believe that you can't even catalog it because it usually doesn't get the volser until OPEN time (at least for file 1 on the tape). _________________ Bruce A. Black
Senior Software Developer
Innovation Data Processing
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum