Operating System - OpenVMS
1829854 Members
1907 Online
109993 Solutions
New Discussion

Re: Vax-VMS (Cobol) listings and PC Software compatibility

 
inam shah
Occasional Contributor

Vax-VMS (Cobol) listings and PC Software compatibility

I am working on Vax-VMS system using COBOL language. I want my Reports to be viewed on PC (retreived from vax through FTP). Is there any PC software which is compatible with COBOL language and reports generated in COBOL can be viewed/edited on a PC?

any query will be wellcomed

Inam shah
10 REPLIES 10
Bojan Nemec
Honored Contributor

Re: Vax-VMS (Cobol) listings and PC Software compatibility

Inam,

The problem is in the COBOL report file format. COBOL uses the VFC, 2 byte header file format. The number of blank lines before and after the line are in a 2 byte header, which is not interpreted by ftp and other communication software.

So as the first thing try to compile yours programs with COBOL/NOVFC. This instructs COBOL to create stream_lf reports instead of VFC reports.

The second option is to write a small program in C, which converts the VFC file in stream_lf file.

Bojan
Wim Van den Wyngaert
Honored Contributor

Re: Vax-VMS (Cobol) listings and PC Software compatibility

If you install a HTTP server (eg wasd) on your VMS machine, you can view the files in internet explorer. Just as any .txt file on the internet.

You can also mail the file to the PC user.

Wim
Wim
Antoniov.
Honored Contributor

Re: Vax-VMS (Cobol) listings and PC Software compatibility

Inam,
I tryed with M$ Word and it works.

Antonio Vigliotti
Antonio Maria Vigliotti
Antoniov.
Honored Contributor

Re: Vax-VMS (Cobol) listings and PC Software compatibility

Wordpad works too.
Notepad can't works.

Antonio Vigliotti
Antonio Maria Vigliotti
inam shah
Occasional Contributor

Re: Vax-VMS (Cobol) listings and PC Software compatibility

thanx to all of u. it has been a great help
Ian Miller.
Honored Contributor

Re: Vax-VMS (Cobol) listings and PC Software compatibility

Bojan,
no need to write a program - use the CONVERT command.
____________________
Purely Personal Opinion
Don Braffitt
New Member

Re: Vax-VMS (Cobol) listings and PC Software compatibility

>I am working on Vax-VMS system using COBOL
>language.

>COBOL/NOVFC. This instructs COBOL to create >stream_lf reports instead of VFC reports.

COBOL/NOVFC is an option we added on Alpha
and I64 but not on VAX.

Don Braffitt
project leader, HP COBOL/SORT for OpenVMS
and Tru64 UNIX
Bojan Nemec
Honored Contributor

Re: Vax-VMS (Cobol) listings and PC Software compatibility

Sory,

I forgot that on VAX there is no /VFC option on VAX.

Ian,

Yes CONVERT can do the job. But how you instruct convert to add blank lines and form feeds to the output? As I know CONVERT will lose all printing information and if you convert a file like:
line 1

line 3


line 6
you will receive a file:
line 1
line 3
line 6

Now I cant test, but a C program like this:
#include
int main(int argc,char ** argv)
{
FILE * inf, *outf;
char buf[1024];

inf = fopen(argv[1],"r");
outf = fopen(argv[2],"w");
for (;;)
{
if (fgets(buf,1024,inf))
fputs(buf,outf);
else
break;
}
fclose (inf);
fclose (outf);
}

will do the work. (the program has no tests and is only an example! Add all tests). For a VAX I am not shure that this works but on an Alpha it works because the C runtime reads the fixed header of the record and interpret the contents. So you receive all the line feeds from the interpreatation of the fixed header.

If this does not work on an VAX you must write a program which will read the file with RMS routines and interpret the fixed header of each record.

Bojan
Hein van den Heuvel
Honored Contributor

Re: Vax-VMS (Cobol) listings and PC Software compatibility


The following two commands may solve your problem, if the PC application can handle form-feeds, and you transfer in ascii mode.

$ excha/net/tran=conv=carr old new
$ set file/attri=(rfm=stmcr,rat=none) new

You may want to check out other EXCHANGE/NET options.
FOr example, it can take an FDL and can make those VFC characters become data characters.

Besides writing a real RMS program (with RABs givign access to RAB$L_RHB) to read teh data raw you can also use CONVERT/FIXED
or... you can just whack the file into submission:
$ set file/attri=(rfm=var,rat=none)

You would then still need something to interpret those 2 byte headers.

The attached file contains some 'treasures' from the digital archives from aroudn 1990.
The first progrma is VAX only CObol solution as it exploits a sneaky way to get a RAB addresss.

The next text in that attachement is an (untested by me) TPU solution with extensive documentation and explanations on these PRN files.

Hope this helps,
Hein.


Hein van den Heuvel
Honored Contributor

Re: Vax-VMS (Cobol) listings and PC Software compatibility


I took my own advice and adapted the convert-vfc.cob program from the prior reply to expect the vfc data as the leading two characters in the records.

Attached an other text file with
- a test program for several PRN/VFC formats
- the adapted program with the VAX dependency removed.

It works... mostly. It does not handle a simple space 1 before print. Still, it should be a useful starting point for anyone needing this. If anyone is really stumpted by this and really needs it tweaked, then i may try to help with that, but not untill the need is proven.

Hope this helps someone out there,

Hein.