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
 

 

Extract fields from Duplicated records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
nazia.lalani
Warnings : 1

New User


Joined: 20 Mar 2009
Posts: 25
Location: hyderabad

PostPosted: Fri Sep 18, 2009 5:05 pm    Post subject: Extract fields from Duplicated records
Reply with quote

I have some dupicated records in input file with ICN
Layout is as follows

ICN Date1 Date2 date 3 numer code
x(5) x(10) x(10) x(10) 9(3) x(2)
12345 2008-01-01 2005-01-01 2007-01-01 123 BC
12345 2007-01-01 2004-01-01 2005-01-01 456 HA
12345 2002-01-01 2006-01-01 2006-01-01 789 US

I want date fields(date1,date2,date3) form first record whereas other (number and code) fields from last records
output shoould contain

12345 2008-01-01 2005-01-01 2007-01-01 789 US
Can anybody suggest me any solution
Back to top
View user's profile Send private message

nazia.lalani
Warnings : 1

New User


Joined: 20 Mar 2009
Posts: 25
Location: hyderabad

PostPosted: Fri Sep 25, 2009 3:13 pm    Post subject:
Reply with quote

Code:
******************************** TOP OF DATA **************************
SYNCSORT FOR Z/OS  1.2.3.1R    U.S. PATENTS: @@@@@@@, @@@@@@@   (C) 200
                               
PRODUCT LICENSED FOR CPU SERIAL NUMBER XXXXX, MODEL XXXX Z04           
SYSIN :                                                               
  SORT FIELDS=COPY                                                     
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,5))),   
       *                                                               
         IFTHEN=(WHEN=GROUP,BEGIN=(81,8,ZD,EQ,1),                     
         PUSH=(1,38))                                                 
  OUTFIL REMOVECC,NODETAIL,BUILD=(1,80),                               
         SECTIONS=(1,5,TRAILER3=(1,80))                               
WER268A  OUTREC STATEMENT  : SYNTAX ERROR                             
WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                         


Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Fri Sep 25, 2009 4:11 pm    Post subject:
Reply with quote

Nazia -- Your SyncSort version is 1.2.3.1R while support for WHEN=GROUP was included in SyncSort for z/OS 1.3.2.0. That's why you get that syntax error. And the solution from Frank would work for DFSORT shops for sure.

Please post the input again and the expected putput from that with rules and LRECL and RECFM of input/output. I try to add BBcode tags in the input/output sample which you showed in very first post but the alignment did not come proper, so I left them as is.

Once you post all the requested information, I may look on your query later in this evening, I've a meeting now... icon_cry.gif
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2181
Location: @my desk

PostPosted: Fri Sep 25, 2009 6:41 pm    Post subject:
Reply with quote

nazia.lalani,

Here's a SYNCTOOL equivalent of the above 'WHEN=GROUP' solution which should work for your version of SyncSort.
Code:
//STEP01   EXEC PGM=SYNCTOOL                             
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//OUT      DD SYSOUT=*                                   
//IN       DD *                                           
12345 2008-01-01 2005-01-01 2007-01-01 123 BC             
12345 2007-01-01 2004-01-01 2005-01-01 456 HA             
12345 2002-01-01 2006-01-01 2006-01-01 789 US             
//TOOLIN   DD *                                           
  SPLICE FROM(IN) TO(OUT) ON(1,5,CH) WITH(40,6) KEEPNODUPS
OUT
Code:
12345 2008-01-01 2005-01-01 2007-01-01 789 US
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 6 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 Removing Duplicates based on certain ... chandracdac DFSORT/ICETOOL 8 Fri Dec 09, 2016 4:40 am
No new posts Limit duplicate records in the SORT pshongal SYNCSORT 6 Mon Nov 21, 2016 12:54 pm
No new posts How to split the records using the am... vnktrrd DFSORT/ICETOOL 24 Fri Oct 28, 2016 7:33 pm


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