Problem solve Get help with specific problems with your technologies, process and projects.

Execute a sequence of PDM options from the WRKMBRPDM panel

Here you'll learn a simple method to execute multiple PDM options -- in sequence -- from the Work with members PDM panel.

Here you'll learn a simple method to execute multiple PDM options -- in sequence -- from the Work with members PDM panel. The method is based on the ability of the FNDSTRPDM command to execute a pdm option if the search string is found in a member. So, searching a space will always cause the searched string to be found and the specified option is executed. Using the simple CL program (provided below) you can submit up to three options. Compile the CL program, and add a new option in PDM with the following sintax:

CALL YOURLIB/MO (&L &F &N 'WS' 'DM' 'SF').
In the above example we get the execution of option WS + DM + SF.


   
/* Pgm: MO - Execute Multiple PDM Options  */                        
/* Author: Roy Restuccia */                                          
/* Instruction: compile this program in a lib in your libl */        
/* Go to Wrkmbrpdm panel, press F16 and add a new option, example: */
/* Option: XY   Command: CALL YOURLIB/MO (&L &F &N 'WS' 'DM' 'SF') */
/*   this will execute in sequence options WS + DM + SF */           
             Pgm (&Lib &File &Mbr &Op1 &Op2 &Op3)                    
             Dcl &Lib  *char 10                                      
             Dcl &File *char 10                                      
             Dcl &Mbr  *char 10                                      
             Dcl &Lib  *char 10                                      
             Dcl &Op1  *char 2                                       
             Dcl &Op2  *char 2                                       
             Dcl &Op3  *char 2                                       
                                                                     
             If (&Op1 ^= '  ') (+                                    
                FndStrPdm String(' ')  +                             
                   File(&Lib/&File)    +                             
                   Mbr(&Mbr)           +                             
                   Option(&Op1))                                     
                                                                     
             If (&Op2 ^= '  ') (+                                    
                FndStrPdm String(' ')  +                             
                   File(&Lib/&File)    +                             
                   Mbr(&Mbr)           +                             
                   Option(&Op2))                                     
                                                                     
             If (&Op3 ^= '  ') (+                                    
                FndStrPdm String(' ')  +                             
                   File(&Lib/&File)    +                             
                   Mbr(&Mbr)           +                             
                   Option(&Op3))                                     
                                                                     
             EndPgm                                                  
  
  

Dig Deeper on iSeries CL programming

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.

-ADS BY GOOGLE

SearchDataCenter

Close