Skip to main content
Dominique Sacre
Rocketeer
Mar 29, 2012 2:28 AM UTC

Creating a Tab delimited file (problem) need help fast

[Migrated content. Thread originally posted on 28 March 2012]

I need some pretty quit help. I'm using Net express 4.0.38 and I'm creating a tab delimited file. The data looks ok in animator, but when I review the file in textpad or a hex viewer, there has been a x'00' character inserted before each tab x'09' character. I've tried with a string command and building the record character by character and have the same resilts. The file is defined as a line sequential file. sample of the string below.

SELECT FILE-IN ASSIGN TO
'C:\\FILE.SAV\\01027137\\ONTARIO\\TEST.DAT'
ORGANIZATION IS LINE SEQUENTIAL
FILE STATUS IS BM-STATUS.

FD FILE-IN.
01 FI-RECORD pic x(80).

OPEN output FILE-IN.
string '500' tab 'mark' tab 'help' delimited by size
into fi-record.
write fi-record.

CLOSE FILE-IN.
GOBACK.


Do I need to turn some switch of or on or is this a bug?

    4 replies

    Chris Glazier
    Moderator
    Mar 29, 2012 2:38 AM UTC

    [Migrated content. Thread originally posted on 28 March 2012]

    I need some pretty quit help. I'm using Net express 4.0.38 and I'm creating a tab delimited file. The data looks ok in animator, but when I review the file in textpad or a hex viewer, there has been a x'00' character inserted before each tab x'09' character. I've tried with a string command and building the record character by character and have the same resilts. The file is defined as a line sequential file. sample of the string below.

    SELECT FILE-IN ASSIGN TO
    'C:\\FILE.SAV\\01027137\\ONTARIO\\TEST.DAT'
    ORGANIZATION IS LINE SEQUENTIAL
    FILE STATUS IS BM-STATUS.

    FD FILE-IN.
    01 FI-RECORD pic x(80).

    OPEN output FILE-IN.
    string '500' tab 'mark' tab 'help' delimited by size
    into fi-record.
    write fi-record.

    CLOSE FILE-IN.
    GOBACK.


    Do I need to turn some switch of or on or is this a bug?
    This is because by default the Net Express file handler inserts a NULL character X"00" before any non-printable character in a line sequential file.

    This is so the character is not treated as a line terminator or other control character when the file is read back in.

    You can turn off this behavior in one of 3 ways.

    Start your program with run-time switch -N
    Example: C:\\myprog (-n)

    or create an extfh.cfg file with the following in it:

    [XFH-DEFAULT]
    INSERTNULL=OFF

    and then set environment variable EXTFH to point to the location of this file:
    Example: SET EXTFH=C:\\mydir\\extfh.cfg

    or use X"91" function 47

    Disables insertion of a null character x"00" before data characters whose value is less than x"20" in line sequential files.

    Syntax:
    call x"91" using result
                     function-code
                     parameter
    Parameters:
    Using call prototype (see Key) Picture (32-bit systems)
    result cblt-x1-compx pic x comp-x.
    function-code cblt-x1-compx pic x comp-x.
    parameter FD name of file

    Dominique Sacre
    Rocketeer
    Mar 29, 2012 3:48 AM UTC

    [Migrated content. Thread originally posted on 28 March 2012]

    I need some pretty quit help. I'm using Net express 4.0.38 and I'm creating a tab delimited file. The data looks ok in animator, but when I review the file in textpad or a hex viewer, there has been a x'00' character inserted before each tab x'09' character. I've tried with a string command and building the record character by character and have the same resilts. The file is defined as a line sequential file. sample of the string below.

    SELECT FILE-IN ASSIGN TO
    'C:\\FILE.SAV\\01027137\\ONTARIO\\TEST.DAT'
    ORGANIZATION IS LINE SEQUENTIAL
    FILE STATUS IS BM-STATUS.

    FD FILE-IN.
    01 FI-RECORD pic x(80).

    OPEN output FILE-IN.
    string '500' tab 'mark' tab 'help' delimited by size
    into fi-record.
    write fi-record.

    CLOSE FILE-IN.
    GOBACK.


    Do I need to turn some switch of or on or is this a bug?
    Thank you so much. I knew there had to be somekind of settings just did not know what. It works like a champ. Thanks again.
    Dominique Sacre
    Rocketeer
    Mar 29, 2012 3:48 AM UTC

    [Migrated content. Thread originally posted on 28 March 2012]

    I need some pretty quit help. I'm using Net express 4.0.38 and I'm creating a tab delimited file. The data looks ok in animator, but when I review the file in textpad or a hex viewer, there has been a x'00' character inserted before each tab x'09' character. I've tried with a string command and building the record character by character and have the same resilts. The file is defined as a line sequential file. sample of the string below.

    SELECT FILE-IN ASSIGN TO
    'C:\\FILE.SAV\\01027137\\ONTARIO\\TEST.DAT'
    ORGANIZATION IS LINE SEQUENTIAL
    FILE STATUS IS BM-STATUS.

    FD FILE-IN.
    01 FI-RECORD pic x(80).

    OPEN output FILE-IN.
    string '500' tab 'mark' tab 'help' delimited by size
    into fi-record.
    write fi-record.

    CLOSE FILE-IN.
    GOBACK.


    Do I need to turn some switch of or on or is this a bug?
    Thank you so much. I knew there had to be somekind of settings just did not know what. It works like a champ. Thanks again.
    Dominique Sacre
    Rocketeer
    Mar 29, 2012 3:48 AM UTC

    [Migrated content. Thread originally posted on 28 March 2012]

    I need some pretty quit help. I'm using Net express 4.0.38 and I'm creating a tab delimited file. The data looks ok in animator, but when I review the file in textpad or a hex viewer, there has been a x'00' character inserted before each tab x'09' character. I've tried with a string command and building the record character by character and have the same resilts. The file is defined as a line sequential file. sample of the string below.

    SELECT FILE-IN ASSIGN TO
    'C:\\FILE.SAV\\01027137\\ONTARIO\\TEST.DAT'
    ORGANIZATION IS LINE SEQUENTIAL
    FILE STATUS IS BM-STATUS.

    FD FILE-IN.
    01 FI-RECORD pic x(80).

    OPEN output FILE-IN.
    string '500' tab 'mark' tab 'help' delimited by size
    into fi-record.
    write fi-record.

    CLOSE FILE-IN.
    GOBACK.


    Do I need to turn some switch of or on or is this a bug?
    Thank you so much. I knew there had to be somekind of settings just did not know what. It works like a champ. Thanks again.