Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

One of my COBOL program(build usi 2

Status
Not open for further replies.

cobp

Programmer
Oct 19, 2001
30
0
0
DE

One of my COBOL program(build using Visual AGE COBOL) has a FILE defined with RECORDLENGTH =80.

When the Input file line character length greater than 80, It splitts the record at 80 th column and remaining characters are considered for the next record. But I want only to have a single record for each input file line, even if it conatins more than 80 characters. Probably this would be possible, by trimming of the remaining characters, but this is OK, for me.
Do we have any option for this?

Interesting thing is that i have the same application compiled in Realia COBOL. Same Application build using REALIA COBOL, gives me desired results(single record for one line). But the record split happens only in Visual Age COBOL. Is there any Compile options, File handling constructs that avoids record split?
 
I don't know the details for Visual Age, but I think you can avoid this by making the file LINE SEQUENTIAL rather than RECORD SEQUENTIAL.

Regards.

Glenn
 
Why do you think it should be legal to *TELL* COBOL that the maximum record size is 80 bytes - but then to "allow" records greater than 80 bytes?

It is true that Line Sequential *might* work, but you really, REALLY should provide the maximum record size when defining files. If the records are vairaible in length, you should tell the compiler this.

Bill Klein
 
If I understand cobp correctly, he can live with the truncation. The problem is that in Visual Age, the truncated data is brought back as the next record.

If my assumption is correct, then the problem is at the file structure level, and the two compilers are interpreting the beginning of each record differently.

The file does not appear to have been built "properly" for standard COBOL file system: it's not Entry Sequenced or Relative or Key Sequenced. The record delimiter is probably a line feed or tab or something of that sort. Check the structure of the file, and then see if your compiler has directives (default or explicit) to handle it.

Dimandja
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top