Export a spool to a HTM file

page d'accueil
Boite à outils

Cette page a été mise à jour le 14 novembre 2020. 
Contact

Welcome page
Tools box

Target:

       convert a text spool to a HTM file. this tool uses the XML Toolkit for IBM i (5733-XT2) 

Characteristics :

        RPG , CL and JAVA under QSH. 

What will not do :

        Do not convert AFPDS, GDDM or IPDS spools. Because most spools are text only.
        Do not take care of PRTF attributes such as underline : heart of this tool is CPYFRMSPLF.

Sample :

        spool.txt      the original text of the spool after CPYFROMSPLF

        splf2htm.xml      spool data converted to unicode utf-8 using xml formatting

        splf2htm.xsl      the xslt style sheet used to transform xml to htm

        SPlf2htm.htm      the htm file to push to users. it's an off-line htm page (works without internet)

Versionning 

last version : The SaveFiles

SPLF2PDF uses also

It is mandatory to use the same CCSID for the job that runs SPLF2HTM and for the job that created the spool, otherwise the convertion to UTF-8 unicode will return erroneous characters

the easiest way to use SPLF2HTM is from the WRKSPLF screen : copy & paste the file name (5 attributes) to the command, then F4

                          Work with All Spooled Files                           
                                                                                
 
Type options, press Enter.                                                     
   
1=Send   2=Change   3=Hold   4=Delete   5=Display   6=Release   7=Messages   
   
8=Attributes        9=Work with printing status                              
                                                                                
                                                                                
                  
File                                                          
 
Opt  File        Nbr     Job         User        Number                        
      QPQUPRFIL       92  SJP56A      LAMONTRE    271212                        
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                   
      Bottom 
 Parameters for options 1, 2, 3 or command                                      
 ===> splf2htm QPQUPRFIL       92  SJP56A      LAMONTRE    271212               
 
F3=Exit   F10=View 2   F11=View 4   F12=Cancel   F22=Printers   F24=More keys  
                                                                                
                                                                                

press F4, change the title, change the XSLT file if you have your own (the logo is inside the xslt transformer)

                    Transform a spool to HTM file (SPLF2HTM)                     
                                                                                
 
Type choices, press Enter.                                                     
                                                                                
 Spooled File Name  . . . . . . . > 
QPQUPRFIL     Name                          
 Spooled File Number  . . . . . . > 92            1-9999, *ONLY, *LAST          
 Job Name . . . . . . . . . . . . > SJP56A        Name, *                       
 User Name  . . . . . . . . . . . > LAMONTRE      Name                          
 Job Number . . . . . . . . . . . > 271212        000000-999999                 
 Start Page Number  . . . . . . .   1             1-9999                        
 End Page Number  . . . . . . . .   *LAST         1-9999, *LAST                 
 htm file title . . . . . . . . .   'jpltools.splf2htm'                         
                                                                                
        
                                                                        
 convert to . . . . . . . . . . .   *HTM          *HTM, *XML                    
 Blank Lines  . . . . . . . . . .   *REMOVE       *PRESERVE, *REMOVE            
 XSLT transform style sheet . . .   '/home/jpltools/splf2htm.xsl'               
      
                                                                          
                                                                                
                                                                                
                                                                  
      More... 
 
F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 F24=More keys                                                                 
 
                                                                                

CONVERT(*XML) produces only the .xml file
CONVERT(*HTM) produces both the .xml file and the .htm file

setup the output ifs file name

                    Transform a spool to HTM file (SPLF2HTM)                     
                                                                                
 
Type choices, press Enter.                                                     
                                                                                
 IFS root . . . . . . . . . . . .   'home'                                      
                                                                                
        
                                                                        
 IFS folder . . . . . . . . . . .   'jpltools'                                  
                                                                                
        
                                                                        
 IFS file without extention . . .   'splf2htm'                                  
                                                                                
        
                                                                        
 *PUBLIC data authority . . . . .   *RWX          *SAME, *NONE, *RWX, *RX...    
 *PUBLIC Object authority . . . .   *ALL          *NONE, *ALL, *OBJEXIST...     
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                                  
       Bottom 
 
F3=Exit   F4=Prompt   F5=Refresh   F12=Cancel   F13=How to use this display    
 F24=More keys                                                                 
 
                                                                                

After command run, You can retrieve the HTM in the IFS :

                             Work with Object Links                              
 
                                                                                
 Directory  . . . . :   /home/jpltools                                           
                                                                                
 Type options, press Enter.                                                      
  
 2=Edit   3=Copy   4=Remove   5=Display   7=Rename   8=Display attributes      
  
 11=Change current directory ...                                               
                                                                                
 Opt   Object link            Type     Attribute    Text                         
       splf2htm.htm           STMF                                               
       splf2htm.xml           STMF                                               
       splf2htm.xsl           STMF                                               
       XmlDebugMSI.msi        STMF                                               
                                                                                
                                                                                
                                                                                
                                                                                
                                                                                
                                                              
           Bottom 
 Parameters or command                                                           
 ===>                                                                           
 F3=Exit   F4=Prompt   F5=Refresh   F9=Retrieve   F12=Cancel   F17=Position to   
 F22=Display entire field           F23=More options                             
                                                                                

Copy it to a PC folder, for example with Navigator, and open it. That's all.

Resources

the splf2htm.xsl file is in the savf IFSOBJ in the JPLTOOLS library.
This savf contains also XmlDebugMsi.Msi. it is a tool to help verifying the XSL file (updating a XSL is not so easy). This tool is a windows app which use is to

the tool save its properties in registry at HKEY_CURRENT_USER\SOFTWARE\VB and VBA Program Settings\JPLTools\xmldebug.exe