Author |
Message
|
bobbee |
Posted: Fri Jul 01, 2016 11:16 am Post subject: Message SELECT |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
I have a file I have read into Environment. I am writing a query against the data using a SET/SELECT. In the debugger I can see it running through the elements. What I want is a list of all the VALUES that have a RuleID=2 and a VarID = 1. Here is the code and a snippet of the Environment data. I put the CAST in there on my last run, trying different things.
Code: |
SET Environment.AccounttProdTypeIMList[] =
SELECT Value
FROM Environment.SV.DFDL.SCORE_VALUE.record[] AS two
WHERE two.RuleID = CAST('2' AS CHAR CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding) and
two.VarId = CAST('1' AS CHAR CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding);
|
Code: |
SV
DFDL
SCORE_VALUE
record
ScoreModel:CHARACTER:4
RuleId:CHARACTER:1
VarId:CHARACTER:0
Value:CHARACTER:966
record
ScoreModel:CHARACTER:4
RuleId:CHARACTER:2
VarId:CHARACTER:0
Value:CHARACTER:IM
record
ScoreModel:CHARACTER:4
RuleId:CHARACTER:2
VarId:CHARACTER:1
Value:CHARACTER:107
record
ScoreModel:CHARACTER:4
RuleId:CHARACTER:2
VarId:CHARACTER:1
Value:CHARACTER:108
|
|
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jul 01, 2016 11:27 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
"SELECT two.Value" _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 01, 2016 11:34 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
I had two.Value. But I just went back and added it back in. i still get nothing. |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 01, 2016 11:37 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
FYI,
When I am in the DEBUGGER, as soon as the FROM is executed I see in the DEBUG session a reference variable named 'one' and in it I see the current record. As I step through the iteration, i see the values change untill I get to 2,1. It just keeps going and returns nothing. |
|
Back to top |
|
 |
mqjeff |
Posted: Fri Jul 01, 2016 11:44 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
is "Value" the name of a child of record?
or the value of the field "record"?
If it's the second, you might need to select from Environment.SV.DFDL.SCORE_VALUE.* instead of Environment.SV.DFDL.SCORE_VALUE.record _________________ chmod -R ugo-wx / |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 01, 2016 11:57 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
It should be a child, how does one tell the difference. |
|
Back to top |
|
 |
bobbee |
Posted: Fri Jul 01, 2016 12:38 pm Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
RuleID != RuleId
Thanks!!!
Second Question.
I am getting repeating:
AccounttProdTypeIMList
Value:CHARACTER:107
AccounttProdTypeIMList
Value:CHARACTER:108
etc.
Which is sort of what I expected. Can I change the output to just an ARRAY of the returned values?
AccounttProdTypeIMList(1) = 107
AccounttProdTypeIMList(2) = 108
etc
?????????? |
|
Back to top |
|
 |
maurito |
Posted: Mon Jul 04, 2016 4:21 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
bobbee wrote: |
RuleID != RuleId
Thanks!!!
Second Question.
I am getting repeating:
AccounttProdTypeIMList
Value:CHARACTER:107
AccounttProdTypeIMList
Value:CHARACTER:108
etc.
Which is sort of what I expected. Can I change the output to just an ARRAY of the returned values?
AccounttProdTypeIMList(1) = 107
AccounttProdTypeIMList(2) = 108
etc
?????????? |
Yes you can.
Question:
What is the point of
Code: |
CAST('2' AS CHAR CCSID InputRoot.MQMD.CodedCharSetId ENCODING InputRoot.MQMD.Encoding) |
What do you think the result will be ?
Similarly for the other CAST. |
|
Back to top |
|
 |
bobbee |
Posted: Mon Jul 04, 2016 5:09 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
When you are in a corner you try things that may be silly but they eliminate random conflicting thoughts in your head.
Your kind of late with the comment, even after my last post. I got it working on my own. Thanks for all that input. Very helpful...................... |
|
Back to top |
|
 |
maurito |
Posted: Mon Jul 04, 2016 5:18 am Post subject: |
|
|
Partisan
Joined: 17 Apr 2014 Posts: 358
|
bobbee wrote: |
When you are in a corner you try things that may be silly but they eliminate random conflicting thoughts in your head.
Your kind of late with the comment, even after my last post. I got it working on my own. Thanks for all that input. Very helpful...................... |
Your post was Friday, and some of us have a job to do. We are not a 'help desk', so you can keep your sarcasm to yourself. And by the way, it is You are kind of late, not YOUR. |
|
Back to top |
|
 |
bobbee |
Posted: Mon Jul 04, 2016 7:58 am Post subject: |
|
|
 Knight
Joined: 20 Sep 2001 Posts: 545 Location: Tampa
|
some of us are dedicated and do this 24x7. Sarcasm is my best personality trait. Almost trumps my IT skills. Now look at that, you've gone from being a programmer to an English teacher on one post. Amazing. |
|
Back to top |
|
 |
|