Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

cobol file creation on an external disk

 
sunny123
Occasional Advisor

cobol file creation on an external disk

Hi,

I am trying to create a sequential file from a COBOL program on a disk which is not an open VMS disk but on a Windows NT disk whcih is in teh same network. Can someone guide how do i go about this.

For example iam trying like this below
SELECT OUT-FILE ASSIGN TO DISK1

The disk DISK1 is a Windows NT disk located in the same network. Please let me know if we how to pass access control strings if we have to pass or how do i communicate from my Open VMS to Windows.

Thanks
6 REPLIES
Volker Halle
Honored Contributor

Re: cobol file creation on an external disk

Hi,

you would need some pieces of additional software (like NFS server on Windows and NFS client on OpenVMS) to be able to do this. And this has nothing to do with COBOL or any other language.

Once the disk 'DISK1' (or part of it's directory structure) can be seen and mounted from the OpenVMS system, you can access if from your COBOL program.

Volker.
sunny123
Occasional Advisor

Re: cobol file creation on an external disk

Hi Volker,
Thanks much for your quick response. I am able to see the disk mounted from Open VMS system.This is how it looks when i looked at the disk on Open VMS system. Also kindly let me know if there is any way that we can check if tyeh NFS is installed on Open VMS system.

sh log disk31
"DISK31" = "_NFS38:" (LNM$SYSTEM_TABLE)

sh dev disk31

Device Name : NFS38
Device Status : Mounted


Thanks,
Sunny

Hein van den Heuvel
Honored Contributor

Re: cobol file creation on an external disk

COBOL has two ways of direcing output files:
- SELECT xxx ASSIGN to YYY
- VALUE OF ID

They map internally to the RMS options "Filename" (FNS=FNA+FNS) and "Default Filename" (DNS=DNA+DNS)

Both names can and will be interpretted as logical names. This avoids hardcoding things like "nfs31:" in the programs.

This is all in the Cobol Userguide, with details in the RMS Ref Manuals.

You probably do not need to knwo any of that though. Before your program runs, in the command file (scripts) which runs it, or interactively define a logical name to direct the output. For example:

$DEFINE DISK1 nfs31:[mydir]myfile.seq

The access control should have been dealt with when the NFS device was mounted.

Good luck!
Hein
sunny123
Occasional Advisor

Re: cobol file creation on an external disk

Hi Hein/Volker,

Thank you very much for all your support and assistance which helped me a lot. Looks like i have an access violation issue which i will check from my end.

Thanks again.

Thanks,
Suunny
Volker Halle
Honored Contributor

Re: cobol file creation on an external disk

Sunny,

looks like you are all set by already using NFS client on your OpenVMS system.

Before you diagnose the access problem from your COBOL program, just try a simple

$ CREATE disk1:file.ext

to find out about possible errors creating a file. Or use $ TYPE disk1:file.ext for testing read access to an existing file.

NFS works with GID/UID, so you need to make sure there is a TCPIP proxy for your OpenVMS username, which maps to a GID/UID. Then that GID/UID must allow you access on the Windows NFS server system.

Volker.
Hein van den Heuvel
Honored Contributor

Re: cobol file creation on an external disk

Sunny,

Pleas egive us the 'exact' error message.
Most of us will read 'access violation' as a hard program failure, but perhaps you mean a 'privilege violation'?

As Volker indicates, let's first be sure that simple remote file access works, outside cobol. Then try the cobol program to write to a local file, and finally when those tow steps work, try to combine.

Cobol listens to some run time environment variables (logical names) to control certain detail actions. For this case you may want to force rms record IO.

$DEFINE COB$USE_RECORD_IO 1

good luck,
Hein