Submitted by Kim Egekjaer on Fri, 10/29/2010 - 00:00
Forums

I have been visiting quite a few of our business partners and often I am surprised of the special functions in InterForm400 that a partner/user is using to a large extent. An example of such a function is the Spooled File Inspector (SFI): A business partner in germany is using this feature extensively (and I do not know of many others that does). It is a secret for many even though it is documented in the manual.

The idea with this feature of the classic InterForm400 package is, that you can search for a given text in a range of lines and positions and get the answer back: Was the special text found or not. The form type of the spooled file will be changed to fit the answer.

Most would probably use a split definition in InterForm400 to solve the same challenge, but I would expect RUNSFI to be more efficient as no new spooled file is generated.

You set up the spooled file inspector via the command:

APF3812/WRKSFID

(Work with Spoooled File Inspector Definitions):

Work with SFI definitions                                    SFI100D 

 Position to . . . . . .                SFI definition                         

 Type options, press Enter.                                                    

   2=Change   3=Copy   4=Delete   5=Display   7=Rename                         

 Opt   Definition  Description                                                 

       DEMO        Search for COPY




                                                                           End 

 F3=Exit   F5=Refresh   F6=Create   F12=Cancel

 

Here you add a definition which MUST have the same definition name as the form type of the spooled file(s) that you have built this for. My DEMO definition looks like this:

Change SFI definition                                        SFI110D 

 SFI definition . . . . . :   DEMO                                             

 Description  . . . . . . .   Search for COPY                                  

 Search text  . . . . . . .   COPY                                             
   Page . . . . . . . . . .   *FIRST       *ANY, *FIRST, *LAST                 
   Print line . . . . . . .     1 -   6                                        
   Position . . . . . . . .     1 -  10                                        

 New form type                                                                 
   If text found  . . . . .   COPY         Form type, *SAME                    
   - If not found . . . . .   NO_COPY      Form type, *SAME 

 

(Remember that the search text is case sensitive..)

The purpose in this case is to handle the spooled file differently depending if the spooled file has been reprinted from an archive or not. If it has been reprinted, then the text COPY is found in the top left of the spooled file. A reprinted spooled file should not be archived and perhaps be printed on a different printer..

When you actually want to put this into production you insert a call to program RUNSFI in library, APF3812 in AFC via an option 8 like below (in sequence line 1):

Seqnbr Funct   Form type  Save Jobname    Filename   Device file  Program   

 0001    8     DEMO                                                         

               Call, program: RUNSFI library: APF3812 User profile AFCOPER  

 0002    *     Handle reprint:                                              


 0003    1     COPY                                                         

               Merge, Overlay: IF400DEMO Fileset: SAMPLE                    

 0004    *     Handle first time print:            


 0005    1     NO_COPY                                                        

               Merge, Overlay: IF400DEMO Fileset: SAMPLE                      

 0006    8     NO_COPY                                                        

               Call, program: ARCHIVE library: MYLIB User profile AFCOPER

 

The RUNSFI program will change the form type of the original spooled file from DEMO to either COPY or NO_COPY and then hold and release the spooled file to add an entry in the data queue for this queue, which will make Auto Forms Control react to the new form type.

If you want to check out this feature of InterForm400, I suggest you install a PTF for InterForm400. Here are the PTFs:

PTF number

3922

Description

SFI: Wrong form type as result of running a SFID

Version

2010.M01 -2010.M03

Library

   

Symptom . . . . . . . . :

Wrong form type as result of running a Spooled File Inspector definition.

 

Cause . . . . . . . . . :

DBCS byte not ignored. Wrong positions searched for condition.

 

Special instructions . . :

None.

 

 

 

PTF number

3849

Description

SFI: Wrong form type as result of running a SFID

Version

2009.M01 -2009.M10

Library

   

Symptom . . . . . . . . :

Wrong form type as result of running a Spooled File Inspector definition.

 

Cause . . . . . . . . . :

DBCS byte not ignored. Wrong positions searched for condition.

 

Special instructions . . :

None.

 
 
 

The PTFs are attached.

Please notice, that the SFI definitions cannot be exported/imported, so you will need manually to rewrite them, if you want to copy a setup to another machine.