In <0B92735D9781D3118F04009027B0C1AB155A62@NTMAIL01> [log in to unmask] writes: > Would somebody mind posting an example of a WHILE/ENDWHILE loop in a stream > job. What I am wanting to do is stream a database resizing job from my > DAYCLOSE do something like this: [snip] You might consider one of the following; If you're on MPE/iX 6.0 use the new syntax for the PAUSE command - :PAUSE JOB=!HPLASTJOBID If not, I use the following command file (we call WAITFOR.XEQ.SYS) to wait for a job to log off: parm lookfor,logon="JOBS.SGAII",exclusive="N" comment comment This job looks for any executing job in !logon (i.e. JOBS.SGAII) comment with the string 'lookfor' in the job line. If found, we wait til comment it logs off. comment If 'exclusive' ="Y" then if we end up waiting, we set the system comment job limit to 0; until we're done waiting. comment We set the CIVAR _oldlimit to the job limit before we change it, comment so it can be reset (by something else) later. comment setvar _oldlimit !HPJOBLIMIT echo Looking for @!lookfor@,!logon at !hpdatef !hptimef xeq findjob.xeq !lookfor,"!logon" if !_found>0 then IF UPS("!exclusive")="Y" THEN xeq limit.xeq.sys 0 ENDIF while !_found>0 do pause 60 xeq findjob.xeq !lookfor,"!logon" endwhile endif echo Done at !hpdatef !hptimef Hope that helps... -Chris Bartram