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: 7228

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: 1738
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: 1738
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: 7228

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: 1715
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 Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts Overlaying one set of charater values... Kevin Lindsley SYNCSORT 7 Sat Nov 05, 2016 3:21 am
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts Comparing Decimal and CHAR columns rakesh17684 DB2 7 Thu Oct 20, 2016 2:33 am


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