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
 

 

Copy only first occuring names in the list (not sorted)

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rahulcherekar

New User


Joined: 20 Feb 2007
Posts: 16
Location: New York

PostPosted: Fri Jan 16, 2009 8:49 pm    Post subject: Copy only first occuring names in the list (not sorted)
Reply with quote

Hi,

My input file is as below:

RAHUL
AMIT
RAHUL
KRISHNA
RAHUL
KRISHNA
AMIT
TT
AMIT

and my desired output is:

RAHUL
AMIT
KRISHNA
TT

Please let me know, if I can use ICETOOL/DFSORT to get the desired ouput.

I tried using

"SPLICE FROM(SORTIN) TO(NODUPES) -
ON(001,012,CH) WITH(1,12) KEEPNODUPS"
and

" SELECT FROM(SORTIN) TO(NODUPES) -
ON(001,012,CH) FIRST "

- both gave me output in a sorted order.

AMIT
KRISHNA
RAHUL
TT

I can only think of writing a program now.
Back to top
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6967
Location: porcelain throne

PostPosted: Fri Jan 16, 2009 9:02 pm    Post subject:
Reply with quote

do a search on sequence numbers in sort.

you input your data and append a sequence number.

sort on the name, drop dups.

sort on the number, remove the appended sequence number and output.

take a look at the sticky Frank created for the DFSORT/ICETOOL forum that contains links to reference material, including quick start guide.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Fri Jan 16, 2009 9:18 pm    Post subject:
Reply with quote

Rahul,

You can use a DFSORT/ICETOOL job like the following to do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD *
RAHUL
AMIT
RAHUL
KRISHNA
RAHUL
KRISHNA
AMIT
TT
AMIT
/*
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT DD SYSOUT=*
//TOOLIN DD *
SELECT FROM(IN) TO(T1) ON(1,12,CH) FIRST USING(CTL1)
SORT FROM(T1) TO(OUT) USING(CTL2)
/*
//CTL1CNTL DD *
  INREC OVERLAY=(81:SEQNUM,8,ZD)
/*
//CTL2CNTL DD *
  SORT FIELDS=(81,8,ZD,A)
  OUTREC BUILD=(1,80)
/*
Back to top
View user's profile Send private message
rahulcherekar

New User


Joined: 20 Feb 2007
Posts: 16
Location: New York

PostPosted: Fri Jan 16, 2009 10:25 pm    Post subject:
Reply with quote

It worked.

Thanks All for your help,
Rahul.
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 member list compare jzhardy TSO/ISPF 6 Fri May 12, 2017 3:18 pm
No new posts copy SEQ to PDS and create stats steve-myers JCL & VSAM 5 Thu Apr 27, 2017 1:15 am
No new posts Copy load modules and alias vasanthz IBM Tools 5 Thu Apr 20, 2017 6:31 am
No new posts SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts HALDB data refresh/copy from producti... vineetanand2007 IMS DB/DC 1 Mon Jan 02, 2017 11:16 am


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