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



Easy to do from Python:

[1]https://github.com/Club-Seiden/python-for-IBM-i-examples/blob/master/non-wheel/dbtocsv/dbtocsv.py

Just change QUOTE_NONNUMERIC to QUOTE_ALL



----- Original message -----
From: Bob Cagle <bcagle@xxxxxxxxxxx>
Sent by: "MIDRANGE-L" <midrange-l-bounces@xxxxxxxxxxxx>
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxx>
Cc:
Subject: RE: Wrap numeric fields in double quotes with CPYTOIMPF?
Date: Fri, Oct 20, 2017 2:46 PM

That's exactly what I was thinking of doing - just create the CSV
programmatically. Just seems like there should be a shortcut!

That would also solve my additional dilemma of them wanting multiple
records from multiple files all in the same CSV file.

Thanks

Bob Cagle
IT Manager
Lynk

>-----Original Message-----
>From: Art Tostaine, Jr.
>
>You can make an intermediate with all alpha fields and CPYF *NOCHK to
it.
>
>If they are packed numeric then you need to write a quick conversion.
>
>I'd just write a program to create the CSV. It's so simple and you
avoid CPYTOIMPF crapping out on you some day.
>
>Read input record or SQL read
>output = %trim(field1) + ',' + %trim(%editc(field2:'Z')) + ','.....
etc.
>write output
>read
>end
>
>Art
>
>On Fri, Oct 20, 2017 at 3:16 PM, Bob Cagle <bcagle@xxxxxxxxxxx> wrote:
>
>> I'm starting to work with a cloud EDI provider and they've asked me
to
>> provide them data in a specific format - a comma separated text file,
>> with each field wrapped in double quotes:
>>
>> "xx", "123" etc...
>>
>> I've been playing with CPYTOIMPF and it's working, except for the
>> numeric fields. I've done some googling and I'm not finding
anything.
>> Is there a way to make CPYTOIMPF wrap numeric fields in double
quotes?
>>
>> Thanks
>>
>> Bob Cagle
>> IT Manager
>> Lynk
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing
list
To post a message email: MIDRANGE-L@xxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
[2]https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_midrange-2Dl&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=2aXRESXNvBGuLbIQEybCPNLc7OK0UqjwsZsoCq7Jz6o&m=jcZL_YFmwA3eNr4KjWdrJNaPcgWqxjgbqKSUMy6mAZw&s=XeFPtJ4bK39G4mE2_yHBAnQF-toSnI5mi3hiXd-oaT8&e=
or email: MIDRANGE-L-request@xxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
[3]https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_midrange-2Dl&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=2aXRESXNvBGuLbIQEybCPNLc7OK0UqjwsZsoCq7Jz6o&m=jcZL_YFmwA3eNr4KjWdrJNaPcgWqxjgbqKSUMy6mAZw&s=MzZnkn4Ip6B_ZUnEvB9_dmk-_6l3b9cUiNKOkeE0e5k&e=.

Please contact support@xxxxxxxxxxxx for any subscription related
questions.

Help support midrange.com by shopping at amazon.com with our affiliate
link:
[4]https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_2dEadiD&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=2aXRESXNvBGuLbIQEybCPNLc7OK0UqjwsZsoCq7Jz6o&m=jcZL_YFmwA3eNr4KjWdrJNaPcgWqxjgbqKSUMy6mAZw&s=UoauWvnEErjEqsNWPg2R8zeIiVtSrzt0sc0FSuH9oFk&e=




References

Visible links
1. https://github.com/Club-Seiden/python-for-IBM-i-examples/blob/master/non-wheel/dbtocsv/dbtocsv.py
2. https://urldefense.proofpoint.com/v2/url?u=https-3A__lists.midrange.com_mailman_listinfo_midrange-2Dl&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=2aXRESXNvBGuLbIQEybCPNLc7OK0UqjwsZsoCq7Jz6o&m=jcZL_YFmwA3eNr4KjWdrJNaPcgWqxjgbqKSUMy6mAZw&s=XeFPtJ4bK39G4mE2_yHBAnQF-toSnI5mi3hiXd-oaT8&e=
3. https://urldefense.proofpoint.com/v2/url?u=https-3A__archive.midrange.com_midrange-2Dl&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=2aXRESXNvBGuLbIQEybCPNLc7OK0UqjwsZsoCq7Jz6o&m=jcZL_YFmwA3eNr4KjWdrJNaPcgWqxjgbqKSUMy6mAZw&s=MzZnkn4Ip6B_ZUnEvB9_dmk-_6l3b9cUiNKOkeE0e5k&e=
4. https://urldefense.proofpoint.com/v2/url?u=http-3A__amzn.to_2dEadiD&d=DwICAg&c=jf_iaSHvJObTbx-siA1ZOg&r=2aXRESXNvBGuLbIQEybCPNLc7OK0UqjwsZsoCq7Jz6o&m=jcZL_YFmwA3eNr4KjWdrJNaPcgWqxjgbqKSUMy6mAZw&s=UoauWvnEErjEqsNWPg2R8zeIiVtSrzt0sc0FSuH9oFk&e=

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.