High/low value identify

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

techsavy
Participant
Posts: 26
Joined: Sat Jan 10, 2015 11:11 am
Location: India

High/low value identify

Post by techsavy »

Hi,

I have a ebcdic file which I am reading through CFF Stage. There is a column where high and Low values are expected. I need to reject those records. Can I identify high/low value in datastage?

Need your suggestions
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

First, that sounds very unusual. "Filling" on high-value (xFF) is useful only when the field is used in a sort and they want all such records at the end of the sort. Low_value is x00, which is also the ASCII null. Having either or both in a field doesn't sound right at all, and if it were me I'd ask for the justification for it.

Settings to reject such records should be relatively easy except for the low-value/null problem. You can examine each byte and set to reject upon finding x00 or xFF. Position-length reference on a Char or VarChar field is setting at the end of the column name [pos,length].

Good luck.
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
techsavy
Participant
Posts: 26
Joined: Sat Jan 10, 2015 11:11 am
Location: India

Post by techsavy »

Thanks Franklin,

Can you give an example to identify low(x00) and high(xFF) value in datastage. I am just wondering how to catch this hex representation in datstage.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Char(0) and Char(255) respectively.

But this only matches a single character.

What do you really want to accomplish?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
techsavy
Participant
Posts: 26
Joined: Sat Jan 10, 2015 11:11 am
Location: India

Post by techsavy »

Hi Ray,

I want to identify those records in transformer stage where the specific column having high or low value.
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

I believe Ray joins me in asking for further details, something specific about the column being examined.

Will it be all x00 or all xFF? Will it be some mix of the two?

The coding for this is basic. You examine the entire column or some portion of it. And to echo the usual question here: what have you tried so far, and what were the results?
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
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

:idea: techsavy,

Please make use of the lovely Reply to topic button, there's no need to be quoting everything you are replying to all the time. The DSXchange Janitorial Service thanks you.
-craig

"You can never have too many knives" -- Logan Nine Fingers
techsavy
Participant
Posts: 26
Joined: Sat Jan 10, 2015 11:11 am
Location: India

Post by techsavy »

The field will either only be high value or only low value (not both).

Incase high value - All the position of the field will be filled with xFF simillary for low value - All the position filled with x00
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

So perhaps simply substring off the first or last character and check that.
-craig

"You can never have too many knives" -- Logan Nine Fingers
FranklinE
Premium Member
Premium Member
Posts: 739
Joined: Tue Nov 25, 2008 2:19 pm
Location: Malvern, PA

Post by FranklinE »

techsavy wrote:The field will either only be high value or only low value (not both).

Incase high value - All the position of the field will be filled with xFF simillary for low value - All the position filled with x00
Example: transformer constraint

Code: Select all

inlink.colname[1,1] <> Char(00) And inlink.colname[1,1] <> Char(255)
Edit: negative logic has to use "and". Also, you can use a Filter stage and if needed create a reject link for the "bad" records.
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
techsavy
Participant
Posts: 26
Joined: Sat Jan 10, 2015 11:11 am
Location: India

Post by techsavy »

Thanks Franklin. I think I can write similar
logic to Check all positions instead of
Only first position. Right?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Probably easier is to use Convert() function to eliminate the low values and high values, then see if there's anything left.

Code: Select all

Convert(Char(0):Char(255),"",InLink.TheField) > ""
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

techsavy wrote:Thanks Franklin. I think I can write similar logic to Check all positions instead of only first position. Right?
Why if they're always all of one or the other? I suggested checking one character because that's what you stated. But...sure, if you feel the need.
-craig

"You can never have too many knives" -- Logan Nine Fingers
techsavy
Participant
Posts: 26
Joined: Sat Jan 10, 2015 11:11 am
Location: India

Post by techsavy »

I tried with Convert but not sure why its not working. When I see the data in datastage view mode it's look like '-1' in place of high value.
chulett
Charter Member
Charter Member
Posts: 43085
Joined: Tue Nov 12, 2002 4:34 pm
Location: Denver, CO

Post by chulett »

Post your derivation code and let us know the data type of the field you are using it on.
-craig

"You can never have too many knives" -- Logan Nine Fingers
Post Reply