Data range input



IBM's Command List programming language & Restructured Extended Executor

Data range input

Postby pcs2smf » Thu Mar 18, 2010 6:18 pm

I've been asked to modify a routine that reads in a set of acceptable return codes like:
PARSE UPPER VAR CCS CC1 CC2 CC3 CC4 CC5 CC6 CC7 CC8 CC9 CC10
the modification should be able to read a range of data to extend the input say from
0,4,8,50,60,70,80,90,92,95
to
0,4,8,50,60-70,80,90,92,95
anyone have any ideas?
pcs2smf
 
Posts: 7
Joined: Wed Aug 12, 2009 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Data range input

Postby enrico-sorichetti » Fri Mar 19, 2010 1:08 pm

we might have if You had cared to explain better the requirement
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Data range input

Postby pcs2smf » Fri Mar 19, 2010 5:17 pm

The parse statement reads a string of numbers on a line - theres only rom for 10 numbers as there are 3 other fields. So in order to add more customer would like to add a range. This is an audit routine reading acceptable return codes. Probably a poor setup but thats what I'm stuck with. The 60-70 would then be CC11 CC12 ..... CC21 and this would have no limit. Any help would be appreciated.
pcs2smf
 
Posts: 7
Joined: Wed Aug 12, 2009 5:17 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Data range input

Postby enrico-sorichetti » Fri Mar 19, 2010 5:39 pm

the explanation keeps getting more confused!
the parse instruction as written will assign to the specified variables the blank separated substrings
it will not care about the content

fr = "01 02 04-09 14 19"
parce var fr a b c d e

will result in
a = "01"
b = "02"
c = "04-09"
d = "14"
e = "19"

nothing more, nothing less
then You will have to decide the format of a range token
and analyze each substring for it

if You really want some help learn to explain better Your requisites
cheers
enrico
When I tell somebody to RTFM or STFW I usually have the page open in another tab/window of my browser,
so that I am sure that the information requested can be reached with a very small effort
enrico-sorichetti
Global moderator
 
Posts: 2994
Joined: Fri Apr 18, 2008 11:25 pm
Has thanked: 0 time
Been thanked: 164 times

Re: Data range input

Postby dick scherrer » Sat Mar 20, 2010 12:03 am

Hello,

You might consider changing the code to accept a range in every CCn. If only 1 value is provided, the range starts and ends with that value. If 2 values are provided, they are the start and end. . . The user might not ever use this, but i believe it would be easier to support one set of code rather than multiple. . .
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post