User Tools

Site Tools


pub:idocsapi

This is an old revision of the document!


[ Up to Main Menu ]

iDocs Programming API's

iDocs has various methods to automatically print forms that are deposited in output queues. There are two different types of form overlay engines which are the processors that automatically search defined output queues for spooled files to merge with form applications or form sets. iDocs also provides api's that can be embedded into a job stream that executes the merge for defined print jobs. The simplest is TFPRT which is intended to be embedded in the job stream following the program that produced the spool file to be processed. With the more complex TRPRTAPI api, you can provide the necessary parameters to process any spool file on the system.

An iDocs merge can be invoked from the command line or from another program using either of two commands:

TFPRTAPI

or

TFPRT

TFPRTAPI

This is the main programming interface to an iDocs merge.

Prerequisites: iDocs library in the library list.

Printer File . . . . . . . . . .                 ( *SCS spool file to merge )
Job Name . . . . . . . . . . . .                 ( spool file job name )
User ID  . . . . . . . . . . . .                 ( spool file user name )
Job Number . . . . . . . . . . .                 ( spool file job number )
Spooled file number  . . . . . .                 ( spool file number )
Form Name  . . . . . . . . . . .                 ( iDocs form definition with which to do the iDocs merge )
Engine Name  . . . . . . . . . .   *FIRST        ( engine name to reference; *FIRST generally works )
Perform Archive/Delete? (Y/N)  .   Y             ( perform archive/delete of original splf )
Portrait? (Y/N)  . . . . . . . .   Y             ( is the output portrait or landscape yes / no )           
Font Sequence# . . . . . . . . .   011           ( generally leave this as is )
Destination Output queue . . . .                 ( output outqueue for merged spool file )
  Library  . . . . . . . . . . .     *LIBL       ( library containing destination outqueue )
Archive Output queue . . . . . .                 ( name of archive outqueue ( override engine specification ) if archiving )
  Library  . . . . . . . . . . .     *LIBL       ( library containing archive outqueue )
Number of copies . . . . . . . .   1             ( number of copies; overrides form )
Output Spooled File Name . . . .   *FILE         ( output spool file name )

TFPRT

This is a simpler version of TFPRTAPI that works on the last spool file created in the current job.

Printer File . . . . . . . . . .                 ( *SCS spool file to merge )
Form Name  . . . . . . . . . . .                 ( iDocs form definition with which to do the iDocs merge )
Engine Name  . . . . . . . . . .   *FIRST        ( engine name to reference; *FIRST generally works )
Perform Archive/Delete? (Y/N)  .   Y             ( perform archive/delete of original splf )
Portrait? (Y/N)  . . . . . . . .   Y             ( is the output portrait or landscape yes / no )           
Font Sequence# . . . . . . . . .   011           ( generally leave this as is )
Destination Output queue . . . .                 ( output outqueue for merged spool file )
  Library  . . . . . . . . . . .     *LIBL       ( library containing destination outqueue )
Archive Output queue . . . . . .                 ( name of archive outqueue ( override engine specification ) if archiving )
  Library  . . . . . . . . . . .     *LIBL       ( library containing archive outqueue )
Number of copies . . . . . . . .   1             ( number of copies; overrides form )
Output Spooled File Name . . . .   *FILE         ( output spool file name )

Following is an example of implementing the TFPRT command. It uses all eight parameters of the command: Printer File, Form name, Engine name, Perform archive delete, Page orientation, Font Sequence, Destination output queue, and Archive output queue. The parameter value for printer file, QSYSPRT contains the file name. Form name contains the defined form application APCHK. The engine parameter contains a value of *NONE since no engine will be use to determine the processing. Instead the processing of the spool file is all defined within the print immediate command itself.

TFPRT FILE(QSYSPRT) FORM(APCHK) ENGINE(*NONE) PERFORM(Y) PORT(Y) FONTSEQ(11) DESTOUTQ(PRT01) ARCHOUTQ(FMG/ARCHIVE)


IFDUPSPLF

Quick utility to duplicate a SCS spool file and change the owner on the new file. Original and new owner must both reside in the System Directory. This command was named DUPSPLF initially but changed to IFDUPSPLF in version 6.83 to ensure that it’s unique on all customer systems.

                   Duplicate iSeries Spooled File (IFDUPSPLF)                  
                                                                               
 Type choices, press Enter.                                                    
                                                                               
 Spooled file . . . . . . . . . . > INV           Name                         
 Spooled file number  . . . . . . > 2             1-999999, *ONLY, *LAST       
 Job name . . . . . . . . . . . . > ANGUYENA      Name, *, *ALL                
   User Name  . . . . . . . . . . >   ANGUYEN     Name                         
   Job Number . . . . . . . . . . >   106730      000000-999999                
 Output Queue . . . . . . . . . .   QPRINT        Name                         
   Library  . . . . . . . . . . .     *LIBL       Name, *LIBL                  
 New SPLF user data . . . . . . .   *SAME         Character value, *SAME       
 New SPLF form type . . . . . . .   *SAME         Character value, *SAME       
 New SPLF name  . . . . . . . . .   *SAME         Name, *SAME                  
 New SPLF Owner . . . . . . . . . > OFERRER       Name, *SAME                  
 Hold new SPLF  . . . . . . . . .   *NO           *YES, *NO                    
 Page range:                                                                   
   Starting page  . . . . . . . .   1             Number                       
   Ending page  . . . . . . . . .   *END          Number, *END                 
                                                                               
                                                                         Bottom
 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display   
 F24=More keys                                                                 

