Page 1 of 2 12 LastLast
Results 1 to 20 of 29

Thread: QUSLOBJ example in free-format?

  1. #1
    RPG Developer
    Join Date
    Apr 2010
    Location
    Minnesota
    Posts
    65
    Rep Power
    395

    QUSLOBJ example in free-format?

    Does anyone have any example code using QUSLOBJ in free-format code? Google hasn't been helping me much.

    I've looked through Jamief's examples, but I'm rubbish at reading fixed format, having been working with RPG almost exclusively in free format.

  2. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Posts
    1,000,000
     

  3. #2
    Driver of cars, eater of food jamief's Avatar
    Join Date
    Jan 2004
    Location
    Belvidere, IL - United States of America
    Age
    49
    Posts
    9,416
    Rep Power
    12605

    Re: QUSLOBJ example in free-format?

    cant someone using that new fangled gui editor thing convert one for him?
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

  4. #3
    RPG Developer
    Join Date
    Apr 2010
    Location
    Minnesota
    Posts
    65
    Rep Power
    395

    Re: QUSLOBJ example in free-format?

    I already ran it through the latest version of RDI's fixed to free format converter, but it left the majority of the code in fixed format. Sadly, this has been my experience with it most times I've tried it.

  5. #4
    Lord of the Dance
    Join Date
    Aug 2008
    Location
    Memphis - Nashville TN
    Posts
    1,692
    Rep Power
    4709

    Re: QUSLOBJ example in free-format?

    edit: nevermind, wrong api
    Last edited by MichaelCatalani; July 29th, 2010 at 03:29 PM.
    Michael Catalani
    Manager of eCommerce Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

  6. #5
    RPG Developer
    Join Date
    Apr 2010
    Location
    Minnesota
    Posts
    65
    Rep Power
    395

    Re: QUSLOBJ example in free-format?

    An example working with QGYOLOBJ would work too - I can't even find a good fixed-format on that one, much less a free format one.

    I really just need a good way to make a list of all objects in a library available to my code.

  7. #6
    Analyst GLS400's Avatar
    Join Date
    May 2006
    Location
    connecticut
    Posts
    1,902
    Rep Power
    5799

    Re: QUSLOBJ example in free-format?

    Hi vitaemachina:

    Craig Rutledge has some nice utilities
    Have a look here:
    http://home.windstream.net/craigru/jcrapi2.html

    In addition to qulsobjd (JCRLOBJ)
    Some of them assist in the conversion of fixed to free
    He has really done a great job but you have to download the entire package not just one utility

    Best of Luck
    GLS
    The problem with quotes on the internet is that it is hard to verify their authenticity.....Abraham Lincoln

  8. #7
    Driver of cars, eater of food jamief's Avatar
    Join Date
    Jan 2004
    Location
    Belvidere, IL - United States of America
    Age
    49
    Posts
    9,416
    Rep Power
    12605

    Re: QUSLOBJ example in free-format?

    or.... ignore the binary (Tom I love u)

    PHP Code:
         H Option(*SrcStmt: *NoDebugIODftActGRP(*No)
         
    *
         
    *  Field Definitions.
         
    * ~~~~~~~~~~~~~~~~~~~~~~~~
         
    D ObjNam          s             10a
         D ObjLib          s             10a
         D ObjTyp          s             10a
         
    **-- Api error data structure:  ----------------------------------
         
    D ApiError        Ds
         D  AeBytPro                     10i 0 Inz
    ( %SizeApiError ))
         
    D  AeBytAvl                     10i 0 Inz
         D  AeMsgId                       7a
         D                                1a
         D  AeMsgDta                    128a
         
    **-- Object description structure OBJD0200:  ---------------------
         
    D RoData          Ds
         D  RoBytRtn                     10i 0
         D  RoBytAvl                     10i 0
         D  RoObjNam                     10a
         D  RoObjLib                     10a
         D  RoObjTypRt                   10a
         D  RoObjLibRt                   10a
         D  RoObjASP                     10i 0
         D  RoObjOwn                     10a
         D  RoObjDmn                      2a
         D  RoObjCrtDts                  13a
         D  RoObjChgDts                  13a
         D  RoExtAtr                     10a
         D  RoTxtDsc                     50a
         D  RoSrcF                       10a
         D  RoSrcLib                     10a
         D  RoSrcMbr                     10a

         dTheData          DS
         d QUSBR05                 1      4B 0
         d QUSBA05                 5      8B 0
         d QUSJN08                 9     18
         d QUSUN07                19     28
         d QUSJNBR07              29     34
         d QUSIJID05              35     50
         d QUSJS14                51     60
         d QUSJT08                61     61
         d QUSJS15                62     62
         d QUSJS16                63     70
         d QUSES00                71     71
         d QUSSN00                72     81
         d QUSSL06                82     91
         d QUSCUN                 92    101
         d QUSDE                 102    102
         d QUSEK                 103    103
         d QUSCK00               104    104
         d QUSPRC                105    108B 0
         d QUSURC                109    112B 0
         d QUSPGMRC              113    116B 0
         d QUSSE02               117    126
         d QUSDN                 127    136
         d QUSGPN                137    146
         d QUSGRP                        10    DIM
    (00015)
         
    d  QUSGN00                      10    OVERLAY(QUSGRP:00001)
         
    d QUSJUID               297    306
         d QUSJUIDS              307    307
          
    *
          *  
    Field Definitions.
          *
         
    d AllText         s             10    Inz('*ALL')
         
    d CmdString       s            256
         d CmdLength       s             15  5
         d Count           s              4  0
         d Format          s              8
         d GenLen          s              8
         d InLibrary       s             10
         d InType          s             10
         d ObjectLib       s             20
         d SpaceVal        s              1    inz
    (*BLANKS)
         
    d SpaceAuth       s             10    inz('*CHANGE')
         
    d SpaceText       s             50    inz(*BLANKS)
         
    d SpaceRepl       s             10    inz('*YES')
         
    d SpaceAttr       s             10    inz(*BLANKS)
         
    d UserSpaceOut    s             20
         d Worktype        s             10    inz
    ('*OUTQ')
         *                                                                                            
         
    GenHdr                                                                                     
         
    *                                                                                            
         d GenHdr          ds                  inz
         d  OffSet                 1      4B 0
         d  NumEnt                 9     12B 0
         d  Lstsiz                13     16B 0
         
    *                                                                                            
         
    *  Data structures                                                                           
         
    *                                                                                            
         d GENDS           ds
         d  OffsetHdr              1      4B 0
         d  NbrInList              9     12B 0
         d  SizeEntry             13     16B 0
          
    *
         
    d HeaderDs        ds
         d  OutFileNam             1     10
         d  OutLibName            11     20
         d  OutType               21     25
         d  OutFormat             31     40
         d  RecordLen             41     44B 0
          
    *
          * 
    API Error Data Structure
          
    *
         
    d ErrorDs         DS                  INZ
         d  BytesPrv               1      4B 0
         d  BytesAvl               5      8B 0
         d  MessageId              9     15
         d  ERR
    ###                16     16
         
    d  MessageDta            17    116
          
    *
         
    d                 DS
         d  StartPosit             1      4B 0
         d  StartLen               5      8B 0
         d  SpaceLen               9     12B 0
         d  ReceiveLen            13     16B 0
         d  MessageKey            17     20B 0
         d  MsgDtaLen             21     24B 0
         d  MsgQueNbr             25     28B 0
          
    *
          * 
    Date structure for retriving userspace info
          
    *
         
    d InputDs         DS
         d  UserSpace              1     20
         d  SpaceName              1     10
         d  SpaceLib              11     20
         d  InpFileLib            29     48
         d  InpFFilNam            29     38
         d  InpFFilLib            39     48
         d  InpRcdFmt             49     58
          
    *
         
    d ObjectDs        ds
         d  Object                       10
         d  Library                      10
         d  ObjectType                   10
         d  InfoStatus                    1
         d  ExtObjAttrib                 10
         d  Description                  50

         
    **-- Retrieve object description:  -------------------------------
         
    d RtvObjD         Pr                  ExtPgm'QUSROBJD' )
         
    d  RoRcvVar                  32767a         Options( *VarSize )
         
    d  RoRcvVarLen                  10i 0 Const
         
    d  RoFmtNam                      8a   Const
         
    d  RoObjNamQ                    20a   Const
         
    d  RoObjTyp                     10a   Const
         
    d  RoError                   32767a         Options( *VarSize )
         **-- List 
    objects:   ---------------------------------------------
         
    d $ListObjects    Pr                  ExtPgm'QUSLOBJ' )
         
    d  userspace                    20a   Const
         
    d  format                        8a   Const
         
    d  objectlib                    20a   Const
         
    d  type                         10a   Const
         **-- 
    Userspace pointer: ------------------------------------------
         
    d $Userspace      Pr                  ExtPgm'QUSRTVUS' )
         
    d  userspace                    20a   Const
         
    d  start                        10i 0 Const
         
    d  Length                       10i 0 Const
         
    d  Returned                  32767a         Options( *VarSize )
         **-- 
    Create Space:   ---------------------------------------------
         
    d $CreateSpace    Pr                  ExtPgm'QUSCRTUS' )
         
    d  UserSpaceOut                 20a   Const
         
    d  SpaceAttr                    10    Const
         
    d  SpaceLen                     10i 0 Const
         
    d  SpaceVal                      1a   Const
         
    d  SpaceAuth                    10a   Const
         
    d  SpaceText                    50a   Const
         
    d  SpaceRepl                    10a   Const
         
    d  ErrorDs                   32767a         Options( *VarSize )

          /
    free
                     exsr $QUSCRTUS
    ;
                     
    ObjectLib =  '*ALL      ' '*LIBL';
             
    //
             // List all the outqueues to the user space
             //
                     
    Format 'OBJL0200';
                     
    $ListObjectsUserspace Format ObjectLib WorkType);
             
    //
             // Retrive header entry and process the user space
             //
                     
    StartPosit 125;
                     
    StartLen   16;
                     
    $UserSpaceUserspace StartPosit StartLen GENDS);

                     
    StartPosit OffsetHdr 1;
                     
    StartLen = %size(ObjectDS);
             
    //
            // Do for number of outqueues in the userspace                            
             //

    B1               for count 1 to  NbrInList;
                      
    $UserSpaceUserspace StartPosit StartLen ObjectDs);
                      
    StartPosit += SizeEntry;
                     endfor;
                     *
    INLR = *On;

            
    //--------------------------------------------------------
            // $QUSCRTUS - create userspace
            //--------------------------------------------------------
                     
    begsr $QUSCRTUS;

                      
    BytesPrv 116;
                      
    Spacename 'LISTOUTQS';
                      
    SpaceLib 'QTEMP';

                   
    //
                   // Create the user space
                   //
                      
    $CreateSpaceUserspace SpaceAttr 4096 :
                                    
    SpaceVal SpaceAuth SpaceText SpaceRepl:
                                    
    ErrorDs);
                     
    endsr;
          /
    End-Free 
    Attached Files Attached Files
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

  9. #8
    RPG Developer
    Join Date
    Apr 2010
    Location
    Minnesota
    Posts
    65
    Rep Power
    395

    Re: QUSLOBJ example in free-format?

    Sheesh, so much for me thinking I'd be able to decipher it in free format any better.

    How do I actually work with the data retrieved? Like, for example if I just wanted to use dsply to list the object names?

  10. #9
    Driver of cars, eater of food jamief's Avatar
    Join Date
    Jan 2004
    Location
    Belvidere, IL - United States of America
    Age
    49
    Posts
    9,416
    Rep Power
    12605

    Re: QUSLOBJ example in free-format?

    put it in debug....


    Code:
    d Worktype        s             10    inz('*OUTQ')
    The above could include, but is not limited to
    *ALL *CSI
    *ALRTBL *CSPMAP
    *AUTL *CSPTBL
    *BNDDIR *CTLD
    *CFGL *DEVD
    *CHTFMT *DOC
    *CLD *DTAARA
    *CLS *DTADCT
    *CMD *DTAQ
    *CNNL *EDTD
    *COSD *EXITRG
    *CRG *FCT
    *CRQD *FILE
    This is the loop that reads (in this case) all the outq's
    PHP Code:
     for count 1 to  NbrInList;
                      
    $UserSpaceUserspace StartPosit StartLen ObjectDs);
                      
    StartPosit += SizeEntry;
                     endfor; 
    NbrInList = total number of items in list...

    place cursor on ObjectDs this is the data structure with all the data in it....




    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

  11. #10
    Lord of the Dance
    Join Date
    Aug 2008
    Location
    Memphis - Nashville TN
    Posts
    1,692
    Rep Power
    4709

    Re: QUSLOBJ example in free-format?

    Quote Originally Posted by vitaemachina View Post
    Sheesh, so much for me thinking I'd be able to decipher it in free format any better.

    How do I actually work with the data retrieved? Like, for example if I just wanted to use dsply to list the object names?
    List api's are good candidates for using call back procedures. Create a wrapper for the api, and send it a procedure address to call each time it retrieves an item from the user space. This way, you can isolate the api into a service program, and not have to deal with mounds of code inside the actual program.
    Michael Catalani
    Manager of eCommerce Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

  12. #11
    Lord of the Dance
    Join Date
    Aug 2008
    Location
    Memphis - Nashville TN
    Posts
    1,692
    Rep Power
    4709

    Re: QUSLOBJ example in free-format?

    I made a couple of changes to Jamie's / Tom's program to separate the api into a subprocedure. You can then move this into it's own service program and bind to it from the program, but for simplicity, I kept it in the program.

    Code:
    H Option(*SrcStmt: *NoDebugIO) DftActGRP(*No)               
     
    d CallBackPTR     S               *   ProcPtr               
     
    d ObjectDs        ds                  Qualified             
    d  Object                       10                          
    d  Library                      10                          
    d  ObjectType                   10                          
    d  InfoStatus                    1                          
    d  ExtObjAttrib                 10                          
    d  Description                  50                          
     
    d ProcessList     pr              n                         
    d   Data                              LikeDS( ObjectDS )    
     
    d RetrieveObjectList...                                     
    d                 pr                                        
    d   ObjectName                  10a   Const                 
    d   LibraryName                 10a   Const                 
    d   TypeObject                  10a   Const                               
    d   CallBackPTR                   *   ProcPtr Const                       
     
    /free                                                                    
     
    RetrieveObjectList( '*ALL' : 'QGPL' : '*FILE' : %paddr(ProcessList));
    *inlr = *on;                                                            
     
    /end-free                                                                
     
    p ProcessList     b                                                       
    d ProcessList     pi              n                                       
    d   Data                              LikeDS( ObjectDS )                  
    /free                                                                    
    dsply Data.Object;                                                    
    return *on;                                                           
    /end-free                                                                
    P                 E                                                       
     
    p RetrieveObjectList...                                                   
    p                 b                                                 
    d RetrieveObjectList...                                             
    d                 pi                                                
    d   ObjectName                  10a   Const                         
    d   LibraryName                 10a   Const                         
    d   TypeObject                  10a   Const                         
    d   CallBackPTR                   *   ProcPtr  Const                
     
     
    D CallBack        pr              n   ExtProc( CallBackPTR )        
    d   Data                              LikeDS( ObjectDS )            
    *                                                                  
    *  Field Definitions.                                              
    * ~~~~~~~~~~~~~~~~~~~~~~~~                                         
    D ObjNam          s             10a                                 
    D ObjLib          s             10a                                 
    D ObjTyp          s             10a                                 
    **-- 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                                 
    **-- Object description structure OBJD0200:  ---------------------  
    D RoData          Ds                                                
    D  RoBytRtn                     10i 0                               
    D  RoBytAvl                     10i 0                               
    D  RoObjNam                     10a                                 
    D  RoObjLib                     10a                                 
    D  RoObjTypRt                   10a                                 
    D  RoObjLibRt                   10a                                 
    D  RoObjASP                     10i 0                               
    D  RoObjOwn                     10a                                 
    D  RoObjDmn                      2a                                 
    D  RoObjCrtDts                  13a                                 
    D  RoObjChgDts                  13a                                 
    D  RoExtAtr                     10a                                 
    D  RoTxtDsc                     50a                                 
    D  RoSrcF                       10a  
    D  RoSrcLib                     10a     
    D  RoSrcMbr                     10a     
     
    dTheData          DS                    
    d QUSBR05                 1      4B 0   
    d QUSBA05                 5      8B 0   
    d QUSJN08                 9     18      
    d QUSUN07                19     28      
    d QUSJNBR07              29     34      
    d QUSIJID05              35     50      
    d QUSJS14                51     60      
    d QUSJT08                61     61      
    d QUSJS15                62     62      
    d QUSJS16                63     70      
    d QUSES00                71     71      
    d QUSSN00                72     81      
    d QUSSL06                82     91      
    d QUSCUN                 92    101      
    d QUSDE                 102    102      
    d QUSEK                 103    103      d QUSCK00               104    104                                 
    d QUSPRC                105    108B 0                              
    d QUSURC                109    112B 0                              
    d QUSPGMRC              113    116B 0                              
    d QUSSE02               117    126                                 
    d QUSDN                 127    136                                 
    d QUSGPN                137    146                                 
    d QUSGRP                        10    DIM(00015)                   
    d  QUSGN00                      10    OVERLAY(QUSGRP:00001)        
    d QUSJUID               297    306                                 
    d QUSJUIDS              307    307                                 
    *                                                                 
    *  Field Definitions.                                             
    *                                                                 
    d AllText         s             10    Inz('*ALL')                  
    d CmdString       s            256                                 
    d CmdLength       s             15  5                              
    d Count           s              4  0                              
    d Format          s              8                                 
    d GenLen          s              8                                 d InLibrary       s             10                    
    d InType          s             10                    
    d ObjectLib       s             20                    
    d SpaceVal        s              1    inz(*BLANKS)    
    d SpaceAuth       s             10    inz('*CHANGE')  
    d SpaceText       s             50    inz(*BLANKS)    
    d SpaceRepl       s             10    inz('*YES')     
    d SpaceAttr       s             10    inz(*BLANKS)    
    d UserSpaceOut    s             20                    
    d Worktype        s             10    inz('*OUTQ')    
    *                                                    
    * GenHdr                                             
    *                                                    
    d GenHdr          ds                  inz             
    d  OffSet                 1      4B 0                 
    d  NumEnt                 9     12B 0                 
    d  Lstsiz                13     16B 0                 
    *                                                    
    *  Data structures                                   
    *                                        
    d GENDS           ds                          
    d  OffsetHdr              1      4B 0         
    d  NbrInList              9     12B 0         
    d  SizeEntry             13     16B 0         
    *                                            
    d HeaderDs        ds                          
    d  OutFileNam             1     10            
    d  OutLibName            11     20            
    d  OutType               21     25            
    d  OutFormat             31     40            
    d  RecordLen             41     44B 0         
    *                                            
    * API Error Data Structure                   
    *                                            
    d ErrorDs         DS                  INZ     
    d  BytesPrv               1      4B 0         
    d  BytesAvl               5      8B 0         
    d  MessageId              9     15            
    d  ERR###                16     16            
    d  MessageDta            17    116                                                           
    *                                                       
    d                 DS                                     
    d  StartPosit             1      4B 0                    
    d  StartLen               5      8B 0                    
    d  SpaceLen               9     12B 0                    
    d  ReceiveLen            13     16B 0                    
    d  MessageKey            17     20B 0                    
    d  MsgDtaLen             21     24B 0                    
    d  MsgQueNbr             25     28B 0                    
    *                                                       
    * Date structure for retriving userspace info           
    *                                                       
    d InputDs         DS                                     
    d  UserSpace              1     20                       
    d  SpaceName              1     10                       
    d  SpaceLib              11     20                       
    d  InpFileLib            29     48                       
    d  InpFFilNam            29     38                       
    d  InpFFilLib            39     48                       
    d  InpRcdFmt             49     58                       
    *                                                                 
     
    **-- Retrieve object description:  ------------------------------- 
    d RtvObjD         Pr                  ExtPgm( 'QUSROBJD' )         
    d  RoRcvVar                  32767a         Options( *VarSize )    
    d  RoRcvVarLen                  10i 0 Const                        
    d  RoFmtNam                      8a   Const                        
    d  RoObjNamQ                    20a   Const                        
    d  RoObjTyp                     10a   Const                        
    d  RoError                   32767a         Options( *VarSize )    
    **-- List objects:   --------------------------------------------- 
    d $ListObjects    Pr                  ExtPgm( 'QUSLOBJ' )          
    d  userspace                    20a   Const                        
    d  format                        8a   Const                        
    d  objectlib                    20a   Const                        
    d  type                         10a   Const                        
    **-- Userspace pointer: ------------------------------------------ 
    d $Userspace      Pr                  ExtPgm( 'QUSRTVUS' )         
    d  userspace                    20a   Const                        
    d  start                        10i 0 Const                        
    d  Length                       10i 0 Const                         
    d  Returned                  32767a         Options( *VarSize )     
    **-- Create Space:   ---------------------------------------------  
    d $CreateSpace    Pr                  ExtPgm( 'QUSCRTUS' )          
    d  UserSpaceOut                 20a   Const                         
    d  SpaceAttr                    10    Const                         
    d  SpaceLen                     10i 0 Const                         
    d  SpaceVal                      1a   Const                         
    d  SpaceAuth                    10a   Const                         
    d  SpaceText                    50a   Const                         
    d  SpaceRepl                    10a   Const                         
    d  ErrorDs                   32767a         Options( *VarSize )     
     
    /free                                                              
            exsr $QUSCRTUS;                                         
            ObjectLib =  ObjectName + LibraryName;                  
    //                                                              
    // List all the outqueues to the user space                     
    //                                                              
            Format = 'OBJL0200';                                    
            $ListObjects( Userspace : Format : ObjectLib : TypeObject);  
    //                                                                   
    // Retrive header entry and process the user space                   
    //                                                                   
            StartPosit = 125;                                            
            StartLen   = 16;                                             
            $UserSpace( Userspace : StartPosit : StartLen : GENDS);      
            StartPosit = OffsetHdr + 1;                                  
            StartLen = %size(ObjectDS);                                  
    //                                                                   
    // Do for number of outqueues in the userspace                       
    //                                                                   
     
            for count = 1 to  NbrInList;                                 
             $UserSpace( Userspace : StartPosit : StartLen : ObjectDs);  
             if NOT CallBack( ObjectDS );                                
             return;                                                     
             endif;                                                      
             StartPosit += SizeEntry;                                    
            endfor;                                                      
            return;                                                      
     
    //--------------------------------------------------------            
    // $QUSCRTUS - create userspace                                       
    //--------------------------------------------------------            
            begsr $QUSCRTUS;                                             
     
             BytesPrv = 116;                                             
             Spacename = 'LISTOUTQS';                                    
             SpaceLib = 'QTEMP';                                         
     
          //                                                             
          // Create the user space                                       
          //                                                             
     
     
                       $CreateSpace( Userspace : SpaceAttr : 4096 :      
                                     SpaceVal : SpaceAuth : SpaceText :  
     SpaceRepl:                                                          
                                     ErrorDs);                           
                      endsr;                    
    /End-Free                                      
    p                 e                                                                                           
    

    Wrapping the api with a callback procedure can greatly simplifiy the program by isolating the ugly api code stuff outside of our program.


    Some changes need to be made to this subprocedure to make it better. Instead of the ObjectDS data structure, we should be passing the Format Data Structure to ensure all of the fields in the format can be accessed.

    The callback procedure passes back a logical return value. This is so that we can stop the list api at any point. So if the list api returns a few thousand items, but we get what we need on the 5th item, we can return an *off to the subprocedure, and it will terminate looping thru the entries.

    If we encapsulated the subprocedure into a service program, and utilizzed copy members for the prototype and format data structure, then any program that utilized this api could be simplified down to the following:


    Code:
    H Option(*SrcStmt: *NoDebugIO) DftActGRP(*No)               
     
    d CallBackPTR     S               *   ProcPtr               
     /copy The format data structure ProcessList     pr              n                         
     /copy The prototype for the subprocedure that contains the QUSRLOBJ api
     
    d   Data                              LikeDS( Format Data Structure )    
     
    /free                                                                    
     
    RetrieveObjectList( '*ALL' : 'QGPL' : '*FILE' : %paddr(ProcessList));
    *inlr = *on;                                                            
     
    /end-free                                                                
     
    p ProcessList     b                                                       
    d ProcessList     pi              n                                       
    d   Data                              LikeDS( Format Data Structure )                  
    /free     
    // ******* Do stuff with the list entries                                                               
     
    if we are done;                                               
      return *off; 
    else;
      return *on;
    endif;                   
     
    /end-free                                                                
    P                 E    
    
    Last edited by MichaelCatalani; July 29th, 2010 at 07:02 PM.
    Michael Catalani
    Manager of eCommerce Development
    Acceptance Insurance Corporation
    www.AcceptanceInsurance.com
    www.ProvatoSys.com

  13. #12
    Harbinger of Doom tomholden's Avatar
    Join Date
    Dec 2007
    Location
    Lebanon, Tennessee, United States
    Posts
    4,328
    Rep Power
    8644

    Re: QUSLOBJ example in free-format?

    it's not my code...that's all Jamie's. he was mentioning me simply because i always give him a hard time about using the "B" data type instead of integer.

    for all list APIs that return data in a user space i use a service program designed specifically for the user space API's. that service program can be downloaded from my website (in the downloads section of course) http://tommyholden.com and there's no "B" data types used
    I'm not anti-social, I just don't like people -Tommy Holden

  14. #13
    RPG Developer
    Join Date
    Apr 2010
    Location
    Minnesota
    Posts
    65
    Rep Power
    395

    Re: QUSLOBJ example in free-format?

    I really appreciate the help, Michael.

    On this same subject - how would I list the members inside source files? I would assume a different API would be required, but a quick romp through the info center isn't turning up any likely candidates.

  15. #14
    Harbinger of Doom tomholden's Avatar
    Join Date
    Dec 2007
    Location
    Lebanon, Tennessee, United States
    Posts
    4,328
    Rep Power
    8644

    Re: QUSLOBJ example in free-format?

    QUSLMBR API is what you are looking for. http://publib.boulder.ibm.com/infoce...is/quslmbr.htm
    I'm not anti-social, I just don't like people -Tommy Holden

  16. #15
    RPG Developer
    Join Date
    Apr 2010
    Location
    Minnesota
    Posts
    65
    Rep Power
    395

    Re: QUSLOBJ example in free-format?

    So it is! I got thrown by how it was described. Looks like Scott Klement has a bit of code that uses it amidst his pointer tutorial, so off I go to see if I can integrate them.

    http://www.scottklement.com/rpg/pointers.html#topic7

  17. #16
    RPG Developer
    Join Date
    Apr 2010
    Location
    Minnesota
    Posts
    65
    Rep Power
    395

    Re: QUSLOBJ example in free-format?

    So filled with questions about all this stuff.

    Alright, so if I call either the code Jamief provided, or what Michael provided using *FILE, I end up with all of the *FILE objects.

    How would I see if they're a source file?

  18. #17
    Driver of cars, eater of food jamief's Avatar
    Join Date
    Jan 2004
    Location
    Belvidere, IL - United States of America
    Age
    49
    Posts
    9,416
    Rep Power
    12605

    Re: QUSLOBJ example in free-format?

    chain to file QADBXREF and look at field DBXTYP = 'S' is source
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

  19. #18
    Driver of cars, eater of food jamief's Avatar
    Join Date
    Jan 2004
    Location
    Belvidere, IL - United States of America
    Age
    49
    Posts
    9,416
    Rep Power
    12605

    Re: QUSLOBJ example in free-format?

    @ Tom - no i mentioned you cause I actually do love you!

    @ Michael - dude you really can write some sweet looking code.... Nice

    @ everyone else - party at my house -- get your own ride....

    jamie
    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

  20. #19
    RPG Developer
    Join Date
    Apr 2010
    Location
    Minnesota
    Posts
    65
    Rep Power
    395

    Re: QUSLOBJ example in free-format?

    D'oh. This is what I get for getting wrapped up in APIs - I forget the basics.

    Thanks for that reminder, jamie.

  21. #20
    Driver of cars, eater of food jamief's Avatar
    Join Date
    Jan 2004
    Location
    Belvidere, IL - United States of America
    Age
    49
    Posts
    9,416
    Rep Power
    12605

    Re: QUSLOBJ example in free-format?

    All my answers were extracted from the "Big Dummy's Guide to the As400"
    and I take no responsibility for any of them.

    www.code400.com

  22. # 666
    Circuit advertisement
    Join Date
    Aug 1965
    Location
    Yakutsk, Russia
    Age
    21
    Posts
    1,000,000
     

Facebook Comments


Similar Threads

  1. Pop Up Calendar In Free Format
    By MichaelCatalani in forum Tips for the Iseries/AS400
    Replies: 2
    Last Post: April 17th, 2009, 10:21 AM
  2. Free Format RPG
    By dcutaia in forum DDS
    Replies: 1
    Last Post: December 18th, 2006, 12:52 PM
  3. Free-Format SQL in V5R4
    By jamief in forum SQL
    Replies: 2
    Last Post: May 10th, 2006, 10:39 AM
  4. How can I convert this to free format
    By jamief in forum RPG/RPGLE
    Replies: 0
    Last Post: November 2nd, 2005, 08:37 AM
  5. Using API QUSLOBJ to list objects
    By jamief in forum Tips for the Iseries/AS400
    Replies: 0
    Last Post: May 4th, 2005, 01:14 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •