I have an IFS file which was originally 9,544 characters long, ending
with an ASCII CRLF. Space allocated is 16,384. After some processing, it
has length 32,256, allocated space 65,536. The original contents were
modified, using 1 less character, so the desired length is now 9,543.
The CCSID coming in is 1252, coming out it is 5348 (1252 with euro - not
sure why, but it's probably not important in this case - this is on a
V5R4 box, by the way).
The remainder of the 32,256 is nulls (x'00'). I need to get a file with
the new length, without the extra nulls. To be fully open here, I want
to avoid using the IFS APIs - I have a reason that is not germane to
I have tried a couple things in QShell - head -n 1 seems to work by
redirecting to another file. Trouble is, it copies the data as CCSID 37,
removes the ASCII CRLF and appends an EBCDIC LF.
So I looked at strip - that works well with strip -b 9543 [filename]
[prefix] - trouble is, it creates 4 files in this case. The first one is
just right, CCSID is correct, it's the exact contents I need. So the
others need only be deleted. Still, not the most elegant solution.
I have another possibility I will be testing today after lunch, which
may make any QShell usage unnecessary.
Still, I want to know more about this. Oh, yeah, I looked at tr
(translate) and wondered about sed (stream editor).
This mailing list archive is Copyright 1997-2019 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