IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Infinite loop while tryin 2 extract Job info 4m spool


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
surupab

New User


Joined: 13 Feb 2008
Posts: 4
Location: Kolkata

PostPosted: Tue Apr 22, 2008 12:05 pm
Reply with quote

Hi, I am deveoping a utility which involves submission of a job and extracting the spool info (once the job finishes) into a PS. Presently I am trying to display the job on the screen itself. After job submission, the TSO OUTPUT command is being executed and the 1st byte of the return message is checked. As soon as it comes out to be IAT6140, it is concluded that the job has completed and the spool message is brought to screen.
While doing this the prob is, as soon as the job is finished the spool is coming on screen in an infinite loop, i.e. after the entire spool is displayed, it is being displayed from the beginning once again and so on..
Can anyone please help (probably it is because of improper usage of TSO OUTPUT command).

The relevent code part is:
Code:

ADDRESS ISPEXEC
X =X OUTTRAP(JOBSUB.)
"LIBDEF ISPLIB DATASET ID('USERID.REXX.SKEL')"
SKELNAM = UTILITY
ADDRESS ISPEXEC
"FTOPEN TEMP" ;"FTINCL &SKELNAM"; "FTCLOSE"
"VGET (ZTEMPF,ZTEMPN) SHARED"
ADDRESS TSO "SUBMIT '"ZTEMPF"'"
X = OUTTRAP(OFF)
PARSE VAR JOBSUB.1 WORD1 WORD2 JOB WORD4
ADDRESS TSO
JOBEND = ''
DO UNTIL (JOBEND = 'Y')
   IF (ST1 = 'IAT6140') THEN
   DO
     JOBEND = 'Y'
   END
   X = OUTTRAP(JOBSTATUS.)
   OUTPUT JOB BEGIN HOLD KEEP
   PARSE VAR JOBSTATUS.1 ST1 ST2 ST3 ST4 ST5 ST6 REST
   SAY 'JOBSTATUS.1' JOBSTATUS.1
   X = OUTTRAP(OFF)
END
Back to top
View user's profile Send private message
kavya123
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 34
Location: hyderabad

PostPosted: Tue Apr 22, 2008 12:41 pm
Reply with quote

what is the info you want from spool for a particular job.
Back to top
View user's profile Send private message
surupab

New User


Joined: 13 Feb 2008
Posts: 4
Location: Kolkata

PostPosted: Tue Apr 22, 2008 12:53 pm
Reply with quote

kavya123 wrote:
what is the info you want from spool for a particular job.


The TSO OUTPUT command extracts the entire job info (JESMSGLG, JESJCL, JESYSMSG, SYSPRINT SYSOUT) from the spool and displays on the screen. Just do a TSO JOBNAME(JOBID) (any jobname or jobid) or do a TSO HELP OUTPUT
Back to top
View user's profile Send private message
kavya123
Warnings : 1

New User


Joined: 11 Jul 2007
Posts: 34
Location: hyderabad

PostPosted: Tue Apr 22, 2008 3:52 pm
Reply with quote

Quote:
DO UNTIL (JOBEND = 'Y')


HERE you have written a dowhile loop stating that if JOBEND = 'Y' it should come out of the loop and

Quote:
IF (ST1 = 'IAT6140') THEN
DO
JOBEND = 'Y'
END


but JOBEND = 'Y' only when ST1 = 'IAT6140'
but ST1 = 'IAT6140' is not happening so it is going to infinate loop.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
This topic is locked: you cannot edit posts or make replies. REXX - Do - Not able to LOOP CLIST & REXX 10
No new posts optim extract file - SAS DB2 2
No new posts Search string in job at regular Spool... CLIST & REXX 0
Search our Forums:

Back to Top