Common options parameter with embedded connection information and execution messages
DescriptionThis type is used in many LINK2i functions as a unique parameter containing connection information and allowing the user to follow the execution through an ExitMessage attribute
Attributes
Link2i.Link2iOptions options = new Link2i.Link2iOptions(){
ConnectionString = "kjhv....",
SessionId = "user00001session25072021"
};
Dim options As Link2i.Link2iOptions = New Link2i.Link2iOptions() With {
.ConnectionString = "kjhv....",
.SessionId = "user00001session25072021"
}
Gets Link2i version
DescriptionThis function retrieves Link2i version level
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
//Function call
result = db2.Version();
//Returned results
result = "LINK2i - V1R0M9 - March 14 2022 - www.aumerial.com/Knowledge.aspx";
'Parameters
Dim db2 As New Link2i
Dim result As String
'Function call
result = db2.Version()
'Returned results
result = "LINK2i - V1R0M9 - March 14 2022 - www.aumerial.com/Knowledge.aspx"
Register Link2i license key
DescriptionCreate KLINK2I, KLINK2T libraries, LICLINK file and Register Link2i license key OR Update license key and get in return a diagnosis message
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
string lparIP = "192.168.2.19";
string usrName = "QSECOFR";
string usrPassword = "PW1234";
string licenseKey = "...mpoOuLXn3D6WnjAjk=…";
string createOrRenew = "Link2i.TypeRegister.CRT";
//Function call
result = db2.RegisterLicenseKey(lparIP, usrName, usrPassword, licenseKey, createOrRenew);
//Returned results
result = "";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim lparIP As String = "192.168.2.19"
Dim usrName As String = "QSECOFR"
Dim usrPassword As String = "PW1234"
Dim licenseKey As String = "...mpoOuLXn3D6WnjAjk=…"
Dim createOrRenew As String = "Link2i.TypeRegister.CRT"
'Function call
result = db2.RegisterLicenseKey(lparIP, usrName, usrPassword, licenseKey, createOrRenew)
'Returned results
result = ""
Create a connection string
DescriptionLINK2i functions require an encrypted connection string containing the IP address, session credentials (user name/user password/ user name of an IBM i *SECOFR account/ password corresponding to the *SECOFR user name) and date of lifetime end of the connection string. This connection string is generated using GetConnectionString. The IBM i access is limited to the security roles established in the IBM i for the specified account.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
string IP = "192.168.2.19";
string usrName = "QSECOFR";
string usrPassword = "PW1234";
string secofrUsr = "S44H3440";
string secofrPwd = "LPAR001";
string connectionStringLifeTime = "31122023";
//Function call
result = db2.GetConnectionString(IP, usrName, usrPassword, secofrUsr, secofrPwd, connectionStringLifeTime);
//Returned results
result = "connection string to use in other functions";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim IP As String = "192.168.2.19"
Dim usrName As String = "QSECOFR"
Dim usrPassword As String = "PW1234"
Dim secofrUsr As String = "S44H3440"
Dim secofrPwd As String = "LPAR001"
Dim connectionStringLifeTime As String = "31122023"
'Function call
result = db2.GetConnectionString(IP, usrName, usrPassword, secofrUsr, secofrPwd, connectionStringLifeTime)
'Returned results
result = "connection string to use in other functions"
These functions allow you to explore the targeted IBM i partition to get a quick in-depth overview of what's inside your machine. They can also be used to interact with other LINK2i functions to specify libraries, files, create user-friendly query wizards...
retrieve licence status
Descriptionretrieves licence status
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
//Function call
result = db2.AboutLink2iLicense(Options);
//Returned results
result = "";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
'Function call
result = db2.AboutLink2iLicense(Options)
'Returned results
result = ""
retrieve targeted IBM i serial number and OS details
DescriptionRetrieves targeted IBM i serial number and the OS details.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
//Function call
result = db2.GetSerialNumberIBMi(Options);
//Returned results
result = "";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
'Function call
result = db2.GetSerialNumberIBMi(Options)
'Returned results
result = ""
Databases/Libraries inventory
DescriptionListDatabases extracts a list of all databases/libraries from the targeted IBM i partition in an object type variable that can be used as datasource. The variable contains databases list.
Parameters
//Parameters
Link2i db2 = new Link2i();
object result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
//Function call
result = db2.ListDatabases(Options);
//Returned results
result; //<Array of databases>
'Parameters
Dim db2 As New Link2i
Dim result As Object
Dim Options As New Link2i.Link2iOptions
'Function call
result = db2.ListDatabases(Options)
'Returned results
result '<Array of databases>
Databases/Libraries inventory
DescriptionListDatabases extracts a list of all databases/libraries from the targeted IBM i partition in an XML stream containing databases list.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
//Function call
result = db2.ListDatabasesXML(Options);
//Returned results
result = "<Databases>...</Databases>";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
'Function call
result = db2.ListDatabasesXML(Options)
'Returned results
result = "<Databases>...</Databases>"
Tables/files inventory in a database/library
DescriptionListTables extracts a list of all tables/files of the specified database/library from the targeted IBM i partition in an object type variable that can be used as datasource. The variable contains tables list.
Parameters
//Parameters
Link2i db2 = new Link2i();
object result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
//Function call
result = db2.ListTables(Options, base);
//Returned results
result; //<Array of tables in a database>
'Parameters
Dim db2 As New Link2i
Dim result As Object
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
'Function call
result = db2.ListTables(Options, base)
'Returned results
result '<Array of tables in a database>
Tables/files inventory in a database/library
DescriptionListTables extracts a list of all tables/files of the specified database/library from the targeted IBM i partition in an XML stream containing tables list.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
//Function call
result = db2.ListTablesXML(Options, base);
//Returned results
result = "<Tables>...</Tables>";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
'Function call
result = db2.ListTablesXML(Options, base)
'Returned results
result = "<Tables>...</Tables>"
Fields inventory in a table/file
DescriptionListFields extracts a list of all fields of the specified table/file of the specified database/library from the targeted IBM i partition in an object type variable that can be used as datasource. The variable contains fields list.
Parameters
//Parameters
Link2i db2 = new Link2i();
object result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
string table = "TABLETEST";
//Function call
result = db2.ListFields(Options, base, table);
//Returned results
result; //<Array of fields in a table>
'Parameters
Dim db2 As New Link2i
Dim result As Object
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
Dim table As String = "TABLETEST"
'Function call
result = db2.ListFields(Options, base, table)
'Returned results
result '<Array of fields in a table>
Fields inventory in a table/file
DescriptionListFields extracts a list of all fields of the specified table/file of the specified database/library from the targeted IBM i partition in an XML stream containing fields list.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
string table = "TABLETEST";
//Function call
result = db2.ListFieldsXML(Options, base, table);
//Returned results
result = "<Fields>...</Fields>";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
Dim table As String = "TABLETEST"
'Function call
result = db2.ListFieldsXML(Options, base, table)
'Returned results
result = "<Fields>...</Fields>"
Inventory of programs of a database
DescriptionListPrograms extracts a list of all programs of the specified database/library from the targeted IBM i partition in an object type variable that can be used as datasource. The variable contains programs list.
Parameters
//Parameters
Link2i db2 = new Link2i();
object result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
//Function call
result = db2.ListPrograms(Options, base);
//Returned results
result; //<Array of programs in a database>
'Parameters
Dim db2 As New Link2i
Dim result As Object
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
'Function call
result = db2.ListPrograms(Options, base)
'Returned results
result '<Array of programs in a database>
Inventory of programs of a database
DescriptionListPrograms extracts a list of all programs of the specified database/library from the targeted IBM i partition in an XML stream containing programs list.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
//Function call
result = db2.ListProgramsXML(Options, base);
//Returned results
result = "<Programs>...</Programs>";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
'Function call
result = db2.ListProgramsXML(Options, base)
'Returned results
result = "<Programs>...</Programs>"
Inventory of source files of a database
DescriptionListSources extracts a list of all source files of the specified database/library from the targeted IBM i partition in an object type variable that can be used as datasource. The variable contains sources list.
Parameters
//Parameters
Link2i db2 = new Link2i();
object result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
//Function call
result = db2.ListSources(Options, base);
//Returned results
result; //<Array of sources in a database>
'Parameters
Dim db2 As New Link2i
Dim result As Object
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
'Function call
result = db2.ListSources(Options, base)
'Returned results
result '<Array of sources in a database>
Inventory of source files of a database
DescriptionListSources extracts a list of all source files of the specified database/library from the targeted IBM i partition in an XML stream containing sources list.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
//Function call
result = db2.ListSourcesXML(Options, base);
//Returned results
result = "<Sources>...</Sources>";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
'Function call
result = db2.ListSourcesXML(Options, base)
'Returned results
result = "<Sources>...</Sources>"
Inventory of source members of a source file of a database
DescriptionListMembers extracts a list of all members of the specified source file of the specified database/library from the targeted IBM i partition in an object type variable that can be used as datasource. The variable contains members list.
Parameters
//Parameters
Link2i db2 = new Link2i();
object result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
string srcFile = "SOURCETEST";
//Function call
result = db2.ListMembers(Options, base, srcFile);
//Returned results
result; //<Array of members in a source file>
'Parameters
Dim db2 As New Link2i
Dim result As Object
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
Dim srcFile As String = "SOURCETEST"
'Function call
result = db2.ListMembers(Options, base, srcFile)
'Returned results
result '<Array of members in a source file>
Inventory of source members of a source file of a database
DescriptionListMembers extracts a list of all members of the specified source file of the specified database/library from the targeted IBM i partition in an XML stream containing members list.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
string srcFile = "SOURCETEST";
//Function call
result = db2.ListMembersXML(Options, base, srcFile);
//Returned results
result = "<Members>...</Members>";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
Dim srcFile As String = "SOURCETEST"
'Function call
result = db2.ListMembersXML(Options, base, srcFile)
'Returned results
result = "<Members>...</Members>"
Details of an IBM i object
DescriptionGetObjectDetails retrieves details of any IBM i object in an object type variable that can be used as datasource, containing parameters and their captions.
Parameters
//Parameters
Link2i db2 = new Link2i();
object result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
string ibmObject = "OBJTEST";
string objType = "*PGM";
//Function call
result = db2.GetObjectDetails(Options, base, ibmObject, objType);
//Returned results
result; //<Array of object details in a database>
'Parameters
Dim db2 As New Link2i
Dim result As Object
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
Dim ibmObject As String = "OBJTEST"
Dim objType As String = "*PGM"
'Function call
result = db2.GetObjectDetails(Options, base, ibmObject, objType)
'Returned results
result '<Array of object details in a database>
Details of an IBM i object
DescriptionGetObjectDetails retrieves details of any IBM i object in an XML stream containing parameters and their captions.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
string ibmObject = "OBJTEST";
string objType = "*PGM";
//Function call
result = db2.GetObjectDetailsXML(Options, base, ibmObject, objType);
//Returned results
result = "<objectDetails>...</objectDetails>";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
Dim ibmObject As String = "OBJTEST"
Dim objType As String = "*PGM"
'Function call
result = db2.GetObjectDetailsXML(Options, base, ibmObject, objType)
'Returned results
result = "<objectDetails>...</objectDetails>"
Run SQL queries and retrieve data in standard structures (XML, DataTable objects) to integrate DB2 for i databases in any environment. Extract and export data in CSV, TXT and XLSX files.
Execute an SQL Query
DescriptionRuns an SQL query on the targeted IBM i.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "update libtest.tabletest set name = 'foo' where name = 'bar'";
//Function call
result = db2.RunSql(Options, sqlQuery);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "update libtest.tabletest set name = 'foo' where name = 'bar'"
'Function call
result = db2.RunSql(Options, sqlQuery)
'Returned results
Execute multiple SQL queries
DescriptionRuns a sequence of up to 10 SQL queries in a row.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "update libtest.tabletest set name = 'foo' where name = 'bar';update libtest.tabletest set product = 'link2i' where machine = 'ibm i'";
string delimiter = ";";
//Function call
result = db2.RunSqlByTen(Options, sqlQuery, delimiter);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "update libtest.tabletest set name = 'foo' where name = 'bar';update libtest.tabletest set product = 'link2i' where machine = 'ibm i'"
Dim delimiter As String = ";"
'Function call
result = db2.RunSqlByTen(Options, sqlQuery, delimiter)
'Returned results
Execute an SQL Query script
Description
Runs an SQL script. The script can either be composed of SQL queries and CL commands. CL commands must be prefixed by 'CX:' or 'CL:'.
When using CX prefix, the script doesn't stop and resumes on error.
When using CL prefix, the script is interrupted on error.
The messages returned at each step of the script appear in the return parameter named diagMessage.
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlScript = "CL:CPYF(...);insert into ... ;CX:DLTF(...)";
string delimiter = ";";
//Function call
result = db2.RunSqlScript(Options, sqlScript, delimiter);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim sqlScript As String = "CL:CPYF(...);insert into ... ;CX:DLTF(...)"
Dim delimiter As String = ";"
'Function call
result = db2.RunSqlScript(Options, sqlScript, delimiter)
'Returned results
Getting large volumes of data by an SQL SELECT query
DescriptionPerforms mass data extraction to CSV file. GetMassData retrieves detailed description of each fields in the header of the file.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "select * from libtest.tabletest";
string delimiter = ";";
int nbrRec = 20000;
string resultFilePath = "c:\extractions\extract.csv";
int chunk = 500;
//Function call
result = db2.GetMassData(Options, sqlQuery, delimiter, nbrRec, resultFilePath, chunk);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "select * from libtest.tabletest"
Dim delimiter As String = ";"
Dim nbrRec As Integer = 20000
Dim resultFilePath As String = "c:\extractions\extract.csv"
Dim chunk As Integer = 500
'Function call
result = db2.GetMassData(Options, sqlQuery, delimiter, nbrRec, resultFilePath, chunk)
'Returned results
Send large amounts of data to a single-field staging table for integration into DB2 for i using the CL CPYFRMIMPF command
DescriptionPutMassData uses a CSV file (with a separator). The CSV file must have values and types in the same position than the fields contained in the destination DB2 for i table. The separator must be an insignificant character on the CSV file values. An intermediate table with only one field must first be created in DB2 for i to receive the transferred data.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string txtField = "field01";
string base = "libtest";
string table = "tabletest";
string docCsv = "c:\extractions\extract.csv";
string delimiter = ";";
//Function call
result = db2.PutMassData(Options, txtField, base, table, docCsv, delimiter);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim txtField As String = "field01"
Dim base As String = "libtest"
Dim table As String = "tabletest"
Dim docCsv As String = "c:\extractions\extract.csv"
Dim delimiter As String = ";"
'Function call
result = db2.PutMassData(Options, txtField, base, table, docCsv, delimiter)
'Returned results
Getting records of a table by an SQL SELECT query
Descriptionretrieves the result of an SQL SELECT query (simple/join) as a System.Data.DataTable object.
Parameters
//Parameters
Link2i db2 = new Link2i();
System.Data.DataTable result = new System.Data.DataTable();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "select ID, NAME, AGE from LIBTEST.TABLETEST WHERE age > 18";
int nbrRec = 2500;
string sqlComplex = "";
//Function call
result = db2.GetAllRecords(Options, sqlQuery, nbrRec, sqlComplex);
//Returned results
result; //
'Parameters
Dim db2 As New Link2i
Dim result As New System.Data.DataTable
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "select ID, NAME, AGE from LIBTEST.TABLETEST WHERE age > 18"
Dim nbrRec As Integer = 2500
Dim sqlComplex As String = ""
'Function call
result = db2.GetAllRecords(Options, sqlQuery, nbrRec, sqlComplex)
'Returned results
result '
Getting records of a table by an SQL SELECT query
Descriptionretrieves the result of an SQL SELECT query (simple/join) in an XML stream.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "select ID, NAME, AGE from LIBTEST.TABLETEST WHERE age > 18";
int nbrRec = 2500;
string sqlComplex = "";
//Function call
result = db2.GetAllRecordsXML(Options, sqlQuery, nbrRec, sqlComplex);
//Returned results
result = "";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "select ID, NAME, AGE from LIBTEST.TABLETEST WHERE age > 18"
Dim nbrRec As Integer = 2500
Dim sqlComplex As String = ""
'Function call
result = db2.GetAllRecordsXML(Options, sqlQuery, nbrRec, sqlComplex)
'Returned results
result = ""
Getting fields values and names in a dictionary structured by an SQL SELECT query
Descriptionretrieves fields values and fields names returned by an SQL SELECT query (simple/join).
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "SELECT NUMART,DESART,DOMAIN FROM newrmf.tarticle WHERE NUMART='2TS4F07800001A'";
string occurs = String.Empty;
string sqlComplex = "";
//Function call
result = db2.GetRecord(Options, sqlQuery, ref occurs, sqlComplex);
//Returned results
result = "NUMART;2TS4F07800001A
DESART;YD.ZZN JUCK 185RC 46/51 33.47QQ
DOMAIN;2";
occurs = "";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "SELECT NUMART,DESART,DOMAIN FROM newrmf.tarticle WHERE NUMART='2TS4F07800001A'"
Dim occurs As String = "
Dim sqlComplex As String = ""
'Function call
result = db2.GetRecord(Options, sqlQuery, occurs, sqlComplex)
'Returned results
result = "NUMART;2TS4F07800001A
DESART;YD.ZZN JUCK 185RC 46/51 33.47QQ
DOMAIN;2"
occurs = ""
Getting fields values and names in a dictionary structured by an SQL SELECT query
Descriptionretrieves fields values and fields names returned by an SQL SELECT query (simple/join) in an XML stream.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "SELECT NUMART,DESART,DOMAIN FROM newrmf.tarticle WHERE NUMART='2TS4F07800001A'";
string occurs = String.Empty;
string sqlComplex = "";
//Function call
result = db2.GetRecordXML(Options, sqlQuery, ref occurs, sqlComplex);
//Returned results
result = "";
occurs = "";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "SELECT NUMART,DESART,DOMAIN FROM newrmf.tarticle WHERE NUMART='2TS4F07800001A'"
Dim occurs As String = "
Dim sqlComplex As String = ""
'Function call
result = db2.GetRecordXML(Options, sqlQuery, occurs, sqlComplex)
'Returned results
result = ""
occurs = ""
Getting detailed description of data structured by an SQL SELECT query
Descriptionretrieves detailed description (type, size, ...) of data returned by an SQL SELECT query (simple/join).
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "SELECT NUMART,DESART,DOMAIN FROM newrmf.tarticle WHERE NUMART='2TS4F07800001A'";
//Function call
result = db2.GetDataDescription(Options, sqlQuery);
//Returned results
result = "NUMART;2TS4F07800001A
DESART;YD.ZZN JUCK 185RC 46/51 33.47QQ
DOMAIN;2
===============================================
SELECT NUMART,DESART,DOMAIN FROM newrmf.tarticle WHERE NUMART='2TS4F07800001A'$§$NUMART$§$NUMART-A-NUMERO_ARTICLE$|$DESART-A-DESIGNATION$|$DOMAIN-A-CODE_DOMAINE$|$
32-0-A-NUMERO_ARTICLE-NUMERO ARTICLE......-0-NUMERO ARTICLE......-NUMART-Y-NUMART$|$64-0-A-DESIGNATION-DESIGNATION.........-0-DESIGNATION.........- - -DESART$|$1-0-A-CODE_DOMAINE-CODE DOMAINE........-0-CODE DOMAINE........- - -DOMAIN$|$
";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "SELECT NUMART,DESART,DOMAIN FROM newrmf.tarticle WHERE NUMART='2TS4F07800001A'"
'Function call
result = db2.GetDataDescription(Options, sqlQuery)
'Returned results
result = "NUMART;2TS4F07800001A
DESART;YD.ZZN JUCK 185RC 46/51 33.47QQ
DOMAIN;2
===============================================
SELECT NUMART,DESART,DOMAIN FROM newrmf.tarticle WHERE NUMART='2TS4F07800001A'$§$NUMART$§$NUMART-A-NUMERO_ARTICLE$|$DESART-A-DESIGNATION$|$DOMAIN-A-CODE_DOMAINE$|$
32-0-A-NUMERO_ARTICLE-NUMERO ARTICLE......-0-NUMERO ARTICLE......-NUMART-Y-NUMART$|$64-0-A-DESIGNATION-DESIGNATION.........-0-DESIGNATION.........- - -DESART$|$1-0-A-CODE_DOMAINE-CODE DOMAINE........-0-CODE DOMAINE........- - -DOMAIN$|$
"
Number of records obtained by an SQL SELECT query
DescriptionCounts records in the result of an SQL SELECT query (simple/join)
Parameters
//Parameters
Link2i db2 = new Link2i();
int result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "select * from LIBTEST.TABLETEST";
//Function call
result = db2.GetRecordCount(Options, sqlQuery);
//Returned results
result = 129000;
'Parameters
Dim db2 As New Link2i
Dim result As Integer
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "select * from LIBTEST.TABLETEST"
'Function call
result = db2.GetRecordCount(Options, sqlQuery)
'Returned results
result = 129000
These functions allow you to run existing IBM i programs from .NET environments, perform joint development and run ILE modules. You can also retrieve, edit and recompile programs using Excel/text files.
Running an existing program on IBM i
DescriptionRunProgram executes a program on the targeted IBM i with no parameters.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string library = "LIBTEST";
string pgmName = "PGMTEST";
//Function call
result = db2.RunProgram(Options, library, pgmName);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim library As String = "LIBTEST"
Dim pgmName As String = "PGMTEST"
'Function call
result = db2.RunProgram(Options, library, pgmName)
'Returned results
Running an existing program on IBM i with input parameters
DescriptionRunProgramParam executes a program on the targeted IBM i with input parameters.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string library = "LIBTEST";
string pgmName = "PGMTEST";
string prmList = String.Empty;
string prmLength = "List of parameters' sizes (input and output) as a list. More details about passing parameters here : www.knowledge.aumerial.com : String (ByVal)";
string delimiter = "Delimiter used in parameters lists: String (ByVal)";
//Function call
result = db2.RunProgramParam(Options, library, pgmName, ref prmList, prmLength, delimiter);
//Returned results
prmList = "List of parameters' values (input and output) as a list. More details about passing parameters here : www.knowledge.aumerial.com : String (ByRef)";
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim library As String = "LIBTEST"
Dim pgmName As String = "PGMTEST"
Dim prmList As String = "
Dim prmLength As String = "List of parameters' sizes (input and output) as a list. More details about passing parameters here : www.knowledge.aumerial.com : String (ByVal)"
Dim delimiter As String = "Delimiter used in parameters lists: String (ByVal)"
'Function call
result = db2.RunProgramParam(Options, library, pgmName, prmList, prmLength, delimiter)
'Returned results
prmList = "List of parameters' values (input and output) as a list. More details about passing parameters here : www.knowledge.aumerial.com : String (ByRef)"
Running an existing program on IBM i with input and return parameters
DescriptionRunProgram executes a program on the targeted IBM i with input and return parameters.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string library = "LIBTEST";
string pgmName = "PGMTEST";
string prmList = String.Empty;
string prmLength = "List of parameters' sizes (input and output) as a list. More details about passing parameters here : www.knowledge.aumerial.com : String (ByVal)";
string prmReturned = "Position in prmList of the parameters to be returned. More details about passing parameters here : www.knowledge.aumerial.com : String (ByVal)";
string delimiter = "Delimiter used in parameters lists: String (ByVal)";
//Function call
result = db2.RunProgramParamReturn(Options, library, pgmName, ref prmList, prmLength, prmReturned, delimiter);
//Returned results
prmList = "List of parameters' values (input and output) as a list. More details about passing parameters here : www.knowledge.aumerial.com : String (ByRef)";
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim library As String = "LIBTEST"
Dim pgmName As String = "PGMTEST"
Dim prmList As String = "
Dim prmLength As String = "List of parameters' sizes (input and output) as a list. More details about passing parameters here : www.knowledge.aumerial.com : String (ByVal)"
Dim prmReturned As String = "Position in prmList of the parameters to be returned. More details about passing parameters here : www.knowledge.aumerial.com : String (ByVal)"
Dim delimiter As String = "Delimiter used in parameters lists: String (ByVal)"
'Function call
result = db2.RunProgramParamReturn(Options, library, pgmName, prmList, prmLength, prmReturned, delimiter)
'Returned results
prmList = "List of parameters' values (input and output) as a list. More details about passing parameters here : www.knowledge.aumerial.com : String (ByRef)"
Running existing ILE module(s) on IBM i
DescriptionRunILEModule executes ILE module(s) on the targeted IBM i.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string library = "LIBTEST";
string pgmName = "PGMTEST";
string modules = "MDLILE01 MDLILE02 MDLILE03 ";
string currentLib = "CURLIBTEST";
string additionalLib = "LIBTEST01$,$LIBTEST02";
//Function call
result = db2.RunILEModule(Options, library, pgmName, modules, currentLib, additionalLib);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim library As String = "LIBTEST"
Dim pgmName As String = "PGMTEST"
Dim modules As String = "MDLILE01 MDLILE02 MDLILE03 "
Dim currentLib As String = "CURLIBTEST"
Dim additionalLib As String = "LIBTEST01$,$LIBTEST02"
'Function call
result = db2.RunILEModule(Options, library, pgmName, modules, currentLib, additionalLib)
'Returned results
Exporting a source member in an Excel Edit structure
DescriptionGetSourceXLSX retrieves a source file from the targeted IBM i as an XLSX file.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
string srcFile = "QDDSSRC";
string member = "FILE001";
string dirPath = "c:\xlsx\";
string outputFileName = "Filetest01";
//Function call
result = db2.GetSourceXLSX(Options, base, srcFile, member, dirPath, outputFileName);
//Returned results
result = "";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
Dim srcFile As String = "QDDSSRC"
Dim member As String = "FILE001"
Dim dirPath As String = "c:\xlsx\"
Dim outputFileName As String = "Filetest01"
'Function call
result = db2.GetSourceXLSX(Options, base, srcFile, member, dirPath, outputFileName)
'Returned results
result = ""
Exporting a source member to a text file
DescriptionGetSourceTXT retrieves a source file from the targeted IBM i as a text file.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
string srcFile = "QDDSSRC";
string member = "FILE001";
string dirPath = "c:\txt\";
string outputFileName = "Filetest01";
//Function call
result = db2.GetSourceTXT(Options, base, srcFile, member, dirPath, outputFileName);
//Returned results
result = "";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
Dim srcFile As String = "QDDSSRC"
Dim member As String = "FILE001"
Dim dirPath As String = "c:\txt\"
Dim outputFileName As String = "Filetest01"
'Function call
result = db2.GetSourceTXT(Options, base, srcFile, member, dirPath, outputFileName)
'Returned results
result = ""
Post a source member in the targeted IBM i
DescriptionCopies a source member from an Excel file to the specified database/library and source file in the targeted IBM i. The Excel workbook to be applied must be formatted as a result file of GetSourceXLSX.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
string srcFile = "QDDSSRC";
string member = "FILE001";
string memberDescription = "Customers file";
string filePath = "c:\xlsx\source01.xlsx";
string srcType = "Link2i.TypeSource.PF";
//Function call
result = db2.PostSource(Options, base, srcFile, member, memberDescription, filePath, srcType);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
Dim srcFile As String = "QDDSSRC"
Dim member As String = "FILE001"
Dim memberDescription As String = "Customers file"
Dim filePath As String = "c:\xlsx\source01.xlsx"
Dim srcType As String = "Link2i.TypeSource.PF"
'Function call
result = db2.PostSource(Options, base, srcFile, member, memberDescription, filePath, srcType)
'Returned results
Generating an executable object (compilation) on IBM i
DescriptionCreateObject compiles a member of the targeted IBM i into an executable object.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string base = "LIBTEST";
string srcFile = "QDDSSRC";
string member = "FILE001";
string srcType = "Link2i.TypeSource.PF";
string destBase = "LIBOBJ";
string objName = "OBJ001";
//Function call
result = db2.CreateObject(Options, base, srcFile, member, srcType, destBase, objName);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim base As String = "LIBTEST"
Dim srcFile As String = "QDDSSRC"
Dim member As String = "FILE001"
Dim srcType As String = "Link2i.TypeSource.PF"
Dim destBase As String = "LIBOBJ"
Dim objName As String = "OBJ001"
'Function call
result = db2.CreateObject(Options, base, srcFile, member, srcType, destBase, objName)
'Returned results
Running an existing stored procedure on the targeted IBM i.
DescriptionRunStoredProcedure runs an existing stored procedure on the targeted IBM i.
Parameters
//Parameters
Link2i db2 = new Link2i();
System.Data.DataTable result = new System.Data.DataTable();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string library = "LIBTEST";
string prcName = "STPROC01";
int absoluteRec = 10;
int nbrRec = 120;
string returnCursor = "Y";
string execCommit = "Y";
string xmlStr = String.Empty;
string prmDataType = "{Link2i.DB2ForiType._Char, Link2i.DB2ForiType._Char, Link2i.DB2ForiType._Decimal, Link2i.DB2ForiType._Char}";
string prmDataList = "{"2TRAY31", "ZSZ NOD", "20", " "}";
string prmDirection = "{"IN", "IN", "IN", "OUT"}";
string prmReturned = String.Empty;
//Function call
result = db2.RunStoredProcedure(Options, library, prcName, absoluteRec, nbrRec, returnCursor, execCommit, ref xmlStr, prmDataType, prmDataList, prmDirection, ref prmReturned);
//Returned results
result; //
xmlStr = "<DataSet>...</DataSet>";
prmReturned = "{" ", " ", " ", " "}";
'Parameters
Dim db2 As New Link2i
Dim result As New System.Data.DataTable
Dim Options As New Link2i.Link2iOptions
Dim library As String = "LIBTEST"
Dim prcName As String = "STPROC01"
Dim absoluteRec As Integer = 10
Dim nbrRec As Integer = 120
Dim returnCursor As String = "Y"
Dim execCommit As String = "Y"
Dim xmlStr As String = "
Dim prmDataType As String = "{Link2i.DB2ForiType._Char, Link2i.DB2ForiType._Char, Link2i.DB2ForiType._Decimal, Link2i.DB2ForiType._Char}"
Dim prmDataList As String = "{"2TRAY31", "ZSZ NOD", "20", " "}"
Dim prmDirection As String = "{"IN", "IN", "IN", "OUT"}"
Dim prmReturned As String = "
'Function call
result = db2.RunStoredProcedure(Options, library, prcName, absoluteRec, nbrRec, returnCursor, execCommit, xmlStr, prmDataType, prmDataList, prmDirection, prmReturned)
'Returned results
result '
xmlStr = "<DataSet>...</DataSet>"
prmReturned = "{" ", " ", " ", " "}"
Run CL commands from .NET
Running an IBM i CL command
DescriptionExecutes any CL command from .NET
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string cmd = ""CRTLIB LIB(LIBTEST) TEXT(LIBRARY TEST)"";
//Function call
result = db2.RunCLCmd(Options, cmd);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim cmd As String = ""CRTLIB LIB(LIBTEST) TEXT(LIBRARY TEST)""
'Function call
result = db2.RunCLCmd(Options, cmd)
'Returned results
Use Excel as an input-output peripheral to manually create, edit or delete data
Creating an EXCEL document for updating data
DescriptionExports an Excel workbook that can be used to manually edit records, and posted back for update to the targeted IBM i using XlsxApply function.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "select ID, NAME, AGE from LIBTEST.TABLETEST WHERE age > 18";
string orderByFields = "ID, NAME DESC";
string dirPath = "c:\xlsx\";
string outputFileName = "FileXlsx";
//Function call
result = db2.XlsxUpdate(Options, sqlQuery, orderByFields, dirPath, outputFileName);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "select ID, NAME, AGE from LIBTEST.TABLETEST WHERE age > 18"
Dim orderByFields As String = "ID, NAME DESC"
Dim dirPath As String = "c:\xlsx\"
Dim outputFileName As String = "FileXlsx"
'Function call
result = db2.XlsxUpdate(Options, sqlQuery, orderByFields, dirPath, outputFileName)
'Returned results
Creating an EXCEL document for creating data
DescriptionComposes an Excel workbook based on an SQL SELECT query, that can be used to manually add records and posted back for adding, to the targeted IBM i using XlsxApply function.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "select * from LIBTEST.TABLETEST";
string orderByFields = "" "";
string dirPath = "c:\xlsx\";
string outputFileName = "FileXlsx";
//Function call
result = db2.XlsxCreate(Options, sqlQuery, orderByFields, dirPath, outputFileName);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "select * from LIBTEST.TABLETEST"
Dim orderByFields As String = "" ""
Dim dirPath As String = "c:\xlsx\"
Dim outputFileName As String = "FileXlsx"
'Function call
result = db2.XlsxCreate(Options, sqlQuery, orderByFields, dirPath, outputFileName)
'Returned results
Creating an EXCEL document for creating data with a generic
DescriptionComposes an Excel workbook based on an SQL SELECT query, with a sample line that can be used to manually add records and posted back for addition, to the targeted IBM i using XlsxApply function.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "select * from LIBTEST.TABLETEST";
string orderByFields = "" "";
string dirPath = "c:\xlsx\";
string outputFileName = "FileXlsx";
//Function call
result = db2.XlsxCreateWithGeneric(Options, sqlQuery, orderByFields, dirPath, outputFileName);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "select * from LIBTEST.TABLETEST"
Dim orderByFields As String = "" ""
Dim dirPath As String = "c:\xlsx\"
Dim outputFileName As String = "FileXlsx"
'Function call
result = db2.XlsxCreateWithGeneric(Options, sqlQuery, orderByFields, dirPath, outputFileName)
'Returned results
Creating an EXCEL document for deleting data
DescriptionExports an Excel workbook that can be used to manually delete records and posted back for deletion to the targeted IBM i using XlsxApply function.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string sqlQuery = "select ID, NAME, AGE from LIBTEST.TABLETEST WHERE age > 18";
string orderByFields = "ID, NAME DESC";
string dirPath = "c:\xlsx\";
string outputFileName = "FileXlsx";
//Function call
result = db2.XlsxDelete(Options, sqlQuery, orderByFields, dirPath, outputFileName);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim sqlQuery As String = "select ID, NAME, AGE from LIBTEST.TABLETEST WHERE age > 18"
Dim orderByFields As String = "ID, NAME DESC"
Dim dirPath As String = "c:\xlsx\"
Dim outputFileName As String = "FileXlsx"
'Function call
result = db2.XlsxDelete(Options, sqlQuery, orderByFields, dirPath, outputFileName)
'Returned results
Applying an EXCEL document to DB2 for i
DescriptionApplies Excel workbooks generated by XlsxUpdate, XlsxCreate, XlsxCreateWithGeneric and XlsxDelete functions.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string resultFilePath = "c:\xlsx\FileXlsx.xlsx";
//Function call
result = db2.XlsxApply(Options, resultFilePath);
//Returned results
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim resultFilePath As String = "c:\xlsx\FileXlsx.xlsx"
'Function call
result = db2.XlsxApply(Options, resultFilePath)
'Returned results
These functions provide you with an out-of-the-box user interface to work with your data. Display and edit data from an ASP.NET page as you would do on a 5250 screen. Go further and exploit XML data to build your own user interfaces to master your data.
Retrieving IBM i CL command in a System.Web.UI.WebControls.Panel
Descriptionretrieves a CL command builder in a System.Web.UI.WebControls.Panel, used to compose a prompt CL command with a 5250-like interface in an ASP.NET web page.
Parameters
//Parameters
Link2i db2 = new Link2i();
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string cmd = String.Empty;
System.Web.UI.WebControls.Panel promptPanel = new System.Web.UI.WebControls.Panel();
//Function call
result = db2.UtilityCLCmdGet(Options, ref cmd, ref promptPanel);
//Returned results
cmd = "CPYF";
promptPanel; //System.Web.UI.WebControls.Panel
'Parameters
Dim db2 As New Link2i
Dim Options As New Link2i.Link2iOptions
Dim cmd As String = "
Dim promptPanel As New System.Web.UI.WebControls.Panel
'Function call
result = db2.UtilityCLCmdGet(Options, cmd, promptPanel)
'Returned results
cmd = "CPYF"
promptPanel 'System.Web.UI.WebControls.Panel
Retrieving IBM i CL command in XML format
Descriptionretrieves a CL command builder in an XML string, used to compose a prompt CL command with a 5250-like interface in an ASP.NET web page.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
Link2i.Link2iOptions Options = new Link2i.Link2iOptions();
string cmd = String.Empty;
//Function call
result = db2.UtilityCLCmdGetXML(Options, ref cmd);
//Returned results
result = " ";
cmd = "CPYF";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim Options As New Link2i.Link2iOptions
Dim cmd As String = "
'Function call
result = db2.UtilityCLCmdGetXML(Options, cmd)
'Returned results
result = " "
cmd = "CPYF"
ASP Panel variant Creating an IBM i command from a formatted prompt using a panel
DescriptionGenerates a valid CL command ready to be executed using RunCLCmd function from a System.Web.Panel control populated using UtilityCLCmdGet function and edited by the user.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
System.Web.UI.WebControls.Panel promptPanel = new System.Web.UI.WebControls.Panel();
//Function call
result = db2.UtilityCLCmdBuild(promptPanel);
//Returned results
result = "CRTLIB LIB(LIBTEST) TEXT(LIBRARY TEST)";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim promptPanel As New System.Web.UI.WebControls.Panel
'Function call
result = db2.UtilityCLCmdBuild(promptPanel)
'Returned results
result = "CRTLIB LIB(LIBTEST) TEXT(LIBRARY TEST)"
String variant Creating an IBM i command from a parameters list in a chars string
DescriptionGenerates a valid CL command ready to be executed using RunCLCmd function from a parameters chars string got using the UtilityCLCmdGet function.
Parameters
//Parameters
Link2i db2 = new Link2i();
string result;
string clParametersStr = "CRTLIB| LIBTEST,*PROD,*LIBCRTAUT,1,*ASP,*SYSVAL,*SYSVAL,Test Library,|LIB,TYPE,AUT,ASP,ASPDEV,CRTAUT,CRTOBJAUD,TEXT,|-,-,-,-,-,-,-,-,|,*PROD,*LIBCRTAUT,1,*ASP,*SYSVAL,*SYSVAL,*BLANK,";
//Function call
result = db2.UtilityCLCmdBuild(clParametersStr);
//Returned results
result = "CRTLIB LIB(LIBTEST) TEXT(LIBRARY TEST)";
'Parameters
Dim db2 As New Link2i
Dim result As String
Dim clParametersStr As String = "CRTLIB| LIBTEST,*PROD,*LIBCRTAUT,1,*ASP,*SYSVAL,*SYSVAL,Test Library,|LIB,TYPE,AUT,ASP,ASPDEV,CRTAUT,CRTOBJAUD,TEXT,|-,-,-,-,-,-,-,-,|,*PROD,*LIBCRTAUT,1,*ASP,*SYSVAL,*SYSVAL,*BLANK,"
'Function call
result = db2.UtilityCLCmdBuild(clParametersStr)
'Returned results
result = "CRTLIB LIB(LIBTEST) TEXT(LIBRARY TEST)"