Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT Character (Numeric Value) to Fixed Decimal

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
y3mvl

New User


Joined: 19 Dec 2007
Posts: 4
Location: chennai

PostPosted: Thu Feb 24, 2011 8:46 pm    Post subject: SYNCSORT Character (Numeric Value) to Fixed Decimal
Reply with quote

INP FILE (using s.3.4):

Code:
9----+----0----+----1---
         7.26           
         24.2           
         12.1           
         11.0           


SORT CARD:
SORT FIELDS=(301,11,CH,A)
OUTREC FIELDS=(1,8,9,10,30,11,94,9,SFF,TO=PD,
114,8,215,11,301,11,100:X)

OUT FILE (using File-Aid):
5/DFX
(30-34)
Code:
- 5----------
         6.05           
         1.21           
         1.10           
         9.68


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!!! icon_smile.gif

attached images were deleted, they added nothing to the info provided,
and just wasted space
Back to top
View user's profile Send private message

y3mvl

New User


Joined: 19 Dec 2007
Posts: 4
Location: chennai

PostPosted: Fri Feb 25, 2011 11:20 am    Post subject: Reply to: SYNCSORT Character (Numeric Value) to Fixed Decima
Reply with quote

No Reply?!!!!!!!!!!!!!!!!!!!! icon_cry.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Fri Feb 25, 2011 8:07 pm    Post subject:
Reply with quote

Hello,

Possibly because your output doesn not even reflect the input. . . icon_confused.gif

Suggest you post the output from the exact input.

You mention position 301, but the "input" posted does not start in 301. . .

The 12.1 and 11.1 values did NOT get changed. You have a decimal point alignment problem.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Fri Feb 25, 2011 9:20 pm    Post subject:
Reply with quote

dick scherrer wrote:
You have a decimal point alignment problem

Yes, Dick. That exactly is his problem icon_smile.gif

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.
Back to top
View user's profile Send private message
y3mvl

New User


Joined: 19 Dec 2007
Posts: 4
Location: chennai

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

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. icon_smile.gif
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.

Thanks again!

Regards,
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10257
Location: italy

PostPosted: Mon Feb 28, 2011 7:08 pm    Post subject: Reply to: SYNCSORT Character (Numeric Value) to Fixed Decima
Reply with quote

Quote:
and it seems I'm not suppose to post the entire input data.


there is no need to post the true data,
what has to be accurate is the layout, the content can be reasonably obfuscated!

but if also the layout cannot be shown, You/Your organization should not seek help on a public forum !
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Mon Feb 28, 2011 8:46 pm    Post subject:
Reply with quote

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. . . icon_sad.gif

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.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Tue Mar 01, 2011 7:42 pm    Post subject:
Reply with quote

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?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Validate date and numeric fields and ... Rick Silvers DFSORT/ICETOOL 6 Thu May 11, 2017 6:51 pm
No new posts the use of 'B3'x character in a panel Pedro TSO/ISPF 1 Thu Feb 16, 2017 3:09 am
No new posts Joinkeys with decimal scdinesh DFSORT/ICETOOL 3 Fri Feb 10, 2017 4:46 am
No new posts Converting decimal to numeric using I... Balaryan DFSORT/ICETOOL 4 Thu Feb 02, 2017 11:27 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us