Page 1 of 1

Reading string via a REXX

PostPosted: Tue Jan 24, 2017 3:15 pm
by arya_starc
Hi
I am writing one sequential file in which I am writing strings seperated by '|' symbol in the same line.

eg:


jobname|procname1|procname2|procname3|procname4|procname5
ABCDABCD|XYZ|BCF|BHN|MNB|GBH|
EFGHABCD|ZXCEDF|EDFBCF|WSDEBHN|TTREMNB|BH|
MNBHABCD|XYZCVDSA|BCFAA|BHNS|MNBSDFG|GBHTRED|

 

As strings length are different so column wise all strings are in different columns.
So I need to justify the position of strings while writing the string in the sequential file, As I know the maximum length of the string is 20.
LIKE THIS


jobname|procname1|procname2|procname3|procname4|procname5
ABCDABCD|XYZ          |BCF     |BHN         |MNB       |GBH        |
EFGHABCD|ZXCEDF    |EDFBCF|WSDEBHN|TTREMNB|BH          |
MNBHABCD|XYZCVDSA|BCFAA |BHNS       |MNBSDFG|GBHTRED|

Re: Reading string via a REXX

PostPosted: Tue Jan 24, 2017 3:37 pm
by prino
Why would you bother? If there is a clearly defined separator character, then the receiving application should have no trouble parsing the data. Or are you one of those people with a mindset like Bloat is not a technical issue, but verily a way of thinking, a "state of mind". Its cure is a simple refusal to accept, and a well directed, resounding "clean up your act and clean up your code!"?

Re: Reading string via a REXX

PostPosted: Tue Jan 24, 2017 9:24 pm
by willy jensen
look up the PARSE and LEFT instructions.