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
 

 

Identifying Unique rows in a PS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
Karthikeyan J

New User


Joined: 19 Dec 2006
Posts: 16
Location: Mumbai

PostPosted: Tue Dec 26, 2006 7:46 pm    Post subject: Identifying Unique rows in a PS
Reply with quote

Hi,

I have a PS with thousands of records. Let each record be in a format say

NAME ROLL-NO MARKS ADDRESS
1-30 31-35 36-38 39-60

I want to see only unique values of ROLL-NO. Is there any ISPF/TSO command that will help me in this regard? Is there any optional attribute that can be used along with SORT command to acheive this task?
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Dec 26, 2006 7:58 pm    Post subject:
Reply with quote

If you sort on ROLL-NO after appending a field (big enough) of 1 and sum on that field, you should be able to omit /include leaving just those with a sum of 1 to output.
Back to top
View user's profile Send private message
cpuhawg

Active User


Joined: 14 Jun 2006
Posts: 331
Location: Jacksonville, FL

PostPosted: Tue Dec 26, 2006 8:03 pm    Post subject: Re: Identifying Unique rows in a PS
Reply with quote

Unfortunately, the SORT command under ISPF can only resequence the records of your dataset.

If you run a batch SORT job using the following parameters, the records in the resulting output file will indicate the unique values of ROLL-NO in positions 31-35.

Code:

 SORT FIELDS=(31,5,CH,A)         
 SUM FIELDS=NONE                 


These control cards will sort your dataset starting in position 31 for 5 positions and will remove all duplicates (according to the sort field).
Back to top
View user's profile Send private message
Karthikeyan J

New User


Joined: 19 Dec 2006
Posts: 16
Location: Mumbai

PostPosted: Tue Dec 26, 2006 9:20 pm    Post subject:
Reply with quote

Thanks william for your quick reply,

Please elaborate on your message to help me understand better. Does that 1 in first line refer to first colum i.e NAME and does OMIT and INCLUDE you refer to are in ISPF.

It would be great if you can post a sort of step by step instruction indicating the commands to try out.

Thanks cpuhawg for that tip on SORT,

But i am looking for an ISPF command or something like that.
Back to top
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Tue Dec 26, 2006 9:26 pm    Post subject: Re: Identifying Unique rows in a PS
Reply with quote

I think this process is going to require a custom-written ISPF EDIT Macro, employing the technique(s) described above.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Dec 26, 2006 9:28 pm    Post subject:
Reply with quote

Karthikeyan J wrote:
Does that 1 in first line refer to first colum i.e NAME and does OMIT and INCLUDE you refer to are in ISPF.
Quote:
The "1" is an added field at the end of your record defined in the INREC.
The INCLUDE/OMIT refer to your choice, include all recs which the summed field = 1 or omit those that are not = 1.
I was seeing that you would need to batch execute a SORT job.
It would be great if you can post a sort of step by step instruction indicating the commands to try out.
This is more Frank's area.
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts To display values of multiple rows in... vinu78 DB2 2 Thu Mar 09, 2017 1:20 pm
No new posts how to send just 10 rows in a CICS sc... Megha Gupta CICS 5 Thu Feb 23, 2017 6:57 pm
This topic is locked: you cannot edit posts or make replies. DB2 query Using Recursion, Converting... smilewithashu2 DB2 3 Tue Jan 03, 2017 12:50 pm
This topic is locked: you cannot edit posts or make replies. Db2 SQL query to convert rows into co... subratarec DB2 5 Thu Nov 17, 2016 4:51 pm
No new posts Row-Numbers of distinct rows? Auryn DB2 1 Thu Oct 20, 2016 4:38 pm


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