× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.



Hello Booth,

You wrote:
>There is a program on an iSeries called QSNDDTAQ with 4 parms.

>One can call this program and it will send data in the 4th parm to the data
>queue and library named in parm 1 and 2.  (parm 3 is the length of the 
>piece of data.)

>I always believed that calling a program over and over was slow and
>expensive.  The last few years it seems not to be the case.

This belief is, and has always been, a furphy. Slow is relative and dynamic 
program call times have frequently been compared to subroutine call times 
which resulted in the monolithic programs most AS/400 programmers create due 
to dynamic calls being a lot slower than subroutine calls.

A dynamic program call uses more machine instructions than a subroutine call 
or a procedure call and thus repetitive dynamic calls will be slower than 
the alternatives. However, the real question is how slow?  That is, how much 
of the job's runtime is consumed by the dynamic calls (specifically the call 
instructions, not the function done by the called code)?  In most cases this 
is an insignificant amount and is of little concern unless you have a very 
tight run window in which to operate.

Static binding (modules and service programs) is an attempt to reduce the 
call overhead (as well as support other advanced functions) however as a 
by-product of improving the call interface, dynamic program calls have been 
improved too and they have become significantly faster than they were when 
the "dynamic calls are slow" furphy was started.

>Should this be one of those new Procedures?  Should we be able to say:
>  C   CallP (E)  QSNDDTAQ(DtqName:Qgpl:30:DataOut)

You can do that if you create a prototype for QSNDDTAQ however that does not 
make it a procedure. It is simply a prototyped call for a program.  CALLP 
does not mean Call Procedure, it means Call with Prototype and can call 
procedures or programs.  I have added my prototype for QSNDDTAQ at the end 
of this note.

>This is not a dumb question.  It may be asked in a dumb way, but that's 
>only because I have no idea what I am talking about.

Leading with your chin again ....

 *************************************************************************
 * Prototype for calling Data Queue API QSNDDTAQ                         *
 *************************************************************************
 /if defined(LONG_PROC_NAMES)                                             
D QmhqSndDtaqEntry...                                                     
D                 PR                                                      
 /else                                                                    
D QSNDDTAQ        PR                                                      
 /endif                                                                   
D                                     EXTPGM('QSNDDTAQ')                  
 *                                                                        
 * Required parameter group:                                              
 *                             Data queue name                            
D   dtaqName                    10    CONST                               
 *                             Data queue library name                    
D   dtaqLib                     10    CONST                               
 *                             Length of data queue entry                 
D   dtaqEntryLen                 5P 0 CONST                               
 *                             Data queue entry                           
D   dtaqEntry                32767    CONST OPTIONS(*VARSIZE)             
 *                                                                        
 * Optional parameter group 1:                                            
 *                             Length of key                              
D   keyLen                       3P 0 CONST OPTIONS(*NOPASS)              
 *                             Key value                             
D   keyData                    256    CONST OPTIONS(*VARSIZE:*NOPASS)
 *                                                                   
 * Optional parameter group 2:                                       
 *                             Asynchronous request                  
D   asyncRqs                    10    CONST OPTIONS(*NOPASS)         

 *************************************************************************
 * Constants                                                             *
 *************************************************************************
D $DQ_DDM_ASYNC_YES...                                                    
D                 C                   CONST('*YES      ')                 
D $DQ_DDM_ASYNC_NO...                                                     
D                 C                   CONST('*NO       ')                 


Regards,
Simon Coulter.
--------------------------------------------------------------------
   FlyByNight Software         AS/400 Technical Specialists       
                                                                  
   http://www.flybynight.com.au/                                  
   Phone: +61 3 9419 0175   Mobile: +61 0411 091 400        /"\   
   Fax:   +61 3 9419 0175   mailto: shc@xxxxxxxxxxxxxxxxx   \ /   
                                                             X    
                 ASCII Ribbon campaign against HTML E-Mail  / \   
--------------------------------------------------------------------


As an Amazon Associate we earn from qualifying purchases.

This thread ...


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.