Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to group the records and retrieve?

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

New User


Joined: 04 Mar 2010
Posts: 38
Location: DC

PostPosted: Wed Mar 17, 2010 7:27 pm    Post subject: How to group the records and retrieve?
Reply with quote

Hi All,

I have got a requirement to fecth only first set of records.

Example, I am having a file (80 bytes),

Code:

0EF PENS01001311   
1EF PENS01001311MONDAY
9EF PENS01001319Z   
0BC PENS01001311SBD
1BC PENS01001311TUESDAY
9BC PENS01001319Z   
0BC PENS01003311CO 
1BC PENS01003319WEDNESDAY 
9BC PENS01003319Z   


Set of records would be based on the value at first postion (0,1 and 9).

0-Header 1- detail and 9- Trailer. Like wise i may get n number of sets.

I would like to get only the first set of records.

I am getting date in the header record, can we use that string to stop fetching next record? else
can we group the records based on the value at postion 1 (0,1 and 9)and fecth the first group?

Please let me know if this can be done in SORT?
Back to top
View user's profile Send private message

Alexis Sebastian

New User


Joined: 04 Mar 2010
Posts: 38
Location: DC

PostPosted: Wed Mar 17, 2010 8:16 pm    Post subject:
Reply with quote

Hi All,

I understood the concep GROUP from manuals and coded as below.
Code:

//SYSIN    DD *                                 
  OPTION COPY                                   
  INREC IFTHEN=(WHEN=GROUP,                     
                 BEGIN=(1,1,CH,EQ,C'0'),       
                 END=(1,1,CH,EQ,C'9'),         
                 PUSH=(81:ID=1))               
  OUTFIL INCLUDE=(81,1,CH,EQ,C'1'),BUILD=(1,80)
//*                                             


It worked fine. Please let me know if i can use anyother method?

Thanks in advance
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Mar 17, 2010 9:50 pm    Post subject:
Reply with quote

Alexis Sebastian,

That is the right way to do it , but remember that you are only using 1 byte ID which would repeat it after every 10 groups. So if you have more than 10 groups you would include the 1,11,21.... groups also.

I suggest to increase the ID to 8 bytes.

Code:

//SYSIN    DD *                                 
  OPTION COPY                                   
  INREC IFTHEN=(WHEN=GROUP,                     
                 BEGIN=(1,1,CH,EQ,C'0'),       
                 END=(1,1,CH,EQ,C'9'),         
                 PUSH=(81:ID=8))               
  OUTFIL INCLUDE=(81,8,ZD,EQ,1),BUILD=(1,80)
//*
Back to top
View user's profile Send private message
Alexis Sebastian

New User


Joined: 04 Mar 2010
Posts: 38
Location: DC

PostPosted: Sat Mar 20, 2010 11:54 pm    Post subject:
Reply with quote

Thank you. I understood.

Have a nice weekend!!!
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 Merging records, but not all the time prino DFSORT/ICETOOL 8 Sat Feb 17, 2018 4:20 pm
No new posts Need all records with high key kalidasvs SYNCSORT 14 Fri Feb 09, 2018 10:38 pm
No new posts Why is SORT rearranging records that ... cschablow DFSORT/ICETOOL 4 Wed Jan 24, 2018 10:14 pm
No new posts Skip records depends on count lakshmiibmmainframes DFSORT/ICETOOL 5 Sun Dec 24, 2017 9:51 pm
No new posts Compare two PS files using ICE TOOL f... SENTHIL MURUGAAN DFSORT/ICETOOL 5 Sun Dec 24, 2017 1:26 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us