Skip to main content  
        iSeries home   |   Easy400     |   CGIDEV2  
Public source
 
About it
IBMi and Unicode
IBMi and Base64
CRLF commands
 
Download
 
 
CRLF commands  

In order to be inserted into an e-mail message, the data of a BASE64 stream file should be organized in rows width a maximum width of 75 characters.

To support this requirement, CVT101 provides the following commands:
  • ADDCRLFS - To create - from the Base64 stream file - a stream file where the Base64 data are folded into a given width rows.
  • RMVCRLFS - To remove - from a Base64 file folded into rows - the rows folding.
Besides, CVT101 features a command to test the result of folding a Base64 file into rows.
  • Command ADDCRLFS - Add CRLFs to a stream file
                           Add CRLFs to a stream file (ADDCRLFS)                      
    
     Type choices, press Enter.
    
     From stream file . . . . . . . .  FRMSTMF                                           
                       
     To stream file . . . . . . . . .  TOSTMF                                            
                       
     Maximum row width (characters) .  ROWWIDTH   75         1-99999
     Display TOSTMF stream file . . .  DSPTOSTMF  *NO        *YES, *NO
    
    
    Use this command to convert a given ASCII stream file to a fixed number of columns by adding CarriageReturnLineFeed (CRLF) characters.
    (This is usually done by mailers when an ASCII file is added as attachment to an e-mail message).
    • From stream file (FRMSTMF) - This is the original stream file. It is copied to the stream file specified in parameter (TOSTMF) and added the required CRLF characters. It must be an ASCII stream file.
    • To stream file (TOSTMF) - This is the resulting stream file containing the the same data as the original FRMSTMF stream file plus the required CRLF characters.
      • If this file already exists, it is deleted and re-created.
      • This file is assigned the same CCSID as the original FRMSTMF stream file.
    • Maximum row width (characters) - Maximum number of characters for all the generated stream file rows.
    • Display the TOSTMF stream file (DSPTOSTMF) - Whether the resulting stream file TOSTMF is displayed after being generated.

  • Command RMVCRLFS - Remove CRLFs from a stream file
                          Rmv CRLFs from a stream file (RMVCRLFS)                
    
     Type choices, press Enter.
    
     From stream file . . . . . . . .  FRMSTMF                                           
                       
     To stream file . . . . . . . . .  TOSTMF                                            
                       
     Display TOSTMF stream file . . .  DSPTOSTMF  *NO        *YES, *NO
    
    Use this command to remove ALL the CarriageReturnLineFeed (CRLF) characters from a given ASCII stream file.
    • From stream file (FRMSTMF) - This is the ASCII stream file to be removed all its CRLF characters. This file is copied - without its CRLF characters - to the stream file specified in parameter TOSTMF.
    • To stream file (TOSTMF) - This is the resulting stream file containing the the same data as the original FRMSTMF stream file without the CRLF characters.
      • If this file already exists, it is deleted and re-created.
      • This file is assigned the same CCSID as the original FRMSTMF stream file.
    • Display the TOSTMF stream file (DSPTOSTMF) - Whether the resulting stream file TOSTMF is displayed after being generated.

  • Command TESTCRLFS - Test CRLF commands
                              Test CRLF commands (TESTCRLFS)                
    
     Type choices, press Enter.
    
     Stream file input to test  . . .  INPSTMF                                           
                       
     Stream file output from test . .  OUTSTMF                                           
                       
    
    
    Use this command to test if commands ADDCRLFS and RMVCRLFs work properly with a stream file of yours.
    (Default parameter values are provided. You may use them to perform a test using a picture provided in the utility).
    The following is done:
    1. The input stream file - specified in parameter INPSTMF - is converted to a BASE64 stream file via command BASE64ENC
    2. Command ADDCRLFS is used to create - from this BASE64 stream file - a fixed column stream file
    3. Command RMVCRLFS is used to create - from this fixed column stream file - a BASE64 stream file (which will be the same as the BASE64 stream file above).
    4. Command BASE64DEC is used to decode this last BASE64 stream file to the stream file specified in parameter OUTSTMF.
    You should then compare the original INPSTMF stream file and the resulting OUTSTMF one. They should be identical.
    • Stream file input to test (INPSTMF) Name of your stream file input to this test. All file name extensions are supported (text, html, image, pdf, video, excel, and so on).
    • Stream file output from test (OUTSTMF) - Name to be assigned to the stream file generated from this test.
      You should then compare it to the INPSTMF stream file. They should be exactly the same.
      • If this file already exists, it is deleted and re-created.



    Contact