× 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.



The cell comes up with '025
If I press F2 to edit it and press Enter without changes, the apostrophe
goes away and it looks great.

Like Rick said, I'm probably SOL.
I'm wondering how long it will take for me to do this with POI having
never used it before.

Tks,

Glenn Gundermann
ggundermann@xxxxxx
(647) 272-3295

Add a single quote before the zero "'025" see if that works


Thanks,
Tommy Holden


-----Original Message-----
From: rpg400-l-bounces@xxxxxxxxxxxx
[mailto:rpg400-l-bounces@xxxxxxxxxxxx] On Behalf Of Glenn Gundermann
Sent: Thursday, May 24, 2007 1:22 PM
To: RPG programming on the AS400 / iSeries
Subject: Re: CSV - how to keep leading zeros and alignment problems

Seeing that I'm creating a csv file, every field is already surrounded
by
double quotes.
Here's a sample of the first five columns:
"025","70010060622","70300457","5507","CO ABC"
"025","70010060620","70300412","MELANIE","CO DEF"

When opening the csv file in Excel, I get:

STATUS PICK TICKET ACCOUNT PO SHIP TO
25 70010060622 70300457 5507 CO ABC
25 70010060620 70300412 MELANIE CO DEF

So you can see I'm missing the leading 0 in the status column, and
the alignment is off for the PO column.

Tks,

Glenn Gundermann
ggundermann@xxxxxx
(647) 272-3295

Booth Martin wrote:
Surround the field with double quotes.

C eval wString = %trim(wString) + ',"' + %editc(Number:
'X') + '"'


Glenn Gundermann wrote:
Hi Everyone,

I haven't ventured into the POI world yet so I'm using RPG to create
a
.csv file in the IFS using the unix APIs like open(), write(), etc.

I can't figure out how to keep leading zeros for a numeric field.

An old article of Bob Cozzi in MC Press said to use the quote
function,
e.g. =("001") but I get =(001")" in my column. Perhaps the quote
function
will only work for people using CPYTOIMPF.

I've tried putting in an apostrophe in the front. I get '001 in my
cell
instead of 001.

Secondly, I have a column (P.O. #) that should be character but the
data
sometimes is numeric. The character data is left-justified and the
numeric data is right-justified.

Any help would be most appreciated.

Tks,

Glenn Gundermann
ggundermann@xxxxxx
(647) 272-3295

As an Amazon Associate we earn from qualifying purchases.

This thread ...

Follow-Ups:
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.