Operating System - OpenVMS
1752782 Members
6080 Online
108789 Solutions
New Discussion юеВ

new to dcl command files

 
Phil Rosenberg
New Member

new to dcl command files

Hi
Firstly I want to appologise for my ignorance. I'm araid I've grown up on microsoft products and I'm a scientist with some programming knowledge not an IT specialist. Hence I hope this is the correct forum for my post.
I'm looking for some help automating some work we do on an OpenVMS system. I work for an atmospheric measurements group and we have one set of instruments (which, if you are interested, measure cloud properties) which collect data in a raw format which must be processed to provide user readable data. We currently perform the processing on an OpenVMS system but it's very time consuming and involves inputting data repeatedly at different stages of the processing so I'd like to automate it, presumabley using a command file. This is my first experience of OpenVMS and dcl so I'm struggling a bit. Here's an example of part of what we do. One exe file that we must run is executed with the line

run mrfb:[pms.spec2d.auto]spec2d_auto

which we currently type at the prompt.
The program then asks us for the measurement start and end times in the format hhmmss which we type in. We have to run a number of these programs each of which require us to enter start and end times.
I'd like to automate this if possible. If I was on an MS DOS system I'd create a batch file and pipe the input of the times from a file. However I'm struggling in OpenVMS. Even a simple command file with the line

$ run mrfb:[pms.spec2d.auto]spec2d_auto

fails with an error
dcl-w-actimage error activating image

I'd really be appreciative if anyone can offer any advice or give an example of what I would need to do.

Cheers
Phil
9 REPLIES 9
labadie_1
Honored Contributor

Re: new to dcl command files

Phil

Welcome to the Vms forums

Read carefully what John Gillings says in this thread

http://forums12.itrc.hp.com/service/forums/questionanswer.do?threadId=1272378

You will find several ways to do it.
Jon Pinkley
Honored Contributor

Re: new to dcl command files

Phil,

In addition to the thread labadie referenced in the previous thread, here is another recent one that discusses passing info.

http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1268313

Jon

it depends
Robert Gezelter
Honored Contributor

Re: new to dcl command files

Phil,

Welcome to the ITRC OpenVMS Forum!

There are quite a few ways to do this, and some of them depend upon how the program is reading its input data. [A side question is: Do you have the sources for the program?]

I would not expect an "error activating image" from an input file change. Are you sure that the file name in the RUN command is correct?

If the program is reading from the standard input (SYS$INPUT), there are two choices: point the input file temporarily to a text file using the ASSIGN/USER_MODE command; or include the text inline in the command file stream.

Personally, if the same inputs will be reused, I tend to query the user, enter the values, check that the values are valid, and then stash them in a temporary file that I reference repeatedly, often using ASSIGN/USER_MODE.

Another, simpler way to start is to work with a simpler example. What programming language is most familiar and is it available on your OpenVMS system?

- Bob Gezelter, http://www.rlgsc.com
Willem Grooters
Honored Contributor

Re: new to dcl command files

$ run mrfb:[pms.spec2d.auto]spec2d_auto
dcl-w-actimage error activating image

The image activator will try to load the program; it could locate the file (otherwise you would get en error indicating the file could not be found) but was unable to make the file ready to be executed.

Question: how did you execute the command file? Intercatively (@), in a subprocess (SPAWN @ or in batch (submit ). It could make the difference.
The following applies if you run the process in batch (have submitted it).
Since the executable is found (no RMS-FNF message) indicates that logical mrfb: is set correctly in your process,and when running the procedure. However, if the program requires shared images (in MS terms: .DLL files) or global sections that are referred by logicals, they may not be set correctly, or at all, when the procedure is run outside your process environment.
What you could do to find out, is:

$ SHOW LOG /FULL

interactively, and as the first command in your procedure. Check for differences.

These logicals can be set in a system-wide login (SYS$SYLOGIN:), or in your perosnal login file (SYS$LOGIN:LOGIN.COM) or any file invoked from either of these two. Beware that these logicals may be set in any of these files but not when run in BATCH mode
(a line like
$ IF F$MODE() .EQS. "BATCH" THEN EXIT
is quite common)

Second: RUN doesn't allow for arguments. This has been covered in both entries already mentioned
Willem Grooters
OpenVMS Developer & System Manager
Phil Rosenberg
New Member

Re: new to dcl command files

Thank-you everyone for your warm welcomes and information. I'll have a good read about passing arguments.

I think I have found part of the problem. I have been creating my .com file on a windows pc with notepad and ftping it accross. As I tinkered with it I got various errors or nothing happening at all. I just tried instead creating the file with the create command on the vms system itself and I have now at least got the image to execute. I now need to work out the arguments.
Interestingly when I use type to display the contents of a file it looks the same whether created on a windows pc or natively. I wonder if there are differences in the carriage return character or something.

again thanks. I'll call back when i hit my next insurmountable problem ;)
labadie_1
Honored Contributor

Re: new to dcl command files

>>>I wonder if there are differences in the carriage return character or something.

Post the result of the command
$ dump comfile
$ dir/fu comfile

Steven Schweda
Honored Contributor

Re: new to dcl command files

> [...] I have been creating my .com file on
> a windows pc with notepad and ftping it
> accross. [...]

I'd expect an _ASCII_ FTP transfer to deal
with any line-ending problems. A binary
(image) FTP transfer could cause problems
with a text file. "ftping it" lacks
sufficient detail for a non-psychic like me
to know exactly what happened.

> Post the result of the command
> [...]

That could tell the story.
Sheldon Smith
HPE Pro

Re: new to dcl command files

I am guessing that you are attempting to edit the DCL procedure on Windows and then FTP it with one of the many nice GUI-based FTP clients? Dollars to doughnuts, the FTP GUI assumes a ".COM" file should be handled as a binary file. Look through the client's settings and preferences, and set it so .COM files are explicitly handled as Text. (No, not psychic, just ran into the same problem a few times.)

While a Windows .COM file *is* binary code, an OpenVMS .COM file is ASCII text, similar to Windows .BAT or .CMD file.

Note: While I am an HPE Employee, all of my comments (whether noted or not), are my own and are not any official representation of the company

Accept or Kudo

Hoff
Honored Contributor

Re: new to dcl command files

I'd suggest spending some time to learn a real text editor. For some of the available options here, vim, emacs, or mayhap (and less portable) one of the OpenVMS text editors.

Learning a real text editor will serve you well, particularly as you branch out into the broader computing environment, and while you continue to use Microsoft software. This whether you're looking at bash or one of the Windows shells, or otherwise. Or writing C or C++ or DCL code, for that matter, at the platform shell.

If you wish to continue to use a tool provided within the default Windows installation (and a tool that's not one of the excellent vim or emacs or related ports), then use Wordpad in preference to Notepad. Wordpad deals with random file formats rather better than notepad.

I've moved from the classic DEC editors to vim because of issues around keypad emulation; that's a feature that's becoming less common and thus more problematic. But I'm not going to tell you that vim is the solution. Editors being a personal choice, there are a wide variety of good ones.