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
 

 

Need to search for Packed decimal number in RRDS file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
kapiltamrakar

New User


Joined: 24 May 2009
Posts: 41
Location: Hyderabad

PostPosted: Mon Aug 01, 2011 8:49 pm    Post subject: Need to search for Packed decimal number in RRDS file
Reply with quote

I need to search for a Packed Decimal value in RRDS file. That value can appear in multiple position in one record as the record consists of multiple occurrences of one copybook.

I know to search PD values by using SORT card for a given position as :

INCLUDE COND=(1,8,PD,EQ,235109261000026)
SORT FIELDS=COPY

I was also trying to use SS (Substring search), but it is not useful for Pack Decimal values.

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

Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Aug 02, 2011 12:00 am    Post subject:
Reply with quote

kapiltamrakar,

It would help you if have posted the cobol layout of the file and where you plan to search.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Aug 02, 2011 1:18 am    Post subject:
Reply with quote

Quote:
I was also trying to use SS (Substring search), but it is not useful for Pack Decimal values.


Not completely true. SS allows hex values, so if your PD values use an F or C for the plus sign, you could use a DFSORT statements like this:

Code:

  OPTION COPY                                         
  INCLUDE COND=(1,80,SS,EQ,X'235109261000026C',OR,   
                1,80,SS,EQ,X'235109261000026F')       
Back to top
View user's profile Send private message
kapiltamrakar

New User


Joined: 24 May 2009
Posts: 41
Location: Hyderabad

PostPosted: Tue Aug 02, 2011 7:27 pm    Post subject:
Reply with quote

Hi Skolusu and Frank Yaeger,
Thanks for your replies.

The COBOL LAYOUT is as below

Code:
         05  KEY.                                   
             07  TIN              PIC S9(15) PACKED-DECIMAL. 
         05  CONTROL-GROUP.                               
             07  LOGICAL-DELETE        PIC X(1).         
                 88  LOGICALLY-DELETED    VALUE 'Y'.       
             07  NUMERIC-FILL          PIC 9(3).   

...
..

I want to search in field "TIN" which is as key for the file.

the example of values which i want to search are as follows :

211111111000026
222222222000026
etc.

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Aug 02, 2011 8:02 pm    Post subject: Reply to: Need to search for Packed decimal number in RRDS f
Reply with quote

So, your comp-3 is signed. If you are not interested in -ve values, and no "F" in the signs...

Modify Frank's code

Code:
  OPTION COPY                                         
  INCLUDE COND=(1,80,SS,EQ,X'211111111000026C',OR,   
             1,80,SS,EQ,X'???????????000026C',OR,
             1,80,SS,EQ,X'222222222000026C')       


For as many as necessary.

If this is an investigation, (ie, not going blindly into another program) I'd suggest

Code:
  OPTION COPY
  INCLUDE COND=(1,80,SS,EQ,X'000026C',OR,   
             1,80,SS,EQ,X'000026F',OR,       
             1,80,SS,EQ,X'000026D')       


If all the fields you are searching for end in the same value. Remember, possible to pick up others in error. Then you can match what is picked against your list, plus you cover the "unsigned" and "negative" as well, just in case.
Back to top
View user's profile Send private message
sqlcode1

Active Member


Joined: 08 Apr 2010
Posts: 578
Location: USA

PostPosted: Tue Aug 02, 2011 8:21 pm    Post subject:
Reply with quote

kapiltamrakar,
Are the search values static? Meaning, are you trying to read search values from a file or is this some kind of predefined constant values ?

Bill,
Frank provided what OP asked for based on OP's sample code or rather trying to clarify that SS works for hex values as well. OP didn't mention if the values would flow from input file or not. If indeed OP wants to pass search values from the input file (based on cobol layout he provided), the above solutions won't work.

Thanks,
Back to top
View user's profile Send private message
kapiltamrakar

New User


Joined: 24 May 2009
Posts: 41
Location: Hyderabad

PostPosted: Tue Aug 02, 2011 9:14 pm    Post subject:
Reply with quote

Hi Skolusu , Frank Yaeger and Bill Woodger,
I am Able to get which i was looking for.
Thank You icon_smile.gif

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Tue Aug 02, 2011 9:42 pm    Post subject: Reply to: Need to search for Packed decimal number in RRDS f
Reply with quote

Quote:
I need to search for a Packed Decimal value in RRDS file. That value can appear in multiple position in one record as the record consists of multiple occurrences of one copybook.



Quote:
Code:
         05  KEY.                                   
             07  TIN              PIC S9(15) PACKED-DECIMAL. 
         05  CONTROL-GROUP.                               
             07  LOGICAL-DELETE        PIC X(1).         
                 88  LOGICALLY-DELETED    VALUE 'Y'.       
             07  NUMERIC-FILL          PIC 9(3).   


So, I assume there can be multiple instances of this layout on the same physical record.

Subject to amending search length for actual file, Frank showed a method to INCLUDE the records in which the "string of hex characters", which happened to represent the packed-decimal value being searched for, occured anywhere within the range to be searched.

From the look of the data provided, I suggested a method which was more inclusive for the search, based on Frank's code, by which might be found records which are "needed" but not on the list of needed records, including covering the possibilities, as suggested by Frank, of different sign values in the packed-decimal field.

TS/OP hasn't been clear. What I assumed was that there are records, with multiple occurences of the copybook later provided, whereby the value being searched for could be in any one of a number of places. SS had been attempted with PD, Frank pointed out how to use SS in such a situation, and I went with that and what I could understand of the requirement.

Unless I have wildly misunderstood TS/OP (can happen), I don't see what shouldn't work. Certainly not a full/complete solution, as we have no full/complete idea of what TS/OP wants, but I think a basis for his solution at the very least.

If it is no use, TS/OP will be back, I guess.
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 11 Tue May 16, 2017 2:20 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am
No new posts READ A PACKED "NEGATIVE" FI... jdesouza CA Products 3 Tue May 02, 2017 11:43 pm


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