Operating System - OpenVMS
1825950 Members
2849 Online
109690 Solutions
New Discussion

Re: Setting VMS file attributes

 
SOLVED
Go to solution
Donald Ashton
Occasional Advisor

Setting VMS file attributes

I have a program running on a PC under Windows2000 which creates and writes files to a shared area on a VAX running OpenVMS.

I then need to run an analysis program on the VAX which reads these files.

The VAX program expects certain attributes for the file, but the creation defaults are incompatible.

I can log a terminal onto the VAX and change the attributes manually using the VMS command SET FILE /ATTIBUTES=(RAT:NONE, RFM:FIX, LRL:512) filename, but I would prefer that the users do not have to do this.

Is there any way to send a VMS command from my PC program to amend the file attributes, or a way to set the directory ACLs so that the default attributes are correct?


13 REPLIES 13
Ian Miller.
Honored Contributor

Re: Setting VMS file attributes

How are you sharing the disk - pathworks ? If so what version?
____________________
Purely Personal Opinion
Donald Ashton
Occasional Advisor

Re: Setting VMS file attributes

Your assumption is correct --- It is shared through Pathworks.

The version is 7.3a with all the latest ECOs.

Martin P.J. Zinser
Honored Contributor

Re: Setting VMS file attributes

Hello Donald,

since you are running the analysis program on the VAX the easiest solution is to just stuff the set file and the program execution into a little DCL and be done with it.

Example:
Assume your analysis program is my_analysis.exe, i.e. no you use

$ run my_analysis.exe to run it

Create a small DCL

$ set file/attributes(rat:none, rfm:fix, lrl:512)
$ run my_analysis.exe

Execute the DCL instead of the program.

Greetings, Martin
Donald Ashton
Occasional Advisor

Re: Setting VMS file attributes

Greate idea!!!
Unfortunately, for every test run the set of files created will be different, and have different names (although there will be some similarities). My PC program knows the specific file names and the VAX program allows the user to select the files for the specific analysis from a particular selection of the files in the target directory.

I think I could work using this method with a bit more thought on the problem, but any better solutions would be preferable.

Thanks.
Dale A. Marcy
Trusted Contributor

Re: Setting VMS file attributes

Can you send the files from the PC with a temporary extension and then have a batch job that runs every few minutes that will locate those files perform the Set File/Attributes command and then renames them to the proper extension for the users?
Donald Ashton
Occasional Advisor

Re: Setting VMS file attributes

Unfortunately this approach is basically not feasible since each file has an extension which is file specific and therefore I would have to put in place a renaming convention.
Jan van den Ende
Honored Contributor

Re: Setting VMS file attributes

Donald,

how does your analysis programm know which files to use?

Somehow your Vax job does know, so tyou can also use that knowledge in Martin's procedure!

If it is unsufficiently clear how you should do that, then post just HOW you activate your analysis execution, and I bet there will be a race condition over here in trying you provide your answer.

Jan
Don't rust yours pelled jacker to fine doll missed aches.
Willem Grooters
Honored Contributor

Re: Setting VMS file attributes

Donald,
Does the analysis on the VAX needs to be started by a user, or could it be done automatically, immediately after transferring them?
Willem Grooters
OpenVMS Developer & System Manager
Antoniov.
Honored Contributor

Re: Setting VMS file attributes

Hello Donald,
assuming you have Pathwork running on Vax;
assuming in your shared folder all files must be /ATTR=(RAT:NONE,RFM:FIX,LRL:512) you can define host attribute for this share:
$ ADMIN MOD SHARE /HOST=(RMS:SEQ)
Usually all files created in share folder are stream format; qualifier /HOTS=RMS permit you to define sequential fixed RMS file format, with 512 record lenght.
Warning: this option is valid for all files created so if you need a text file in same folder you must execute SET FILE ATTR....

H.T.H.
@Antoniov
Antonio Maria Vigliotti
Donald Ashton
Occasional Advisor

Re: Setting VMS file attributes

Both the PC program and VAX analysis are activated under user control. The analysis program operates interactively on files selected by the user from within the program.

I shall do some investigation into setting the default file attributes from the share definition since this one seems to be feasible.

I have subsequently found out that different users work in different disk areas without common shares and copy directories as required. The use of a comand file to perform the directory copying rather than directly using the DCL copy command is another approach I will consider.
Martin P.J. Zinser
Honored Contributor

Re: Setting VMS file attributes

If the files do arrive in specific places on the VAX you could use job_daemon (see

http://zinser.no-ip.info/vms/sw/job_daemon.htmlx

to trigger a DCL to change the file attributes)

Greetings, Martin
Kjell Carlsson
Frequent Advisor
Solution

Re: Setting VMS file attributes

Hi

You can use the RSH command from the PC to create and execute DCL-commands within the VAX. Just enable the RSH/REXEC service from TCPIP$CONFIG.

If you wish to run it from a PC program, just spawn a subprocess.

Kjell Carlsson
Donald Ashton
Occasional Advisor

Re: Setting VMS file attributes

The user can decide just where to put the files, which rules out most approaches. I have currently implemented a special 'directory copy' command file with the file attribute changes applied automatically.

The use of RSH looks promising and certainly merits further investigation.