RXS_ProcessStmf()
This subprocedure can be used to create, copy, move, rename, or delete a specified IFS stream file.
Subprocedure Prototype
|
|
|
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
*--------------------------------------------------------------
* 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
*--------------------------------------------------------------
* 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
*--------------------------------------------------------------
* This example code moves an IFS file from /tmp/new_file.xml
* to /tmpdir/new_file.xml. Note that this can only be used
* to move the file to a new directory, not to rename the file.
*--------------------------------------------------------------
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.Stmf = '/tmp/new_file.xml';
MoveStmfDS.ToDir = '/tmpdir/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
RXS_ResetDS( DeleteStmfDS : RXS_DS_TYPE_DELETESTMF );
DeleteStmfDS.Stmf = '/tmp/new_file.xml';
RXS_ProcessStmf( DeleteStmfDS );
*INLR = *ON;
/end-free
*--------------------------------------------------------------
* This example code renames an IFS file from /tmp/new_file.xml
* to /tmp/renamed_new_file.xml. Note that this can only be used
* to rename the file, not move it to a new directory.
*--------------------------------------------------------------
H DFTACTGRP(*NO) BNDDIR('RXSBND') ACTGRP(*CALLER)
/copy QRPGLECPY,RXSCB
D RenameStmfDS DS LikeDS(RXS_RenameStmfDS_t)
D Inz(*LikeDS)
/free
RXS_ResetDS( RenameStmfDS : RXS_DS_TYPE_RENAMESTMF );
RenameStmfDS.FromStmf = '/tmp/new_file.xml';
RenameStmfDS.ToStmf = '/tmp/renamed_new_file.xml';
RXS_ProcessStmf( RenameStmfDS );
*INLR = *ON;
/end-free
Data Structures
|
|
|
|
|
Internal use only |
|
|
|
Specify the IFS file path to copy from. |
|
Specify the IFS file path to copy to. |
|
Specify the CCSID the copied file will use. |
|
Internal use only |
|
|
|
|
|
Internal use only |
|
|
|
Specify IFS path where the file will be created. |
|
Specify the CCSID to create the file with. |
|
Internal use only |
|
|
|
|
|
Internal use only |
|
|
|
Specify the IFS file path to delete. |
|
Internal use only |
|
|
|
|
|
Internal use only |
|
|
|
Specify the IFS file path to move from. |
|
Specify an IFS file directory to move to. Note: You should only specify a directory path, not a full path to a file. |
|
Internal use only |
|
|
|
|
|
Internal use only |
|
|
|
Specify the IFS file path to rename from. |
|
Specify the IFS file path to rename to. |
|
Internal use only |