All X'0D' lost during reading line sequential file using microfocusse

This is a discussion on All X'0D' lost during reading line sequential file using microfocusse within the cobol forums in Programming Languages category; Hi all I'm writing a batch source to match 2 input files which is exported from AIX DB2 giving the matched records. All other characters are going well except X'0D':all of them get lost when reading the input files into the program. I tried many file handler options and runtime switches but no one worked. Any advice is appreaciated. Thanks in advance! Line sequential file, variable-length record. This is the file handler I'm using now: [XFH-DEFAULT] STRIPSPACE=OFF INSERTNULL=OFF EXPANDTAB=OFF AIX 5.3, Microfocus Server Express 5.0...

Go Back   Application Development Forum > Programming Languages > cobol

Object Mix

Register FAQ Calendar Search Today's Posts Mark Forums Read
  #1  
Old 07-24-2008, 05:40 AM
taoxianfeng@gmail.com
Guest
 
Default All X'0D' lost during reading line sequential file using microfocusse

Hi all

I'm writing a batch source to match 2 input files which is exported
from AIX DB2 giving the matched records.

All other characters are going well except X'0D':all of them get lost
when reading the input files into the program. I tried many file
handler options and runtime switches but no one worked. Any advice is
appreaciated. Thanks in advance!

Line sequential file, variable-length record.

This is the file handler I'm using now:
[XFH-DEFAULT]
STRIPSPACE=OFF
INSERTNULL=OFF
EXPANDTAB=OFF

AIX 5.3, Microfocus Server Express 5.0
Reply With Quote
  #2  
Old 07-24-2008, 01:28 PM
Robert
Guest
 
Default Re: All X'0D' lost during reading line sequential file using microfocus se

On Thu, 24 Jul 2008 02:40:37 -0700 (PDT), taoxianfeng@gmail.com wrote:

>Hi all
>
>I'm writing a batch source to match 2 input files which is exported
>from AIX DB2 giving the matched records.
>
>All other characters are going well except X'0D':all of them get lost
>when reading the input files into the program. I tried many file
>handler options and runtime switches but no one worked. Any advice is
>appreaciated. Thanks in advance!
>
>Line sequential file, variable-length record.
>
>This is the file handler I'm using now:
>[XFH-DEFAULT]
>STRIPSPACE=OFF
>INSERTNULL=OFF
>EXPANDTAB=OFF
>
>AIX 5.3, Microfocus Server Express 5.0


Define the file as record sequential, record length 512, and parse the lines yourself. The
last short block is a little tricky.
Reply With Quote
  #3  
Old 07-24-2008, 01:47 PM
Howard Brazee
Guest
 
Default Re: All X'0D' lost during reading line sequential file using microfocus se

I noticed that a free editor for the Mac (Textwrangler) gives people
the option of saving a text file about a dozen different ways. (Mac,
Unix, various Unicode, Windows, line-feed, form-feed).

I'm wondering if there are similar free or cheap utilities that can do
this kind of conversion on your platform.
Reply With Quote
  #4  
Old 07-24-2008, 03:30 PM
Richard
Guest
 
Default Re: All X'0D' lost during reading line sequential file usingmicrofocus se

On Jul 24, 9:40*pm, taoxianf...@gmail.com wrote:
> Hi all
>
> I'm writing a batch source to match 2 input files which is exported
> from AIX DB2 giving the matched records.
>
> All other characters are going well except X'0D':all of them get lost
> when reading the input files into the program. I tried many file
> handler options and runtime switches but no one worked. Any advice is
> appreaciated. Thanks in advance!
>
> Line sequential file, variable-length record.


LINE SEQUENTIAL is defined as being variable records where the end of
each record is indicated (on AIX) by a x'0D' character. These are
added automatically when writing and stripped off when reading.

You have specified that the file is 'line sequential' and then
complain when you get the designated behavior.

Specify the file like this:

SELECT TextFile
ASSIGN whatever
ORGANIZATION LINE SEQUENTIAL
FILE STATUS ..
Reply With Quote
  #5  
Old 07-24-2008, 08:51 PM
taoxianfeng@gmail.com
Guest
 
Default Re: All X'0D' lost during reading line sequential file usingmicrofocus se

On Jul 25, 2:28*am, Robert <n...@e.mail> wrote:
> On Thu, 24 Jul 2008 02:40:37 -0700 (PDT), taoxianf...@gmail.com wrote:
> >Hi all

>
> >I'm writing a batch source to match 2 input files which is exported
> >from AIX DB2 giving the matched records.

>
> >All other characters are going well except X'0D':all of them get lost
> >when reading the input files into the program. I tried many file
> >handler options and runtime switches but no one worked. Any advice is
> >appreaciated. Thanks in advance!

