- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- file renaming and Entry input
Operating System - OpenVMS
1748162
Members
3658
Online
108758
Solutions
Forums
Categories
Company
Local Language
юдл
back
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
юдл
back
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
Discussion Boards
Discussion Boards
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО08-15-2005 02:57 AM
тАО08-15-2005 02:57 AM
Hi,
I need to automate certain mechanical tasks. However, I have two separate problems right now.
My dir structure fixed for all projects
projDir1 - models.dir
- com.dir
- data.dir
Problem 1
Now I have setup a script
which moves *.EXT files to models.dir
now I wish to rename the latest version file(*.EXT) in models.dir to
*_GFILT.EXT
like the following
$RENAME [.models]*.ext [.models]*_GFILT.EXT
So I need to add/insert the stringg "_GFILT"
Currently I do
NAME_EXT=F$Search("[.models]*.EXT")
NAME = NAME_EXT - "AIM;1"
NAME_NEW = NAME +"_GFILT.AIM"
RENAME *.AIM 'NAME_NEW
However, F$search understandably keeps track of the older path so
when i make a new projDir2
projDir2 - models.dir
- com.dir
- data.dir
it still searches in "projDir1" instead of "projDir2"
If you are aware of better way to insert "GFILT" please let me know or to clear pointer of F$Search
Problem 2
In the above projects I start a que_base which on it's completion generates data_que
now I need to wait for que_base to end in order to start the next type of que to process data_que
How can I automate this to get final_data
so projDir1_data -> start que_base -> data_que->start que_next->final_data
if there is simple way please let me know
Thanks in advance.
I need to automate certain mechanical tasks. However, I have two separate problems right now.
My dir structure fixed for all projects
projDir1 - models.dir
- com.dir
- data.dir
Problem 1
Now I have setup a script
which moves *.EXT files to models.dir
now I wish to rename the latest version file(*.EXT) in models.dir to
*_GFILT.EXT
like the following
$RENAME [.models]*.ext [.models]*_GFILT.EXT
So I need to add/insert the stringg "_GFILT"
Currently I do
NAME_EXT=F$Search("[.models]*.EXT")
NAME = NAME_EXT - "AIM;1"
NAME_NEW = NAME +"_GFILT.AIM"
RENAME *.AIM 'NAME_NEW
However, F$search understandably keeps track of the older path so
when i make a new projDir2
projDir2 - models.dir
- com.dir
- data.dir
it still searches in "projDir1" instead of "projDir2"
If you are aware of better way to insert "GFILT" please let me know or to clear pointer of F$Search
Problem 2
In the above projects I start a que_base which on it's completion generates data_que
now I need to wait for que_base to end in order to start the next type of que to process data_que
How can I automate this to get final_data
so projDir1_data -> start que_base -> data_que->start que_next->final_data
if there is simple way please let me know
Thanks in advance.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2005 04:30 AM
тАО08-15-2005 04:30 AM
Solution
You can easily invalidate the F$SEARCH() context. In the history I used
$ S = F$SEARCH("@")
but Jan had a better idea:
$ S = F$SEARCH ("INVALIDATE_SEARCH_CONTEXT")
It is highly unlikely that you have a file by that name, right?
For problem 2:
it sounds like you are working with batch jobs, but I am not absolutely sure - would be nice if you can explain a bit more details.
If my guess is right, can you SUBMIT them for batch processing in a batch queue with /JOB_LIMIT=1. ?
$ S = F$SEARCH("@")
but Jan had a better idea:
$ S = F$SEARCH ("INVALIDATE_SEARCH_CONTEXT")
It is highly unlikely that you have a file by that name, right?
For problem 2:
it sounds like you are working with batch jobs, but I am not absolutely sure - would be nice if you can explain a bit more details.
If my guess is right, can you SUBMIT them for batch processing in a batch queue with /JOB_LIMIT=1. ?
.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2005 05:45 AM
тАО08-15-2005 05:45 AM
Re: file renaming and Entry input
F$Search uses a 2nd parameter (Context), so that you can nest F$SEARCHes, e.g. an outer loop uses F$SEARCH(file,1212) and an inner loop f$SEARCH(file2,1313).
I'm not sure, if I understand your 2nd problem, but you can wait for the completion of a batchjob with SYNCHRONIZE. The SUBMIT command returns the entrynumber of a batchjob in the DCL symbol $ENTRY.
regards Kalle
I'm not sure, if I understand your 2nd problem, but you can wait for the completion of a batchjob with SYNCHRONIZE. The SUBMIT command returns the entrynumber of a batchjob in the DCL symbol $ENTRY.
regards Kalle
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-15-2005 06:28 AM
тАО08-15-2005 06:28 AM
Re: file renaming and Entry input
The way that you have problem 1 stated shows that you are useing the directory as "[.models]" which seems to indicate that you are relaying on your current default directory to be correct. Try setting your default directory to [projdir2] before you start the next f$search for "[.models]". Also using the f$search context is always a good idea so that you don't get searches mixed up between each other.
For problem2 I agree that we need more specific information on the problem. If you are using the SUBMIT command then try sumbitting it with a /NAME=job-name and then use the SYNCHRONIZE command in DCL to tell if it is finished. If you are submitting multiple procedures to the batch job and you want to watch the queue until all the jobs are finished then you need to use a gosub as follows:
$CHECK_OPTIMIZE_JOB:
$ wait 00:10:00.00
$ temp = f$getqui("")
$ optimize_done = "Y"
$ write sys$output "Checking SYS$BATCH for OPTIMIZE_FILE at ''f$time()'"
$QLOOP:
$ qname = f$getqui("DISPLAY_QUEUE","QUEUE_NAME","SYS$BATCH*")
$! if qname .eqs. "" then goto exit_check_optimize_job
$JLOOP:
$ jname = f$getqui("DISPLAY_JOB","JOB_NAME",,"ALL_JOBS")
$ if jname .eqs. "" then goto end_wait_loop
$! write sys$output jname
$ if jname .eqs. "OPTIMIZE_FILE"
$ then
$ optimize_done = "N"
$ write sys$output "Found an OPTIMIZE_FILE job in SYS$BATCH"
$ goto end_wait_loop
$ endif
$ goto jloop
$!
$END_WAIT_LOOP:
$ if optimize_done .eqs. "Y" then goto exit_check_optimize_job
$ goto check_optimize_job
$!
$EXIT_CHECK_OPTIMIZE_JOB:
$ return
This basically looks for a specific file name in the bqtch queue and if it finds one still in the queue it waits and looks again. If there it doesn't find one in the queue then it will exit and your procedure can continue with the next batch of files to submit.
Phil
For problem2 I agree that we need more specific information on the problem. If you are using the SUBMIT command then try sumbitting it with a /NAME=job-name and then use the SYNCHRONIZE command in DCL to tell if it is finished. If you are submitting multiple procedures to the batch job and you want to watch the queue until all the jobs are finished then you need to use a gosub as follows:
$CHECK_OPTIMIZE_JOB:
$ wait 00:10:00.00
$ temp = f$getqui("")
$ optimize_done = "Y"
$ write sys$output "Checking SYS$BATCH for OPTIMIZE_FILE at ''f$time()'"
$QLOOP:
$ qname = f$getqui("DISPLAY_QUEUE","QUEUE_NAME","SYS$BATCH*")
$! if qname .eqs. "" then goto exit_check_optimize_job
$JLOOP:
$ jname = f$getqui("DISPLAY_JOB","JOB_NAME",,"ALL_JOBS")
$ if jname .eqs. "" then goto end_wait_loop
$! write sys$output jname
$ if jname .eqs. "OPTIMIZE_FILE"
$ then
$ optimize_done = "N"
$ write sys$output "Found an OPTIMIZE_FILE job in SYS$BATCH"
$ goto end_wait_loop
$ endif
$ goto jloop
$!
$END_WAIT_LOOP:
$ if optimize_done .eqs. "Y" then goto exit_check_optimize_job
$ goto check_optimize_job
$!
$EXIT_CHECK_OPTIMIZE_JOB:
$ return
This basically looks for a specific file name in the bqtch queue and if it finds one still in the queue it waits and looks again. If there it doesn't find one in the queue then it will exit and your procedure can continue with the next batch of files to submit.
Phil
Once it's in production it's all bugs after that.
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP