Solved

vms script

Posted on 2007-11-15
6
2,178 Views
Last Modified: 2013-12-06
I want to create a script in OpenVMS host  which

1) creates directory
2) create file in that directory and write some data

i want to loop step 2 so that i can create multiple files
0
Comment
Question by:perlperl
  • 3
  • 2
6 Comments
 

Author Comment

by:perlperl
ID: 20289586
I found something...

 
$ file =  test.txt

$ open/write fd 'file'
write fd "This is a test"
close fd


now i am trying to find for loop such that i cna create multiple files
0
 

Author Comment

by:perlperl
ID: 20290031
i found the looping also...

if i have one more write fd line, it writes on the seconfd line..can i write on sam eline...
0
 

Author Comment

by:perlperl
ID: 20290867
in perl we use
print "\n" to print nect line
what is the equivalent in openVMS
0
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

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

 
LVL 10

Expert Comment

by:3_S
ID: 20307871
Hello perlperl
I suppose you want to write you script in DCL?
To create a directory use the command DIRECTORY
on thusday i can give you more information on the loop and the new line issue.  
bye
0
 
LVL 10

Accepted Solution

by:
3_S earned 250 total points
ID: 20336250
Hello perlper

First of all I want to correct my first answer.
example
create /dir/vers=10 [.tmp] /prot=(w:rwed)
This creates a directory tmp in the current directory which will keep a maximum of ten versions of each file put in the directory. If you want an other directory other than the current you should place something like $1$dka100:[000000.TMP].
make the permission according to you needs.

As for you last question.  Can't you use a variable to hold the string until you have everything to put on 1 line.  You can concat a string with the +.
Normally you do not have to add something special to go to the next line like \n.  Every write command starts at a new line.

bye
0
 
LVL 40

Assisted Solution

by:noci
noci earned 250 total points
ID: 20362296
WRITE fd ""

Will write a blank line

btw. HELP COMMAND
should give you the various options you need for a command
CREATE/DIR     creates a directory

And creating a file can have some issues like file record/format.

From DCL the best way to create a file is with:
$ CREATE somefile.file
$ OPEN/APPEND fd somefile.file    ! to add data to the now empty file.
Then a plain text file will be created.  (CREATE/FDL for index sequential or other designed files).

OPEN /WRITE fd somefile

will just create a print formated file. (with different record semantics).
From C programs usualy stream line feed files are created (linefeed separated records).

There might be some other issues..

(BTW reading from a file can be done with READ with the /ERROR and /END qualified to specify a label to jump to in case of error or end of file.)
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Suggested Solutions

As the title indicates, I have done this before. It chills me everytime I update the OS on my phone, (http://www.experts-exchange.com/articles/18084/Upgrading-to-Android-5-0-Lollipop.html) because one time I did this and I essentially had a bricked …
In this article we will discuss all things related to StageFright bug, the most vulnerable bug of android devices.
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

789 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