I like the Kevin way using SED ... but you can get your CSV using only SQL
... through some great Niels Liesberg's procedures and some new lines of
code ...

I just added a new FAQ to Blog.Faq400.com website, take a look here:

iDB2-FAQ-032 – Create CSV with SQL (with “Leading Zeros” for decimal
numbers from -1 to +1)
<https://blog.faq400.com/en/db2-for-i/sql-db2fori-faq-howtos-part-4-yl/>

HTH




Il giorno mer 3 giu 2020 alle ore 20:11 Kevin Bucknum <
Kevin@xxxxxxxxxxxxxxxxxxx> ha scritto:

That is only available in *FIXED. I ended up having to run mine through
sed to get the results I wanted. From a cleanup cl.

CHGVAR VAR(&FILE2) VALUE('/temp/mds30gl.work1')
CPY OBJ(&FILE) TOOBJ('/temp/mds30gl.work1') +
FROMCCSID(37) TOCCSID(819) DTAFMT(*TEXT) +
REPLACE(*YES)
STRQSH CMD('/usr/bin/touch -C 819 /temp/mds30gl.work')
CHGVAR VAR(&CMD) VALUE('sed -e ''s/\" \"//g'' ' +
*BCAT &FILE2 *BCAT '| sed -e +
''s/,\./,0\./g'' | tr -d ''\r'' > +
/temp/mds30gl.work')
STRQSH CMD(&CMD)
RMVLNK OBJLNK(&FILE)
MOV OBJ('/temp/mds30gl.work') TOOBJ(&FILE)

The part that does what you want is this:
sed -e 's/,\./,0\./g'

Thats everywhere it finds ,. replace it with ,0.
On Wed, 2020-06-03 at 17:57 +0000, Mark Waterbury wrote:

Gio,


Type CPYTOIMPF and press F4=Prompt to "prompt" the CPYTOIMPF command.
When the prompt panel appears, press F9 to see the additional parameters.
Press F11 to see the keywords. Page down to see all of the parameters.


Place the cursor in each input parameter field and press F1=Help to learn
more about each option available.


Look for the NUMFLDPAD parameter. It defaults to "*NONE". You can
change this to specify "*ZERO" -- I think that will give you want you are
after.


Hope that helps,


Mark S. Waterbury


> On Wednesday, June 3, 2020, 1:24:50 PM EDT, gio.cot via MIDRANGE-L <

<mailto:midrange-l@xxxxxxxxxxxxxxxxxx>

midrange-l@xxxxxxxxxxxxxxxxxx

wrote:


Hi all


When i run CPYTOIMPF, i would need to not remove the zeros before the

decimal ;


i.e. for a number like 0.12 i would need 0.12 and not .12.


how can solve this ?


thanks in advance


Gio





[https://www.medtronsoftware.com/img/MedtronMinilogo.bmp] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Local: 985-893-2550
Toll Free: 877-893-2550
https://www.medtronsoftware.com



CONFIDENTIALITY NOTICE

This document and any accompanying this email transmission contain
confidential information, belonging to the sender that is legally
privileged. This information is intended only for the use of the
individual or entity named above. The authorized recipient of this
information is prohibited from disclosing this information to any other
party and is required to destroy the information after its stated need has
been fulfilled. If you are not the intended recipient, or the employee of
agent responsible to deliver it to the intended recipient, you are hereby
notified that any disclosure, copying, distribution or action taken in
reliance on the contents of these documents is STRICTLY PROHIBITED. If you
have received this email in error, please notify the sender immediately to
arrange for return or destruction of these documents.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit: https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at https://archive.midrange.com/midrange-l.

Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link: https://amazon.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.