High/low value identify
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Basically it means a stage variable of the same data type and size as the incoming values you want to compare it to. And then you define one to have an initial value of all low values and another to have all high values as essentially constants during the job run. Then you would compare your incoming values to the stage variables. This rather than converting everything to strings.
In pondering this I'm not sure it is actually possible as I don't recall what data types are supported for stage variables. But at a high level, as generic advice, I've done things like that many times.
In pondering this I'm not sure it is actually possible as I don't recall what data types are supported for stage variables. But at a high level, as generic advice, I've done things like that many times.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
Now that I know this is a COMP field, the situation is different.
COMP is a storage format for a numeric value. It is not convertible to string in the usual sense, nor do you really want to think of it as "binary" data except in the FTP protocol sense.
You have a field of a certain length. Signed or unsigned, it has a minimum value of 0 and a maximum value of dec15 (F) in each position. Your check should be on that maximum value, not on the hex codes.
PIC 9(4) COMP has a maximum value of 9,999. One approach would be a logic statement like
would give you an active filter for all values in the column that you want to pass on, and a reject link could take the rest.
The odd thing about this is finding all xF in a COMP field. This is not standard practice that I'm aware of. I suggest checking back with your data source folks to find out why this is being done. In the meantime, to bypass the confusion, look to the actual storage of the field, and work your logic from that. If the COMP value is stored in a 2-byte storage length, then your maximum value is 65,535 (xFFFF).
COMP is a storage format for a numeric value. It is not convertible to string in the usual sense, nor do you really want to think of it as "binary" data except in the FTP protocol sense.
You have a field of a certain length. Signed or unsigned, it has a minimum value of 0 and a maximum value of dec15 (F) in each position. Your check should be on that maximum value, not on the hex codes.
PIC 9(4) COMP has a maximum value of 9,999. One approach would be a logic statement like
Code: Select all
If Abs(col1) > 0 And Abs(col1) < 9999
The odd thing about this is finding all xF in a COMP field. This is not standard practice that I'm aware of. I suggest checking back with your data source folks to find out why this is being done. In the meantime, to bypass the confusion, look to the actual storage of the field, and work your logic from that. If the COMP value is stored in a 2-byte storage length, then your maximum value is 65,535 (xFFFF).
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
The short answer is yes, that would be my choice. In the meantime, I believe you have a design issue with the high-values being set in a COMP field. I suggest you follow up on that with your Cobol team.
Franklin Evans
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872
"Shared pain is lessened, shared joy increased. Thus do we refute entropy." -- Spider Robinson
Using mainframe data FAQ: viewtopic.php?t=143596 Using CFF FAQ: viewtopic.php?t=157872