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

Need Help in Syncsort V1.3.


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Raghuraman_New

New User


Joined: 03 Oct 2008
Posts: 43
Location: Chennai,India.

PostPosted: Thu Jan 07, 2010 6:27 pm
Reply with quote

Hi,

Input:

AACBBC ABC
AAC000 ABC
AAC000
AAC000
AAC000 DEF
AAC000 DEF
ABA001
ABA001 DEF
ABA002 DEF
ABA002

Output :

AACBBC ABC
AAC000 ABC
AAC000
AAC000
AAC000 DEF
AAC001 DEF
ABA002 DEF


In the above example

Consider in the Coloumn 3 .

For any row , if we have the code DEF , that row shuld not be repeated(only one instance shuld be present)
For any other codes , the row shuld be processed as such.

Please help me in solving this out using Sort.

Note:
REFM : FB
LREC : 80

Thanks.
Back to top
View user's profile Send private message
gcicchet

Senior Member


Joined: 28 Jul 2006
Posts: 1702
Location: Australia

PostPosted: Fri Jan 08, 2010 4:09 am
Reply with quote

Hi,

if this is a sequential file then there is no such thing as rows, just records.

These output records are not mentioned in the input file unless I'm missing something

Code:
AAC001 DEF
ABA002 DEF



Gerry
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 496
Location: USA

PostPosted: Sat Jan 09, 2010 2:21 am
Reply with quote

Raghuram,

Your requirements are not clear. Here is a SyncSort for z/OS job that will produce the output below.
Code:
//SORT   EXEC PGM=SORT                                           
//SYSOUT   DD SYSOUT=*                                           
//SORTOUT  DD  DISP=(NEW,PASS),DSN=&&TEMP                         
//SORTIN   DD *                                                   
AACBBC ABC                                                       
AAC000 ABC                                                       
AAC000                                                           
AAC000                                                           
AAC000 DEF                                                       
AAC000 DEF                                                       
ABA001                                                           
ABA001 DEF                                                       
ABA002 DEF                                                       
ABA002                                                           
//SYSIN    DD *                                                   
   INREC IFTHEN=(WHEN=INIT,OVERLAY=(80:SEQNUM,8,ZD)),             
         IFTHEN=(WHEN=(8,3,CH,NE,C'DEF'),OVERLAY=(88:SEQNUM,8,ZD))
   SORT FIELDS=(1,6,CH,A,88,8,CH,A)                               
   SUM FIELDS=NONE
/*           
//S2 EXEC PGM=SORT             
//SYSOUT DD SYSOUT=*           
//SORTIN DD DISP=SHR,DSN=&&TEMP
//SORTOUT DD SYSOUT=*         
//SYSIN DD *                   
  SORT FIELDS=(80,8,CH,A)     
  OUTREC FIELDS=(1,80)         
/*

Output produced:
Code:
AACBBC ABC
AAC000 ABC
AAC000   
AAC000   
AAC000 DEF
ABA001   
ABA001 DEF
ABA002 DEF
ABA002   

The only record removed is
Code:
AAC000 DEF

If this is not what you want, then please be more specific in your description.
Back to top
View user's profile Send private message
sril.krishy

Active User


Joined: 30 Jul 2005
Posts: 183
Location: hyderabad

PostPosted: Sun Jan 10, 2010 12:30 am
Reply with quote

Hi,
Here is the another way of getting the outut as shown by Alissa thru
SYNCSORT FOR Z/OS 1.3.0.2RI.
Code:

//PS020    EXEC PGM=SYNCTOOL                               
//SYSOUT   DD  SYSOUT=*                                     
//TOOLMSG  DD  SYSOUT=*                                     
//DFSMSG   DD  SYSOUT=*                                     
//IN       DD  *                                           
AACBBC ABC                                                 
AAC000 ABC                                                 
AAC000                                                     
AAC000                                                     
AAC000 DEF                                                 
AAC000 DEF                                                 
ABA001                                                     
ABA001 DEF                                                 
ABA002 DEF                                                 
ABA002                                                     
//OUT      DD  SYSOUT=*                                     
//TOOLIN   DD  *                                           
   SORT FROM(IN) TO(OUT) USING(CTL1)                       
//CTL1CNTL DD  *                                           
   OPTION COPY                                             
   INREC OVERLAY=(11:SEQNUM,3,ZD,RESTART=(1,10))           
   OUTFIL FNAMES=OUT,                                       
   OUTREC=(1,10),OMIT=(8,3,CH,EQ,C'DEF',AND,11,3,ZD,GE,002)
/*                                                         


Thanks
Krishy
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 -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Count Records with a crietaria in a f... DFSORT/ICETOOL 5
No new posts DFSORT/SYNCSORT/ICETOOL JCL & VSAM 8
No new posts Syncsort "Y2C" Function SYNCSORT 1
No new posts Arithmetic division using Syncsort SYNCSORT 6
Search our Forums:

Back to Top