- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - OpenVMS
- >
- F$mode() info required
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
04-21-2006 02:34 AM
04-21-2006 02:34 AM
We need urgent help regarding f$mode() on open VMS.
Need to know
1) How this gets set as BATCH/INTERACTIVE?
2) If i want to run a application in batch always, how do i set it?
Please reply back.
Thanks and Regards,
Rajni.
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 02:41 AM
04-21-2006 02:41 AM
SolutionThe lexical function F$MODE() returns as a character string the mode in which the process is executing ( INTERACTIVE, BATCH, NETWORK, OTHER ). It cannot set this mode.
See the Help topic "Lexicals".
If you want to run an app in BATCH always, you will have to create a command procedure that invokes this app, and SUBMIT this procedure to a batch queue for execution.
Please see
http://h71000.www7.hp.com/doc/731FINAL/6489/6489pro_contents_005.html#toc_chapter_16
for further reading.
Regards,
Kris (aka Qkcl)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 02:44 AM
04-21-2006 02:44 AM
Re: F$mode() info required
Try the following:
$ IF F$MODE() .NES. "INTERACTIVE" THEN GOTO ENDINTER
$ IF F$MODE() .NES. "BATCH" THEN GOTO ENDBATCH
You can also use GOSUB with RETURN as well
XMAN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 02:45 AM
04-21-2006 02:45 AM
Re: F$mode() info required
Welcome to the ITRC OpenVMS forum!
The lexical function f$mode()returns a character string showing the mode in which a process is executing.
It does not set an application or process to batch/interactive mode. The bit(s) which are read by f$mode() are set up in the process header at the time of process creation.
To run a process in batch mode, submit a command procedure to a previously defined batch queue (e.g. sys$batch).
Duncan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 02:56 AM
04-21-2006 02:56 AM
Re: F$mode() info required
Thanks for your reply.
Since in our case, we need to have this job run immediately i.e. it can not be queued in with SUBMIT command.
So could you please let us know is there any alternative to set f$mode() to batch.
Is it possible if I run my script using PIPE (.....)& ??
Since am very new to VMS, so may be the questions are quite like a learner.
Please let me know.
Thanks and Regards,
Rajni.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 02:56 AM
04-21-2006 02:56 AM
Re: F$mode() info required
F$MODE() is a lexical function and can be tested against
"OTHER", "NETWORK", "INTERACTIVE" & "BATCH" modes.
you can also assign it to a variable and then test that variable like:
$ X = f$mode()
and then test "X" or you can use it directly like:
$ If F$MODE() .EQS. "OTHER" THEN GOTO/GOSUB YOUR_WORKPARA
$ IF F$MODE() .EQS. "NETWORK" THEN GOTO/GOSUB YOUR_WORKPARA
$ IF F$MODE() .EQS. "INTERACTIVE" THEN GOTO/GOSUB YOUR_WORKPARA
$ IF F$MODE() .EQS. "BATCH" THEN GOTO/GOSUB YOUR_WORKPARA
Hope this helps.
XMAN
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 03:04 AM
04-21-2006 03:04 AM
Re: F$mode() info required
"Since in our case, we need to have this job run immediately i.e. it can not be queued in with SUBMIT command.
So could you please let us know is there any alternative to set f$mode() to batch."
As you say, you are new to OpenVMS. ALL batch jobs run in a batch queue. You can have the job start immediately within the queue. If you are thinking of a "background" task, then you could consider using SPAWN/NOWAIT - but please be careful! This is a very different environment to Unix.
Duncan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 03:08 AM
04-21-2006 03:08 AM
Re: F$mode() info required
please read chapter 16 of the OpenVMS user guide for a good description of batch jobs, subprocesses and similar.
I am sure that you will find the information that you need in this link
http://h71000.www7.hp.com/doc/731FINAL/6489/6489pro_contents_005.html#toc_chapter_16
Duncan
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 04:39 AM
04-21-2006 04:39 AM
Re: F$mode() info required
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-21-2006 04:48 AM
04-21-2006 04:48 AM
Re: F$mode() info required
hopefully these answers will help you, and if you need more information on any OpenVMS topic, feel free to opena new topic.
Once you have had time to go through the answers, maybe you can find some time to do some assigning?
http://forums1.itrc.hp.com/service/forums/helptips.do?#33
Mind, I do not say you necessarily need to give lots of points. It is fully up to _YOU_ to decide how many. If you consider an answer is not deserving any points, you can also assign 0 ( = zero ) points, and then that answer will no longer be counted as unassigned.
Consider, that every poster took at least the trouble of posting for you!
Thanks on behalf of your Forum colleagues.
Duncan