Thanks for sharing that code, Carsten.  Yeah, that looks useful in the
right places.  :)

Not to fault your code (which, again, I do appreciate!), I'm curious why
you don't use QSYSINC items for some of that stuff (like QUSEC, for
example).  If it's because of variable data being left undefined (such as
QUSED01), you might find the following useful:

  *   PLEASE keep the next two lines TOGETHER!!!
 D/Copy qsysinc/qrpglesrc,qusec
 D QUSED01                     1024
  *   PLEASE keep the previous two lines TOGETHER!!!

HTH somebody.

Thanks again.
Dennis






"Carsten Flensburg" <flensburg@novasol.dk>@midrange.com on 10/29/2002
10:03:10 AM

Please respond to midrange-l@midrange.com

Sent by:    midrange-l-admin@midrange.com


To:    <MIDRANGE-L@midrange.com>
cc:
Subject:    Re: LCKW Problem



----- Original Message -----
From: "Dennis Lovelady" <dlovelady@dtcc.com>
To: <midrange-l@midrange.com>
Sent: Monday, October 28, 2002 1:17 PM
Subject: Re: LCKW Problem


>
> Cool!
>
> Thanks, Simon!
>
> My current client just converted to V5R1 over the past weekend, so maybe
> I'll have a chance to check that API out.  Sounds like a very worthwhile
> investigation.

- Here's a sample:

     **-- Header specifications:
     --------------------------------------------**
     H Option( *SrcStmt )
     **-- Api error data structure:
     -----------------------------------------**
     D ApiError        Ds
     D  AeBytPro                     10i 0 Inz( %Size( ApiError ))
     D  AeBytAvl                     10i 0 Inz
     D  AeMsgId                       7a
     D                                1a
     D  AeMsgDta                    128a
     **-- Global variables:
     -------------------------------------------------**
     D Idx                            5i 0
     **-- Job lock information:
     ---------------------------------------------**
     D JBLK0100        Ds         65535
     D  JlBytAvl                     10i 0
     D  JlBytRtn                     10i 0
     D  JlNbrObjLck                  10i 0
     D  JlOfsObjLck                  10i 0
     D  JlNbrLckObjRt                10i 0
     D  JlLckObjEntLn                10i 0
     **
     D LckInf          Ds                  Based( pLckInf )
     D  LiObjNam                     10a
     D  LiObjLib                     10a
     D  LiObjTyp                     10a
     D  LiObjExtAtr                  10a
     D  LiLckStt                     10a
     D                                2a
     D  LiLckSts                     10i 0
     D  LiMbrLcks                    10i 0
     D  LiLckCnt                     10i 0
     D  LiLckScp                      1a
     D                                2a
     D  LiThrId                       8a
     **-- Job id:
     -----------------------------------------------------------**
     D JlJobId         Ds
     D  JiJobNam                     10a   Inz( '*' )
     D  JiUsrNam                     10a
     D  JiJobNbr                      6a
     D  JiIntJobId                   16a   Inz( *Blanks )
     D                                2a   Inz( *Allx'00' )
     D  JlThrInd                     10i 0 Inz( 2 )
     D  JlThrId                       8a
     **-- Retrieve job record locks:
     ----------------------------------------**
     D RtvJobLck       Pr                  ExtPgm( 'QWCRJBLK' )
     D  JlRcvVar                  65535a         Options( *VarSize )
     D  JlRcvVarLen                  10i 0 Const
     D  JlFmtNam                      8a   Const
     D  JlJobId                      56a   Const
     D  JlFmtJobId                    8a   Const
     D  JlError                   32767a         Options( *VarSize )
     **
     **-- Mainline:
     ---------------------------------------------------------**
     **
     C                   CallP     RtvJobLck( JBLK0100
     C                                      : %Size( JBLK0100 )
     C                                      : 'JBLK0100'
     C                                      : JlJobId
     C                                      : 'JIDF0100'
     C                                      : ApiError
     C                                      )
     **
     C                   If        AeBytAvl    = *Zero
     C                   ExSr      PrcJobLck
     C                   EndIf
     **
     C                   Return
     **
     **-- Process job locks:
     ------------------------------------------------**
     C     PrcJobLck     BegSr
     **
     C                   Eval      pLckInf     = %Addr( JBLK0100 ) +
     C                                           JlOfsObjLck
     **
     C                   For       Idx         = 1  to JlNbrLckObjRt
     **
     **-- Do whatever...
     **
     C                   If        Idx         < JlNbrLckObjRt
     C                   Eval      pLckInf     = pLckInf + JlLckObjEntLn
     C                   EndIf
     C                   EndFor
     **
     C                   EndSr



_______________________________________________
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@midrange.com
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/cgi-bin/listinfo/midrange-l
or email: MIDRANGE-L-request@midrange.com
Before posting, please take a moment to review the archives
at http://archive.midrange.com/midrange-l.







As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.