Solved

vms script

Posted on 2007-11-15
6
2,171 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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 
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 39

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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In a recent article here at Experts Exchange (http://www.experts-exchange.com/articles/18880/PaperPort-14-in-Windows-10-A-First-Look.html), I discussed my nine-month sandbox testing of the Windows 10 Technical Preview, specifically with respect to r…
Windows 10 is here and for most admins this means frustration and challenges getting that first working Windows 10 image. As in my previous sysprep articles, I've put together a simple help guide to get you through this process. The aim is to achiev…
Here's a very brief overview of the methods PRTG Network Monitor (https://www.paessler.com/prtg) offers for monitoring bandwidth, to help you decide which methods you´d like to investigate in more detail.  The methods are covered in more detail in o…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now