MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

using include cond with PD data

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
pzmohanty
Beginner


Joined: 20 May 2004
Posts: 97
Topics: 43
Location: hyderabad, India

PostPosted: Fri Jun 17, 2005 8:36 am    Post subject: using include cond with PD data Reply with quote

Hi all,

I have a following problem:

My input file layout definition contain a internal table with following defn of the layout:

01 FILE-REC.
10 FILLER PIC X(20)
10 DATA-TABLE OCCURS 30 TIMES.
15 TABLE-ELEMENT PIC S9(5) COMP-3.
10 FILLER PIC X(60)

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.

I have to do this using SORT only.

Thanks & regards
_________________
Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Fri Jun 17, 2005 9:45 am    Post subject: Reply with quote

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.

Code:

//SYSIN DD *
  SORT FIELDS=COPY
  INCLUDE COND=(021,2,PD0,EQ,X'C30C',OR, 
                024,2,PD0,EQ,X'C30C',OR, 
                027,2,PD0,EQ,X'C30C',OR, 
                030,2,PD0,EQ,X'C30C',OR, 
                033,2,PD0,EQ,X'C30C',OR, 
                036,2,PD0,EQ,X'C30C',OR, 
                039,2,PD0,EQ,X'C30C',OR, 
                042,2,PD0,EQ,X'C30C',OR, 
                045,2,PD0,EQ,X'C30C',OR, 
                048,2,PD0,EQ,X'C30C',OR, 
                051,2,PD0,EQ,X'C30C',OR, 
                054,2,PD0,EQ,X'C30C',OR, 
                057,2,PD0,EQ,X'C30C',OR, 
                060,2,PD0,EQ,X'C30C',OR, 
                063,2,PD0,EQ,X'C30C',OR, 
                066,2,PD0,EQ,X'C30C',OR, 
                069,2,PD0,EQ,X'C30C',OR, 
                072,2,PD0,EQ,X'C30C',OR, 
                075,2,PD0,EQ,X'C30C',OR, 
                078,2,PD0,EQ,X'C30C',OR, 
                081,2,PD0,EQ,X'C30C',OR, 
                084,2,PD0,EQ,X'C30C',OR, 
                087,2,PD0,EQ,X'C30C',OR, 
                090,2,PD0,EQ,X'C30C',OR, 
                093,2,PD0,EQ,X'C30C',OR, 
                096,2,PD0,EQ,X'C30C',OR, 
                099,2,PD0,EQ,X'C30C',OR, 
                102,2,PD0,EQ,X'C30C',OR, 
                105,2,PD0,EQ,X'C30C',OR, 
                108,2,PD0,EQ,X'C30C')
/*


Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
pzmohanty
Beginner


Joined: 20 May 2004
Posts: 97
Topics: 43
Location: hyderabad, India

PostPosted: Sat Jun 18, 2005 5:19 am    Post subject: Reply with quote

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.

thanks & regards
_________________
Priya Ranjan Mohanty
Consultant
Kanbay Software (I) pvt. Ltd.
Hyderabad
Back to top
View user's profile Send private message Send e-mail Yahoo Messenger
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Sat Jun 18, 2005 9:49 am    Post subject: Reply with quote

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
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
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


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group