>
> >Line sequential file, variable-length record.

>
> >This is the file handler I'm using now:
> >[XFH-DEFAULT]
> >STRIPSPACE=OFF
> >INSERTNULL=OFF
> >EXPANDTAB=OFF

>
> >AIX 5.3, Microfocus Server Express 5.0

>
> Define the file as record sequential, record length 512, and parse the lines yourself. The
> last short block is a little tricky.- Hide quoted text -
>
> - Show quoted text -


Do you mean fixed-length record sequential? The record exported from
AIX DB2 is variable-length so I think it will be even worse.
Reply With Quote
  #6  
Old 07-24-2008, 09:16 PM
taoxianfeng@gmail.com
Guest
 
Default Re: All X'0D' lost during reading line sequential file usingmicrofocus se

On Jul 25, 2:47*am, Howard Brazee <how...@brazee.net> wrote:
> I noticed that a free editor for the Mac (Textwrangler) gives people
> the option of saving a text file about a dozen different ways. * (Mac,
> Unix, various Unicode, Windows, line-feed, form-feed).
>
> I'm wondering if there are similar free or cheap utilities that can do
> this kind of conversion on your platform.


We are restricted to solving the problem within the cobol program, not
to mention the Mac editor...
Thanks anyway
Reply With Quote
  #7  
Old 07-24-2008, 09:34 PM
taoxianfeng@gmail.com
Guest
 
Default Re: All X'0D' lost during reading line sequential file usingmicrofocus se

On Jul 25, 4:30 am, Richard <rip...@azonic.co.nz> wrote:
> On Jul 24, 9:40 pm, taoxianf...@gmail.com wrote:
>
> > Hi all

>
> > I'm writing a batch source to match 2 input files which is exported
> > from AIX DB2 giving the matched records.

>
> > All other characters are going well except X'0D':all of them get lost
> > when reading the input files into the program. I tried many file
> > handler options and runtime switches but no one worked. Any advice is
> > appreaciated. Thanks in advance!

>
> > Line sequential file, variable-length record.

>
> LINE SEQUENTIAL is defined as being variable records where the end of
> each record is indicated (on AIX) by a x'0D' character. These are
> added automatically when writing and stripped off when reading.
>
> You have specified that the file is 'line sequential' and then
> complain when you get the designated behavior.
>
> Specify the file like this:
>
> SELECT TextFile
> ASSIGN whatever
> ORGANIZATION LINE SEQUENTIAL
> FILE STATUS ..
> .
>
> DATA DIVISION.
> FILE SECTION.
> FD TextFile
> RECORD VARYING FROM 0 TO 256 DEPENDING ON TSize.
> 01 TextLine.
> 03 TLc PIC X(256).
>
> TSize will contain the record length. You can insert a x"0D" after
> that or use reference modification on the compares, or just compare
> lengths.


I don't agree.Isn't line sequential file delimited by X'0A'?

