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



Have you tried to copy the contents of the cdv-file into a PF with CPYFRMIMPF?

Because I wanted it in a PF to process in an RPG program using embedded SQL, this was for me the quickest way to achieve it.

With CCSID 1208 I got the correct values in the PF, with the original one (1252) not.

Just another approach.

Kind regards,

Carel Teijgeler


Op 19-6-2018 om 21:12 schreef Soucy, Michael:
Why would 1208 produce a conversion error?
I'm not sure. I'm very confused by all of this.

Is the data not properly encoded for 1208?
I'm not sure. All I know is when I export the report from ADP, and save it to the IFS it comes out as character set 1252. That seems to be the only character set that the program likes.

Or, is the program not written to handle conversions properly?
You are referring to something that I wrote.
Yes, I am using this utility you wrote, running on V7R1 (We will be upgrading soon).

https://www.scottklement.com/csv/

Can you tell me which utility this is, and what the code looks like?
This is my RPG program that I'm testing with.

H DFTACTGRP(*NO) ACTGRP('KLEMENT') BNDDIR('CSV')
/copy CSV_H
D empno s 6a varying
D liccode s 10a varying
D licdesc s 40a varying
D licenseid s 20a varying
D licapldate s 10a varying
D liceffdate s 10a varying
D licexpdate s 10a varying
D prilicind s 1a varying
D csvfile s like(CSV_HANDLE)
D fc s 10i 0
D fld s 132a varying
D prt ds 132
/free
csvfile = csv_open('/mike/Professional Licenses.csv');
dow csv_loadrec(csvfile);
CSV_getfld(csvfile : empno : %size(empno));
CSV_getfld(csvfile : liccode : %size(liccode));
CSV_getfld(csvfile : licdesc : %size(licdesc));
CSV_getfld(csvfile : licenseid : %size(licenseid));
CSV_getfld(csvfile : licapldate : %size(licapldate));
CSV_getfld(csvfile : liceffdate : %size(liceffdate));
CSV_getfld(csvfile : licexpdate : %size(licexpdate));
CSV_getfld(csvfile : prilicind : %size(prilicind));
enddo;
csv_close(csvfile);
*inlr = *on;
/end-free

I have written many things that could be called "CSV utilities", and if the problem is the way my code is opening the file, I'd need to to see the specific code in order to comment on how it can be fixed.
Of course, if you got it from me, you undoubtedly have the source code and could also fix it yourself.  But, I'd be glad to give my thoughts, if I understood which tool we were working with.
The program crashes on the csv_open command when I change the character type.

Thank you,
Mike


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.