Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
pavaniabbineni

New User

Joined: 12 Nov 2012
Posts: 3
Location: India

 Posted: Mon Nov 12, 2012 8:58 pm    Post subject: Packed decimal values comparison in Sort 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

Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

 Posted: Mon Nov 12, 2012 9:01 pm    Post subject: Reply to: Packed decimal values comparison in Sort What, when you coded it, did you think the 1.4 would do?
pavaniabbineni

New User

Joined: 12 Nov 2012
Posts: 3
Location: India

 Posted: Mon Nov 12, 2012 9:18 pm    Post subject: 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?
Akatsukami

Global Moderator

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

Posted: Mon Nov 12, 2012 9:38 pm    Post subject:

 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.
pavaniabbineni

New User

Joined: 12 Nov 2012
Posts: 3
Location: India

 Posted: Mon Nov 12, 2012 9:41 pm    Post subject: Reply to: Packed decimal values comparison in Sort Can you suggest me how can we do that?
Akatsukami

Global Moderator

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

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

 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?
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

Posted: Mon Nov 12, 2012 10:36 pm    Post subject:

 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?
Nic Clouston

Global Moderator

Joined: 10 May 2007
Posts: 2020
Location: UK

 Posted: Tue Nov 13, 2012 3:27 am    Post subject: How about testing for values less than 1000000?
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics How can I convert charactor to fixed ... liying DFSORT/ICETOOL 7 Tue May 22, 2018 3:35 pm LOW VALUES as a KEY juares castro DB2 10 Sat Apr 07, 2018 1:06 am Sort numeric fields with trailing spaces sancraig16 SYNCSORT 7 Tue Apr 03, 2018 1:21 am Find & Replace string in CA-SORT mrgnndhmk CA Products 1 Fri Mar 30, 2018 12:58 am SORT 3 files,extract specific fields ... Kiransr DFSORT/ICETOOL 13 Fri Mar 23, 2018 10:54 am

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us