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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Problem with tabs in Output

Status
Not open for further replies.

dave41

IS-IT--Management
Jul 24, 2000
2
0
0
US
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
 
Hi,

I don't know the cause but you can get rid of them by using the free rcopy routine of CA.

Syntax:

RCOPY <inputfile>[T] <outputfile>[N]

If you use Realia, you can use the same formatters to force the output to be normal.

Where the tabs perhaps part of the input?

I hope this is helpful.

 
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.
 
Dave41,

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 &quot;ANYFILE&quot;.
05 PRNT-FIL-NAM3-EXT PIC X(04) VALUE &quot;.TXT&quot;.
03 PRNT-FIL-NAM4-TYPE PIC X(03) VALUE &quot;[N]&quot;.


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 &quot;U&quot; 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.

Have a good day,


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top