Solved

VAX DCL code to UNIX shell script logicals conversion question

Posted on 2012-03-16
8
595 Views
Last Modified: 2012-03-19
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!
0
Comment
Question by:labradorchik
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 4
  • 4
8 Comments
 
LVL 40

Expert Comment

by:noci
ID: 37732746
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.
0
 

Author Comment

by:labradorchik
ID: 37733504
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?
0
 
LVL 40

Expert Comment

by:noci
ID: 37734746
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.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:labradorchik
ID: 37738053
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!!
0
 
LVL 40

Expert Comment

by:noci
ID: 37739274
indeed that cannot be done.
0
 

Author Comment

by:labradorchik
ID: 37739500
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.
0
 
LVL 40

Accepted Solution

by:
noci earned 500 total points
ID: 37739792
Usume you have some directories with datasets below that: (/data/mysasdata/dataset1/whatever, /data/mysasdata/dataset2/whatever )

you can chdir to some directory (say /data/mysasdata/)
And then reference the datasets with:

dataset1/whatever will access your first dataset
and
dataset2/whatever will access the 2nd one.

Or use full specs:
/data/mysasdata/dataset1/whetever etc.
0
 

Author Comment

by:labradorchik
ID: 37739904
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!!
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
.dn property wont validate - Powershell 2 32
PowerShell and cisco ios 3 68
Help with Progress 4gl Rounding Function 6 60
Eclipse neon2 "Java build path" correctness 7 43
Entering a date in Microsoft Access can be tricky. A typo can cause month and day to be shuffled, entering the day only causes an error, as does entering, say, day 31 in June. This article shows how an inputmask supported by code can help the user a…
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question