1747992 Members
5355 Online
108756 Solutions
New Discussion юеВ

Re: DCL script doubts

 

DCL script doubts

hi ,
this is vinay i have doubt abt converting following instructions which r in DCl to unix equivalents can anybody help ?

f$trlnm
set noverify
set verify
f$parse


submit/que=sjmpsc$batch/after="tomorrow+19:00"/log=cer_mgr_log:sjmpsc_oracle_backups.log -
/noprint/notify/keep/restart cust_proc:sjmpsc_oracle_backups.com

BACKUP/LOG/NEW

please help me
23 REPLIES 23
Kris Clippeleyr
Honored Contributor

Re: DCL script doubts

Hi,
Might I refer you to the book
"Unix for OpenVMS users" ?
See:
http://www.amazon.com/UNIX-OpenVMS-Users-Second-Technologies/dp/1555581552

Regards,
Kris (aka Qkcl)

I'm gonna hit the highway like a battering ram on a silver-black phantom bike...
labadie_1
Honored Contributor

Re: DCL script doubts

set noverify -> sh +x
set verify -> sh -x

The lexicals functions do not exist in Unixland and it is a pity. So you can forget about f$parse, f$trnlnm (and the logical names do not exist too).

The Unix way is
some_command | grep some_text | cut ...
(cut is more or less a f$edit on a string)

Joseph Huber_1
Honored Contributor

Re: DCL script doubts

Recently -in a different forum- somebody even asked for a general translator DCL -> shell, really!
Even if the syntax can be "translated", the semantics of commands and functions simply have no equivalent in "unix" land.
There are some implementations of DCL as a shell or interpreter (VX/DCL from sector7.com for example), which might be the easier way to port DCL procedures.

f$trnlnm: there is no such thing as logical names in unices.
shell variables come near in some cases, (symbolic) links for files may replace some uses.
One always has to see each individual use of f$trnlnm to understand what is wanted: is it simply a call to see if a name or variable is defined ?
is it a call to extract individual items of a search list ?
is it a logical name translation to use and handle a file-specification defined in the logical ?
Each of the uses requires a different "unix" equivalent (if any).

f$parse: "unix" has no strict file-specification syntax like VMS, so it depends again on the individual f$parse call to find a "unix" equivalent:
parse to find the device a file is on ? there is no device as part of a "unix" filespec, only a "root" directory if it begins with "/".
parse with default or related specs to complete a file-specification ??
parse to extract the file-name only ? (hint: basename in "unix")
parse to extract the file type ? (there is no equivalent in "unix", only widespread conventions to use the rest after the last dot in a filespec as "type").
parse to remove the version number ? there is no such thing in "unix".

submit: there is no standard batch queuing facility in "unix": You have to explicitly see the target "unix" system to find out its batch facility, all have "at", some "batch" or "nqs".

http://www.mpp.mpg.de/~huber
Hoff
Honored Contributor

Re: DCL script doubts

You're going to have to convert DCL to bash and to Unix native utilities and such, or to use hardware emulation or such and run OpenVMS on the Unix box.

Or you might look to use contract with one of the organizations that sell conversion and porting and compatibility tools.

If you've been contracted to provide this, then you're going to have to learn DCL and you're going to have to learn bash, and map the two. This isn't a small base of knowledge, either; there aren't all that many folks that are really good at both bash and DCL.

And there are no direct mappings for any of the cited commands, either.

Here are some related discussions:

http://labs.hoffmanlabs.com/node/741

http://labs.hoffmanlabs.com/node/225
Rick Retterer
Respected Contributor

Re: DCL script doubts


You may find some good information at this website...

http://rcr-www.med.nyu.edu/rcr/gcg/openvms_unix_differences.html
- Rick Retterer



labadie_1
Honored Contributor

Re: DCL script doubts

On that link, I disagree with

Unix -> Ctrl Z suspends a program
VMS -> nothing

never heard of
$ set proc/suspend...

???
Sheldon Smith
HPE Pro

Re: DCL script doubts

"The Unix way is
"some_command | grep some_text | cut ...
"(cut is more or less a f$edit on a string)

Unless you are trying to do something very simple, you will probably find sequences like "do-something | grep | cut" to be, awkward if not painful.

I'd recommend learning something like Perl. There are a number of tutorial sites on the web, and quite a few beginning Perl books available. Personally, I used "Learning Perl", by Randal L. Schwartz, for about a year before needing to get deeper in Perl.

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

Huc_1
Honored Contributor

Re: DCL script doubts

For some the older folks still around.

edit by Digital Press in the Vax Users Series

Title "UNIX for VMS Users" by Philip E. Bourne

I have copy on the shelf next me, It does a good job .. aahh quality ! where have you been

But to read this you have to quite knowledgeable in either Vms environment and/or Unix shell.

Maybe you can get still hold of a copy (DP ISBN 1-55558-034-3).

Enjoy life,

Jean-Pierre.
Smile I will feel the difference
Richard W Hunt
Valued Contributor

Re: DCL script doubts

As an aside to Labadie:

Of the three basic non-executing states that are not resource-related or paging-related, SUSPEND is the "deepest" sleep, the others being HIBERNATE (HIB state) and Event Flag wait (LEF or CEF state).

SET PROCESS process/SUSPEND puts the process in SUSP scheduler state. SET PROCESS process/RESUME returns it to COM state.
SET PROCESS process/SUSPEND was described (in my VMS Operations class) as a way to stop a runaway process from eating your CPU alive and yet let you change your mind if you later decided you wanted this process to run a little bit more.

It has been a while since I played with these, but the main difference among the various voluntary sleep states is (I believe) that a SUSPENDED process cannot RESUME itself from an internal AST event. A process that is suspended needs external help to wake up.

By contrast, a hibernating process can execute an AST that performs a WAKE system service call on itself. A process in a WAIT state can execute an AST that sets an event flag and again, release itself back to COM state.

Regarding the mapping between UNIX & VMS functions, since the O/S are inherently different due to their different origins and growth paths, you will have to expect that some things don't map well.

For instance, OpenVMS "context" (a description of what a process can "see" at a given moment) includes a wider variety of possible things to be seen than are visible in most UNIX environments. The differences in the way file-search paths work is also a big issue.

I would seriously consider that at some point, a redesign of the application or process for the new environment. A simple conversion is not going to work perfectly simply because the system "styles" don't map perfectly.
Sr. Systems Janitor