View previous topic :: View next topic |
Author |
Message |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Jun 11, 2010 9:38 am Post subject: Invalid File Refence !! Easytrieve giving MAXCC=16 |
|
|
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 |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Fri Jun 11, 2010 11:13 am Post subject: |
|
|
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 |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Jun 11, 2010 12:34 pm Post subject: |
|
|
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 |
|
 |
mf_user Intermediate

Joined: 01 Jun 2003 Posts: 372 Topics: 105
|
Posted: Fri Jun 11, 2010 12:47 pm Post subject: hint you've given |
|
|
Kolusu, with the hint you've given I modified the code as given below and it has worked
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 |
|
 |
|
|