Operating System - OpenVMS
cancel
Showing results for 
Search instead for 
Did you mean: 

How to run a command file by submitting it as job to queue

 
Meen
Occasional Advisor

How to run a command file by submitting it as job to queue

Hello All,

I am trying to run a command type file by submitting it as job to queue.

But the command is not getting executed.Could anyone please spot the mistake in below command?

submit/name='FILE_NAME'/noprint/log='FILE_NAME_LOG'- /que=sys$run_rgen_report 'FILE_NAME_COM'

Here,

FILE_NAME is the variable containing the name of the job.

FILE_NAME_LOG is the variable containing the name of the log file.

sys$run_rgen_report is the queue to which I am submitting the job.

FILE_NAME_COM is the variable containing the name of the command file which need to be executed.

Please find below command for further reference.
This is the content of the input file which I am sending to the command file
.

BRESA3_CALS> ty RUN_RGEN_REPORT_INPUT_PARAMETER.TXT
1,ADARC01J,2006002425,2006002656

This is the content of the command file which contains the queue command.

BRESA3_CALS> ty RUN_RGEN_REPORT.COM
$! PROGRAM : RUN_RGEN_REPORT.COM
$! AUTHOR : Tom Frasor
$! PURPOSE : Executes a RGEN report and saves the output into a text file
$!
$!
$! DEFINE PARAMETERS :
$ SET NOON
$!
$ OPEN LIST RUN_RGEN_REPORT_INPUT_PARAMETER.TXT
$! Start read loop
$ READ_LOOP_1:
$ READ/END_OF_FILE=ENDIT_1 LIST LINE_CONT
$! Extract the group, report name, item code
$! FILE_NAME_COM is the name of the script that is going to be run
$! FILE_NAME_TXT is the name of the output file (of the report)
$! JOB_NAME is the name of the batch job
$!
$ GROUP_NUMBER = F$ELEMENT(0,",",LINE_CONT)
$ REPORT_NAME = F$ELEMENT(1,",",LINE_CONT)
$ REPORT_INPUT1 = F$ELEMENT(2,",",LINE_CONT)
$ REPORT_INPUT2 = F$ELEMENT(3,",",LINE_CONT)
$ FILE_NAME = GROUP_NUMBER+"_"+REPORT_NAME+"_"+REPORT_INPUT1+"_"+REPORT_INPUT2
$ FILE_NAME_COM = FILE_NAME+".COM"
$ FILE_NAME_TXT = FILE_NAME+".TXT"
$ FILE_NAME_LOG = FILE_NAME+".LOG"
$! JOB_NAME = FILE_NAME_TXT - ".TXT"
$ OPEN/WRITE PROG1 'FILE_NAME_COM'
$ WRITE PROG1 "$ SET NOON"
$ WRITE PROG1 "$ RUN CALS$EXE:LBMGR"
$ WRITE PROG1 GROUP_NUMBER
$ WRITE PROG1 "/E"
$ WRITE PROG1 "LDBMS,"+ REPORT_NAME
$ WRITE PROG1 REPORT_INPUT1
$ WRITE PROG1 REPORT_INPUT2
$ WRITE PROG1 "FILE"
$ WRITE PROG1 FILE_NAME_TXT
$ WRITE PROG1 "EX"
$ WRITE PROG1 "$ EXIT"
$ CLOSE PROG1
$!
$! Run the program to execute the RGEN report and save the output
$! @'FILE_NAME'
$! Submit the script to the queue
$ submit/name='FILE_NAME'/noprint/log='FILE_NAME_LOG'-
/que=sys$run_rgen_report 'FILE_NAME_COM'
$ GOTO READ_LOOP_1
$ ENDIT_1:
$ CLOSE LIST
$!
$ EXIT

This is the temporary .com file (1_ADARC01J_2006002425.COM) created by above command type file . This is the file which is submitted to the queue as shown in the above command file (RUN_RGEN_REPORT.COM)

BRESA3_CALS> ty 1_ADARC01J_2006002425.COM
$ SET NOON
$ RUN CALS$EXE:LBMGR
1
/E
LDBMS,ADARC01J
2006002425
2006002656
FILE
1_ADARC01J_2006002425.TXT
EX
$ EXIT

Note: Without Queue command,If i run the temporary command file normally it provides the output text file.Within queue command,It doesnt works.