Sorry I didn't find English page.
$B9T=g%U%!%$%k$G$O!"%U%!%$%k$N3F%l%3!<%I$N4V$O!"% l%3!<%I6h@Z$jJ8;z$G6h@Z$i$l$^$9!#%l%3!<%I6h@Z$jJ8; z$O!"%i%$%s%U%#!<%IJ8;z(B (x"0A") $B$G9=(B
$B@.$5$l!"3F%l%3!<%I$N:G8e$K$"$k6uGrJ8;z0J30$NJ8; z$N8e$KA^F~$5$l$^$9(Bhttp://www.microfocus.co.jp/manuals/
SE40/fhorgs.htm

Or could you give me the documentation link saying that line
sequential file is delimited by X'0D'?
Thank you very much
Reply With Quote
  #8  
Old 07-24-2008, 09:45 PM
taoxianfeng@gmail.com
Guest
 
Default Re: All X'0D' lost during reading line sequential file usingmicrofocus se

On Jul 25, 4:30*am, Richard <rip...@azonic.co.nz> wrote:
> On Jul 24, 9:40*pm, taoxianf...@gmail.com wrote:
>
> > Hi all

>
> > I'm writing a batch source to match 2 input files which is exported
> > from AIX DB2 giving the matched records.

>
> > All other characters are going well except X'0D':all of them get lost
> > when reading the input files into the program. I tried many file
> > handler options and runtime switches but no one worked. Any advice is
> > appreaciated. Thanks in advance!

>
> > Line sequential file, variable-length record.

>
> LINE SEQUENTIAL is defined as being variable records where the end of
> each record is indicated (on AIX) by a x'0D' character. These are
> added automatically when writing and stripped off when reading.
>
> You have specified that the file is 'line sequential' and then
> complain when you get the designated behavior.
>
> Specify the file like this:
>
> * * * * * *SELECT TextFile
> * * * * * * * *ASSIGN whatever
> * * * * * * * *ORGANIZATION LINE SEQUENTIAL
> * * * * * * * *FILE STATUS ..
> * * * * * *.
>
> * * * *DATA DIVISION.
> * * * *FILE SECTION.
> * * * *FD *TextFile
> * * * * * *RECORD VARYING FROM 0 TO 256 DEPENDING ON TSize.
> * * * *01 *TextLine.
> * * * * * *03 TLc * * * * * * * * * * *PIC X(256).
>
> TSize will contain the record length. You can insert a x"0D" after
> that or use reference modification on the compares, or just compare
> lengths.


I don't agree.Isn't line sequential file delimited by X'0A'?

These are the documentation I referred:
(JP)http://www.microfocus.co.jp/manuals/SE40/fhorgs.htm
(EN)http://supportline.microfocus.com/Do...on/books/sx50/
sx50indx.htm

Line Sequential Files
The primary use of line sequential files (which are also known as
"text files" or "ASCII files") is for display-only data. Most PC
editors, for example Notepad, produce line sequential files.

In a line sequential file, each record in the file is separated from
the next by a record delimiter. The record delimiter, which is the
line feed (x"0A") character, is inserted after the last non-space
character in each record. A WRITE statement removes trailing spaces
from the data record and appends the record delimiter. A READ
statement removes the record delimiter and, if necessary, pads the
data record (with trailing spaces) to the record size defined by the
program reading the data.

To define a file as line sequential, specify ORGANIZATION IS LINE
SEQUENTIAL in the SELECT clause for the file in your COBOL program,
for example:

select lineseq assign to "lineseq.dat"
organization is line sequential.


Or could you give me the documentation link saying that line
sequential file is delimited by X'0D'?
Thank you very much

Reply With Quote
  #9  
Old 07-24-2008, 11:31 PM
Robert
Guest
 
Default Re: All X'0D' lost during reading line sequential file using microfocus se

On Thu, 24 Jul 2008 17:51:59 -0700 (PDT), taoxianfeng@gmail.com wrote:

>On Jul 25, 2:28*am, Robert <n...@e.mail> wrote:
>> On Thu, 24 Jul 2008 02:40:37 -0700 (PDT), taoxianf...@gmail.com wrote:
>> >Hi all

>>
>> >I'm writing a batch source to match 2 input files which is exported
>> >from AIX DB2 giving the matched records.

>>
>> >All other characters are going well except X'0D':all of them get lost
>> >when reading the input files into the program. I tried many file
>> >handler options and runtime switches but no one worked. Any advice is
>> >appreaciated. Thanks in advance!

>>
>> >Line sequential file, variable-length record.

>>
>> >This is the file handler I'm using now:
>> >[XFH-DEFAULT]
>> >STRIPSPACE=OFF
>> >INSERTNULL=OFF
>> >EXPANDTAB=OFF

>>
>> >AIX 5.3, Microfocus Server Express 5.0

>>
>> Define the file as record sequential, record length 512, and parse the lines yourself. The
>> last short block is a little tricky.- Hide quoted text -
>>
>> - Show quoted text -

>
>Do you mean fixed-length record sequential? The record exported from
>AIX DB2 is variable-length so I think it will be even worse.


A variable length record is just a string of bytes terminated by x'0D'. Line sequential
parses the records for you. You are complaining about that. Line sequential just gives you
512 bytes of raw data, allowing you to parse them yourself.

Is the problem that you don't know the length of an input line sequential record? Why do
you care? The tail end will be filled with spaces. You COULD search right to left for a
non-space, or follow Richard's instructions for getting the length.
Reply With Quote
  #10  
Old 07-25-2008, 12:05 AM
Robert
Guest
 
Default Re: All X'0D' lost during reading line sequential file using microfocus se

On Thu, 24 Jul 2008 18:34:40 -0700 (PDT), taoxianfeng@gmail.com wrote:

>I don't agree.Isn't line sequential file delimited by X'0A'?


The operating system, not Cobol, specifies the line terminator. AIX and other Unix use
x'0D'. Old Macs (OS9) used 0A. Windows uses 0D0A.

A FILE is delimited by its size (in the directory), not by a character. If your textbook
says a file is terminated by 0A or 1A, it is 25 years out of date.
Reply With Quote
Reply


Thread Tools
Display Modes


All times are GMT -5. The time now is 08:04 AM.


Powered by vBulletin® Version 3.7.2
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.2.0
vB Ad Management by =RedTyger=

In an effort to better serve ads to our visitors, cookies are used on objectmix.com. For more information, check out our Privacy Policy.