RXS_ProcessStmf()

This subprocedure can be used to create, copy, move, or delete a specified IFS stream file.

Subprocedure Prototype

D RXS_ProcessStmf...
D                 PR                  Extproc('RXS_ProcessStmf') Opdesc
 
D   DS                                Like(RXS_Var64K_t)
D                                     Options(*Varsize)

Contains the IFS file path as well as configuration options to control how the data is written. May be one of a few possible data structures, outlined below.

Valid Values:

  • RXS_CreateStmfDS_t
  • RXS_CopyStmfDS_t
  • RXS_MoveStmfDS_t
  • RXS_DeleteStmfDS_t

Example Code

*--------------------------------------------------------------
* This example code creates a stream file named new_file.xml in 
* the IFS directory /tmp with CCSID 819.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)

 /copy QRPGLECPY,RXSCB

D CreateStmfDS    DS                  LikeDS(RXS_CreateStmfDS_t)
D                                     Inz(*LikeDS)
 /free

   reset CreateStmfDS;
   CreateStmfDS.Stmf = '/tmp/new_file.xml';
   CreateStmfDS.Ccsid = RXS_CCISD_ISO88591;
   RXS_ProcessStmf( CreateStmfDS );

   *INLR = *ON;
 /end-free
*--------------------------------------------------------------
* This example code copies an IFS file from /tmp/new_file.xml to 
* /tmp/copied_new_file.xml.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)

 /copy QRPGLECPY,RXSCB

D CopyStmfDS      DS                  LikeDS(RXS_CopyStmfDS_t)
D                                     Inz(*LikeDS)
 /free

   reset CopyStmfDS;
   CopyStmfDS.FromStmf = '/tmp/new_file.xml';
   CopyStmfDS.ToStmf = '/tmp/copied_new_file.xml';
   RXS_ProcessStmf( CopyStmfDS );

   *INLR = *ON;
 /end-free
*--------------------------------------------------------------
* This example code copies an IFS file from /tmp/new_file.xml 
* to /tmp/moved_new_file.xml.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)

 /copy QRPGLECPY,RXSCB

D MoveStmfDS      DS                  LikeDS(RXS_MoveStmfDS_t)
D                                     Inz(*LikeDS)
 /free

   reset MoveStmfDS;
   MoveStmfDS.FromStmf = '/tmp/new_file.xml';
   MoveStmfDS.ToStmf = '/tmp/moved_new_file.xml';
   RXS_ProcessStmf( MoveStmfDS );

   *INLR = *ON;
 /end-free
*--------------------------------------------------------------
* This example code deletes an IFS file named /tmp/moved_new_file.xml.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)

 /copy QRPGLECPY,RXSCB

D DeleteStmfDS    DS                  LikeDS(RXS_DeleteStmfDS_t)
D                                     Inz(*LikeDS)
 /free

   reset DeleteStmfDS;
   DeleteStmfDS.Stmf = '/tmp/moved_new_file.xml';
   RXS_ProcessStmf( DeleteStmfDS );

   *INLR = *ON;
 /end-free

Data Structures

D RXS_CopyStmfDS_t...
D                 DS                  Qualified Template Inz
 
D   ReturnedErrorInfo...
D                                     LikeDS(RXS_ReturnedErrorInfoDS_t) Inz
 
D   OnErrorMessageType...
D                               10I 0
 
D   FromStmf                          LIKE(RXS_Var1Kv_t)

Specify the IFS file path to copy from.

D   ToStmf                            LIKE(RXS_Var1Kv_t)

Specify the IFS file path to copy to.

D   ToCcsid                     10I 0

Specify the CCSID the copied file will use.

D   Reserved                  2048A

Internal use only

D RXS_CreateStmfDS_t...
D                 DS                  Qualified Template Inz
 
D   ReturnedErrorInfo...
D                                     LikeDS(RXS_ReturnedErrorInfoDS_t) Inz
 
D   OnErrorMessageType...
D                               10I 0
 
D   Stmf                              LIKE(RXS_Var1Kv_t)

Specify IFS path where the file will be created.

D   Ccsid                       10I 0

Specify the CCSID to create the file with.

D   Reserved                  2048A

Internal use only

D RXS_DeleteStmfDS_t...
D                 DS                  Qualified Template Inz
 
D   ReturnedErrorInfo...
D                                     LikeDS(RXS_ReturnedErrorInfoDS_t) Inz
 
D   OnErrorMessageType...
D                               10I 0
 
D   Stmf                              LIKE(RXS_Var1Kv_t)

Specify the IFS file path to delete.

D   Reserved                  2048A

Internal use only

D RXS_MoveStmfDS_t...
D                 DS                  Qualified Template Inz
 
D   ReturnedErrorInfo...
D                                     LikeDS(RXS_ReturnedErrorInfoDS_t) Inz
 
D   OnErrorMessageType...
D                               10I 0
 
D   Stmf                              LIKE(RXS_Var1Kv_t)

Specify the IFS file path to move from.

D   ToDir                             LIKE(RXS_Var1Kv_t)

Specify an IFS file directory to move to. Note: You should only specify a directory path, not a full path to a file.

D   Reserved                  2048A

Internal use only