IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Packed decimal values comparison in Sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Nov 12, 2012 9:01 pm
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
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: 1788
Location: Bloomington, IL

PostPosted: Mon Nov 12, 2012 9:38 pm
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
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: 1788
Location: Bloomington, IL

PostPosted: Mon Nov 12, 2012 9:54 pm
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

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Mon Nov 12, 2012 10:36 pm
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: 2455
Location: Hampshire, UK

PostPosted: Tue Nov 13, 2012 3:27 am
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
Search our Forums:

Back to Top