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 

Invalid File Refence !! Easytrieve giving MAXCC=16

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Jun 11, 2010 9:38 am    Post subject: Invalid File Refence !! Easytrieve giving MAXCC=16 Reply with quote

Hi,

This easytrieve issues MAXCC=16 beause of
Code:

    44 *******A010 INVALID FILE REFERENCE - INFILE2 


Code:
Code:

//SYSIN    DD *                           
  FILE INFILE1                           
       IN-REC1                 01 0345 A 
       IN1-ID                  01 03   A 
       *                                 
  FILE INFILE2                           
       IN-REC2                 01 0345 A 
       IN2-ID                  01 03   A 
       *                                 
  COUNT1                       W  10   N 
  COUNT2                       W  10   N 
******************************************
*                           PROCEDURE     
******************************************
JOB  INPUT NULL                           
*                                         
   DO WHILE NOT EOF INFILE1               
      PERFORM CODE2                       
   END-DO                                 
*                                         
   DO WHILE NOT EOF INFILE2               
      PERFORM CODE2                       
   END-DO                                 
*                                         
  IF EOF INFILE1 AND EOF INFILE2           
     DISPLAY 'FILE1 RECORDS => ' COUNT1
     DISPLAY 'FILE2 RECORDS => ' COUNT2
  END-IF                                   
*                                         
  IF COUNT1 NE COUNT2                     
     RETURN-CODE = 04                     
  END-IF                                   
  STOP                                     
*                                         
  CODE1. PROC                             
    IF IN1-ID = 'AAA'                         
     COUNT1 = COUNT1 + 1                   
    END-IF                 
    GET INFILE1             
  END-PROC                 
*                           
  CODE2. PROC               
    IF IN2-ID = 'AAA'         
    COUNT2 = COUNT2 + 1     
    END-IF                 
    GET INFILE2             
  END-PROC                 
*                           
//*                         


Would you please let me know what is wrong and should be corrected?

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12378
Topics: 75
Location: San Jose

PostPosted: Fri Jun 11, 2010 11:13 am    Post subject: Reply with quote

mf_user,

Not to nitpick but that is a poorly written code. on the first look itself I can tell you the problem is with CODE1 & CODE2 . You did not even open the file for the first read and yet you are validating it contains AAA which you cannot do.

You are making a Simple requirement into a huge task.

Good luck

Kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Jun 11, 2010 12:34 pm    Post subject: Reply with quote

Kolusu, I am novice to Easytrieve. I looked into the programming guide and came up with this code. At some point I got it worked with MAXCC=0 but not exact results......

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
mf_user
Intermediate


Joined: 01 Jun 2003
Posts: 372
Topics: 105

PostPosted: Fri Jun 11, 2010 12:47 pm    Post subject: hint you've given Reply with quote

Kolusu, with the hint you've given I modified the code as given below and it has worked Very Happy

Code:

//SYSIN    DD *                           
  FILE INFILE1                           
       IN-REC1                 01 0345 A 
       IN1-ID                  01 03   A 
       *                                 
  FILE INFILE2                           
       IN-REC2                 01 0345 A 
       IN2-ID                  01 03   A 
       *                                 
  COUNT1                       W  10   N 
  COUNT2                       W  10   N 
****************************************
*                           PROCEDURE   
****************************************
JOB  INPUT NULL                         
*                                       
   GET INFILE1                         
   DO WHILE NOT EOF INFILE1             
      PERFORM CODE1                     
   END-DO                               
*                                       
   GET INFILE2                         
   DO WHILE NOT EOF INFILE2             
      PERFORM CODE2                     
   END-DO                               
*                                       
  IF EOF INFILE1 AND EOF INFILE2           
     DISPLAY 'FILE1 RECORDS => ' COUNT1 
     DISPLAY 'FILE2 RECORDS => ' COUNT2 
  END-IF                                   
*                                           
  IF COUNT1 NE COUNT2                       
     RETURN-CODE = 04                       
  END-IF                                   
  STOP                                     
*                                           
  CODE1. PROC                               
    IF IN1-ID = 'AAA'                         
     COUNT1 = COUNT1 + 1                   
    END-IF                                 
    GET INFILE1                             
  END-PROC                                 
*                                           
  CODE2. PROC                               
    IF IN2-ID = 'AAA'                         
    COUNT2 = COUNT2 + 1     
    END-IF                 
    GET INFILE2             
  END-PROC                 
*                           
//*                         


May I request you to know the simplified version please?

Thanks.
_________________
MF
==
Any training that does not include the emotions, mind and body is incomplete; knowledge fades without feeling.
==
Back to top
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming 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