AS400 API : QUSRJOBI set up problem


I am writing a code in which allow to use API directly from on site.

I am able to user QUSLJOB API already. I would like to use QUSRJOBI (
but when i launch my program, i receive the error code : "CPF3C58 - Job name specified is not valid"

Job name is a part of Qualified job name which is composed of :

Length of receiver variable = 8 bytes

Format name = JOBI0100

Job name = "QZSCSRVS"
User name= ""
Job number =""

and finally
internal job identifier = ""

This is of the API should work even on the console...
Maybe i've done something wrong

Does someone has used it in the as400 console ? where is my mistake ?

Help much appreciated

Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

The JOBI0100 format information is valid for active jobs and jobs on queues.
just verify the jobname, because it can be wrong and the status of the job depends on whether you get info or not. Do you know if the job did fail?
with Retrieve Job Information (QUSRJOBI) API you can select these:
Format name INPUT; CHAR(8)
The format of the job information to be returned. The format names supported are:
JOBI0100 This format returns basic performance information about a job. It is faster than the JOBI0150 format and the JOBI0200 format (which also contain performance information). The reason that this format is faster is that it does not touch as many objects, causing less paging when retrieving information about the job.
JOBI0150 This format returns additional performance information, and is slower than the JOBI0100 format. It is similar to the JOBI0200 format, but is faster than that format because there is less paging involved in retrieving the information.
JOBI0200 This format returns information equivalent to that found on the Work with Active Jobs (WRKACTJOB) command.
JOBI0300 This format returns job queue and output queue information for a job, as well as information about the submitter's job if the job is a submitted batch job.
JOBI0400 This format primarily returns job attribute types of information, but has other types of information as well.
JOBI0500 This format returns message logging information.
JOBI0600 This format returns information about active jobs only. It is intended to supplement the JOBI0400 format. It retrieves information from several additional objects associated with the job, and therefore, it causes additional paging.
JOBI0700 This format returns library list information for an active job.
JOBI0750 This format returns library list information for an active job plus additional information about each library returned.
JOBI0800 This format returns signal information for an active job.
JOBI0900 This format returns SQL information for an active job.
JOBI1000 This format returns elapsed performance statistics. Performance values returned are based on an elapsed time (returned as part of this format).
dgallimoreAuthor Commented:
Hello, Thanks for your reply

The format i use is JOBI0100,

I tried with different job name, even * which should display current job ... but still the same error. Can't figured it out ...
here is how I coded it.

D Qusrjobi        Pr                  ExtPgm('QUSRJOBI')          
D  P_Receiver                         Like(Jobi0100)              
D  P_Reclen                           Like(Reclen)    Const      
D  P_Format                           Like(Format)    Const      
D  P_Job                              Like(Fulljob)   Const      
D  P_Ijob                             Like(Ijob)      Const      
D  P_Error                            Like(Errords)   Const      

D Jobi0100        Ds                                                  
D  Intjobid                     16    Overlay(Jobi0100:35)            
D  Status                       10    Overlay(Jobi0100:51)            
D Reclen          S             10I 0 Inz(%Size(Jobi0100))            
D Format          S              8    Inz('JOBI0100')                
D Fulljob         S             26                                    
D Ijob            S             16                                    

D ErrorDS         ds            16    Qualified                    
D   BytesProv                   10i 0 inz(%size(ErrorDS))          
D   BytesAvail                  10i 0                              
D   ExceptionID                  7                                

D Job             S             10    Const          
D User            S             10    Const          
D Jobnbr          S              6    Const          

C                   Reset                   Jobi0100                    
C                   Reset                   Errords                    
C                   Eval      Fulljob = Job + User + Jobnbr            
C                   Callp     Qusrjobi(Jobi0100                        
C                                      : Reclen                        
C                                      : Format                        
C                                      : Fulljob                        
C                                      : Ijob                          
C                                      : Errords)                      


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
dgallimoreAuthor Commented:

I'll try to convert this code into my program, i'll let you know the result

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
IBM System i

From novice to tech pro — start learning today.