View previous topic :: View next topic
|
Author |
Message |
krupagk
New User
Joined: 07 Aug 2010 Posts: 13 Location: Hyderabad
|
|
|
|
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 |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
krupagk
New User
Joined: 07 Aug 2010 Posts: 13 Location: Hyderabad
|
|
|
|
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 |
|
|
Akatsukami
Global Moderator
Joined: 03 Oct 2009 Posts: 1788 Location: Bloomington, IL
|
|
|
|
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 |
|
|
krupagk
New User
Joined: 07 Aug 2010 Posts: 13 Location: Hyderabad
|
|
|
|
Hi Akatsukami,
Thanks for the update. Closing this post here and opening in SyncSort
Regards |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Marso
REXX Moderator
Joined: 13 Mar 2006 Posts: 1353 Location: Israel
|
|
|
|
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 |
|
|
krupagk
New User
Joined: 07 Aug 2010 Posts: 13 Location: Hyderabad
|
|
|
|
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 |
|
|
krupagk
New User
Joined: 07 Aug 2010 Posts: 13 Location: Hyderabad
|
|
|
|
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 |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
Quote: |
I came to know that Pavaniabbineni is also working on the same task. We are in a team. |
pretty religious people around here
Quote: |
Do not let your left hand know what your right hand is doing. |
Matthews 6.4 |
|
Back to top |
|
|
|