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

COBOL Sequential File Being Read in Notpad 1

Status
Not open for further replies.

scottv123

Programmer
Aug 5, 2003
5
US
I am unable to find an answer to this on them web, and hope that some here can help. I am using Microfocus Cobol running on AIX 4.3.3. I am trying to produce a record sequential file that is fixed width (each record is PIC x(202), and email this data file to an end-user. The thing is that when the user opens this file in windows notepad, there is a "box" character in the first position of the file, and the same character in the last position. I am assuming that these are carriage returns, but need to know how to not have them in the output file while retaining the file format. Thanks
 
For an accurate response, we need to see the SELECT sentence from the FILE-CONTROL paragraph. Can you provide that, please?

Tom Morrison
 
SELECT PRINT-X ASSIGN TO "/data13/rebates/out"
ORGANIZATION IS record sequential
FILE STATUS IS DISK-ERR.


FD PRINT-X RECORD CONTAINS 202 CHARACTERS.
01 P-1 PIC X(202).

I do a simple WRITE P-1, to add the data to the file.
 
I would first try changing to
Code:
ORGANIZATION LINE SEQUENTIAL
because I think that will work for Notepad.

Are all 202 characters in the normal printable range of x20-x7e?

Tom Morrison
 
I have also tried the line sequential in the select statement, but I still get those "box" characters.
 
Ok, then here is my best guess (since I am not a Micro Focus expert).

What is most likely happening is that the records are being delimited with a new line character, the traditional character for delimiting text records on Unix. The DOS/Windows standard, however is the two-character sequence carriage return, line feed.

If this is the case, try viewing the attachment with WordPad, which is a little more accepting of new line than Notepad.

Tom Morrison
 
Also, on the Windows side, what are the actual character codes in those positions? If you do not have an editor capable of displaying hex, then, from a command line prompt, use debug filename and type d at the first debug prompt to view the first 128 bytes of the file.

Tom Morrison
 
Actually the .txt extension changed to .wri did it. Thanks for all of your help and the quick reply!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top