AS/400 HELP
"CRTCSVF"
Copy an AS/400 database file to a PC .CSV file for use in Spreadsheet programs
like EXCEL
Written By Hideyuki Yahagi (see LICENSE file in library CSV)


This copy was
compiled at V5r1
In the AS/400
print screen I’m creating the .CSV file
in /QDLS/DOWNLOAD
I previously
created the folder /DOWNLOAD (in QDLS).
Use the command WRKLNK to view all FILES/FOLDERS. You can create the file anywhere you want in
the IFS but if you want to E-MAIL this file using SNDDST you must send the file
from a folder in QDLS. (see note1 below)
PC INSTRUCTIONS:
Download "CSV” to your PC.
Go to a DOS session and enter the following;
FTP SYSTEM (system = your AS/400’s
name or IP address)
Enter a valid user id and password
CD QGPL
LCD C:\DIRECTORY (directory= the directory on your pc where you
downloaded “ CSV.savf”
QUOTE
SITE NAMEFMT 1
BIN
PUT
CSV.SAVF
QUOTE RCMD
RSTLIB SAVLIB(CSV) DEV(*SAVF) SAVF(QGPL/CSV)
Note: If there is a security problem restoring all
objects with the command above, sign on
to your as/400 as Qsecofr and run RSTLIB
from the command line.
AS/400
INSTRUCTIONS:
To create a .CSV
file
ADDLIBLE CSV
CRTCSVF
NOTE: If you need to recompile CRTCSVFRPG Use the command STRREXPRC
SRCMBR(MAKE) SRCFILE(CSV/SOURCE)
NOTE1. We use Microsoft Exchange for our e-mail. For certain applications I embedded CRTCSVF
and SNDDST in the CL programs
and we can send .CSV files
anywhere in the world via E-mail. You must configure SMTP on your AS/400 (not difficult) and make your E-Mail server
forward outgoing mail.
NOTE2. You may have permission problems
with different users replacing the same
.CSV file. Without getting into
security/authority concepts you can simply add the ERASE command to delete the .CSV in your CL program.
NOTE3. RPG program CRTCSVFRPG was (slightly)
modified to include the API formats instead of the /copy command from library
QSYSINC.