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
 

 

Packed decimal values comparison in Sort

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
pavaniabbineni

New User


Joined: 12 Nov 2012
Posts: 3
Location: India

PostPosted: Mon Nov 12, 2012 8:58 pm    Post subject: Packed decimal values comparison in Sort
Reply with quote

Hi

i have to sort a file based on a packed decimal field such that, if the first three digits of the packed decimal S9(09) are zeroes then those records should be omitted.

The packed decimal field starts at position 228
I have coded sort as below:
SORT FIELDS=COPY
INCLUDE COND=(268,2,ZD,EQ,00,AND,
(1,3,ZD,EQ,600,AND,
228,1.4,PD,NE,0)) --- syntax error is coming


But the job is failing showing error message at 1.4 a syntax error

Please tell me if the code i am using is wrong and let me know if there is any other way
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Nov 12, 2012 9:01 pm    Post subject: Reply to: Packed decimal values comparison in Sort
Reply with quote

What, when you coded it, did you think the 1.4 would do?
Back to top
View user's profile Send private message
pavaniabbineni

New User


Joined: 12 Nov 2012
Posts: 3
Location: India

PostPosted: Mon Nov 12, 2012 9:18 pm    Post subject:
Reply with quote

I t has been suggested in one of the forum that part of packed decimal number can be used in this way, its been suggested to be used in SORT


SORT FIELDS=(4.4,0.4,BI,D) for sorting the records based on the second digit in fourth byte in decending order.

ccan't we use the similar concept while comparing the packed decimal values also?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1765
Location: Bloomington, IL

PostPosted: Mon Nov 12, 2012 9:38 pm    Post subject:
Reply with quote

pavaniabbineni wrote:
I t has been suggested in one of the forum that part of packed decimal number can be used in this way, its been suggested to be used in SORT


SORT FIELDS=(4.4,0.4,BI,D) for sorting the records based on the second digit in fourth byte in decending order.

ccan't we use the similar concept while comparing the packed decimal values also?

The DFSORT control card syntax has nothing in it that refers to part of a packed decimal field. You can, of course, treat that fraction of it as character or binary -- remembering in the latter case that it will be BCD -- but then you must specify it as if it were in fact a whole character or binary field.
Back to top
View user's profile Send private message
pavaniabbineni

New User


Joined: 12 Nov 2012
Posts: 3
Location: India

PostPosted: Mon Nov 12, 2012 9:41 pm    Post subject: Reply to: Packed decimal values comparison in Sort
Reply with quote

Can you suggest me how can we do that?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1765
Location: Bloomington, IL

PostPosted: Mon Nov 12, 2012 9:54 pm    Post subject: Re: Reply to: Packed decimal values comparison in Sort
Reply with quote

pavaniabbineni wrote:
i have to sort a file based on a packed decimal field such that, if the first three digits of the packed decimal S9(09) are zeroes then those records should be omitted. [...] Can you suggest me how can we do that?

Code:
SORT FIELDS=COPY
INCLUDE COND=(268,2,ZD,EQ,00,AND,
(1,3,ZD,EQ,600,AND,
228,3,BI,NE,0))

Incidentally, your problem seems to be very similar, if not identical, to that posted by krupagk in the JCL forum. Are you competing or cooperating?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Nov 12, 2012 10:36 pm    Post subject:
Reply with quote

pavaniabbineni wrote:
I t has been suggested in one of the forum that part of packed decimal number can be used in this way, its been suggested to be used in SORT


Can you say what to search for to find this, please?
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1806
Location: UK

PostPosted: Tue Nov 13, 2012 3:27 am    Post subject:
Reply with quote

How about testing for values less than 1000000?
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Optimize sort inrec parse vishwakotin DFSORT/ICETOOL 5 Mon Jun 26, 2017 11:15 pm
No new posts Reduce CPU Times for Join Sort santoshn SYNCSORT 12 Sat Jun 10, 2017 1:40 pm
No new posts Db2 load job abending in SORT mistah kurtz DB2 4 Mon Jun 05, 2017 3:58 pm
No new posts Sorting of hex values Saurabh_mi DFSORT/ICETOOL 11 Thu May 25, 2017 3:49 pm
No new posts How to change 'K' or 'M' use Sort vice_versa DFSORT/ICETOOL 5 Thu May 18, 2017 7:11 am


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