Page 1 of 1

Create HIGH HEX value

Posted: Fri Aug 03, 2018 3:20 am
by kmare
Dear Gurus,
I have a requirement to create a trailer record of length 30 with HIGH hex value (FF) in ebcidic format,fixed width so that mainframes can invoke it ,able to create one "FF" using Conversion("255","MX","O") in transformer and write to CFF stage / peek, however it is not tested @ mainframes,can see in peek. what I need to create is like
"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF" , in laymen's language 30 Fs :).
Any ideas is appreciated.
Thanks in advance
Kishore

Posted: Sun Aug 05, 2018 5:50 pm
by ray.wurlod
0xff can be represented in DataStage as Char(255).

Thirty of them can be generated using

Code: Select all

Str(Char(255),30)

Posted: Mon Aug 06, 2018 5:10 am
by kmare
Hi Franklin,
Thanks for your inputs .
I tried as you suggested but its not working as expected.
1)stagevariable:- Space(30) or ' ' -(tried with both)
2) Convert(' ','xFF',StageVar_1).
And HEX value i see in the ebcidic file is "A7" not "FF" .

Hi Ray ,
Thanks for your input.
I tried like below
COl = Str(Char(255),30)
and write to ebcidic file and it generates HEX value "40" .

Also tried
1) StgVar :- Conversion("255","MX","O")
2)col :- StgVar:StgVar:.......(concate 30 times ) ,apparently dint worked :(

I am still trying and will update once I achieve it .

Posted: Mon Aug 06, 2018 6:17 am
by FranklinE
The only thing I can think of is that you are setting the char column under the control of an ASCII character set. That's why it's getting converted to xA7 or x40.

Check your project defaults. You may need to put peeks at every stage to uncover what's happening.

Good luck.

Posted: Mon Aug 06, 2018 6:48 am
by kmare
Hi Franklin,
Thanks for your reply.
You are correct as we do this transformation in ASCII set up and write to EBCIDIC file using CFF stage and not sure how datastage would understand our generated values (xFF ) and writes to EBCIDIC file.

Posted: Mon Aug 06, 2018 6:53 am
by FranklinE
You have to juggle the settings. Sometimes the two character sets, ASCII and EBCDIC, have implied conversions between them that you can't control.

If it were my job -- and that means you might not find this valuable -- I'd customize the entire job to use EBCDIC throughout. At some point, you need to force the column to have xFF values. I'm an old mainframe dog, as it were, but I don't claim to understand how character sets work in DataStage. We might both learn something here.

Posted: Mon Aug 06, 2018 8:21 pm
by ray.wurlod
In a server job you could use the pre-loaded system variable @IM but this is not available in parallel jobs. Try loading a stage variable with just Char(255) without applying any conversion functions to it. Then assemble 30 of these as you described.

Posted: Wed Aug 08, 2018 7:06 am
by kmare
Hi ,

we agreed on populating default values :lol: :lol:
Thanks for your time .
Iwill close this marking as workaround.