Converting to .txt

45 pts.
Tags:
AS/400
AS/400 database
AS/400 Database File
AS/400 Database to Text File
Hello All, I'm trying to convert an AS400 database file to a .txt with pipe delimeter and I want to make the .txt file name a batch number. 0012345.txt Any help is greatly appreciated.
ASKED: December 8, 2008  2:45 PM
UPDATED: December 8, 2008  3:28 PM

Answer Wiki

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

Hi,

The following command should do what you want :-

CPYTOIMPF FROMFILE(YOURLIB/YOURFILE)
TOSTMF(‘/YOURFOLDER/0012345.TXT’)
MBROPT(*REPLACE)
STMFCODPAG(*STDASCII)
RMVBLANK(*BOTH)
FLDDLM(‘|’)

You can replace the TOSTMF parameter with a variable in a CL program if you need to be able to create batches with sequence numbers.

Regards,

Martin Gilbert.

Discuss This Question:  

 
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

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