The input field is CH with numeric value
And
I need the output as FIXED DEC(9,2) (as in PL/1). Length of 5

So I used SFF,TO=PD, but ended with wrong decimal places.
Here 12.1 and 11.0 got changed to 1.21 and 1.10 respectively. (Ignore 6.05 & 9.68 in the image, as records got sorted)

After going thorugh manuals and google, I (blindly) kept trying many options like, UFF/SFF,PD/ZD,FS/SI,etc.... But no use.

P.S.:
1) To=PD is the only option giving me an output closer to my expectation
2) My knowledge of datatypes is very limited

Hope you got the question!!!

attached images were deleted, they added nothing to the info provided,
and just wasted space

Joined: 17 Oct 2006 Posts: 2323 Location: @my desk

Posted: Fri Feb 25, 2011 9:20 pm Post subject:

dick scherrer wrote:

You have a decimal point alignment problem

Yes, Dick. That exactly is his problem

As per my understanding he is trying to sort on a 11 byte field which is at pos-301. After sorting, he wants to convert the 9-byte numeric data field which starts at pos-94(as shown in the sample data) to PD.

This seems to be a candidate for a PARSE application.

Posted: Mon Feb 28, 2011 6:56 pm Post subject: Reply to: SYNCSORT Character (Numeric Value) to Fixed Decima

HI PPL,
Thanks for the replies....

Checked with my team, and it seems I'm not suppose to post the entire input data.

The problem is not with postition 301. It gets sorted correctly.
The problem is when trying to move Numerals in CH data type (at position 94) to a Numeric Format.

The field in problem starts from 94, length is 9, Type is CHAR and Alignment is Right.

Here, when converting using 'SFF,TO=PD', no matter how many digits are there behind the decimal point, it just gives out two digits after the decimal point.
So my question is how can I overcome this problem, and retain the number of digits before and after the decimal point.

P.S. I tried with PARSE, but not sure whether it is suppoted in SYNCSORT. I just got confused there and stopped looking at it.

Joined: 23 Nov 2006 Posts: 19270 Location: Inside the Matrix

Posted: Mon Feb 28, 2011 8:46 pm Post subject:

Hello,

Quote:

Here, when converting using 'SFF,TO=PD', no matter how many digits are there behind the decimal point, it just gives out two digits after the decimal point.

Not true. . .

The "two digits" are your doing - not the "sort". A packed decimal value has no "decimal places" - it is just a packed value. "You" cause the insertion of decimal places by how you define and use the field.

x'1234567C' could be 12.34567 or 1234.567 or 12345.67 etc based on your use.

Joined: 17 Oct 2006 Posts: 2323 Location: @my desk

Posted: Tue Mar 01, 2011 7:42 pm Post subject:

y3mvl wrote:

I tried with PARSE, but not sure whether it is suppoted in SYNCSORT. I just got confused there and stopped looking at it

You can achieve what you want using 'PARSE' and AFAIK PARSE is supported even by older versions of Syncsort.
(IIRC since Syncsort 1.3) Which version do you have there?