Accessing abc.csv AS/400 files

350 pts.
Tags:
AS/400
AS/400 CSV
CSV
CSV file format
how to access abc.csv files in as400.i have a abc.csv file,in this file have contain some data but i want to access into my physical file,with out using 3rd party tool.pls give advice

Software/Hardware used:
software

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    There are two general ways to use the .CVS data. You can convert (copy) it into a database format and access the resulting data in the database file. Or you can use the open(), read() and close() Unix APIs to read lines directly from the .CVS file into RPG or other HLL program. At V5R4 and later, it's fairly easy even in ILE CL. To convert to a database format, create a physical file with fields that match the columns in the .CVS file. Generally, you only need to match data types. That is, if you have a column in the .CVS that holds a FirstName of a person, you don't need to count how many characters are in the column -- just create a character field in your file that is big enough to hold any first name. You can use DDS to create a PF or SQL to CREATE TABLE. Once you have a file that can receive the values, use the CPYFRMIMPF command to run the conversion. Alternatively, you can create a PF with a single large character field, big enough to hold the longest line in the .CVS file. Use CPYFRMSTMF to copy the lines into the flat PF and then read the lines in RPG record by record. You still need to write instructions to parse through those lines to break out each data value, so the CPYFRMIMPF method can be easier unless non-standard formatting is used. If you need to go with the Unix APIs, you should consider coding in C. There are alternative C library functions -- fopen(), fgets() and fclose() -- that make a lot of logic easier. It's possible to kind of use those in other ILE languages, but you need to decipher the macros to track down what really gets called by those library functions and what their parms are, and then call those actual APIs in your RPG (or CL or whatever). Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following