FileBase class | QSYS API Reference Guide
Estimated reading time: 28 minutes
Defines common functionality for files (Database, Printfile, Workstation)
Namespace: ASNA.QSys.Runtime Assembly: ASNA.QSys.Runtime.dll
Inheritance: Object
Constructors
Name | Description |
---|---|
FileBase(String) | Initializes a new instance of the FileBase class. |
FileBase(String, Action) | Initializes a new instance of the FileBase class. |
FileBase(String)
Initializes a new instance of the FileBase class.
FileBase(String)
Parameters
Type | Parameter name | Description |
---|---|---|
String | dclFileName | Field name for this file in the program. |
FileBase(String, Action)
Initializes a new instance of the FileBase class.
FileBase(String, Action)
Parameters
Type | Parameter name | Description |
---|---|---|
String | dclFileName | Field name for this file in the program. |
Action | infSR | InfSR delegate. This is the method to call when a file error occurs. |
Properties
Type | Name | Description |
---|---|---|
AdgDataSet | DataSet | Gets the AdgDataSet that moves data between the program and the database. |
String | DclFileName | Gets the name of this file field in the program. |
Boolean | IsEof | Gets or sets the IsEof flag of the file, true when the file is at End of File. |
Boolean | IsEqual | Gets or sets the IsEqual flag of the file, true when a record with the same key was found in a file operation. |
Boolean | IsFound | Gets or sets the IsFound flag of the file, true when a record is found. |
Boolean | IsOpen | Gets a value indicating whether the file is open. |
RuntimeException | LastException | Gets the RuntimeException that resulted from a file operation. |
Int32 | StatusCode | Gets the status code resulting from a file operation. |
Methods
Signature | Description |
---|---|
allocateBuffer() | Allocate DataSet buffer. |
ChainByRRN(String, Int32, Boolean) | Read a record format using the relative record number. |
ChainByRRN(String, Int32, Boolean, IDS) | Read a record format using the relative record number. |
chainKey(String, AdgKeyTable, Boolean) | When overriden in a derived class, read a record format using a key. |
chainKey(String, AdgKeyTable, Boolean, IDS) | Read a record format using a key. |
ChainKey(String, AdgKeyTable, Boolean) | Read a record format using a key. |
ChainKey(String, AdgKeyTable, Boolean, IDS) | Read a record format using a key. |
chainRRN(String, Int32, Boolean) | Read a record format using the relative record number. |
chainRRN(String, Int32, Boolean, IDS) | Read a record format using the relative record number. |
close() | When overriden in a derived class, close a file. |
Close() | Close a file. |
deleteByRRN(String, Int32) | When overriden in a derived class deletes a record using its relative record number. |
DeleteByRRN(String, Int32) | Delete a record using its relative record number. |
dumpRecord() | Dumps the current DataSet record into a string buffer. The values are put in the string bufferaccording to the RPG type of the corresponding record field. |
GetDataColumn(String, String) | Get Data Column from DataSet. |
GetDataTable(String) | Support for RPG’s lack of indexed properties. |
insert(String, Int32) | Add a new record to a file given its record format name. |
Insert(String, Int32) | Add a new record to a file given its record format name. |
loadRecord(String, String) | Load a record in the DataSet with values extracted from a string buffer. The values are kept in the string bufferaccording to the RPG type of the corresponding record field. |
populateBuffer(String) | Calls the delegate to populate buffer from fields. |
populateBufferWithFields(String, String[]) | Invoke the delegate to copy values from the given program fields into the dataset record. |
populateFields() | Invoke the delegate to copy values from the dataset record to the program fields. |
setStatusCodeFromLastException() | Set and return the Status Code from last exception. |
update(String) | Update a record given its record format name. |
update(String, Char[]) | When overriden in a derived class, update a record given its record format name. |
update(String, IDS) | Update a record given its record format name. |
update(String, Char[], IDS) | When overridden in a derived class, updates the current record using field values from a data structure.This base class throws a NotSupportedException exception by default. |
update(String, IDS, IDS) | Update a record given its record format name using field values from a data structure. |
Update(String) | Update a record given its record format name. |
Update(String, Char[]) | Update a record given its record format name. |
Update(String, IDS) | Update a record given its record format name. |
Update(String, Char[], IDS) | Update a record given its record format name using field values from a data structure. |
Update(String, IDS, IDS) | Update a record given its record format name using field values from a data structure. |
updateFlds(String, String[]) | When overridden in a derived class, updates the specified fields on the current record. This base class throws a NotSupportedException exception by default. |
UpdateFlds(String, String[]) | Update a record given its record format name, only those fields indicated in fieldNames. |
write(String) | Write a record given its record format name. |
write(String, Char[]) | Write a record given its record format name. |
write(String, IDS) | Write a record given its record format name. |
write(String, Char[], IDS) | Write a record given its record format name, getting the field values out of a data structure. |
Write(String) | Write a record given its record format name. |
Write(String, IDS) | Write a record given its record format name. |
Write(String, Char[]) | Write a record given its record format name. |
Write(String, Char[], IDS) | Write a record given its record format name, getting the field values out of a data structure. |
writeSubfile(String, Int32) | Write a subfile record given its record format name. |
writeSubfile(String, Int32, IDS) | Write a subfile record given its record format name. |
writeSubfile(String, Int32, Char[]) | Write a subfile record given its record format name. |
WriteSubfile(String, Int32) | Write a subfile record given its record format name. |
WriteSubfile(String, Int32, IDS) | Write a subfile record given its record format name. |
WriteSubfile(String, Int32, Char[]) | Write a subfile record given its record format name. |
AdgDataSet allocateBuffer()
Allocate DataSet buffer.
AdgDataSet allocateBuffer()
void ChainByRRN(string formatName, int rrn, bool noLock)
Read a record format using the relative record number.
void ChainByRRN(string formatName, int rrn, bool noLock)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to read. |
Int32 | rrn | Relative record number of the record to read. |
Boolean | noLock | True to leave the record unlocked after the operation. |
void ChainByRRN(string formatName, int rrn, bool noLock, IDS intoDS)
Read a record format using the relative record number.
void ChainByRRN(string formatName, int rrn, bool noLock, IDS intoDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to read. |
Int32 | rrn | Relative record number of the record to read. |
Boolean | noLock | True to leave the record unlocked after the operation. |
IDS | intoDS | IDS object that receives the data read. |
void chainKey(string formatName, AdgKeyTable key, bool noLock)
When overriden in a derived class, read a record format using a key.
void chainKey(string formatName, AdgKeyTable key, bool noLock)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to read. |
AdgKeyTable | key | An AdgKeyTable object containing the key of the record to read. |
Boolean | noLock | True to leave the record unlocked after the operation. |
void chainKey(string formatName, AdgKeyTable key, bool noLock, IDS intoDS)
Read a record format using a key.
void chainKey(string formatName, AdgKeyTable key, bool noLock, IDS intoDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to read. |
AdgKeyTable | key | An AdgKeyTable object containing the key of the record to read. |
Boolean | noLock | True to leave the record unlocked after the operation. |
IDS | intoDS | IDS object that receives the data read. |
void ChainKey(string formatName, AdgKeyTable key, bool noLock)
Read a record format using a key.
void ChainKey(string formatName, AdgKeyTable key, bool noLock)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to read. |
AdgKeyTable | key | An AdgKeyTable object containing the key of the record to read. |
Boolean | noLock | True to leave the record unlocked after the operation. |
void ChainKey(string formatName, AdgKeyTable key, bool noLock, IDS intoDS)
Read a record format using a key.
void ChainKey(string formatName, AdgKeyTable key, bool noLock, IDS intoDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to read. |
AdgKeyTable | key | An AdgKeyTable object containing the key of the record to read. |
Boolean | noLock | True to leave the record unlocked after the operation. |
IDS | intoDS | IDS object that receives the data read. |
void chainRRN(string formatName, int rrn, bool noLock)
Read a record format using the relative record number.
void chainRRN(string formatName, int rrn, bool noLock)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to read. |
Int32 | rrn | Relative record number of the record to read. |
Boolean | noLock | True to leave the record unlocked after the operation. |
void chainRRN(string formatName, int rrn, bool noLock, IDS intoDS)
Read a record format using the relative record number.
void chainRRN(string formatName, int rrn, bool noLock, IDS intoDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to read. |
Int32 | rrn | Relative record number of the record to read. |
Boolean | noLock | True to leave the record unlocked after the operation. |
IDS | intoDS | IDS object that receives the data read. |
void close()
When overriden in a derived class, close a file.
void close()
void Close()
Close a file.
void Close()
void deleteByRRN(string formatName, int rrn)
When overriden in a derived class deletes a record using its relative record number.
void deleteByRRN(string formatName, int rrn)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to delete. |
Int32 | rrn | Relative record number of the record to read. |
bool DeleteByRRN(string formatName, int rrn)
Delete a record using its relative record number.
bool DeleteByRRN(string formatName, int rrn)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to delete. |
Int32 | rrn | Relative Record Number. |
Returns
Type | Description |
---|---|
Boolean | True if record was found, otherwise false. |
string dumpRecord()
Dumps the current DataSet record into a string buffer. The values are put in the string bufferaccording to the RPG type of the corresponding record field.
string dumpRecord()
DataColumn GetDataColumn(string tableName, string columnName)
Get Data Column from DataSet.
DataColumn GetDataColumn(string tableName, string columnName)
Parameters
Type | Parameter name | Description |
---|---|---|
String | tableName | Input table name. |
String | columnName | Input column name. |
Returns
Type | Description |
---|---|
DataColumn | The Data Column referenced by input parameters. |
DataTable GetDataTable(string tableName)
Support for RPG’s lack of indexed properties.
DataTable GetDataTable(string tableName)
Parameters
Type | Parameter name | Description |
---|---|---|
String | tableName | Input table name. |
Returns
Type | Description |
---|---|
DataTable | Data table. |
void insert(string formatName, int rrn)
Add a new record to a file given its record format name.
void insert(string formatName, int rrn)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to add. |
Int32 | rrn | Relative record number of the record to read. |
void Insert(string formatName, int rrn)
Add a new record to a file given its record format name.
void Insert(string formatName, int rrn)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to add. |
Int32 | rrn | Relative record number of the record to read. |
void loadRecord(string formatName, string value)
Load a record in the DataSet with values extracted from a string buffer. The values are kept in the string bufferaccording to the RPG type of the corresponding record field.
void loadRecord(string formatName, string value)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to load. |
String | value | String buffer containing the values to load in the record. |
void populateBuffer(string formatName)
Calls the delegate to populate buffer from fields.
void populateBuffer(string formatName)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Input record format name. |
void populateBufferWithFields(string formatName, String[] fieldNames)
Invoke the delegate to copy values from the given program fields into the dataset record.
void populateBufferWithFields(string formatName, String[] fieldNames)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to fill. |
String[] | fieldNames | Array of the names of the fields to copy. |
void populateFields()
Invoke the delegate to copy values from the dataset record to the program fields.
void populateFields()
int setStatusCodeFromLastException()
Set and return the Status Code from last exception.
int setStatusCodeFromLastException()
void update(string formatName)
Update a record given its record format name.
void update(string formatName)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
void update(string formatName, Char[] optionIndicators)
When overriden in a derived class, update a record given its record format name.
void update(string formatName, Char[] optionIndicators)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
Char[] | optionIndicators | Indicator array to use in the update operation. |
void update(string formatName, IDS indDS)
Update a record given its record format name.
void update(string formatName, IDS indDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
IDS | indDS | Indicator data structure to use in the update operation. |
void update(string formatName, Char[] optionIndicators, IDS fromDS)
When overridden in a derived class, updates the current record using field values from a data structure.This base class throws a NotSupportedException exception by default.
Remarks
This base implentation throws a NotImplementedException exception.
void update(string formatName, Char[] optionIndicators, IDS fromDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
Char[] | optionIndicators | Indicator array to use in the update operation. |
IDS | fromDS | IDS object where the data comes from. |
void update(string formatName, IDS optionIndicators, IDS fromDS)
Update a record given its record format name using field values from a data structure.
void update(string formatName, IDS optionIndicators, IDS fromDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
IDS | optionIndicators | Indicator data structure to use in the update operation. |
IDS | fromDS | IDS object where the data comes from. |
void Update(string formatName)
Update a record given its record format name.
void Update(string formatName)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
void Update(string formatName, Char[] optionIndicators)
Update a record given its record format name.
void Update(string formatName, Char[] optionIndicators)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
Char[] | optionIndicators | Indicator array to use in the update operation. |
void Update(string formatName, IDS indDS)
Update a record given its record format name.
void Update(string formatName, IDS indDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
IDS | indDS | Indicator data structure to use in the update operation. |
void Update(string formatName, Char[] optionIndicators, IDS fromDS)
Update a record given its record format name using field values from a data structure.
void Update(string formatName, Char[] optionIndicators, IDS fromDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
Char[] | optionIndicators | Indicator array to use in the update operation. |
IDS | fromDS | IDS object where the data comes from. |
void Update(string formatName, IDS optionIndicators, IDS fromDS)
Update a record given its record format name using field values from a data structure.
void Update(string formatName, IDS optionIndicators, IDS fromDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
IDS | optionIndicators | Indicator array to use in the update operation. |
IDS | fromDS | IDS object where the data comes from. |
void updateFlds(string formatName, String[] fieldNames)
When overridden in a derived class, updates the specified fields on the current record. This base class throws a NotSupportedException exception by default.
Remarks
This base implentation throws a NotImplementedException exception.
void updateFlds(string formatName, String[] fieldNames)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
String[] | fieldNames | The fields to update. |
void UpdateFlds(string formatName, String[] fieldNames)
Update a record given its record format name, only those fields indicated in fieldNames.
void UpdateFlds(string formatName, String[] fieldNames)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to update. |
String[] | fieldNames | The fields to update. |
void write(string formatName)
Write a record given its record format name.
void write(string formatName)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
void write(string formatName, Char[] optionIndicators)
Write a record given its record format name.
void write(string formatName, Char[] optionIndicators)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
Char[] | optionIndicators | Indicator array to use in the write operation. |
void write(string formatName, IDS indDS)
Write a record given its record format name.
void write(string formatName, IDS indDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
IDS | indDS | Indicator data structure to use in the write operation. |
void write(string formatName, Char[] optionIndicators, IDS fromDS)
Write a record given its record format name, getting the field values out of a data structure.
void write(string formatName, Char[] optionIndicators, IDS fromDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
Char[] | optionIndicators | Indicator array to use in the write operation. |
IDS | fromDS | IDS object where the data comes from. |
void Write(string formatName)
Write a record given its record format name.
void Write(string formatName)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
void Write(string formatName, IDS indDS)
Write a record given its record format name.
void Write(string formatName, IDS indDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
IDS | indDS | Indicator data structure to use in the write operation. |
void Write(string formatName, Char[] optionIndicators)
Write a record given its record format name.
void Write(string formatName, Char[] optionIndicators)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
Char[] | optionIndicators | Indicator array to use in the write operation. |
void Write(string formatName, Char[] optionIndicators, IDS fromDS)
Write a record given its record format name, getting the field values out of a data structure.
void Write(string formatName, Char[] optionIndicators, IDS fromDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
Char[] | optionIndicators | Indicator array to use in the write operation. |
IDS | fromDS | IDS object where the data comes from. |
void writeSubfile(string formatName, int rrn)
Write a subfile record given its record format name.
void writeSubfile(string formatName, int rrn)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
Int32 | rrn | Relative record number of the record to write. |
void writeSubfile(string formatName, int rrn, IDS indDS)
Write a subfile record given its record format name.
void writeSubfile(string formatName, int rrn, IDS indDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
Int32 | rrn | Relative record number of the record to write. |
IDS | indDS | Indicator data structure to use in the write operation. |
void writeSubfile(string formatName, int rrn, Char[] optionIndicators)
Write a subfile record given its record format name.
void writeSubfile(string formatName, int rrn, Char[] optionIndicators)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
Int32 | rrn | Relative record number of the record to write. |
Char[] | optionIndicators | Indicator array to use in the write operation. |
void WriteSubfile(string formatName, int rrn)
Write a subfile record given its record format name.
void WriteSubfile(string formatName, int rrn)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
Int32 | rrn | Relative record number of the record to write. |
void WriteSubfile(string formatName, int rrn, IDS indDS)
Write a subfile record given its record format name.
void WriteSubfile(string formatName, int rrn, IDS indDS)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
Int32 | rrn | Relative record number of the record to write. |
IDS | indDS | Indicator data structure to use in the write operation. |
void WriteSubfile(string formatName, int rrn, Char[] optionIndicators)
Write a subfile record given its record format name.
void WriteSubfile(string formatName, int rrn, Char[] optionIndicators)
Parameters
Type | Parameter name | Description |
---|---|---|
String | formatName | Name of the record format to write. |
Int32 | rrn | Relative record number of the record to write. |
Char[] | optionIndicators | Indicator array to use in the write operation. |