Reading string via a REXX



IBM's Command List programming language & Restructured Extended Executor

Reading string via a REXX

Postby arya_starc » Tue Jan 24, 2017 3:15 pm

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|
arya_starc
 
Posts: 109
Joined: Mon Sep 21, 2015 1:39 pm
Has thanked: 4 times
Been thanked: 0 time

Re: Reading string via a REXX

 

Re: Reading string via a REXX

Postby prino » Tue Jan 24, 2017 3:37 pm

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!"?
Robert AH Prins
robert.ah.prins @ the.17+Gb.Google thingy
User avatar
prino
 
Posts: 539
Joined: Wed Mar 11, 2009 12:22 am
Location: Oostende, Belgium
Has thanked: 3 times
Been thanked: 21 times

Re: Reading string via a REXX

Postby willy jensen » Tue Jan 24, 2017 9:24 pm

look up the PARSE and LEFT instructions.
willy jensen
 
Posts: 133
Joined: Thu Mar 10, 2016 5:03 pm
Has thanked: 0 time
Been thanked: 21 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post