AS400 API : QUSRJOBI set up problem

Hello,

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

I am able to user QUSLJOB API already. I would like to use QUSRJOBI (http://as400bks.rochester.ibm.com/iseries/v5r2/ic2924/index.htm?info/apis/apifinder.htm)
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

Regards
dgallimoreAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
daveslaterConnect With a Mentor Commented:
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                                                                    
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)                      


dave
0
 
egtebertCommented:
Hi
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).
0
 
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 ...
0
 
dgallimoreAuthor Commented:
Thanks,

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

Regards
0
All Courses

From novice to tech pro — start learning today.