Format Statement T descriptor problem

Format Statement T descriptor problem

I am writing 1000 character records to an output file using a format statement which works perfectly in my mainframe version but my VF compiled version has a problem. There are a several T descriptors in the format statement. All records after the first record are written to the file perfectly. The first record ends up being split into many lines and each of these split lines begines with the same strange characters. If I use an X descriptor to replace the T descriptor at the position where the problem occurs, the line does not split there but still ends up getting split at some later point. I could replace all T descriptors with X descriptors but it would be nice to know why this problem occurs.

6 posts / 0 new
Last post
For more complete information about compiler optimizations, see our Optimization Notice.

I can't tell from your description what the issue is, but I'd guess you're running to format reversion. (Look up this topic in the Language Reference Manual.) Note that the T format simply repositions you in the current buffer but does not itself cause any data to be transferred.

Steve

Steve - Intel Developer Support

I would have put my money on RECL being too small, or a compiler bug. Format reversion should work the same in CVF as on a mainframe, right? If the OP is relying on the default RECL instead of setting it explicitly, he is exposing himself to a behavior that really can vary from compiler to compiler. The first line doing something different and wierd, though... maybe a bug in the compiler. But if it's a header line, more likely some kind of bug in the program. A small example that demonstrates this behavior would be useful here.

I doubt it's a compiler bug, and I don't think RECL units are an issue either. Of course, with no actual example to look at, it's hard to know.

Steve

Steve - Intel Developer Support

Here is a little more detail:
In CMS the following write statement would write output as shown:

WRITE (13,100) FTYPE, APCODE, CITY, STATE, APALT, MAGVAR,
1 APNAME, TPI, LPI, TEMPID, REVDTE, ZONECD, HSHTTL

100 FORMAT (T2, A, T10, A, T24, A, T40, A, T58, F6.0, T68, I3,
1 T79, A, T121, 'TPI ', A, T134, 'LPI ', A, T144, 'T DEG ',
2 A, T155, A, T171, A, T962, 'HASHTOTAL ', I8 )

(First 50 columns only)
|...+....1....+....2....+....3....+....4....+....5
AIRPT ATL ATLANTA, GA
AIRPT MCO ORLANDO, FL
AIRPT LAX LOS ANGELES, CA
AIRPT SLC SALT LAKE CITY, UT
AIRPT DFW DALLAS-FT WORTH TX

But with CVF the same write statement gives me the following output
(First 50 columns only)
|...+....1....+....2....+....3....+....4....+....5
AIRPT ATL ATLANTA, GA
(The first line is correct for the first 132 characters)

(This goes on for about 80 lines)
(Then this text which is actually columns 962-979 of the first record)
HASHTOTAL 1030
AIRPT MCO ORLANDO, FL
AIRPT LAX LOS ANGELES, CA
AIRPT SLC SALT LAKE CITY, UT
AIRPT DFW DALLAS-FT WORTH TX
AIRPT DFW DALLAS-FT WORTH TX

Still can't tell from what you've written what might be happening. I note that you're running CVF 6.1, which is two years old. I'm not aware of any bugs in format processing like this, but one never knows. If you can reproduce the problem in 6.6, send us an example at vf-support@compaq.com.

Steve

Steve - Intel Developer Support

Leave a Comment

Please sign in to add a comment. Not a member? Join today