Solved

vms script

Posted on 2007-11-15
6
2,175 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Introduction Often we come across situations wherein our batch files would be needing to reboot Windows for a variety of reasons. A few of them would be like: (1) Setup files have been updated whose changes can take effect only after a reboot …
Windows 7 does not have the best desktop search built in. This is something Windows 7 users have struggled with. You type something in, and your search results don’t always match what you are looking for, or it doesn’t actually work at all. There ar…
A short film showing how OnPage and Connectwise integration works.
Need to grow your business through quality cloud solutions? With everything required to build a cloud platform and solution, you may feel like the distance between you and the cloud is quite long. Help is here. Spend some time learning about the Con…

919 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

19 Experts available now in Live!

Get 1:1 Help Now