FILE HANDLING Problem....



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

FILE HANDLING Problem....

Postby GauravKudesiya » Thu Mar 26, 2009 9:41 pm

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....
GauravKudesiya
 
Posts: 4
Joined: Thu Mar 26, 2009 12:19 am
Has thanked: 0 time
Been thanked: 0 time

Re: FILE HANDLING Problem....

Postby GauravKudesiya » Thu Mar 26, 2009 11:00 pm

DONE..........
GauravKudesiya
 
Posts: 4
Joined: Thu Mar 26, 2009 12:19 am
Has thanked: 0 time
Been thanked: 0 time

Re: FILE HANDLING Problem....

Postby dick scherrer » Fri Mar 27, 2009 1:11 am

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. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post