Example 4 (PL/I: 64-bit DLL)

The following is an example of a 64-bit PL/I program calling IDISNAP as a DLL.
*PROCESS AGGREGATE,ATTRIBUTES(FULL),LIST,MAP,NEST,SOURCE,STMT,
         NONUMBER,OFFSET,XREF(FULL),OPTIONS,NOBLKOFF,RENT;    
*PROCESS LIMITS(EXTNAME(8)),LP(64);                           
 IDISPLI2: PROC                 OPTIONS(MAIN) ;               
                                                              
  DECLARE                                                     
    IDISNPD     External Entry Options(asm),                  
    plist_pointer  pointer,                                   
    1 snap_list based(plist_pointer),                         
    3 args_list(3) pointer(32),                               
      3 Work        Char(4),                                  
      3 Work140     Char(140),                                
      3 Work1402    Char(140),                                
    lastargflag bit(1) based;                                 
                                                              
  plist_pointer = alloc31(stg(snap_list));                    
  Work ='0002';                                               
  Work140 = 'User Title Data';                                
  Work1402 = 'Datasets(IDIHIST(MY.HIST))';                    
  args_list(1) = addr(work);                                  
  args_list(2) = addr(work140);                               
  args_list(3) = addr(work1402);                              
  addr( args_list(3 ))->lastargflag = '1'b;                   
                                                              
  Call IDISNPD(args_list);                                    
                                                              
  Call plifree(plist_pointer);                                
 End IDISPLI2;                                                

This example is provided as sample job IDIVPLS2 in data set IDI.SIDISAM1.