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
 

 

Selecting a prticular group based on a condition

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Selecting a prticular group based on a condition
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Jul 05, 2012 3:54 pm    Post subject:
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    Post subject:
Reply with quote

Techslam,

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

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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Thu Jul 05, 2012 9:34 pm    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Fri Jul 06, 2012 5:20 pm    Post subject:
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    Post subject:
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    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 Split file based on comparsion to 2 f... Div Grad DFSORT/ICETOOL 3 Thu Jul 27, 2017 9:16 pm
This topic is locked: you cannot edit posts or make replies. Need help on If condition continuatio... ashok_uddaraju CLIST & REXX 4 Fri May 19, 2017 8:55 am
No new posts find RACF group for access to spooled... jzhardy JCL & VSAM 1 Mon May 08, 2017 11:46 am
No new posts Group Data based on a key Arun Raj DFSORT/ICETOOL 7 Thu Apr 27, 2017 11:29 pm
No new posts Need Help with : IFTHEN(WHEN=GROUP) Sumanta_89 DFSORT/ICETOOL 1 Wed Apr 19, 2017 5:23 pm


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