Touch by default will set the CCSID to be the same as your job. The QSH version of touch has a -C flag that will let you set the CCSID if touch is creating the file. If the file already exists, it won't change the CCSID. Touch from pase doesn't have the -C flag.
From: RPG400-L [mailto:rpg400-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of John Yeung
Sent: Friday, March 22, 2019 11:41 AM
To: RPG programming on IBM i
Subject: Re: Append to IFS File
On Fri, Mar 22, 2019 at 11:59 AM Barbara Morris <bmorris@xxxxxxxxxx> wrote:
CHGATR wouldn't work after using 'cat' since data-loss would have
I didn't realize there *was* data loss. I would have thought `cat` just faithfully reproduces bytes. (Is that Unix thinking when we actually need Unix-style-but-on-IBM-i thinking?)
But it should work to use 'touch' to create the file, CHGATR to set
the CCSID, then 'cat'.
It had been my understanding that `touch`, *from QSH*, sets the CCSID, so you would only need to do CHGATR at all if you purposely needed a different CCSID. And even then, the circumstances would be kind of weird, because CHGATR doesn't actually change bytes *in* the file, just metadata. If all the job/system/whatever CCSIDs are properly set before embarking on this endeavor, I would have thought you shouldn't need CHGATR at all when working from QSH.
This is the RPG programming on IBM i (RPG400-L) mailing list To post a message email: RPG400-L@xxxxxxxxxxxxxxxxxx To subscribe, unsubscribe, or change list options,
or email: RPG400-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives at https://archive.midrange.com/rpg400-l
Please contact support@xxxxxxxxxxxx for any subscription related questions.
Help support midrange.com by shopping at amazon.com with our affiliate link: https://amazon.midrange.com
] Kevin Bucknum
Senior Programmer Analyst
MEDDATA / MEDTRON
120 Innwood Drive
Covington LA 70433
Toll Free: 877-893-2550
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.