IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

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


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Fri Jan 16, 2009 9:02 pm
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 Developer


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

PostPosted: Fri Jan 16, 2009 9:18 pm
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts VB to VB copy - Full length reached SYNCSORT 8
No new posts How to create a list of SAR jobs with... CA Products 3
No new posts Need COBOL COPY Help in MVS Environment COBOL Programming 4
No new posts Issue after ISPF copy to Linklist Lib... TSO/ISPF 1
No new posts DB2 Table - Image copy unload IBM Tools 2
Search our Forums:

Back to Top