Re: Tab delimiter
- From: Robin Lee <robinlee@xxxxxxxx>
- Date: Mon, 30 Oct 2006 18:36:46 -0500
Richard wrote:
Robin Lee wrote:
As an aside, Microfocus (or at least the Microsoft version of it) had a
(-N) runtime switch to suppress tab expansion,
That's not what it does. Well, not in any way that is useful. The 'N'
(Null) switch has been in Microfocus at least as far back as Level II
Cobol, as is the 'T' (Tab) switch.
But neither does quite what is normally meant by 'suppressing tab
expansion'.
When the Null switch is on (+N) on writing there will be a Null (x"00")
inserted before each hex character in the record less than x"1B". This
will make a tab into a x"00"x"09" pair. On reading these pairs will
not be expanded and the nulls will be stripped so that the record is as
it was when the WRITE was executed. It will still expand solo tabs.
When the Null switch is off (-N) there is no null insertion on writing
and tabs are expanded on reading.
If it is required to read 'tab separated' data from other programs then
it would be required to have the 'tab' preceeded in each case by a
null.
The Tab switch on causes writing to replace runs of spaces with a tab
character where appropriate. Tabs are expnaded on reading regardless of
this setting.
Thank you for the refresher. Of course you are right, and my recall of how the switches work was blurry. But now I remember that it was the whole null insertion kludge that made processing line sequential files so awkward. And even with that you *still* couldn't read a tab delimited file. Truth is, once I started using my own assembler routines I never again even thought of the N and T runtime switches.
as well as a system call that
could be executed from within the program to do the same. In the long run,
I found these to be so awkward that I instead wrote an assembly language
routine to do the chore of reading sequential files. This proved to be
quite reliable, and also allowed accommodating other non-printable
characters, as well as files with non-DOS line terminations ... files from
other systems with other variation of textual data files.
I haven't had to deal with this yet in Fujitsu... it's good to know ahead of
time that there's no way to work around it, other than perhaps preprocessing
the input file, as my assembly skills aren't what they used to be.
You could call C routines. Just call fopen, fgets, fclose.
I figured something like that. But now Ski has posted a reference to CBL_IO
routines so I'll look them over in the docs, just in case I run across the need someday.
Again, thanks for the refresher on MF line files.
.
- References:
- Tab delimiter
- From: hmitchell
- Re: Tab delimiter
- From: Richard
- Re: Tab delimiter
- From: HeyBub
- Re: Tab delimiter
- From: Donald Tees
- Re: Tab delimiter
- From: Richard
- Re: Tab delimiter
- From: Robin Lee
- Re: Tab delimiter
- From: Richard
- Tab delimiter
- Prev by Date: Re: calling SOAP services (or TCP messages in general) from iSeries Cobol
- Next by Date: Re: Single Source CICS/Batch
- Previous by thread: Re: Tab delimiter
- Next by thread: Something has to be tested and maintained was Re: GoTo in Java
- Index(es):
Relevant Pages
|