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
 

 

COMP-3 field comparison

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
krupagk

New User


Joined: 07 Aug 2010
Posts: 13
Location: Hyderabad

PostPosted: Mon Nov 12, 2012 8:46 pm    Post subject: COMP-3 field comparison
Reply with quote

Hi All,

I have a COMP-3 field and i want to compare first 3 bytes of it. Can you help me with the JCL sort. Here is my field and my condition

03 : FIELD-A PIC S9(09) COMP-3.

My Condition is FIELD-A(1:3) NE 000 i.e. first three characters not equal to 000

Regards
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Mon Nov 12, 2012 8:59 pm    Post subject: Reply to: COMP-3 field comparison
Reply with quote

When you say three bytes of zero, do you mean you expec X'F0F0F0' (zoned/display decimal) or X'000000' (packed/comp-3/binary/comp/comp-4/comp-5) or what?

Show an example, in HEX, for the input and show what you want to do with it.
Back to top
View user's profile Send private message
krupagk

New User


Joined: 07 Aug 2010
Posts: 13
Location: Hyderabad

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

Hi Bill,

Here is my input file

FIELD-X FIELD-A
31/AN 5/PS
(1-31) (228-232)
ZZZZZZZZZZZZZZZZZAAAAAAAAAAAAAA 0
AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA 44005643
BBBBBBBBBBBBBBBBBBBBBBBBBBBBBBB 3554
DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD 0
CCCCCCCCCCCCCCCCCCCCCCCCCCCCCCC 0

Here only the 2nd record must come in output all other has to be skip as FIELD-A(1:3) is non zero's

Regards
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:59 pm    Post subject: Re: COMP-3 field comparison
Reply with quote

krupagk wrote:
Hi All,

I have a COMP-3 field and i want to compare first 3 bytes of it. Can you help me with the JCL sort. Here is my field and my condition

03 : FIELD-A PIC S9(09) COMP-3.

My Condition is FIELD-A(1:3) NE 000 i.e. first three characters not equal to 000

Look at this this thread. Although it is in the DFSORT forum and you are either using Syncsort or posting in the wrong forum, the syntax should be identical.
Back to top
View user's profile Send private message
krupagk

New User


Joined: 07 Aug 2010
Posts: 13
Location: Hyderabad

PostPosted: Tue Nov 13, 2012 2:08 pm    Post subject:
Reply with quote

Hi Akatsukami,

Thanks for the update. Closing this post here and opening in SyncSort

Regards
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7236

PostPosted: Tue Nov 13, 2012 3:08 pm    Post subject: Reply to: COMP-3 field comparison
Reply with quote

You are already in the correct forum for SyncSort. Your new duplicate in the DFSORT forum has been deleted.

What is curious, as Mr A. has noted, is that there is you and there is pavaniabbineni who seem to be working on the same thing.

pavaniabbineni is in DFSORT.

Are you working together? Or how do the tasks happend to be the same?

Test for X'000000' if leading zeros in a packed/comp-3 field.
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1219
Location: Israel

PostPosted: Tue Nov 13, 2012 3:24 pm    Post subject:
Reply with quote

COMP-3 fields contain numbers, so you have to take a different approach:
being defined as PIC S9(9), values range between 999999999- and 999999999+.
The 3 left bytes cover the 6 leftmost digits. If they are zeroes then the range changes to 000000999- and 000000999+.
If in fact you only want to check the 3 leftmost digits. then the range of numbers will be 000999999- and 000999999+

Knowing this, it is now easy to INCLUDE/OMIT according to the correct range:
COND=(228,5,PD,LT,-999999,OR,228,5,PD,GT,+999999)
for example
Back to top
View user's profile Send private message
krupagk

New User


Joined: 07 Aug 2010
Posts: 13
Location: Hyderabad

PostPosted: Tue Nov 13, 2012 3:36 pm    Post subject:
Reply with quote

Hi Bill,

Thanks for the update. I am not sure about Pavaniabbineni.

Hi Marso,

Thanks a lot for the solution. I will try it and let you know the results

Regards
Back to top
View user's profile Send private message
krupagk

New User


Joined: 07 Aug 2010
Posts: 13
Location: Hyderabad

PostPosted: Tue Nov 13, 2012 6:30 pm    Post subject:
Reply with quote

Hi Marso,

It is working. Thanks a lot for your help.

Hi Bill,

I came to know that Pavaniabbineni is also working on the same task. We are in a team. I will tell her. Thank you

Hi All,

Thanks a lot for your help.

Regards
Daniel K Gadde
Back to top
View user's profile Send private message
enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10203
Location: italy

PostPosted: Tue Nov 13, 2012 7:54 pm    Post subject: Reply to: COMP-3 field comparison
Reply with quote

Quote:
I came to know that Pavaniabbineni is also working on the same task. We are in a team.


pretty religious people around here icon_cool.gif

Quote:
Do not let your left hand know what your right hand is doing.

Matthews 6.4
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Performing arithmetic on input field zh_lad DFSORT/ICETOOL 24 Tue Dec 06, 2016 8:04 pm
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts CICS NEW SIT PARAMETERS CICS BEHAVIOR... Kyle Carroll CICS 0 Fri Nov 04, 2016 11:55 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm
No new posts Sort records based on numeric field. Alks SYNCSORT 2 Wed Oct 19, 2016 10:14 pm


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