MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

IDCAMS: PRINT command is giving trouble

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
nishant_mrec
Beginner


Joined: 02 Sep 2004
Posts: 2
Topics: 1

PostPosted: Thu Sep 02, 2004 5:43 am    Post subject: IDCAMS: PRINT command is giving trouble Reply with quote

We have one dataset and we are checking whether there is any data or not in this .
We are using following SYSIN parameter for

Code:

//JSTEP025 EXEC PGM=IDCAMS                                   
//CHKLETTR DD DISP=SHR,DSN=NWC.REFMDAT.CYCVRINV.CVNSLTR     
//SYSPRINT DD SYSOUT=*                                       
//SYSIN    DD *                                             
  PRINT INFILE(CHKLETTR) CHAR COUNT(1)                       
/*                                                           

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     

Can anybody help on this problem
Back to top
View user's profile Send private message
Bill Dennis
Advanced


Joined: 03 Dec 2002
Posts: 579
Topics: 1
Location: Iowa, USA

PostPosted: Thu Sep 02, 2004 9:46 am    Post subject: Reply with quote

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.

Regards,
Bill
Back to top
View user's profile Send private message
nishant_mrec
Beginner


Joined: 02 Sep 2004
Posts: 2
Topics: 1

PostPosted: Thu Sep 02, 2004 10:04 am    Post subject: Reply with quote

Bill,

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.

Thanks & Regards
Nishant
Back to top
View user's profile Send private message
Mike Chantrey
Intermediate


Joined: 10 Sep 2003
Posts: 234
Topics: 1
Location: Wansford

PostPosted: Fri Sep 03, 2004 5:40 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
bablack
Beginner


Joined: 04 Dec 2002
Posts: 71
Topics: 0
Location: Little Falls, NJ

PostPosted: Fri Sep 03, 2004 10:20 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Cogito-Ergo-Sum
Advanced


Joined: 15 Dec 2002
Posts: 637
Topics: 43
Location: Bengaluru, INDIA

PostPosted: Fri Sep 03, 2004 10:51 am    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
bablack
Beginner


Joined: 04 Dec 2002
Posts: 71
Topics: 0
Location: Little Falls, NJ

PostPosted: Fri Sep 03, 2004 2:57 pm    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group