Page 1 of 1

DataStage equivalent datatype of mainframe

Posted: Tue May 13, 2014 10:58 am
by skp
Hi,

I got the mainframe file and the data comes as below,
101010+

I need to read this as 1010.10+ into data stage. I tried different ways to read it using copy book,but i did not get exact picture type.

Could some one provide the picture type to read into datastage?

Thanks

Posted: Tue May 13, 2014 11:20 am
by FranklinE
Please post the copybook, including the full PIC clauses. I can't comment on your problem without them.

Posted: Wed May 14, 2014 2:26 am
by skp
Hi,

This is my copy book content given below,

01 RECORDIDENTIFICATION.
03 AMOUNTS PIC 9(4)V99S.

Posted: Wed May 14, 2014 6:36 am
by chulett
OK... a signed number with an implied decimal.

So about this need you have. What is your target - do you want to read it into a string so you end up with an explicit sign (+/-) at the end? Or you just need it to be a properly signed decimal? Assuming the former as the latter should happen automatically.

You never specified what stage you are using, the "different ways" you tried nor what exactly you got when you tried them. Always good to include information and examples of that nature.

Posted: Wed May 14, 2014 11:45 am
by rameshrr3
Have you imported the copy book Successfully ? Then open table def , and go to layout , select the parallel radio button , and see what datatype it defines to that column. Use this in your schema file or in the sequential file's columns tab . so that you dont have to write a transfomer derivation unnecessarily.

Posted: Wed May 14, 2014 3:13 pm
by FranklinE
Upon import, AMOUNTS PIC 9(4)V99S should be Decimal(6,2) and in the column properties you should find trailing sign set.

Based on your first post, the column is Decimal(6,0) with trailing sign. It should be that simple to fix.

The thing to remember is the Cobol standard for storing numeric data: never have an explicit position for the decimal. You define it when you read it. It looks the same when you write it, assuming the same number of digits, regardless of how it's defined for the written record. It's not recommended, but you can write something like PIC 9(6)V9(2) and read it with PIC 9(2)V9(6) and there's nothing that prevents it.

Posted: Wed May 14, 2014 6:32 pm
by chulett
Still curious what their target is...