# RXS_ProcessStmf() This subprocedure can be used to create, copy, move, or delete a specified IFS stream file. ## Subprocedure Prototype ### IBM i 6.1+ | Field | Description | |---|---| | ` 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, listed below. | ## Example Code ### IBM i 6.1+ #### Example 1: Create an IFS Stream File ```rpgle *-------------------------------------------------------------- * 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 RXS_ResetDS( CreateStmfDS : RXS_DS_TYPE_CREATESTMF ); CreateStmfDS.Stmf = '/tmp/new_file.xml'; CreateStmfDS.Ccsid = RXS_CCISD_ISO88591; RXS_ProcessStmf( CreateStmfDS ); *INLR = *ON; /end-free ``` #### Example 2: Copy an IFS Stream File ```rpgle *-------------------------------------------------------------- * 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 RXS_ResetDS( CopyStmfDS : RXS_DS_TYPE_COPYSTMF ); CopyStmfDS.FromStmf = '/tmp/new_file.xml'; CopyStmfDS.ToStmf = '/tmp/copied_new_file.xml'; RXS_ProcessStmf( CopyStmfDS ); *INLR = *ON; /end-free ``` #### Example 3: Move an IFS Stream File ```rpgle *-------------------------------------------------------------- * 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 RXS_ResetDS( MoveStmfDS : RXS_DS_TYPE_MOVESTMF ); MoveStmfDS.FromStmf = '/tmp/new_file.xml'; MoveStmfDS.ToStmf = '/tmp/moved_new_file.xml'; RXS_ProcessStmf( MoveStmfDS ); *INLR = *ON; /end-free ``` #### Example 4: Delete an IFS Stream File ```rpgle *-------------------------------------------------------------- * 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 RXS_ResetDS( DeleteStmfDS : RXS_DS_TYPE_DELETESTMF ); DeleteStmfDS.Stmf = '/tmp/moved_new_file.xml'; RXS_ProcessStmf( DeleteStmfDS ); *INLR = *ON; /end-free ``` ## Data Structures ### RXS_CopyStmfDS_t | Field | Description | |---|---| | ` 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** | ### RXS_CreateStmfDS_t | Field | Description | |---|---| | ` 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** | ### RXS_DeleteStmfDS_t | Field | Description | |---|---| | ` 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** | ### RXS_MoveStmfDS_t | Field | Description | |---|---| | ` 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** |