Solved

vms script

Posted on 2007-11-15
6
2,176 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
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 
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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

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

I don't know if many of you have made the great mistake of using the Cisco Thin Client model with the management software VXC. If you have then you are probably more then familiar with the incredibly clunky interface, the numerous work arounds, and …
I use more than 1 computer in my office for various reasons. Multiple keyboards and mice take up more than just extra space, they make working a little more complicated. Using one mouse and keyboard for all of my computers makes life easier. This co…
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.

785 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