- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- Re: VAX Batch Script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2005 08:50 PM
11-08-2005 08:50 PM
VAX Batch Script
$ on error then goto retry
$ set def dai
$ set def gen6$disk
$ if f$search("gen7$disk:[ian]hello.txt") .EQS "" then goto retry
$ copy gen7$disk:[ian]hello.txt; gen7$disk:[vaxroom]
$ ren gen7$disk:[ian]hello.txt; hello.old;
$ submit /after="tomorrow+02:00" hello.com /noprint
$ exit
$ retry:
$ submit /after="+0:1:00" hello.com /noprint
$!
$ exit
$!
$ onerror:
$ on error then gosub onerror
$ return
Thanks, Ian
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2005 08:58 PM
11-08-2005 08:58 PM
Re: VAX Batch Script
$ str = "rob"
$ if f$length(str) .eq. 3 then write sys$output "''str'"
$ exit
HTH
Rob
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2005 09:01 PM
11-08-2005 09:01 PM
Re: VAX Batch Script
You just have to add one line.
After the f$search insert:
$ if f$file_att(
ie, request the file attribute RecordATtribute to be FIX.
As always, HELP is your friend:
HELP LEXIC F$FILE ARG
for much more along those lines.
Success.
Proost.
Have one on me.
jpe
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-08-2005 10:45 PM
11-08-2005 10:45 PM
Re: VAX Batch Script
some changes are implemented down in the example...
1.use SET DEF with directory specification, if GEN6$DISK isn't logical name with full path specified. If it is disk device only, your current dir will be used and it may not exist on that disk
2. don't submit another job for retry, but use retry loop. may be put some counter in it and command to tell you, after some time, that the file isn't still there
3. don't try to submit another job for on error, but deal with the error
4. in RENAME command as you have it there, the file will be renamed to gen6$disk
$ on error then goto onerror
$ set def dai
$ set def gen6$disk
$ retry:
$ if f$search("gen7$disk:[ian]hello.txt") .EQS ""
$ then
$ wait 00:01
$ goto retry
$ endif
$ copy gen7$disk:[ian]hello.txt; gen7$disk:[vaxroom]
$ ren gen7$disk:[ian]hello.txt; hello.old;
$ submit /after="tomorrow+02:00" hello.com /noprint
$ exit
$
$onerror:
$ 'error handling here'
Mike
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2005 03:25 PM
11-09-2005 03:25 PM
Re: VAX Batch Script
If so, Jan has the solution, 'xcept that he meant RFM for "Record ForMat".
Several hints...
This 'hello.com', is that the procedure itself?
If so, then I suggest making that dynamic and independend:
$this_script = f$elem(0,";",f$env("procedure"))
:
$submit ... 'this_script
Next, you really don't want to hardcode a file name mutliple times in a single prodedure. Nor even for testing. Specially not for testing as it is too error prone.
Stick the name in a variable, use the variable.
In your case:
$file_name = "gen7$disk:[ian]hello.txt"
:
$found_name = f$search(file_name)
$if found_name .EQS."" ...
$stripped_name = f$elem(0,";",found_name) + ";"
$if "FIX".EQS.f$attr(stripped_name,"RFM") ...
$copy 'stripped_name gen7$disk:[vaxroom]
$rena 'stripped_name .old
:
$copy 'filename
hth,
Hein.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-09-2005 07:06 PM
11-09-2005 07:06 PM
Re: VAX Batch Script
could you please explain what you fixed lenght mean?
From my point of view I think you want to know if something is writing on it.
Some time ago, I wrote some statements to solve this:
$! Var FAL doesn't have to exist
$ IF F$TYPE(FAL).NES."" THEN DELETE/SYMB FAL
$! Now I want to catch error
$ SET NOON
$ DEFINE SYS$ERROR NLA0:
$ DEFINE SYS$OUTPUT NLA0:
$! If file is in use, FAL can't be created
$! due error condition
$ FAL=F$FILE(
$! Restore error trap
$ DEASS SYS$OUTPUT
$ DEASS SYS$ERROR
$ SET ON
$! If var FAL doesn't exist file is in use
$ IF F$TYPE(FAL).EQS."" THEN GOTO FILE_IN_USE
$! here file is free
Antonio
http://it.openvms.org
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
11-10-2005 09:21 PM
11-10-2005 09:21 PM
Re: VAX Batch Script
I think the answers given are one you need.
But try to get rid of 'SET DEFAULT' in routines. You know the filespec. so use it.
I'm at a site whith OpenVMS managers (doing this for several years) and they are all using 'set default' always, and a few weeks ago a compleet system wasn't working because a manager did SET DEFAULT device:[000000] and executed a .COM that by accident did change the protection of the 000000.dir ! Whole drive readonly and a whole company confused!
I did mentioned this several times the last months of not doing this. It's not funny when I'm right.
AvR