Hi,
I have to write some of the packed decimal fields in Sequential file. Source data is unpacked number and target (sequential file) is packed.
PIC S9(8 ) C-3
PIC S9(9)v99 C-3
Is there any way I can use Sequential file stage as target stage and write these kind of packed decimals OR I have to use CFF stage?
Please suggest.
Write Packed Decimal Fields in Sequential File
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 11
- Joined: Mon Feb 04, 2013 8:03 am
Write Packed Decimal Fields in Sequential File
Thanks & Regards,
Rohit
Rohit
The stage you use is dependent on the platform on which the destination file resides. If you are writing to Unix, Sequential Stage should be enough. CFF is the best way to write to the mainframe. I use (because we don't have CFF) FTP Enterprise.
The rest is just getting the table defintion and column attributes set properly.
The rest is just getting the table defintion and column attributes set properly.
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
-
- Participant
- Posts: 11
- Joined: Mon Feb 04, 2013 8:03 am
Thanks for the reply.
I just wanted to know whether we can compress the data as part of packed decimal in sequential file stage. I know we can write packed decimal in sequential file stage but I am not sure whether we can define 'comp -3' or 'comp -2'.
s9(7)v99 comp-3
s9(7)v99 comp-2
I just wanted to know whether we can compress the data as part of packed decimal in sequential file stage. I know we can write packed decimal in sequential file stage but I am not sure whether we can define 'comp -3' or 'comp -2'.
s9(7)v99 comp-3
s9(7)v99 comp-2
Thanks & Regards,
Rohit
Rohit
COMP-2 is a double-precision floating point data type, not packed decimal.
In Sequential File stage, set the Decimal Type to Packed in the column attributes. Your decimal column should be a Decimal(9,2) in DataStage.
Regards,
In Sequential File stage, set the Decimal Type to Packed in the column attributes. Your decimal column should be a Decimal(9,2) in DataStage.
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.
-
- Participant
- Posts: 11
- Joined: Mon Feb 04, 2013 8:03 am
COMP-3 is Packed Decimal. Setting Packed = Yes provides Packed Decimal/COMP-3.
Column -> Decimal(9,2) as I stated previously, NOT Decimal(7,2). In DataStage, length is the total number of digits (before and after the decimal point), and scale is how many of those appear after the decimal point. In a COBOL definition, before and after are expressed separately:
S9(7)v99 COMP-3 is 9 digits total (7 before + 2 after), therefore when translating into a DataStage decimal, it becomes Decimal(9,2).
Regards,
Column -> Decimal(9,2) as I stated previously, NOT Decimal(7,2). In DataStage, length is the total number of digits (before and after the decimal point), and scale is how many of those appear after the decimal point. In a COBOL definition, before and after are expressed separately:
S9(7)v99 COMP-3 is 9 digits total (7 before + 2 after), therefore when translating into a DataStage decimal, it becomes Decimal(9,2).
Regards,
- james wiles
All generalizations are false, including this one - Mark Twain.
All generalizations are false, including this one - Mark Twain.