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

Extract fields from Duplicated records


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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
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

Superior Member


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

PostPosted: Fri Sep 25, 2009 4:11 pm
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: 2481
Location: @my desk

PostPosted: Fri Sep 25, 2009 6:41 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 2
No new posts Compare 2 files(F1 & F2) and writ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top