Kevin,
Nice catch ... your "work-around" using SED is quite clever.
Perhaps an RFE to request an enhancement to CPYTOIMPF to also support NUMFLDPAD(*ZERO) with DTAFMT(*DLM) may be warranted?
All the best,
Mark S. Waterbury
On Wednesday, June 3, 2020, 2:11:22 PM EDT, Kevin Bucknum <kevin@xxxxxxxxxxxxxxxxxxx> wrote:
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.
As an Amazon Associate we earn from qualifying purchases.