I am working with an old COBOL program that used to produce a normal output file. Now it has tab fields between the data where it should have spaces. If anyone has some insight as to what might have caused this please let me know. Thanks
What compiler are you using? If the file is defined as line sequential, some compilers have an option that will compress spaces into TABS. This is usually a runtime switch setting.
If your using Ca-Realia, the problem is the default file format type in your compiler options. I would suspect other compilers use the same format types also.
To prevent the hidden tabs in your output, just define your file with the File Format that you would like to use...
A crude example would be something like this...
01 PRNT-HD-NAM.
03 PRNT-HD-NAM1.
05 PRNT-FIL-NAM1 PIC X(07) VALUE "ANYFILE".
05 PRNT-FIL-NAM3-EXT PIC X(04) VALUE ".TXT".
03 PRNT-FIL-NAM4-TYPE PIC X(03) VALUE "[N]".
N = TEXT FILE. ON OUTPUT REMOVE TRAILING BLANKS
T = TEXT FILE. ON OUTPUT, COMPRESS BLANKS TO TABS; REMOVE TRAILING BLANKS. ON INPUT, DECOMPRESS BLANKS.
U = TEXT FILE. LEAVE BLANKS UNCHANGED.
CHECK YOU MANUAL FOR OTHER FILE FORMAT TYPES...
Had this problem awhile back. When tring to import a flat text file into access. Used the U option to overide the default T option. One note of caution,,, dont get carried away and start using the U option in an application that has had the same file compiled using the default option of your compiler. The program that has not been compiled with the "U" option will not read in the data as you would expect!!! Been there, done that....
Let me clear this up a bit... Programs that read this data file must all be recompiled, if this file is written out using something other than the default compiler option.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.