× 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.


  • Subject: Re: FTP Question, Urgent
  • From: Jim Langston <jimlangston@xxxxxxxxxxxxxxxx>
  • Date: Mon, 09 Apr 2001 15:05:32 -0700
  • Organization: Pacer International

Here is a working version I have of an *insert trigger that
writes a record to an external data queue.

**************************************************************
***                                                        ***
*** CLPRECTRIG - CLPRec Trigger File - 6/10/00             ***
***                                                        ***
*** This program is designed to be used as an *INSERT      ***
***  trigger to the QS36F/CLPREC file on the Conex system. ***
***                                                        ***
*** This program will read the newly created record in the ***
***  input buffer (see DS Buffer), export the required     ***
***  fields to the Pacer Cartage CCOHD file layout, and    ***
***  then "write" the record to a Data Queue tied to the   ***
***  Pacer Cartage system, COMPTON.                        ***
***                                                        ***
*** It has been preposed that "writing" the record         ***
***  directly to the external data queue may not be a good ***
***  idea, as in the event that the communications between ***
***  the Compton system and ICS400 is down any program     ***
***  creating a record to the CLPREC file will crash, as   ***
***  the this *INSERT trigger crashes.                     ***
***                                                        ***
*** In the event this becomes an issue, the Compton Data   ***
***  queue will be made a local data queue.  Then another  ***
***  program will be written that will "read" the records  ***
***  from the local data queue, and "write" the records to ***
***  the ICS400 data queue.  The only reason I have not    ***
***  done this, however, is in this case the communication ***
***  could be down and nobody would know, unless the job   ***
***  that is transfering the records is watched closely.   ***
***                                                        ***
*** Jim Langston - June 12th, 2000                         ***
***                                                        ***
**************************************************************
**************************************************************
                                                              
******************************************************        
*** Data structures and variables for File Trigger ***        
******************************************************        
                                                              
 *** Input Buffer ***                    
D Buffer          DS         32767       
D  FileName                     10       
D  LibName                      10       
D  MemName                      10       
D  TrigEvent                     1       
D  TrigTime                      1       
D  CommLockLvl                   1       
D                                3       
D  CCSID                         7B 0    
D                                8       
D  OldOffset                     7B 0    
D  OldLength                     7B 0    
D  OldByteMapOff                 7B 0    
D  OldByteMapLen                 7B 0    
D  NewOffset                     7B 0    
D  NewLength                     7B 0    
D  NewByteMapOff                 7B 0    
D  NewByteMapLen                 7B 0    
D  DataSpace              1  32767       
D  Bytes                         1    Overlay(DataSpace) DIM(32767)  
                                                                     
 *** Input Buffer Length ***                                         
D BufferLen       S              7B 0                                
                                                                     
 *** Original Record ***                                             
D@OrRecord        S               *   Inz(*Null)                     
DOrRecord       E DS                  ExtName(CLPREC) Prefix(Or_)    
D                                     Based(@OrRecord)               
                                                                     
 *** New Record ***                                                  
D@NwRecord        S               *   Inz(*Null)                     
DNwRecord       E DS                  ExtName(CLPREC)                
D                                     Based(@NwRecord)               
                                                                     
 ***************************************************                 
 *** Data Structure and Variables for Data Queue ***                 
 ***************************************************                 
                                                                     
D DtaQName        S             10    Inz('COMPTON')                 
D DtaQLib         S             10    Inz('*LIBL')      
D DtaQLen         S              5  0 Inz(548)          
D DtaQData      E DS                  ExtName(CCOHD)    
                                                        
 *****************************                          
 *** System Data Structure ***                          
 *****************************                          
                                                        
D SDS            SDS                                    
                                                        
D  SDPGM                  1     10                      
D  SDSTAT                11     15  0                   
D  SDPRST                16     20  0                   
D  SDSTMT                21     28                      
D  SDRTN                 29     36                      
D  SDPARM                37     39  0                   
D  SDEXTY                40     42                      
D  SDEXNO                43     46                      
D  SDMI                  47     50                      
D  SDMSGW                51     80                      
D  SDOLIB                81     90        
D  SDEXDT                91    170        
D  SD9001               171    174        
D  SDFLNM               201    208        
D  SDFLST               209    243        
D  SDJOB                244    253        
D  SDUSER               254    263        
D  SDJOB#               264    269  0     
D  SD@UDT               270    275  0     
D  SD@RUN               276    281  0     
D  SD#RUN               282    287  0     
D  SD@CMP               288    293        
D  SD#CMP               294    299        
D  SDCLVL               300    303        
D  SDSFIL               304    313        
D  SDSLIB               314    323        
D  SDSMBR               324    333        
                                          
 *************************                
 *** Program Main Line ***                
 *************************                                              
                                                                        
C     *Entry        PList                                               
C                   Parm                    Buffer                      
C                   Parm                    BufferLen                   
                                                                        
 *                  *** Pointer manipulation to get the records "into"  
 *                  *** our buffer variables                            
C                   eval      @OrRecord = %Addr(Bytes(OldOffset+1))     
C                   eval      @NwRecord = %Addr(Bytes(NewOffset+1))     
                                                                        
C                   If        (CRComp = 51) And (CRCtrN <> *Blanks) And 
C                             (Or_CRCtrN <> CRCtrN)                     
 *                  *** Translate the data                              
C                   ExSR      ExportData                                
 *                  *** "Write" the record to our Data Queue            
C                   ExSR      WriteData                                 
C                   EndIf                                               
                                                                        
C                   Eval      *INLR = *On                               
                                                                              
 *****************************************                                    
 *** Export to Pacer CCOHD file format ***                                    
 *****************************************                                    
                                                                              
C     ExportData    BegSR                                                     
                                                                              
 *                  ** Domestic/Import - CONSTANT 'Import' (We lie) **        
C                   Eval      OHDmIm = 'I'                                    
                                                                              
 *** Program edited for length for posting<SNIP>
                                                                    
 *                  ** Next Invoice Number - CONSTANT '1' **        
C                   Eval      OHNxIn = 1                            
                                                                    
C                   EndSR                                           
                                                                    
 *************************************************                  
 *** Write Data out to DDM Data Queue to Pacer ***                  
 *************************************************                  
                                                                    
C     WriteData     BegSR                                           
                                                                    
C***                Movel     DtaQDataDS    DtaQData                
C                   Call      'QSNDDTAQ'                            
C                   Parm                    DtaQName                
C                   Parm                    DtaQLib                 
C                   Parm                    DtaQLen                 
C                   Parm                    DtaQData        
                                                            
C                   EndSR                                   

RReddy@medicalartspress.com wrote:
> 
> Jim.
> 
> I kinda like your idea but i am totally a newbie to the triggers.
> 
> If you can give me a example with code, i would really appreciate that.
> 
> Thanks.
> Raj.
+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

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.