× The internal search function is temporarily non-functional. The current search engine is no longer viable and we are researching alternatives.
As a stop gap measure, we are using Google's custom search engine service.
If you know of an easy to use, open source, search engine ... please contact support@midrange.com.


  • Subject: Re: CSV file creation
  • From: "Jim Franz" <jfranz@xxxxxxxxxxxx>
  • Date: Sun, 17 Dec 2000 12:23:00 -0500

the following cmd will take a native file and write a flat file with the
commas. The ftp to other system. If the file needs column headings, then
write a "first record" with column headings. Build the "to" file as a flat
file
with record length big enough for your largest record, plus all the
characters. The from file is a normal DDS file. Can't remember if
negative signs work out right (leading or trailing). My files don't
have signed numbers.

  CPYTOIMPF  FROMFILE(&CUST#/NTORQ7 *FIRST) +
               TOFILE(&CUST#/NTORQ7R *FIRST) +
               MBROPT(*REPLACE) RCDDLM(*EOR) +
               DTAFMT(*DLM) STRDLM('"')
The data format *DLM is for delimited.
sample data:
Find . . . . . . .
*...+....1....+....2....+....3....+....4....+....5....+....6....+....7....+.
"FIRM                          ","NOTICE_NO","NOTICE_DT","ORDER_BY
"PAVERMODULE OF FLORIDA INC    ","968990   ","12/10/00 ","THE POOL PEOPLE, I
"PAVERMODULE OF FLORIDA INC    ","979409   ","12/06/00 ","STONE AGE PAVERS,
"PAVERMODULE OF FLORIDA INC    ","983724   ","12/10/00 ","CENTRAL FLORIDA #1
"PAVERMODULE OF FLORIDA INC    ","983775   ","12/08/00 ","THE PAVING STONE #
hope this helps
jim

----- Original Message -----
From: "Saunders, Martin P" <Martin.Saunders@capgemini.co.uk>
To: <RPG400-L@midrange.com>
Sent: Wednesday, December 13, 2000 5:00 AM
Subject: CSV file creation


> I have an RPG program which is currently populating a DB file with data.
> There is a requirement for this data to be sent via ftp to a third party
in
> csv format.
>
> What is the best/easiest way to do this?
>
> Should the RPG program be changed to output to a flat file with comma
> separators or is there another way to convert the DB file to a csv file
> without leaving the 400 since the file will be transferred from the AS/400
> directly?  Would this involve going outside the QSYS file system (I have
> never done this)?
>
> The ftp part won't be a problem as we already ftp flat files to other
third
> parties, but these people are insisting on csv.
>
> Thanks in advance
>
> Martin
> +---
> | This is the RPG/400 Mailing List!
> | To submit a new message, send your mail to RPG400-L@midrange.com.
> | To subscribe to this list send email to RPG400-L-SUB@midrange.com.
> | To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
> | Questions should be directed to the list owner/operator:
david@midrange.com
> +---

+---
| This is the RPG/400 Mailing List!
| To submit a new message, send your mail to RPG400-L@midrange.com.
| To subscribe to this list send email to RPG400-L-SUB@midrange.com.
| To unsubscribe from this list send email to RPG400-L-UNSUB@midrange.com.
| Questions should be directed to the list owner/operator: david@midrange.com
+---

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Replies:

Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].

Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.