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
 

 

Need Help in Syncsort V1.3.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Need Help in Syncsort V1.3.
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: 1703
Location: Australia

PostPosted: Fri Jan 08, 2010 4:09 am    Post subject:
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: 500
Location: USA

PostPosted: Sat Jan 09, 2010 2:21 am    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SYNCSORT SEQNUM and FI fields. nartcr SYNCSORT 7 Sat Jan 21, 2017 4:02 am
No new posts Syncsort Help to group fields sudhakarraju SYNCSORT 6 Thu Dec 29, 2016 1:38 am
No new posts syncsort: copy lines after the keyword shreya19 SYNCSORT 7 Fri Dec 02, 2016 9:47 am
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts Syncsort - NULL in Integer field chec... nartcr SYNCSORT 4 Thu Oct 06, 2016 6:47 am


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