Parameters:

Spooled file: input spool file name
Spooled file number: input spool file number
Job name/User Name/ Job Number: job ID of input spool

Output Queue/Library: name and library of output queue
New SPLF user data: enter user data of output spool file (*SAME to retain the same attribute of input spool file)
New SPLF form type: enter form type of output spool file (*SAME to retain the same attribute of input spool file)
New SPLF name: enter spool file name of output spool file (*SAME to retain the same attribute of input spool file
Hold new SPLF: Hold the output spool file name
Page range: enter the range of pages of input spool file name

Example:

IFDUPSPLF FILE(INV) SPLNBR(2) JOB(106730/ANGUYEN/ANGUYENA) OWNER(OFERRER)


ESNDFILE

A new command ESNDFILE is introduced in iDocs 6.97 to send a file or folder from the IBM i to a SFTP server using Password authentication.

                     Send IFS File to SFTP server (ESNDFILE)                    
                                                                                
 Type choices, press Enter.                                                     
                                                                                
 SFTP server  . . . . . . . . . .   'tdgtest.ocr-inc.com'                       
                                                                                
 Authentication User ID . . . . .   testID                                      
                                                                                
 Authentication Password  . . . .                                               
                                                                                
 Port . . . . . . . . . . . . . .   22            Number                        
 IFS Local Path . . . . . . . . .   '/home/anguyen/awtest.txt'                  
                                                                                
                                                                                
                                                                                
 Remote folder  . . . . . . . . .   '/QBND'                                     
                                                                                
                                                                                
                                                                                
 Overwrite  . . . . . . . . . . .   N             Y, N                          
                                                                         Bottom 
 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 F24=More keys                                                                  

SFTP supports 2 methods of authentication:

  • SSH Key authentication
  • Password authentication

Our iBridge utility sends file using SSH Key and sends as a PDF file only

ESNDFILE sends file using Password authentication: the server will authenticate the client by the submitting username and password from client.

Parameters: SFTP server
Authentication User ID
Job name/User Name/ Job Number: job ID of input spool
Authentication Password
Port number
IFS local path
Remote folder
Overwrite (Y/N)

Result on SFTP Server:


JOINSPLF

Quick utility to Stitches together multiple spool files into one spool file (Combine multiple spool files). Here is how it works:

  1. Give the new spool file a name in the 'Output Spool Name' parameter.
  2. Assign the out queue to insert the newly combined spool file with the 'Output Queue' and 'Library' parameters.
  3. Then add the spool file information for the spool files that will be combined.
  4. Once evoked, the command will stitch together the spool files and write the new spool file to the destination out queue.

                      Join multiple spool files (JOINSPLF)                      
                                                                                
 Type choices, press Enter.                                                     
                                                                                
 Output Spool Name  . . . . . . . > JOINTEST01    Character value               
 Output Queue . . . . . . . . . . > OUT           Name                          
   Library  . . . . . . . . . . . >   IDOCS6      Name, *CURLIB                 
 Selected spool files:                                                          
   Spool file name  . . . . . . . > R43500        Name                          
   Spool file number  . . . . . . > 000008        1-999999, *ONLY, *LAST, *ANY  
   Job name . . . . . . . . . . . > OFDEMOADD     Name, *                       
     Job user . . . . . . . . . . >   OFERRER     Name                          
     Job number . . . . . . . . . >   184316      000000-999999                 
                + for more values                                               
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                         Bottom 
 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 F24=More keys                                                                  
                                                                                                                                                                                                       

                    Specify More Values for Parameter SPLF                      
                                                                                
 Type choices, press Enter.                                                     
                                                                                
 Selected spool files:                                                          
   Spool file name  . . . . . . . > R43500        Name                          
   Spool file number  . . . . . . > 000008        1-999999, *ONLY, *LAST, *ANY  
   Job name . . . . . . . . . . . > OFDEMOADD     Name, *                       
     Job user . . . . . . . . . . >   OFERRER     Name                          
     Job number . . . . . . . . . >   184316      000000-999999                 
                                                                                
   Spool file name  . . . . . . .   R43500        Name                          
   Spool file number  . . . . . .   000033        1-999999, *ONLY, *LAST, *ANY  
   Job name . . . . . . . . . . .   OFDEMOADD     Name, *                       
     Job user . . . . . . . . . .     OFERRER     Name                          
     Job number . . . . . . . . .     184316      000000-999999                 
                                                                                
                                                                                
                                                                                
                                                                                
                                                                        More... 
 F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 F24=More keys                                                                                                                          


[ Up to Main Menu ]

pub/idocsapi.1627060044.txt.gz · Last modified: 2022/06/25 17:02 (external edit)