View previous topic :: View next topic
|
Author |
Message |
Karthikeyan J
New User
Joined: 19 Dec 2006 Posts: 16 Location: Mumbai
|
|
|
|
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 |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
cpuhawg
Active User
Joined: 14 Jun 2006 Posts: 331 Location: Jacksonville, FL
|
|
|
|
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 |
|
|
Karthikeyan J
New User
Joined: 19 Dec 2006 Posts: 16 Location: Mumbai
|
|
|
|
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 |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
I think this process is going to require a custom-written ISPF EDIT Macro, employing the technique(s) described above. |
|
Back to top |
|
|
William Thompson
Global Moderator
Joined: 18 Nov 2006 Posts: 3156 Location: Tucson AZ
|
|
|
|
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 |
|
|
|