|
Everyone? <vbg>
-Bob Cozzi
www.i5PodCast.com
Ask your manager to watch i5 TV
-----Original Message-----
From: rpg400-l-bounces+bob=rpgworld.com@xxxxxxxxxxxx
[mailto:rpg400-l-bounces+bob=rpgworld.com@xxxxxxxxxxxx] On Behalf Of Glenn
Gundermann
Sent: Friday, May 25, 2007 12:52 PM
To: RPG programming on the AS400 / iSeries
Subject: RE: CSV - how to keep leading zeros and alignment problems
Thank you everyone for all your advice and assistance!!
Yes, =("025") did work for me. I inadvertently surrounded it with quotes
at first "=("025")", which of course didn't work. I am using the Quote
Function =() for all my character fields so the numeric data will be left
justified. I have solved the two initial problems I had asked.
Thanks again!
Glenn Gundermann
ggundermann@xxxxxx
(647) 272-3295
> I though you said your numbers were being generated like this:
>
> =("025"),"70010060622","70300457","5507","CO ABC"
> =("025"),"70010060620","70300412","MELANIE","CO DEF"
>
>
> As a result of =("025") I get 025 in cell A in Excel.
>
> -Bob Cozzi
> www.i5PodCast.com
> Ask your manager to watch i5 TV
>
>
>
> -----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
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
--
This is the RPG programming on the AS400 / iSeries (RPG400-L) mailing list
To post a message email: RPG400-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/rpg400-l
or email: RPG400-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at http://archive.midrange.com/rpg400-l.
As an Amazon Associate we earn from qualifying purchases.
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.