Link to home
Start Free TrialLog in
Avatar of labradorchik
labradorchikFlag for United States of America

asked on

VAX DCL code to UNIX shell script logicals conversion question

I am trying to convert some of VAX DCL code (.COM) to UNIX shell script and I am having a problem with logicals for files, datasets, and directories with files or datastes. My files in the .COM are SAS programs with SAS datastets.  

I have done some search for logical define for directory in script and that works fine. But still need to find out on how to define the logical for the specific dataset since many of logicals define in *.COM are SAS datasets.  

Since I do not have to much of a UNIX knowledge, then any comments or examples will be very helpfull.
Thank you!
Avatar of noci
noci

Unix doesn't have logicals.

Now I don't know SAS on unix, chances are it can use Environment variables. [ Like DCL symbols ]. and use those as a reference to data sets.

Otherwise you most probably need to specify full pathnames.

This might help:
http://www.stat.washington.edu/~handcock/506/Lectures/lec12.pdf

Page 5 contains an example to open a dataset.
Avatar of labradorchik

ASKER

Thank you for your comments!
I already found out how to access SAS datasets in Unix from .SAS programs, but my question is how can I access SAS datasets and other files that are already in Unix from the script? Before I had to call all these files (.SAS, SAS datasets, and other files...) in my VAX DCL code, but how can I do nowthe same thing in Unix? I thought I could used logicals for directories and filenames?
That can be done using a shell-script (bash, ksh, csh , whatever is on your system).
Like a DCL script it's just a set of commands, and you can use conditionals etc. but they are a bit different from DCL. (these links might help)
http://www3.sympatico.ca/n.rieck/docs/vms_vs_unix.html
http://www.physnet.uni-hamburg.de/physnet/vms-unix-commands.html

In OpenVMS logicals are a kernel level private ("process"), or shared ("job", "group" or "system") wide set of namespaces which is orthogonal of the filesystems that can be mounted.

Unix has no such concept at all. It only has one tree structured filesystem namespace.
you can create some kind private space by using chroot, but that's most probably not where you want to go.

The only thing is using you shell's environment variables. (they look like OpenVMS's DCL symbols) they can be accessed by a program if needed but it needs active support by a program. Like i said before i don't know SAS but you may want to browse it's unix documentation for the use of "environment" variables.
Thank you very much for your ditailed explanations!!
So, to make sure I understand it correctly. I my bash shell script (UNIX), I can't introduce simular logicals as in the VAX DCL code, for example, this is what I have used in VAX DCL code before to define my directory and file:

$ DEFINE  logical1  mydirectory1:mysasdataset.sas7bdat

Open in new window


or another directory with a .TXT file
DEFINE/NOLOG  logical2  mydirectory6:mytextfile.txt 

Open in new window


There is no way to define this in the UNIX bash shell script??

Thank you!!
indeed that cannot be done.
Wow, that's too bad :(
So, how can I reference my directories and filenames in the Unix bash shell script?
I am sorry to ask so many questions, but I just can't find this information in Unix manuals/books. If you have any examples of referencing that would be really great.
ASKER CERTIFIED SOLUTION
Avatar of noci
noci

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great!!  I wil try to use in my Unix shell script these directories and files just like you advised. I will post a few more questions within the next a few days regarding the conversion of VAX DCL code to Unix shell script, please see if you can answer any of them.  
Thank you very much again!!