Page 1 of 1

Is there a way to specify that a binary field is signed?

Posted: Tue Jan 06, 2009 10:46 am
by Sandeep.pendem
Hello,

Is there a way to specify that a binary field is signed in datastage? I have a binary field Periodkey with value as 6957, however when I multiply it with -1 in the extract JCL it converts it into a integer value and doesnt shows the correct value as -6957 in datastage. it shows value as 0.

So I am trying to understand whether we can have a negative value in the binary format?
Thanks,
Sandeep

Posted: Tue Jan 06, 2009 1:58 pm
by ArndW
Yes, binary fields can be signed in DataStage. But you need to know which type of binary you are using and also which type of negative representation. This is easiest with the COBOL type fields, but can also be done with other binary representations.

So, what sort of a binary field do you have?

Posted: Tue Jan 06, 2009 2:13 pm
by Sandeep.pendem
Hello,

Thank you.

I have PERIODKEY as PIC S9(4) COMP. and OUTLETKEY as PIC S9(9) COMP.
PERIODKEY = 6957 and OUTLETKEY = 9.
So What I am trying to do here is Multiply the SQL statement with -1 i.e
SELECT (PERIODKEY * -1),(OUTLETKEY * -1)
FROM CDS.FCREIMBS A
So I expected this to be seen in datastage as -6957 and -1 but it shows min and max integer values...any idea why it shows min/max values of integers?
I define the above fields as Binary in CFF stage.
Are there different types of binary reprensation on cobol coybooks?

Thanks for the help

Posted: Tue Jan 06, 2009 2:23 pm
by Sandeep.pendem
Hello,

Thank you.

I have PERIODKEY as PIC S9(4) COMP. and OUTLETKEY as PIC S9(9) COMP.
PERIODKEY = 6957 and OUTLETKEY = 9.
So What I am trying to do here is Multiply the SQL statement with -1 i.e
SELECT (PERIODKEY * -1),(OUTLETKEY * -1)
FROM CDS.FCREIMBS A
So I expected this to be seen in datastage as -6957 and -1 but it shows min and max integer values...any idea why it shows min/max values of integers?
I define the above fields as Binary in CFF stage.
Are there different types of binary reprensation on cobol coybooks?

Thanks for the help

Posted: Tue Jan 06, 2009 2:41 pm
by ArndW
In what stage are you doing a "SELECT" and does this not return non-binary display values which can then be used by DataStage?

Posted: Tue Jan 06, 2009 2:45 pm
by Sandeep.pendem
Hello,

Thank you.

The select stuff happens on mainframe, basically its an unload from DB2 table on mainframe i.e creating a file and sent across to DS server. this file is then used in CFF stage to read the data i.e EBCDIC to binary.

Thanks for the help

Posted: Tue Jan 06, 2009 6:37 pm
by ArndW
So how do you declare this field in your CFF stage? If it is a DB2 query, then chances are high that the data is not transferred as binary, but as EBCDIC text data. You could check this with a binary display tool and see if you are getting actual binary data or text data on the UNIX machine.