www.krengeltech.com

RXS_cmpTransFile

From Wiki

User Guide

Contents

Description

In the process of doing web services you will most likely run across the need to create many files in the IFS, and each of those files must be uniquely named if you don't want one to over write the next. Instead of doing several concatenations of strings and dates and numbers to come up with a unique file name, use RXS_cmpTransFile.

Basically, a programmer tells the function the file extension (i.e. .xml), the separator for each piece of information in the file name (up to 4) that will be passed to it (i.e. _).

Prototype

     D RXS_cmpTransFile...
     D                 pr                  like(RXS_FilePath)
     D  pSep                          1a   value
     D  pExt                         10a   value varying
     D  pVal1                              value like(RXS_NameVal)
     D                                     options(*nopass)
     D  pVal2                              value like(RXS_NameVal)
     D                                     options(*nopass)
     D  pVal3                              value like(RXS_NameVal)
     D                                     options(*nopass)
     D  pVal4                              value like(RXS_NameVal)
     D                                     options(*nopass)
     D  pVal5                              value like(RXS_NameVal)
     D                                     options(*nopass)

Parameters

pSep
Specify the value to use for the separator between each pVal1-5 parameter. (i.e. _)
pExt
Specify the extension of the file including the period (i.e. .xml)
pVal1
Use this (and pVal2-pVal5) to specify the data for the subprocedure to use for qualifying the IFS file. RXS_cmpTransFile recognizes two special keywords – RXS_UnqNbr which retrieves a unique number from data area RXS/RSXUNQ, and RXS_Timestamp which returns a timestamp in character format. Using these keywords reduces the amount of %CHAR (Convert to Character Data) RPG BIF and %TIMESTAMP (Convert to Timestamp) RPG BIF invocations needed for passing parameters.
pVal2
Same as pVal1.
pVal3
Same as pVal1.
pVal4
Same as pVal1.
pVal5
Same as pVal1.

Return value

None.

Notes / Examples

The following example produces a string with the contents /www/myrxs/trans/99999_req.xml where 99999 is the next sequential number in data queue RXS/RXSUNQ, and '/www/myrxs/trans/' is the value stored in column TRANSDIR in table RXSCFG:


     gReqFile = RXS_cmpTransFile('_': '.xml': RXS_nextUnqChar(): 'req');