?
Solved

vms script

Posted on 2007-11-15
6
Medium Priority
?
2,185 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
[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
  • 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
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!

 
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 1000 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 1000 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

Independent Software Vendors: 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!

Question has a verified solution.

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

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…
I. Introduction There's an interesting discussion going on now in an Experts Exchange Group — Attachments with no extension (http://www.experts-exchange.com/discussions/210281/Attachments-with-no-extension.html). This reminded me of questions tha…
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.

762 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