Re: [CMS-PIPELINES] IF testing characters
Thanks John for this education Kris Buelens, --- VM/VSE consultant, Belgium --- --- Op ma 28 nov. 2022 om 13:45 schreef John P. Hartmann : > On 11/28/22 11:10, Kris Buelens wrote: > > I repeat that #1 (or in France £1) is a counter, so no spaces by > > definition. > > This is no longer the case. > > Counters can now contain non-numeric strings as well as proper numbers. > Perhaps #1 should be called a variable, just as Alain does. > > The initial value of a counter is nothing, which will be either the null > string or zero, depending on to what the counter is coerced in an > expression. > > set #1:="" > > causes the counter to contain a null string, which converts to 0 for > numerics (perhaps it shouldn't). This also applies when assigning a > null value from a column range that is not present in the record. >
Re: [CMS-PIPELINES] IF testing characters
On 11/28/22 11:10, Kris Buelens wrote: I repeat that #1 (or in France £1) is a counter, so no spaces by definition. This is no longer the case. Counters can now contain non-numeric strings as well as proper numbers. Perhaps #1 should be called a variable, just as Alain does. The initial value of a counter is nothing, which will be either the null string or zero, depending on to what the counter is coerced in an expression. set #1:="" causes the counter to contain a null string, which converts to 0 for numerics (perhaps it shouldn't). This also applies when assigning a null value from a column range that is not present in the record.
Re: [CMS-PIPELINES] IF testing characters
On 11/28/22 10:07, Alain Benvéniste wrote: Yes John ^ is the good character. There is something i still don’t understand : If i code If £1==a and a is equal to b3339 b for blank, the if is not honored If I use a If space(£1)==space(a) it works. It could mean that when i do a set £1:=a the blank is removed… ? Resiliency Services on Z Mainframe alain.benveni...@kyndryl.com == is the exactly equal operator. It operates on strings. So (a == " 3339") and (a = 3339) both evaluate to 1 In the numeric example, the string (a) is stripped of blanks and converted successfully to a number for numeric compare. There are a number of quirks with string operands. literal 5|spec a: 1-* 1 if a==5 then ... PIPSPX1086E Improper operand for string expression. It fails because numeric constants are rejected with a string operator (mea culpa). However a string function does not reject a numeric constant: a==strip(5) is processed OK with the result 0 because a has a leading blank, but 5 does not.
Re: [CMS-PIPELINES] IF testing characters
I repeat that #1 (or in France £1) is a counter, so no spaces by definition. I guess that space(#1) converts it to a string and so you can compare to identifier "a", what is a string Kris Buelens, --- VM/VSE consultant, Belgium --- --- Op ma 28 nov. 2022 om 10:07 schreef Alain Benvéniste : > Yes John ^ is the good character. > There is something i still don’t understand : > If i code > If £1==a > and a is equal to b3339 > b for blank, the if is not honored > If I use a > If space(£1)==space(a) it works. > It could mean that when i do a set £1:=a the blank is removed… ? > > Resiliency Services on Z Mainframe > alain.benveni...@kyndryl.com > > > Le 27 nov. 2022 à 14:59, John P. Hartmann a écrit : > > > > On 11/27/22 13:51, a.benveni...@free.fr wrote: > >> Sorry John to come back but, > > > > There is no /== operator in specs. > > > > For me, ^== works as the not exactly equal operator because my terminal > > emulator maps ^ to not; perhaps it works for you too. Otherwise you > > need to find the not character on your terminal, or turn the expression > > around to use ==. > > > > (/= is divide counter by the right-hand expression assignment operator; > > it is not a binary logical operator. See pp 737) >
Re: [CMS-PIPELINES] IF testing characters
Yes John ^ is the good character. There is something i still don’t understand : If i code If £1==a and a is equal to b3339 b for blank, the if is not honored If I use a If space(£1)==space(a) it works. It could mean that when i do a set £1:=a the blank is removed… ? Resiliency Services on Z Mainframe alain.benveni...@kyndryl.com > Le 27 nov. 2022 à 14:59, John P. Hartmann a écrit : > > On 11/27/22 13:51, a.benveni...@free.fr wrote: >> Sorry John to come back but, > > There is no /== operator in specs. > > For me, ^== works as the not exactly equal operator because my terminal > emulator maps ^ to not; perhaps it works for you too. Otherwise you > need to find the not character on your terminal, or turn the expression > around to use ==. > > (/= is divide counter by the right-hand expression assignment operator; > it is not a binary logical operator. See pp 737)
Re: [CMS-PIPELINES] IF testing characters
On 11/27/22 13:51, a.benveni...@free.fr wrote: Sorry John to come back but, There is no /== operator in specs. For me, ^== works as the not exactly equal operator because my terminal emulator maps ^ to not; perhaps it works for you too. Otherwise you need to find the not character on your terminal, or turn the expression around to use ==. (/= is divide counter by the right-hand expression assignment operator; it is not a binary logical operator. See pp 737)
Re: [CMS-PIPELINES] IF testing characters
Sorry John to come back but, With "! SPECs", " a: 54.5 .", " if (£1/==a) then", " set £1:=a", " set £2:=1", " else", " set £2+=1", " endif", and with 6010A or 60102 and by reducing or not my storage from 128M to 16M I receive : FPLYAC1434E Parse error in state 145, unexpected O_EQ at offset 5: "=a) then set £1:=a set £2:=1 else set £2+=1 endif 1-* 1 print £2 picture 9 nextword" FPLMSG003I ... Issued from stage 5 of pipeline 1 FPLMSG001I ... Running "SPECs a: 54.5 . if (£1/==a) then set £1:=" FPLYAC1435I Expecting T_IDLETTER T_NUMBER T_QSTRING T_IDENT T_ID_CHAR T_CTR T_DO T T_DOTDOT T_CTRARRAY S_LP O_PLUS O_NOT F_FIRST F_EOF F_BREAK F_C2D F_C2F F_X2D F_X2F F_STRING F_AVERAGE F_VARIANCE F_NUMBER F_EXACT F_SQRT F_STDDEV F_STDERRMEA N F_TYPE F_A FPLSPE192I ... Scan at position 21; previous data "a: 54.5 . if (£1/==" Ready; T=0.01/0.01 13:39:06 De : CMS/TSO Pipelines Discussion List de la part de John P. Hartmann Date : dimanche, 27 novembre 2022 à 13:07 À : cms-pipeli...@listserv.meduniwien.ac.at Objet : Re: IF testing characters On 11/27/22 12:39, a.benveni...@free.fr wrote: > " if (£1/=a) then", The numerically not equal operator converts both arguments to numbers and then performs a numeric compare. Your compare of 6010A fails because the digit A is not decimal. (Specs has no facility to compare hexadecimal.) Use /== to compare strings for not equal. With the /== operator, numbers are converted to string before the comparison. Conversion to string can fail only if you run out of storage.
Re: [CMS-PIPELINES] IF testing characters
On 11/27/22 12:39, a.benveni...@free.fr wrote: " if (£1/=a) then", The numerically not equal operator converts both arguments to numbers and then performs a numeric compare. Your compare of 6010A fails because the digit A is not decimal. (Specs has no facility to compare hexadecimal.) Use /== to compare strings for not equal. With the /== operator, numbers are converted to string before the comparison. Conversion to string can fail only if you run out of storage.
Re: [CMS-PIPELINES] IF testing characters
Rob, I would pleased to run it ! De : CMS/TSO Pipelines Discussion List de la part de Rob van der Heij Date : dimanche, 27 novembre 2022 à 10:06 À : cms-pipeli...@listserv.meduniwien.ac.at Objet : Re: IF testing characters While this doesn't address your questions about SPEC, I do have a very interesting pipeline that uses almost all options of LOOKUP to go through a User Directory and determine gaps or re-allocate minidisks from one (or all) volumes to new volumes to generate DIRMAINT commands... Rob
Re: [CMS-PIPELINES] IF testing characters
Yes John ! But now, back with a simplified code, [code] "! SPECs", " a: 54.5 .", " if (£1/=a) then", " set £1:=a", " set £2:=1", " else", " set £2+=1", " endif", " 1-* 1", " print £2 picture 9 nextword", "!> $$TEMP$$ $$TEMP$$ A3" a: value can be 60102, 30051 but also 1113. As shown column 90, £2 is not reseted to 1 when £1 is not equal to a: As I understand it, at first record £1 can't be equal because it is not set to anything; at second record £1 is set to the previous value a: and compared to the value a: found in this second record, and it matches. ..+3+4+5+6+7+8+9...> 07-E8 DEVTYPE = 3390-0C CYLS = 601020175-CYT91 SSID = 0309 02094 07-E8 DEVTYPE = 3390-0C CYLS = 300510175-CYT91 SSID = 030A 02095 Now if I change 60102 to 6010A in the thrid record and I receive : FPLSPV1038E Not a decimal number: "6010A" FPLMSG003I ... Issued from stage 5 of pipeline 1 FPLMSG001I ... Running "SPECs a: 54.5 . if (£1/=a) then set £1:=a" FPLSPV1426I ... Evaluating "£1/=a" FPLSPE1490I Processing item number 2: if (£1/=a) then Ok, I understand i am not using the good syntax for set and if. I did many tests but still not find it... [/code] De : CMS/TSO Pipelines Discussion List de la part de John P. Hartmann Date : samedi, 26 novembre 2022 à 15:03 À : cms-pipeli...@listserv.meduniwien.ac.at Objet : Re: IF testing characters The else clause is never executed because you unconditionally assign counters 1 through 5 at the beginning of each cycle. Perhaps you should delete the first five assignments. Or use if first() to initialise counters. On 11/26/22 14:44, a.benveni...@free.fr wrote: > The last test I did do not send any error message but £4 and £5 are not > incremented as it is supposed based on the if : > > From the q da details command : > a is the cyls value > b is the serial number value > c is the ssid value > > "! SPECs", > " a: 54.5 .", > " b: 67.10 .", > " c: 85.4 .", > " set £1:=a", > " set £2:=b", > " set £3:=c", > " set £4:=0", > " set £5:=0", > " if (£1==a & £2==b & £3==c) then", > " set £4+=1", > " set £5:=1", > " else", > " set £1:=a", > " set £2:=b", > " set £3:=c", > " set £4:=1", > " set £5+=1", > " endif", > " 1-* 1", > " print £4 picture 9 nextword", > " print £5 picture 9 next", > "!01:" > > > De : CMS/TSO Pipelines Discussion List > de la part de John P. Hartmann > > Date : samedi, 26 novembre 2022 à 14:15 > À : cms-pipeli...@listserv.meduniwien.ac.at > > Objet : Re: IF testing characters > ! is the vertical bar (|) on most European terminals. It would have > been nice to know the actual error message. > > On 11/26/22 12:14, Kris Buelens wrote: >> I don't understand what these >> are supposed to do
Re: [CMS-PIPELINES] IF testing characters
While this doesn't address your questions about SPEC, I do have a very interesting pipeline that uses almost all options of LOOKUP to go through a User Directory and determine gaps or re-allocate minidisks from one (or all) volumes to new volumes to generate DIRMAINT commands... Rob
Re: [CMS-PIPELINES] IF testing characters
The else clause is never executed because you unconditionally assign counters 1 through 5 at the beginning of each cycle. Perhaps you should delete the first five assignments. Or use if first() to initialise counters. On 11/26/22 14:44, a.benveni...@free.fr wrote: The last test I did do not send any error message but £4 and £5 are not incremented as it is supposed based on the if : From the q da details command : a is the cyls value b is the serial number value c is the ssid value "! SPECs", " a: 54.5 .", " b: 67.10 .", " c: 85.4 .", " set £1:=a", " set £2:=b", " set £3:=c", " set £4:=0", " set £5:=0", " if (£1==a & £2==b & £3==c) then", " set £4+=1", " set £5:=1", " else", " set £1:=a", " set £2:=b", " set £3:=c", " set £4:=1", " set £5+=1", " endif", " 1-* 1", " print £4 picture 9 nextword", " print £5 picture 9 next", "!01:" De : CMS/TSO Pipelines Discussion List de la part de John P. Hartmann Date : samedi, 26 novembre 2022 à 14:15 À : cms-pipeli...@listserv.meduniwien.ac.at Objet : Re: IF testing characters ! is the vertical bar (|) on most European terminals. It would have been nice to know the actual error message. On 11/26/22 12:14, Kris Buelens wrote: I don't understand what these are supposed to do
Re: [CMS-PIPELINES] IF testing characters
The last test I did do not send any error message but £4 and £5 are not incremented as it is supposed based on the if : >From the q da details command : a is the cyls value b is the serial number value c is the ssid value "! SPECs", " a: 54.5 .", " b: 67.10 .", " c: 85.4 .", " set £1:=a", " set £2:=b", " set £3:=c", " set £4:=0", " set £5:=0", " if (£1==a & £2==b & £3==c) then", " set £4+=1", " set £5:=1", " else", " set £1:=a", " set £2:=b", " set £3:=c", " set £4:=1", " set £5+=1", " endif", " 1-* 1", " print £4 picture 9 nextword", " print £5 picture 9 next", "!01:" De : CMS/TSO Pipelines Discussion List de la part de John P. Hartmann Date : samedi, 26 novembre 2022 à 14:15 À : cms-pipeli...@listserv.meduniwien.ac.at Objet : Re: IF testing characters ! is the vertical bar (|) on most European terminals. It would have been nice to know the actual error message. On 11/26/22 12:14, Kris Buelens wrote: > I don't understand what these > are supposed to do
Re: [CMS-PIPELINES] IF testing characters
On 11/26/22 13:15, Alain Benvéniste wrote: So there no syntax to assign characters to a variable to test it through a if ? Sure there is: if (#56 -= 1) then ... (decrement counter 56 and test for 0 or nonzero.) Perhaps it would be easier if you set your terminal/emulator to the US code page while writing REXX and pipeline code, if it can then produce <|>.
Re: [CMS-PIPELINES] IF testing characters
! is the vertical bar (|) on most European terminals. It would have been nice to know the actual error message. On 11/26/22 12:14, Kris Buelens wrote: I don't understand what these are supposed to do
Re: [CMS-PIPELINES] IF testing characters
I think there’s the /= for “not equal” numeric, and /== for when it’sa string. Rob On Sat, 26 Nov 2022 at 13:15, Alain Benvéniste wrote: > It is just things i tested… > I suspect…. £ is # like @ is à… > So there no syntax to assign characters to a variable to test it through a > if ? > > > Resiliency Services on Z Mainframe > alain.benveni...@kyndryl.com > > > Le 26 nov. 2022 à 12:24, Kris Buelens a écrit : > > > > This doesn't read very well here > > " set £1=''", > > I guess £1 stands for #1 outside the UK, and I don't understand what > these > > are supposed to do > > Ignoring it would mean you try to assign counter 1 to an empty > > string. It are counters, hence only accept numeric values > > > > Kris Buelens, > > --- VM/VSE consultant, Belgium --- > > --- > > > > > > Op za 26 nov. 2022 om 11:00 schreef Alain Benveniste < > a.benveni...@free.fr>: > > > >> Hi, > >> > >> I try to compare characters fields (a, b and c) in the if using this way > >> and the concatenation. > >> Both cases send me a error msg. > >> The sets seem ok, but when testing them in the if it looks to me I use a > >> wrong syntax... > >> > >> "! SPECs", > >> " a: 54.5 .", > >> " b: 67.10 .", > >> " c: 85.4 .", > >> " set £1=''", > >> " set £2=''", > >> " set £3=''", > >> " set £4:=0", > >> " set £5:=0", > >> " if (£1=a & £2=b & £3=c) then", > >> " set £4+=1", > >> " set £5:=1", > >> " else", > >> " set £4:=1", > >> " set £5+=1", > >> " set £1=a", > >> " set £2=b", > >> " set £3=c", > >> " endif", > >> " 1-* 1", > >> " print £4 picture 9 nextword", > >> " print £5 picture 9 next", > >> > >> Alain > >> > >> >
Re: [CMS-PIPELINES] IF testing characters
It is just things i tested… I suspect…. £ is # like @ is à… So there no syntax to assign characters to a variable to test it through a if ? Resiliency Services on Z Mainframe alain.benveni...@kyndryl.com > Le 26 nov. 2022 à 12:24, Kris Buelens a écrit : > > This doesn't read very well here > " set £1=''", > I guess £1 stands for #1 outside the UK, and I don't understand what these > are supposed to do > Ignoring it would mean you try to assign counter 1 to an empty > string. It are counters, hence only accept numeric values > > Kris Buelens, > --- VM/VSE consultant, Belgium --- > --- > > > Op za 26 nov. 2022 om 11:00 schreef Alain Benveniste : > >> Hi, >> >> I try to compare characters fields (a, b and c) in the if using this way >> and the concatenation. >> Both cases send me a error msg. >> The sets seem ok, but when testing them in the if it looks to me I use a >> wrong syntax... >> >> "! SPECs", >> " a: 54.5 .", >> " b: 67.10 .", >> " c: 85.4 .", >> " set £1=''", >> " set £2=''", >> " set £3=''", >> " set £4:=0", >> " set £5:=0", >> " if (£1=a & £2=b & £3=c) then", >> " set £4+=1", >> " set £5:=1", >> " else", >> " set £4:=1", >> " set £5+=1", >> " set £1=a", >> " set £2=b", >> " set £3=c", >> " endif", >> " 1-* 1", >> " print £4 picture 9 nextword", >> " print £5 picture 9 next", >> >> Alain >> >>
Re: [CMS-PIPELINES] IF testing characters
This doesn't read very well here " set £1=''", I guess £1 stands for #1 outside the UK, and I don't understand what these are supposed to do Ignoring it would mean you try to assign counter 1 to an empty string. It are counters, hence only accept numeric values Kris Buelens, --- VM/VSE consultant, Belgium --- --- Op za 26 nov. 2022 om 11:00 schreef Alain Benveniste : > Hi, > > I try to compare characters fields (a, b and c) in the if using this way > and the concatenation. > Both cases send me a error msg. > The sets seem ok, but when testing them in the if it looks to me I use a > wrong syntax... > > "! SPECs", > " a: 54.5 .", > " b: 67.10 .", > " c: 85.4 .", > " set £1=''", > " set £2=''", > " set £3=''", > " set £4:=0", > " set £5:=0", > " if (£1=a & £2=b & £3=c) then", > " set £4+=1", > " set £5:=1", > " else", > " set £4:=1", > " set £5+=1", > " set £1=a", > " set £2=b", > " set £3=c", > " endif", > " 1-* 1", > " print £4 picture 9 nextword", > " print £5 picture 9 next", > > Alain > >
[CMS-PIPELINES] IF testing characters
Hi, I try to compare characters fields (a, b and c) in the if using this way and the concatenation. Both cases send me a error msg. The sets seem ok, but when testing them in the if it looks to me I use a wrong syntax... "! SPECs", " a: 54.5 .", " b: 67.10 .", " c: 85.4 .", " set £1=''", " set £2=''", " set £3=''", " set £4:=0", " set £5:=0", " if (£1=a & £2=b & £3=c) then", " set £4+=1", " set £5:=1", " else", " set £4:=1", " set £5+=1", " set £1=a", " set £2=b", " set £3=c", " endif", " 1-* 1", " print £4 picture 9 nextword", " print £5 picture 9 next", Alain