/*******************************************************************************/ /* This FTP site contains code made available by IBM Corporation on an AS IS */ /* basis. Any one receiving a code module is considered to be licensed under */ /* IBM copyrights to use the IBM-provided source code in any way he or she */ /* deems fit, including copying it, compiling it, modifying it, and */ /* redistributing it, with or without modifications. No license under any IBM */ /* patents or patent applications is to be implied from this copyright */ /* license. */ /* */ /* A user of the module should understand that IBM cannot provide technical */ /* support for the module and will not be responsible for any consequences of */ /* use of the program. */ /* */ /* Service Web site: */ /* http://www-947.ibm.com/support/entry/portal/Overview/ */ /* */ /* Last update 2014-04-09 */ /*******************************************************************************/ WINDOWS Samples & Tools ============================== Tools ----- IBMiTransfer.exe Windows installer for a program that will transfer files to a CSV format and transfer the column headings, Field Names, or Field Text (Label) values in the first row. The PC file type is limited to CSV but the code page can be specified as ANSI, ASCII, or any other valid code page. CreateHomeDirectories.zip A java tool which uses the java toolbox for iSeries (jt400.jar) to create the home directories that are specified as a part of every user profile. AddInScript.zip A vb script to add the COM-based Excel data transfer add-in to the COM-based add-ins in Excel for the current windows user. Can be combined with the install of the V6R1 and later clients to automate adding the data transfer add-in. Rmtcmdb.zip Sample for unattended remote command. Intended for use with incoming remote command (IRC) and other Window's services. Rxferpcb.zip IBM iSeries Support Center sample for unattended batch data transfers. This sample program wraps the R510 CAE data transfer automation objects. The sample accepts a user ID and password in addition to the transfer request file. Because the prompt mode is set to \"never\" it can be used in unattended environments such as with CAE incoming remote command service (IRC) or the Windows scheduler service. Qaqqini.exe QAQQINI GUI editor Hcheck.zip VB program that scans ODBC SQL trace logs for handle leaks. Also parses out SQL statements, number or prepares/executes, number of errors, and other information. Net400.exe (replaces netdrive.exe) Client Access Network Provider Tool. Based on the Netdrive.exe program from the toolkit, this version routes network drive and printer requests directly to the client access network provider (bypassing most coexistance problems with other providers). Command line format is net400 assign drive: \\host\path [delay time] net400 assign lpt_number \\host\printer [delay time] net400 release drive: [/f] net400 release lpt_number [/f] net400 status [/all] net400 connect \\host Wrtrsamp32.exe 32bit EHNAPPC API test program Convert.zip VB 5.0 application that can insert CR LF to a "flat" PC file at the specified byte count. (Useful for formating files to work with Client Access Data Transfer) FixEOL.exe A 32-bit Windows console application to correct text files which are missing carriage returns (CR) and have only line feed (LF) characters at the end of the PC file records. Client Access (and other) file transfer programs are coded to require both CR and LF characters to mark the end of a text file record. This program will detect if a given input file is missing the CR before the LF. Optionally the program can create a new output file with CR/LF pairs. FixEOL will also report statistics for the input file, the length of the longest line and the total number of lines will be displayed on the screen. Command line format to scan file only is: FixEOL inputfile Command line format to create an output file is: FixEOL inputfile outputfile [/y] /y indicates to overwrite existing output file. Errorlevels returned to the OS are: 0 - indicates the input file is OK 10 - indicates input file is missing CR's 20 - fatal error such as a file wasn't found FixCSV.exe A 32-bit Windows console application to correct text files which are missing a carriage return and line feed following the last row of data. This program may be used to circumvent problems encountered with the Client Access Data Transfer when attempting to transfer CSV (Comma Separated Variable) format files to the AS/400. (If the CSV file is missing the carriage return and line feed after the last row of data, Data Transfer will not transfer the data. Some PC spreadsheet applications generate CSV files without the final carriage return and line feed.) FindNull.exe Scans a PC file for embedded Nulls, locates the nulls and optionally replaces them with the specified character. (Useful for cleaning up PC files for use with Client Access Data Transfer) VbHllapi.zip Contains a setup program to install the hllapi API test program. This is a "compiled" version of the vb sample program distributed in the Client Access toolkit. Use this file if you need to run the test program on a customer system and they do not have Visual Basic. Ffd2dds.exe DOS program that creates DDS source based on on the output of a DSPFFD command. NlTest.exe Program that retrieves PC DOS and ANSI code pages, default job CCSID, language of Client Access. Used to verify code pages if translation problems are encountered. NetSvrEdit.zip A Win32 console application that utilizes Client Access Express API's and remote command calls to stop and start Netserver, change server name and guest profile, and create new file shares. Includes C source that shows how to call the Netserver apis with CA APIs. DspDsn.bat A batch program to display all of the keywords and values that are saved in a data source. This is a batch file program for use in Windows and it relies on the REG program shipped with windows to display registry settings. This is preferable to having someone use the regedit tool which could be used to damage the registry. Run the command from a windows command prompt to see the syntax information. CleanNames.zip Java toolbox utility to remove files and directories from the integrated file system (IFS) that have invalid names which prevents them from being removed by other means. Splfodbc.zip CL programs to show how to retrieve the spooled files generated by ODBC (QZDASOINIT) jobs and call them through a stored procedure. cwbodtrc.dll ODBC tracing DLL ASP Samples ----------- X3TierSamp.zip Updated version of the samples from the Client Access express IIS web page. This sample adds a default page that allows you to specify session level userid/pwd and system name. The two sample pages were modified to print session variables to aid in debug. Janet2.asp ASP sample showing how to use the dataqueue automation objects in an asp script. RdsRedbook.zip This is the vb project for the "business" object referred to in the Client Access OLE DB redbook (SG24-5183). The business object is a VB ActiveX dll whose methods are marshaled over to a IE 4.0 or IE 5.0 browser via RDS. It does not use HTTP protocol. C - Samples ----------- Dvapisp4.zip An updated version of the R510 toolbox cwbdb api sample. This version includes examples of using the lob locator APIs to read and write lob data via locators. CrtRsmp32.zip 32 bit version of EHNAPPC test program found in QIWSTOOL folder. ChllSmp.zip Simple EHLLAPI sample in C. Corrects the 3270 sample that is in the toolkit CdqTest.zip Simple sample program demonstrating data queue api. Cdspsplf.zip Simple console application showing how to use the cwbOBJ APIs to open a spool file in the AFP spool file viewer. Logonusr.zip Simple sample program demonstrating the use of the new cwbSY_LogonUser API. Visual Basic - OLE/OCX/ActiveX Samples ------------------------------ WshXfer.zip Windows Scripting Host example of a batch data transfers. Includes examples for ADO and CAE Data Transfer Automation Objects. VbBlob.zip Visual Basic sample showing how to insert and read blob and clob fields using ADO, Microsoft OLEDB provider for ODBC, and the Client Access Express ODBC driver. VbDqRmtcmd.zip Tuturial/Sample program showing use of the Data Queue and Remote Command Custom Controls and Data Queue automation object. VbDqOcx_v3.zip Sample program showing use of Data Queue Custom Control and automation objects. Includes example of using keyed Data Queue. Also shows how to use the async read. VbDb.zip Sample program demonstrating the use of the Client Access cwbDatabase automation objects. Sample shows how to download an AS/400 DB file as ASCII text and upload an ASCII text file to a DB file. VbRdoTest.zip RDO 1.x Sample showing: - Calling Stored Procedures with input/output parameters - Binding Stored Procedure Result set to data control. Transfer.vbs Visual Basic script using the ActiveX data transfer object to transfer a file. Visual Basic - Direct API Samples --------------------------------- VbKAllobj.zip Express vballobj sample modified to use keyed data queue. Includes a class that returns error message text for the DQ return codes. VbDataq.zip Simple sample demonstrating Data Queue API. VbDqApi.zip More complex example for Data Queue API. How send using SetDataAddr or SetData How to receive: 1) Blocking using SetDataAddr 2) Blocking using SetData 3) Non-blocking using AsyncRead and CheckData VbOdbcT4.zip ODBC api sample in a "How to" format. Examples Includes: Calling system commands, Stored Procedure Result Set(s), Stored Procedure calls, Block inserts, Insert binary data, PutData api, parameterized queries, Binding Result Data, Updating by cursor posistion. VbOdbct4_Setup.zip Setup program for sample above (includes all OCX). VbRtrSmp32.zip EHNAPPC API sample program. A 32bit version of the 16 bit sample in QIWSTOOL. VbCwbCoTst.zip Communication API sample including the System List box OCX, and several apis. VbCwbSyTst.zip Security API (cwbSY) sample program. Includes the new cwbSY_LogonUser API. VbCwbNL.zip National Language API sample showing how to convert strings ASCII/ANSI to/from EBCDIC. Visual Basic - API Declares --------------------------- The CD ROM included with the Client Access for Windows 95/NT API reference included .bas files with the Visual Basic API declares. These files contained multiple errors. The following corrected files are included on the ftp site in a file VbCwbDeclares.zip: cwb.bas No changes cwbco.bas Communications APIs cwbdq.bas Data Queue APIs cwbnlcnv.bas National Language APIs (EBCDIC/ASCII conversion) cwbOBJ.bas Object APIs cwbrc.bas Remote Command Distributed Program Call APIs cwbsv.bas Service APIs cwbsy.bas Security APIs n/a Ehnappc api declares are included in vbRtrSmp32.zip. The Client Access Express product added additional API's. The .bas files have been updated to include these changes. The following files are available on this ftp site in a file VbExpressDeclares.zip: cwb.bas cwbad.bas cwbco.bas cwbcosys.bas cwbdq.bas cwbnlcnv.bas cwbobj.bas cwbrc.bas cwbsy.bas cwbsv.bas Java Toolbox Samples -------------------- NetSvrCfg.zip Example of calling Netserver APIs from java Ftppf.zip Example using the AS400FTP class to transfer a physical file member to a stream file. WINDOWS 3.1 Samples & Tools =========================== Tools ----- RtrSmp16.exe 16bit EHNAPPC API test program Dqtoolw.exe 16 bit Data Queue API test program Ffd2dds.exe See DOS tools below C - Samples ----------- RtrSmp16.zip 16 bit version of EHNAPPC test program found in QIWSTOOL folder, updated for MSVC. Dqtoolw.zip MSVC 2.x Source and make file for data queue api test program. P5xk1Sdk.zip The PC5250 SDK for ehllapi, pcsapi, and dde. OS/400 Samples and Tools ======================== Deletedir.savf A V5R3 and later save file containing a program which can be used to delete directories the root of the IFS with invalid names. The program uses the QlgRmdir to remove the directory. FileExit.mbr File Server exit program example in C. The program includes an example of converting the unicode file name (CCSID 61952) to US EBCDIC (CCSID 037). GetIPAddrS.savf CL program and command to display the IPv4 address of the client connected to an active server job. Ifstool.savf AS/400 R450 savf with executable and source for: DELTREE Delete a directory & all subdirectories and files in it. DEL Recursive delete by pattern match such as *.eml. CHGAUTALL Runs CHGAUT on all files in a directory and all directories and files in subdirectories under it. CHGOWNALL Similar to CHGAUTALL but uses CHGOWN command. ATTRIB Set/clear all PC attributes of an IFS file or directory similar to the DOS ATTRIB command. \S option will accept a directory name and apply changes to all directories and files in that directory. QRYIFSLIB Dump information such as file size, owner, group, etc to outfile and sum directory size. RNMIFSF Rename an invalid file or directory name. DLTIFSF Delete a file from the IFS containing invalid characters. DSPLINK Display the actual location a symbolic link references. CHGCCISD Change CCSID on one file or all files in a directory. CMDALL Runs specified command on all files in a directory and all directories and files in subdirectories under it. Any command that has the OBJ parameter can be used. IfstoolR440.savf Same as above but for V4R4 systems. IpExitPgm.mbr CL exit program example that uses QUSRJOBI to retrieve the IPv4 address of the client making the connection to the i. It logs this and other job information into a flat log file. Lstcurusr.mbr CL Program demonstrating how to retrieve the current user profile for a host server prestart job. The sample will list either ALL ODBC jobs and their current user or only active ODBC jobs for a specific user profile depending on the input parameter. NetServer2.mbr Example of listing netserver shares from a CL program. NetXfer.mbr CL Program source demonstrating the use of the QNTC file system and the CPYTOIMPF command as an alternative to an automated data transfer. Transfers a database file to a PC file format with character and numeric conversions performed without the use of Client Access or an equivalent product. See Support Line Knowledge Base article 21115031 for more information. Qadmpgms.savf Programs to enable users to reset their own profiles. See knowledge base article 336511131 for more information. It is available here: http://tinyurl.com/4dxx7fy Qlowsavf.savf A tool to list all objects owned for a user profile. See knowledge base article 26773859 for more information. It is available here: http://tinyurl.com/4lskcf4 Qlpasavf.savf List Private Authorities tool. See support document 25634809. Qtempstg.savf A tool to to check the amount of temporary storage for all batch jobs or all interactive jobs. Refer to registered knowledge base document 331432235 for more information. Rstnetusrf.savf A CL program and command to create the RSTNETUSR command which can be used to re-enable a user profile which has become disabled for NetServer use. Rtvipadr.zip A C program to retrieve the IP address of the remote system that has a socket connection with the iSeries. This program must be called from within the job that has the socket connection. This can be done easily in an exit program. The zip file also contains an example exit program written in CL which uses the RTVIPADR program. The source code and a readme file are included also. Rtvipad.savf The C program to retrieve the IP address that a job is connected to. This is included in the Rtvipadr.zip example as well. Runrmtcmdd.zip AS/400 CMD object with *DFT option to route RUNRMTCMD to the PC that started the emulation session. ILE C program that shows how to retrieve the APPC device associated with the emulation session or IP address of the telnet session (R320, R370, and R410 only). Smbcmd.savf AS/400 save file containing programs and source code for an AS/400 menu interface for the AS/400 NetServer (R420 and above only) smbsavf.savf Source members for a program documented in Technote N1010645 to monitor for disabled NetServer user IDs and re-enable them. TracePrograms.zip CL programs and commands to start and stop multiple traces using the TRCCNN and TRCINT tools. Includes a readme file with more detailed instructions for use. VirusExit.savf Example of a file server exit program that can block the copy or creation of a file with a particular extension (like eml). Note: An exit cannot block a rename to a particular extension. OS/400 Misc. ============ R440sqlpkg.savf These are binary save files of the two SQL Packages R450sqlpkg.savf which the system needs in order to create other SQL R510sqlpkg.savf packages. They are release specific as implied by R520sqlpkg.savf the names. To restore these objects, download the R530sqlpkg.savf save file from this server to your computer, create R540sqlpkg.savf a save file on your iSeries server and using ftp in R610sqlpkg.savf binary mode, put the downloaded file to the save file. R710sqlpkg.savf Then simply restore the objects using the RSTOBJ command. .NET Samples ============ VbAllObj.NET.zip vbAllObj Visual Basic sample converted to .NET format. Uses COM Compatibility layer. VbDataQ.Net.zip Application written in VB.Net which makes use of the cwbx automation object to create and manipulate data queues as well as retrieve a list of configured systems from the client PC. Note that the interop DLL shipped with this zip file is created using the V5R3 iSeries Access client. The program will likely need to be recompiled in order to work with a different iSeries Access for Windows version. TransferToXML.zip Uses cwbx COM object and IBM DB2 UDB for iSeries .Net provider. Includes executable and source.