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 

Sort on specific critiria

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


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Thu Apr 23, 2009 4:52 pm    Post subject: Sort on specific critiria Reply with quote

Hi All,

I have a input file LRECL=37, RECFM=FB.

The input is as shown below
[code:1:5e5d14bee3]
----+----1----+----2----+----3----+--

& M@ABC0302981 LTCMNRESIDFLPOAA
& N ABC0302981 LTCMNRESIDGAPOAA

_________________
Regards,
Chandra
Back to top
View user's profile Send private message
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Thu Apr 23, 2009 5:30 pm    Post subject: Reply with quote

If the POAA , SOWN is present for any member num then it should be the first record

The better input out put example here


[code:1:3e7575589d]& M@ABC0302981 LTCMNRESIDFLPOAA
& N ABC0302981 LTCMNRESIDGAPOAA

_________________
Regards,
Chandra
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Thu Apr 23, 2009 5:37 pm    Post subject: Reply with quote

chandra,

You are not consistent with your rules .
ex : ABC0302981 have 4 records 2 of them have POAA and INSD member type. According to your rule INSD should be sorted last , but your desired output shows that you want to club them based on the state code , FL but for the other case you dont follow the same pattern XYZ1230001 has POAA with state codes CA, WI , MN , how come WI is sorted before MN?

You need to do a better job of defining the rules
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Thu Apr 23, 2009 10:00 pm    Post subject: Reply with quote

Hi Kolusu,

Sorry for the confusion.

Yes, I want to club the records by state code depending on following rules

1. For each member there will be POAA, SOWN, INSD ((At least one or more will be present for each Member number) is present then that state group records should come first. The order must follow POAA,SOWN,INSD,INOTC,COVSP,COVCH,PCHD

The output is as follows

[code:1:a9f508652e]& M@ABC0302981 LTCMNRESIDFLPOAA

_________________
Regards,
Chandra
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Apr 24, 2009 12:22 pm    Post subject: Reply with quote

chandra,

Use the following Control cards

Code:

//SYSIN    DD *                                                   
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(39:C'99')),                     
        IFTHEN=(WHEN=(33,5,CH,EQ,C'POAA '),OVERLAY=(38:C'1',31,2)),
        IFTHEN=(WHEN=(33,5,CH,EQ,C'SOWN '),OVERLAY=(38:C'2',31,2)),
        IFTHEN=(WHEN=(33,5,CH,EQ,C'INSD '),OVERLAY=(38:C'3',31,2)),
        IFTHEN=(WHEN=(33,5,CH,EQ,C'INOTC'),OVERLAY=(38:C'4')),     
        IFTHEN=(WHEN=(33,5,CH,EQ,C'COVSP'),OVERLAY=(38:C'5')),     
        IFTHEN=(WHEN=(33,5,CH,EQ,C'COVCH'),OVERLAY=(38:C'6')),     
        IFTHEN=(WHEN=(33,5,CH,EQ,C'PCHD '),OVERLAY=(38:C'7'))     
  SORT FIELDS=(6,15,CH,A,39,2,CH,A,38,1,CH,A)                     
  OUTREC BUILD=(1,37)                                             
/*

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


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Fri Apr 24, 2009 2:12 pm    Post subject: Reply with quote

Thank you very much Kolusu, It is working as expected.

Thank you once again.
_________________
Regards,
Chandra
Back to top
View user's profile Send private message
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