How to convert characters to numeric in CSV file?

330 pts.
Tags:
AS/400
RPG
Roy wrote the editors of Search400.com recently, looking for help with a CSV file. He said: "I'm using CRTCSVF to create a csv file. My problem is that my customer number is alphanumeric, but they want it to be numeric (without the quotes) in the CSV file and with the leading zeros intact. "Is there a way to convert character to numeric without suppressing the zeros?" -- Michelle Davidson, editor, Search400.com
ASKED: September 26, 2005  9:58 AM
UPDATED: November 14, 2009  1:05 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

Check out website RPGIV.com Bob Cozzi has an example

Discuss This Question: 1  Reply

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • TomLiotta
    Best way is not to use CRTCSVF (whatever that is), but rather do it yourself. If you're comfortable with Qshell, you might use the db2 utility to string character fields and numeric fields that you convert to characters together, separated by commas and with whatever quotes you might want wherever you might them. Pipe the output through sed to strip out any heading lines and redirect the outputput to a .CSV file. You can include leading zeros when you want, or drop them from anywhere. You can do anything that SQL can do to any column. Tom
    125,585 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following