Thanks in advance :)

8 REPLIES 8
Brad McCusker
Respected Contributor

Re: How to run a command file by submitting it as job to queue

Can you show us a log file from the run?   Can you provide some detail that explains "doesnt works"?  What does it do compared with waht you expected it to do?

Brad McCusker
Software Concepts International
Meen
Occasional Advisor

Re: How to run a command file by submitting it as job to queue

Hello Brad,

Queue command is getting ignored ,hence It didnt create any log file for this command.

If I run the command file using  @temporarycommandfilename ,it executes fine and provides the output text file.

When I include it to execute as a job in the queue command ,It doesnt run and didnt provide the output text file.

Thank you!

 

Maurizio De Tommaso_
Valued Contributor

Re: How to run a command file by submitting it as job to queue

Hello,

I tested your dcl procedure on my VMS server :

$ submit/name=1_ADARC01J_2006002425_2006002656/noprint/log=1_ADARC01J_2006002425_2006002656.LOG-
/que=sys$run_rgen_report 1_ADARC01J_2006002425_2006002656.COM

Obviously, 1_ADARC01J_2006002425_2006002656.COM fails because I haven't the CALS$EXE:[SYSMGR]LBMGR.EXE image.

The log file is created into the login directory of the OpenVMS account submitted the command procedure.

So please, show us the content of the log file.

Regards,
/Maurizio

Volker Halle
Honored Contributor

Re: How to run a command file by submitting it as job to queue

Consider to manually enter the SUBMIT command in DCL and show us the DCL output of issuing that command. Or run your @Run_RGEN_REPORT.COM procedure after $ SET VERIFY and provide the output generated by the SUBMIT  command.

If the SUBMIT command is being executed by your DCL procedure, it can't fail 'silently'. There is either an error message or a 'JOB xxx (queue ... ,entry xxx) started on ...' output line.

Volker.

.

Meen
Occasional Advisor

Re: How to run a command file by submitting it as job to queue

Hello Maurizio and Volker,

Please find the log file as you requested in the reply.

BRESA3_CALS> ty 1_ADARC01J_2006002425_2006002656.LOG;7
11:43:51 12/03/2019 LabManager LIMS, Copyright (C) Beckman Coulter, 1990-1999
Revision 8.5a

Welcome to LabManager Cals User
You last logged in on 11:36:15 12/03/2019

************************************************************
* System Message *
* -------------- *
* The following error message was generated *
* by the LABC21_CHECK program. *
* *
Validation errors found in group
* *
* Please investigate and correct. *
* The standard message screen LABMANAGER_ANNOUNCE.TXT *
* has been temporarily renamed to LABMANAGER_ANNOUNCE.COP *
************************************************************

Enter LabManager Group Number:
Server: ORACLE/ORS13
Enter <cr> to Enter Menu System, </E> to Bypass:

CALS OLBMGR 1:
CALS Lab Database Management System Revision 8.5aa

Starting Report Parsing phase ...
Starting Data Extraction phase ...2/03/2019
Active & Completed Retrieval
Enter Start <***********
Sample Number : *
Enter End < *
Sample Number : age was generated *
Retrieving ...1_CHECK program. *
Number of samples Retrieved: 230 *
Number of tests Retrieved: 3035d in group
Starting Sorting phase ... *
Starting Report phase ...correct. *
Enter Print Device: ge screen LABMANAGER_ANNOUNCE.TXT *
Enter file name: arily renamed to LABMANAGER_ANNOUNCE.COP *
************************************************************

Enter LabManager Group Number:
Server: ORACLE/ORS13
CALS OLBMGR 1: nter Menu System, </E> to Bypass:

End LabManager, Time Logged to System: 0 Hours 1 Minute

CALS job terminated at 12-MAR-2019 11:45:32.71

Accounting information:
Buffered I/O count: 2948 Peak working set size: 10512
Direct I/O count: 15995 Peak virtual size: 206080
Page faults: 796 Mounted volumes: 0
Charged CPU time: 0 00:00:16.09 Elapsed time: 0 00:01:43.93

Also please find the output below when I run the submit command directly.

BRESA3_CALS> submit/name=1_ADARC01J_2006002425_2006002656/noprint/log=1_ADARC01J
_2006002425_2006002656.LOG-/que=sys$run_rgen_report 1_ADARC01J_2006002425_2006002656.COM;21
Job 1_ADARC01J_2006002425_2006002656 (queue SYS$RUN_RGEN_REPORT, entry 183) started on SYS$RUN_RGEN_REPORT

