ibmi-brunch-learn

Announcement

Collapse
No announcement yet.

Call(e)

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Call(e)

    hi

    any guess why and where call(e) is used?

    regards,
    sushrut

  • #2
    Re: Call(e)

    No quess if the call ends in error then you can do something.
    It stops the program from going into one of those error screens

    I use it like this

    PHP Code:
    ~
     *                                                                    
    c                   call(e)   'QUSRMBRD'                              
    c                   parm                    MbrD0100                  
    c                   parm                    nBufLen                   
    c                   parm                    Format                    
    c                   parm                    FileLib                   
    c                   parm                    Membername                
    c                   parm                    bOvr                      
     
    *                                                                    
     * if %
    error = *on then the member doesnt exist...so create.          
     * If 
    member already exists then make sure the current check          
     
    doesnt exist here.                                                 
     *                                                                    
    c                   if        %error                                  
     
    *                                                                    
     * 
    call with membername first to reset library field                  
     
    *                                                                    
    c                   eval      cmdstring 'addpfm file(APZJPM) MBR(' +
    c                                          %trim(membername) + ')'    
    c                   eval      cmdlength = %len(%trim(cmdstring))      
    c                   call(e)   'QCMDEXC'                                         
    c                   parm                    cmdstring                           
    c                   parm                    cmdlength                           
     
    *                                                                              
     * 
    ADDLFM FILE(APZJPMAMBR(TESTMEMBERDTAMBRS((library/APZJPMA (TESTMEMBER))) 
     *                                                                              
    c                   eval      cmdstring 'addlfm file(APZJPMA) MBR(' +         
    c                                          %trim(membername) + ')'  +           
    c                                         ' DTAMBRS((WORKLIB'      +            
    c                                         '/APZJPM (' + %trim(membername) +     
    c                                         ')))'                                 
    c                   eval      cmdlength = %len(%trim(cmdstring))                
    c                   call(e)   'QCMDEXC'                                         
    c                   parm                    cmdstring                           
    c                   parm                    cmdlength                           
    c                   
    endif 
    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

    Comment

    Working...
    X