CHGVAR VAR(&OUTPATH) VALUE('/HOME/XXXXXX/OUTBOUND/' || +
&BATCHOUT) |< '.TXT')
|< is the same as *TCAT (Truncate and concatenate)
I prefer to use *CAT *BCAT and *TCAT for readability (for me anyway).
-----Original Message-----
From: MIDRANGE-L [mailto:midrange-l-bounces@xxxxxxxxxxxxxxxxxx] On Behalf Of Rob Berendt
Sent: Tuesday, August 31, 2021 4:49 PM
To: Midrange Systems Technical Discussion <midrange-l@xxxxxxxxxxxxxxxxxx>
Subject: RE: Using %TRIM in CL
Can you do it this way?
CHGVAR VAR(&OUTPATH) VALUE('/HOME/XXXXXX/OUTBOUND/' || +
%trim(&BATCHOUT) || '.TXT')
Rob Berendt
--
IBM Certified System Administrator - IBM i 6.1 Group Dekko Dept 1600 Mail to: 7310 Innovation Blvd, Suite 104
Ft. Wayne, IN 46818
Ship to: 7310 Innovation Blvd, Dock 9C
Ft. Wayne, IN 46818
http://www.dekko.com
-----Original Message-----
From: MIDRANGE-L <midrange-l-bounces@xxxxxxxxxxxxxxxxxx> On Behalf Of Howie, Bill
Sent: Tuesday, August 31, 2021 4:46 PM
To: midrange-l@xxxxxxxxxxxxxxxxxx
Subject: Using %TRIM in CL
CAUTION: This email originated from outside of the organization. Do not click links or open attachments unless you recognize the sender and know the content is safe.
Hello all,
I'm having a bit of trouble using the %TRIM function in a CL statement. Here's what I have:
CHGVAR VAR(&BATCHOUT) VALUE(%TRIM(&BATCHNAME))
CHGVAR VAR(&OUTPATH) VALUE('/HOME/XXXXXX/OUTBOUND/' || +
&BATCHOUT || '.TXT')
Both the BATCHOUT and BATCHNAME variables are character fields, 20 positions long. I was originally trying to do this with just the BATCHNAME variable alone, but that wasn't working, so I thought I'd try moving the trimmed value to a new variable, and that didn't work either. I'm basically trying to format a file name for the IFS dynamically. The value of the &BATCHNAME variable at the beginning of this is 'HCC-354' followed by 13 spaces. So right now the result of this looks like this: /HOME/XXXXXX/OUTBOUND/HCC-354 .TXT
Is there a trick to using %TRIM in CL that I'm not aware of? All info is, as always, much appreciated.
[Related image]<
https://www.hc-companies.com/>Bill Howie
Senior ERP Programmer/Analyst
Direct: 330.487.3739 | Cell: 330.888.8085 | Toll Free: 800.225.7712
2450 Edison Blvd, Suite 3, Twinsburg OH 44087
hc-companies.com<
https://www.hc-companies.com/>
Leader in Horticultural Containers
[cid:image003.png@01D79E86.A330A740]<
https://www.linkedin.com/company/the-hc-companies> [cid:image004.png@01D79E86.A330A740] <
https://www.facebook.com/HCCompanies/> [cid:image005.png@01D79E86.A330A740] <
https://www.instagram.com/hccompanies/> [cid:image006.png@01D79E86.A330A740] <
https://twitter.com/hc_companies>
Disclaimer
The information contained in this communication from the sender is confidential. It is intended solely for use by the recipient and others authorized to receive it. If you are not the recipient, you are hereby notified that any disclosure, copying, distribution or taking action in relation of the contents of this information is strictly prohibited and may be unlawful.
This email has been scanned for viruses and malware, and may have been automatically archived by Mimecast Ltd, an innovator in Software as a Service (SaaS) for business. Providing a safer and more useful place for your human generated data. Specializing in; Security, archiving and compliance. To find out more visit the Mimecast website.
--
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.
Help support midrange.com by shopping at amazon.com with our affiliate link:
https://amazon.midrange.com
As an Amazon Associate we earn from qualifying purchases.