Job is executing in queue but it is not creating the text output file in the specified location.

Volker Halle
Honored Contributor

Re: How to run a command file by submitting it as job to queue

So the SUBMIT command works as expected and the batch job runs and produces the expected batch log file. Just the 'LabManager' does not produce the expected output, if run in BATCH mode.

Run @1_ADARC01J_2006002425.COM interactively (after a $ SET VERIFY) and compare the generated output to the batch log file. Does the output differ ? Is CALS$EXE:LBMGR supposed to work if run in batch mode ?

Volker.

Mark_Corcoran
Frequent Advisor

Re: How to run a command file by submitting it as job to queue

Hi Meen,

At the risk of asking the obvious, are you looking at the correct files in the correct location?


You indicated that the code in RUN_RGEN_REPORT.COM does:
[deletia]
$ FILE_NAME = GROUP_NUMBER+"_"+REPORT_NAME+"_"+REPORT_INPUT1+"_"+REPORT_INPUT2
[deletia]
$ FILE_NAME_TXT = FILE_NAME+".TXT"
[deletia]
$ WRITE PROG1 "LDBMS,"+ REPORT_NAME
$ WRITE PROG1 REPORT_INPUT1
$ WRITE PROG1 REPORT_INPUT2
$ WRITE PROG1 "FILE"
$ WRITE PROG1 FILE_NAME_TXT
[deletia]


You said that the content of RUN_RGEN_REPORT_INPUT_PARAMETER.TXT was this:
1,ADARC01J,2006002425,2006002656


So, RUN_RGEN_REPORT.COM should define the FILE_NAME_COM symbol as "1_ADARC01J_2006002425_2006002656.COM", and the FILE_NAME_TXT symbol as "1_ADARC01J_2006002425_2006002656.TXT"

However, you typed out a file called 1_ADARC01J_2006002425.COM (note that it doesn't include the REPORT_INPUT2 component as part of the file name!) which had the following content:
$ SET NOON
$ RUN CALS$EXE:LBMGR
1
/E
LDBMS,ADARC01J
2006002425
2006002656
FILE
1_ADARC01J_2006002425.TXT
EX
$ EXIT


That's not consistent with what the code in RUN_RGEN_REPORT.COM does - and indeed, as Maurizio showed in the sample run from his system, the temporary command file that is generated (which does include the REPORT_INPUT2 component of the filename), is 1_ADARC01J_2006002425_2006002656.COM


If you do the following:
$ DIRECTORY /DATE=(MODIFIED,CREATED) 1_ADARC01J_2006002425.COM

Then surely the date of that temporary command file can't be recent? (the content suggests it was maybe generated by an older version of RUN_RGEN_REPORT.COM, possibly whilst it was still being developed/debugged).

If it is recent, then the file has to be getting created by something other than RUN_RGEN_REPORT.COM (or a different version of it - are you sure that the version that you posted here, is the version that is actually being run?)

 

Mark

[Formerly appearing as woeisme]
Maurizio De Tommaso_
Valued Contributor

Re: How to run a command file by submitting it as job to queue

Hello Meen,

we don't have enough information about the logic used by your code, so it is very hard to try to help you.

Basing on my experience, I could hypothesize your code needs the difinition of some symbols and/or logical names.

So, try checking :

1- Systemwide login command procedures SYS$MANAGER:SYLOGIN.COM (if not different defined)
2- Login Command Procedure for the User Account LOGIN.COM (if not different defined)

May be that the process symbols and the process logical names, needed by your code, are defined only into "INTERACTIVE" section. In this case, define them also into "BATCH" section. For example :

...
$ MODE = F$MODE()
$ IF MODE .NES. "INTERACTIVE" THEN GOTO ENDINTER
$!
$! Put commands that you want executed only on an interactive login
$! between this comment and the "ENDINTER:" label.
...
...
$ IF MODE .NES. "BATCH" THEN GOTO ENDBATCH
$!
$! Put commands you want executed only in batch mode between this comment
$! and the "ENDBATCH:" label.
$!
$
...

This would also explain why your code runs in interactive mode and not in batch mode, but this is only a simple supposition.

Regards,
/Maurizio