using SORT , I have to extract only those records where TABLE-ELEMENT field in the file contains '*30**'.
That means we have to extract only those records from the input file where the number contained in TABLE-ELEMENT field has '30' starting from 2 character with a length of 2 character.
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
Posted: Fri Jun 17, 2005 9:45 am Post subject:
pzmohanty,
You can use the PD0 format to select the desired records. This format is used to sequence 2-8 byte packed decimal data. PD0 ignores the first digit and trailing sign during processing.
Joined: 20 May 2004 Posts: 97 Topics: 43 Location: hyderabad, India
Posted: Sat Jun 18, 2005 5:19 am Post subject:
Hi Kolusu ,
I am still not getting the results after using PD0.
My input file's one record's internal table's first element contains the numeric value as '43012'.
My sort card is following :
SORT FIELDS=COPY
INCLUDE COND=(21,2,PD0,EQ,X'4301')
still no records were selected , can you please explain more on the usage of PD0 , I rummaged the net for more info on PD0 format , but was of no help.
Can u please explain with an example & dummy data & sort card.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Sat Jun 18, 2005 9:49 am Post subject:
Priya,
I'm confused. You show your table element as PIC S9(5) COMP-3 which would mean it's a 3-byte PD field. But you say it contains '43012' and that you have to extract only those records from the input file where the number contained in TABLE-ELEMENT field has '30' starting from 2 character with a length of 2 character.
Is the field PD or CH? If it's PD, then it would look like this in hex:
43012C
and what you really want to do is extract records where the 2nd and 3rd digits contain 30. If that's the case, then a DFSORT INCLUDE statement like this should do what you want:
Code:
INCLUDE COND=(21,2,PD0,EQ,X'30',OR,
24,2,PD0,EQ,X'30',OR,
...)
In this case the X'30' looks for X'h30h' in the first two bytes. h is ignored, so any two bytes with 30 in the middle will be included.
If that doesn't work, then you need to show us what your table elements REALLY look like in HEX, e.g.
Code:
INREC FIELDS=(21,3,HEX)
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum