"truncate" was my first thought but, from what I can see, it doesn't exist in PASE.
A combination of "wc -m" and "head" to cat all but the last character out to another file could be cobbled together.
Personally, I'd just put together an RPG version of truncate, frontend it with a command and use that.
Roger Harman
COMMON Certified Application Developer - ILE RPG on IBM i on Power
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of cesco via MIDRANGE-L
Sent: Thursday, November 13, 2025 4:35 AM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Cc: cesco <emaxt6@xxxxxxxxx>
Subject: Re: creating ifs fixed length text file with unusual requirement
well.... for a quick fix you can PASE your way out with a shell "truncate -1" to remove last byte...but man, ain't ugly eh?, close your eyes while doing it
btw in the RFC for CSV the last one is specified as optional, so a receiving parser should be obliged to recon..
On Wednesday, November 12, 2025 at 04:43:52 PM GMT+1, Jim Franz <franz9000@xxxxxxxxx> wrote:
Creating fixed length (801) ascii txt file with LF in 802 but requiring
last row to have no LF.
This is not a written requirement but their workaround after state
government agency I'll not name implemented a new web portal (old portal
upload worked for 10+ years, New portal breaks as its failing looking for
next record that does not exist.
I'm only assisting to fix issue.
File created CPYTOSTMF UTF-8 and rows added with CPYTOIMPF
I could build a RPGLE pgm to remove last row LF, but is there a script way
of doing this that can execute from clle? Not too familiar with script
except sftp processing. V7R5
Thx
Jim Franz...
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
--
This is the Midrange Systems Technical Discussion (MIDRANGE-L) mailing list
To post a message email: MIDRANGE-L@xxxxxxxxxxxxxxxxxx
To subscribe, unsubscribe, or change list options,
visit:
https://lists.midrange.com/mailman/listinfo/midrange-l
or email: MIDRANGE-L-request@xxxxxxxxxxxxxxxxxx
Before posting, please take a moment to review the archives
at
https://archive.midrange.com/midrange-l.
Please contact support@xxxxxxxxxxxxxxxxxxxx for any subscription related questions.
As an Amazon Associate we earn from qualifying purchases.