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
DataStage equivalent datatype of mainframe
Moderators: chulett, rschirm, roy
Please post the copybook, including the full PIC clauses. I can't comment on your problem without them.
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
"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
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.
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.
Last edited by chulett on Wed May 14, 2014 12:01 pm, edited 1 time in total.
-craig
"You can never have too many knives" -- Logan Nine Fingers
"You can never have too many knives" -- Logan Nine Fingers
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.
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.
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.
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
"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