Ask the Expert

COBOL program that will run in z/OS and open in MS-Word

I want to write a COBOL program that will run in z/OS and create a sequential file that can then be FTP's to a network drive and opened with MS-Word (MS-Office 2003) as a fully formatted Word document with page headers, tables, and paragraphs.

I've tried XML, but MS-Word opens the file as if you are wanting to edit an XML document. I've tried HTML, but when I click it, I get most of the "view" I want, but I'm in Internet Explorer and cannot modify the document.

I've also tried a *.csv to MS-Excel, but I cannot get the formatting I need.

These files are to document test cases and will need to be opened by MS-Word and updated.

Can you please give me some direction? I don't even know where to begin looking.

Requires Free Membership to View

Is your problem in the formatting of the file, or in getting Word to open it as a Word document? I can't help with the formatting except to say that whatever the format is, it must contain ASCII data written in an EBCDIC environment and whatever control information is needed for Word to open it as a fully formatted Word file (if that is what you want). This implies that you must do a BINARY FTP transfer to the network drive where the file will reside to be opened by someone.

Since I can't help with any of the formatting part, the only advise I can give is to make sure the file name is suffixed with ".doc" on the network drive when you FTP it. That is what will cause windows to open the document using Word by default when someone clicks on the file. If you launch word manually and try to open the file from the Word menu (File --> Open) and it does not open correctly, then there is a problem with the format of the file you are creating in your COBOL program.

If you create a machine readable text file on z/OS (which will be in EBCDIC), then you should be able to FTP it using the ASCII option (which will translate the EBCDIC text to ASCII) to the network drive and as long as the file name ends in ".doc" Word should be able to open it without any problems. However, you still could encounter some EBCDIC to ASCII translation issues depending on the data in the file.

This was first published in March 2006

There are Comments. Add yours.

TIP: Want to include a code block in your comment? Use <pre> or <code> tags around the desired text. Ex: <code>insert code</code>

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
Sort by: OldestNewest

Forgot Password?

No problem! Submit your e-mail address below. We'll send you an email containing your password.

Your password has been sent to: