IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Selecting a prticular group based on a condition


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Thu Jul 05, 2012 3:25 pm
Reply with quote

Hello,

I have below input REPORT file[LRECL=40] -->
Code:

----+----1----+----2----+----3----+----4
GROUP INFORMATION 1
JOHN
ID 123456
DEPT ENG
123456
GROUP INFORMATION 2
JAMES
ID 456789
DEPT ENG
456789
GROUP INFORMATION 3
DAVID
ID 987456
DEPT SCI
987456
GROUP INFORMATION 5
WILLIAMS
ID 963258
DEPT ENG
963258
GROUP INFORMATION 6
RICHARD
ID 745896
DEPT PHY
745896
GROUP INFORMATION 7
DONALD
ID 852456
DEPT PHY
852456


The requirement is to pull out those set of records which belongs to department = ENGLISH.

That is, the Group begins with (1,17,CH,EQ,'GROUP INFORMATION')
Third line of the Group has Department information. We need only those groups whose department information is (6,3,CH,EQ,'ENG')

So the expected output file[LRECL=40] will be as below -->

Code:

----+----1----+----2----+----3----+----4
GROUP INFORMATION 1
JOHN
ID 123456
DEPT ENG
123456
GROUP INFORMATION 2
JAMES
ID 456789
DEPT ENG
456789
GROUP INFORMATION 5
WILLIAMS
ID 963258
DEPT ENG
963258



The actual problem lies in the fact that the DEPARTMENT is present in
the third line . Had it been in the first line of the group , the task would have been much simpler by coding (WHEN=GROUP, PUSH ) statement .

Help would be highly appreciated.
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jul 05, 2012 3:54 pm
Reply with quote

Have a think about JOINKEYS with the same file for both inputs.

In one JNFnCNTL file, do a GROUP to push the ID=, and then only include the records which are your IDs.

On the other JNFnCNTL, do the same GROUP to push the ID=.

Use JOINKEYS on the ID=.

Bit of Deja Vu with another recent topic...
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Jul 05, 2012 9:19 pm
Reply with quote

Techslam,

Check this link which is quite similar to the problem you have.

www.ibmmainframes.com/viewtopic.php?p=293155#293155
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Thu Jul 05, 2012 9:34 pm
Reply with quote

Techslam,

Do your groups always start with GROUP? If not, remember that you can use RECORDS in the WHEN=GROUP.

Do all your departments records start DEPT?
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Fri Jul 06, 2012 5:02 pm
Reply with quote

@Bill Woodger

Yes my groups always start with 'GROUP INFORMATION'
&
All department records start with 'DEPT'
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7309
Location: Inside the Matrix

PostPosted: Fri Jul 06, 2012 5:20 pm
Reply with quote

OK, good. Let us know how it gets on with Kolusu's solution.
Back to top
View user's profile Send private message
techslam

New User


Joined: 03 Dec 2010
Posts: 87
Location: India

PostPosted: Fri Jul 06, 2012 7:00 pm
Reply with quote

@Skolusu
Thanks. I follwoed your link and it worked perfectly for me. Thanks a ton for this help. Appreciate it.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To search DB2 table based on Conditio... DB2 1
This topic is locked: you cannot edit posts or make replies. Merge 2 input files based on the reco... JCL & VSAM 2
No new posts Compare latest 2 rows of a table usin... DB2 1
No new posts Selecting the max value from a file. DFSORT/ICETOOL 3
No new posts Split large FB file based on Key coun... DFSORT/ICETOOL 4
Search our Forums:

Back to Top