View previous topic :: View next topic
|
Author |
Message |
pavaniabbineni
New User
Joined: 12 Nov 2012 Posts: 3 Location: India
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What, when you coded it, did you think the 1.4 would do? |
|
Back to top |
|
|
pavaniabbineni
New User
Joined: 12 Nov 2012 Posts: 3 Location: India
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
pavaniabbineni
New User
Joined: 12 Nov 2012 Posts: 3 Location: India
|
|
|
|
Can you suggest me how can we do that? |
|
Back to top |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2455 Location: Hampshire, UK
|
|
|
|
How about testing for values less than 1000000? |
|
Back to top |
|
|
|