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

Post questions here relative to DataStage Server Edition for such areas as Server job design, DS Basic, Routines, Job Sequences, etc.

Moderators: chulett, rschirm, roy

Post Reply
Sandeep.pendem
Participant
Posts: 27
Joined: Fri May 02, 2008 8:01 am
Location: Mumbai

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

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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?
Sandeep.pendem
Participant
Posts: 27
Joined: Fri May 02, 2008 8:01 am
Location: Mumbai

Post 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
Sandeep.pendem
Participant
Posts: 27
Joined: Fri May 02, 2008 8:01 am
Location: Mumbai

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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?
Sandeep.pendem
Participant
Posts: 27
Joined: Fri May 02, 2008 8:01 am
Location: Mumbai

Post 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
ArndW
Participant
Posts: 16318
Joined: Tue Nov 16, 2004 9:08 am
Location: Germany
Contact:

Post 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.
Post Reply