With just a couple of modifications to your existing script I think I got what you were attempting to do.
1. I purge the 'TEMP' file I used in this command.
2. instead of using the build file command I changed it to a file equation
3. I added an additional 'IF' statement to check the 1st character of each input string.
If it equals a '#' sign then I want to evaluate that input string further, otherwise I skip over it.
I believe the option ';nocctl' is the default but I add it for clarification.
So, here's the modified script:
PURGE JOBLIST,TEMP;NOCONFIRM >$NULL
FILE JOBLIST,NEW;REC=-80,,F,ASCII;DISC=10000;MSG;TEMP;NOCCTL
SHOWJOB JOB=@J;*JOBLIST
SETVAR JOBLIST_EOF, FINFO("JOBLIST","EOF")
ECHO !JOBLIST_EOF
SETVAR JOB_COUNT, 0
WHILE JOB_COUNT < JOBLIST_EOF
SETVAR JOB_COUNT, JOB_COUNT + 1
INPUT JOB_NAME < JOBLIST
IF LFT('!JOB_NAME',1) = "#"
ECHO !JOB_NAME
SETVAR FINAL_JOB_NAME REPL("!JOB_NAME",",","")
ECHO !FINAL_JOB_NAME
SETVAR POS_VALUE POS("!HPACCOUNT","!FINAL_JOB_NAME")
IF !POS_VALUE > 0
ECHO !JOB_NAME
ENDIF
ENDIF
ENDWHILE
I hope this helps?
Larry B.
-----Original Message-----
From: Venkataraman Ramakrishnan [mailto:[log in to unmask]]
Sent: Monday, October 20, 2003 2:28 AM
To: [log in to unmask]
Subject: [HP3000-L] Command File help
Hello everybody,
I am trying to write a command file to list all the jobs in a particular
account, but am having some trouble making it work.
Am using the SHOWJOB JOB=@J command and dumping all the details into a
msg file.
Then am reading the msg file in a loop till the end and checking for
jobs in that account using POS command.
Have copy pasted the details below.
--------------------------------------------------------------
PURGE JOBLIST.DATA
BUILD JOBLIST.DATA;REC=-80,,F,ASCII;DISC=10000;MSG
SHOWJOB JOB=@J > JOBLIST.DATA
SETVAR JOBLIST_EOF, FINFO("JOBLIST.DATA","EOF")
ECHO !JOBLIST_EOF
SETVAR JOB_COUNT, 0
WHILE JOB_COUNT < JOBLIST_EOF
SETVAR JOB_COUNT, JOB_COUNT + 1
INPUT JOB_NAME < JOBLIST.DATA
ECHO !JOB_NAME
SETVAR FINAL_JOB_NAME REPL("!JOB_NAME",",","")
ECHO !FINAL_JOB_NAME
SETVAR POS_VALUE POS("!HPACCOUNT","!FINAL_JOB_NAME")
IF !POS_VALUE > 0
ECHO !JOB_NAME
ENDIF
ENDWHILE
------------------------------------------------------------------
but when I run this command file the output it shows me the E.O.F value
and the rest are all timestamps and their edited value.
For ex.. MON, OCT 20, 2003, 12:26 AM
After using REPL the value is echoed as MON OCT 20 2003 12:26 AM
But when I print the JOBLIST.DATA file am getting the job details
correctly, from where is this timestamp value coming form?
Can somebody please help me out?
Thanks
Venkat
"The way I see it, if you want the rainbow, you gotta put up with the
rain."
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
* To join/leave the list, search archives, change list settings, *
* etc., please visit http://raven.utc.edu/archives/hp3000-l.html *
|