Page 1 of 1

FILE HANDLING Problem....

PostPosted: Thu Mar 26, 2009 9:41 pm
by GauravKudesiya
I am using following code:

FILE-CONTROL.
SELECT HPDCEXC ASSIGN TO HPDCEXC
FILE STATUS IS FS1.
SELECT HPDCRULE ASSIGN TO HPDCACF
FILE STATUS IS FS2.
SELECT HPDCOUT ASSIGN TO HPDCOUT
FILE STATUS IS FS3.

DATA DIVISION.
FILE SECTION.
FD HPDCEXC
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS
DATA RECORD IS EXCREC.
01 EXCREC PIC X(7).

FD HPDCRULE
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS
DATA RECORD IS HPDCREC.
01 HPDCREC PIC X(50).

FD HPDCOUT
RECORDING MODE IS F
LABEL RECORDS ARE STANDARD
BLOCK CONTAINS 0 RECORDS
DATA RECORD IS OUTREC.
01 OUTREC PIC X(50).


PROCEDURE DIVISION.
.
.
.
.
READ HPDCREC AT END MOVE 'Y' TO EOFA.
MOVE HPDCREC TO OLD-RECORD.

.
.
.
READ EXCREC AT END MOVE 'Y' TO EOFB.
MOVE EXCREC TO EXCEPTN-TID.

.
.
.
IF OLD-RECORD(8, 7) = EXCEPTN-TID
GO TO 0599-COMPARE-REC-EXIT
ELSE
MOVE OLD-RECORD TO OUTREC
WRITE OUTREC.

Getting error on MOVE Statements...


like :

71 IGYPS2074-S "HPDCREC" was defined as a type that was invalid in this context. The statement was discarded.
78 IGYPS2074-S "EXCREC" was defined as a type that was invalid in this context. The statement was discarded.
88 IGYPS2120-S Expected a reference-modification specification but found "7". The "IF" statement was discarded.



I am not able to find out where i am missing.....

Thanks in Advance for your Help....

Re: FILE HANDLING Problem....

PostPosted: Thu Mar 26, 2009 11:00 pm
by GauravKudesiya
DONE..........

Re: FILE HANDLING Problem....

PostPosted: Fri Mar 27, 2009 1:11 am
by dick scherrer
Hello,

DONE..........
Maybe not completely. . . :?

After the 2 posted READs, the code moves the "input" record even if none was read (i.e. the file went "at end"). This will probably cause problems (either abends or incorrect results) - preferable sooner than later. . .

FWIW - OLD-RECORD didn't make it to the topic. Neither did EXCEPTN-TID. If there were more to do, it might be difficult without these. . .