Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Hi all,
This is the message I have got from SPOOL after running a PLI Program.
Quote: |
The ENDFILE condition was raised when the end of an input file was
encountered. There was no ON-unit to handle the ENDFILE condition.
The ERROR condition has been raised.
To prevent the ERROR condition from being raised, add an ON-unit to
handle the ENDFILE condition for each input file used in the program.
The oncode is 0070. |
I want to know how to add ON-unit to handle the ENDFILE condition.
Please help me. The program what I have tried is given below.
Quote: |
DCL EMPFL FILE RECORD INPUT;
DCL MOREREC BIT(01) INIT('1'B);
DCL NO BIT(01) INIT('0'B);
DCL 01 EMPST,
05 ENO PIC '9999',
05 ENAME PIC 'XXXXXX',
05 ESAL PIC '99999',
05 DEPT PIC 'XX',
05 FILLER CHAR(63);
ON ENDFILE(EMPL) MOREREC = NO;
READ FILE(EMPFL) INTO(EMPST);
DO WHILE(MOREREC);
PUT SKIP LIST(EMPST);
READ FILE(EMPFL) INTO(EMPST);
END;
|
|
|
Gnanas N
Active Member
Joined: 06 Sep 2007 Posts: 792 Location: Chennai, India
|
|
|
|
Sorry, I found logic error in my program. I got the correct thing.
Quote: |
ON ENDFILE(EMPL) MOREREC = NO; |
should be
Quote: |
ON ENDFILE(EMPFL) MOREREC = NO; |
I request the moderator to delete this topic. Sorry for the inconvenience. |
|