Outfile for WRKJOB command.

170 pts.
Tags:
AS/400
AS/400 commands
AS/400 jobs
HI All, I need to print all the instance of a job in some spool file or database file. Suppose we have a daily job ABCJOB. Now if I do WRKJOB ABCJOB, it will display all the jobs with date and if I select any, it will show the spool file and other options. Now what I want is instead of displaying all the jobs in screen, it should dump it in spool file or some database file. Thanks, Deepak

Software/Hardware used:
AS/400

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 6  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • LetItBe
    DSPLOG QHST for a date range, specify output *print, press F10 for more parameters and enter ABCJOB  for jobs to display.All ABCJOBs during that date range will be listed.
    260 pointsBadges:
    report
  • ddaswani
    Thanks LtitBe.It should work.
    170 pointsBadges:
    report
  • TomLiotta
    ...it should dump it in sool fiile or some databse file.   What do you expect to find in any output file? How do you expect to process it? For most uses, neither WRKJOB nor DSPLOG will give you very much useful information. To process the output, a lot of messy programming will have to be done.   If you describe what you actually need to do with the file, much better methods can be suggested.   Tom
    125,585 pointsBadges:
    report
  • ddaswani
    Hi Tom, We are using Robot for scheduling and other stuff, but now instead of Robot, We are using ESP which is on mainframes...so ESP kick off the job... Now the main problem is like Robot keep all the Spool file under the Job with all the history..ESP saves the history for 1 day... Now what i m trying to do..is built a similar sort of utility..which have the list of all the jobs run on which date and through that we can get directly the spool file of the any job run previously... I hope u got my point.
    170 pointsBadges:
    report
  • ToddN2000
    If you want the spoolfile contents of all the times the job was run yo may be able to do it this way. If all the output was directed to 1 OUTQ you could dump the contents to a spool file. Copy that to a PF. Read that pf for the spool file info and copy that to another flat file with an add option for each spoolfile. Something like this...
                 PGM                                                          
                                                                      
                 DCL        VAR(&SPOOL)  TYPE(*CHAR) LEN(6)           
                 DCL        VAR(&JOBNR)  TYPE(*CHAR) LEN(6)           
                 DCL        VAR(&CLWORK) TYPE(*CHAR) LEN(132)         
                 DCL        VAR(&USRNM)  TYPE(*CHAR) LEN(10)          
                 DCL        VAR(&JOBNM)  TYPE(*CHAR) LEN(10)          
                                                                      
                 DCLF       FILE(WORK)                                
                                                                      
                 WRKOUTQ    OUTQ(FRNPRT) OUTPUT(*PRINT)               
                 CPYSPLF    FILE(QPRTSPLQ) TOFILE(WORK)               
                 DLTSPLF    FILE(QPRTSPLQ)                            
                                                                      
    /* Read spool entries                                          */ 
                                                                      
    TAG01:       RCVF                                                 
                 MONMSG     MSGID(CPF0000) EXEC(GOTO CMDLBL(TAGDONE))   
                                                                      
    /* GET SPOOL FILE                                                   */          
                                                                                    
                 CHGVAR     VAR(&JOBNR) VALUE(%SST(&CLWORK 95 6))                   
                 CHGVAR     VAR(&SPOOL) VALUE(%SST(&CLWORK 75 4))                   
                 CHGVAR     VAR(&USRNM) VALUE(%SST(&CLWORK 13 10))                  
                 CHGVAR     VAR(&JOBNM) VALUE(%SST(&CLWORK 84 10))                  
                                                                                    
    /*  Zero fill spool number                                       */             
                 IF         COND(%SST(&SPOOL 1 1) *EQ ' ') THEN(CHGVAR +            
                              VAR(%SST(&SPOOL 1 1)) VALUE('0'))                     
                 IF         COND(%SST(&SPOOL 2 1) *EQ ' ') THEN(CHGVAR +            
                              VAR(%SST(&SPOOL 2 1)) VALUE('0'))                     
                 IF         COND(%SST(&SPOOL 3 1) *EQ ' ') THEN(CHGVAR +            
                              VAR(%SST(&SPOOL 3 1)) VALUE('0'))                     
                                                                                    
    /* COPY TO DATABASE                                                 */          
                                                                                    
                 CPYSPLF    FILE(QSYSPRT) TOFILE(MY_LIB/MY_DB) +                    
                              JOB(&JOBNR/&USRNM/&JOBNM) SPLNBR(&SPOOL) MBROPT(*ADD) 
                 GOTO       CMDLBL(TAG01)                                           
                         
     TAGDONE:    ENDPGM 
      
    15,605 pointsBadges:
    report
  • TomLiotta
    ...which have the list of all the jobs run on which date and through that we can get directly the spool file of the any job run previously…   That helps a little, but it misses a big part.   You can simply run WRKJOB for that job name from a command line to get access to all the spooled files. Or iSeries Navigator will bring up a list of all jobs of that name that have spooled output, and you can work with spooled files from there. Why do you need a utility for it? What does the utility need to do that isn't already available?   It's fairly easy for me to create that kind of utility on my systems because I already have a lot of little procedures that I can bind together to do it. It will take more work for you unless you also have code to do the parts that go into it. To know the right parts, it needs knowing what the purpose is. What will the utility be used for? How will it be used? Who will use it?   Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following