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
 

 

update the trailer count while eliminating duplicates

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

New User


Joined: 02 Jun 2008
Posts: 48
Location: India

PostPosted: Thu Aug 25, 2011 1:34 pm    Post subject: update the trailer count while eliminating duplicates
Reply with quote

I have requirement to delete the duplicates from a file and while deleting duplicates we need to update the trailer record count.

Below is the input file before eliminating dups

AISCDCHNG2011-08-24 -----header
D010004M
D010004M
D010004M
D010004M
D010004M
D010005A
D010006M
D010007M
D010008M
D010008M
D010008M
D010008M
D010008M
D010008M
D010009M
Z0000000015 ----trailer with count as 15 records


after sort my expected results should be as

***************************** Top
AISCDCHNG2011-08-24
D010004M
D010005A
D010006M
D010007M
D010008M
D010009M
Z0000000006
**************************** Bott
header shoul come as it is, and triler should update with new count.
Back to top
View user's profile Send private message

Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Aug 25, 2011 1:39 pm    Post subject: Reply to: update the trailer count while eliminating duplic
Reply with quote

Have a look through the forum, there are many trailer-update examples and dropping-duplicate examples.

While you are "dropping" them, is anything "catching" them, or do they just disappear off to some recycle-bing in the sky? If the data on the duplicate records doesn't mean anything, why were the records generated in the first place?
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Thu Aug 25, 2011 2:45 pm    Post subject:
Reply with quote

Can you please provide the details whether the file is FB/VB and RECFM etc.
Back to top
View user's profile Send private message
sant532

New User


Joined: 02 Jun 2008
Posts: 48
Location: India

PostPosted: Thu Aug 25, 2011 2:55 pm    Post subject: Reply to: update the trailer count while eliminating duplic
Reply with quote

input/output both are FB only,

Record formate is FB
Record length is 50 bytes
Structure is

Header record stat with 'H' and 49 bytes data
Details record start with 'D' and 49 bytes data
trailer record start with 'Z' and 10 byte count and 39 byte spaces

and eliminated duplicate need not to capture in any file.

I need to achive this requirment in one step only. could you please help me here.
Back to top
View user's profile Send private message
THINKSRINIII
Warnings : 1

New User


Joined: 09 Jan 2009
Posts: 88
Location: India

PostPosted: Thu Aug 25, 2011 3:00 pm    Post subject:
Reply with quote

The following would achieve the same :

Code:

//SORTOUT  DD DSN=&&TEMP,DISP=(,PASS,DELETE)               
//TOOLIN   DD *                                           
  SELECT FROM(SORTIN) TO(SORTOUT) ON(1,8,CH) NODUPS       
//STEP02 EXEC PGM=SORT                                   
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD DSN=&&TEMP,DISP=SHR                         
//SORTOUT  DD SYSOUT=*                                     
//SYSIN    DD *                                           
  OPTION COPY                                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY(81:SEQNUM,10,ZD)),       
        IFTHEN=(WHEN=(1,1,CH,EQ,C'Z'),OVERLAY(2:81,10))   
  OUTREC BUILD=(1:1,50)                                   


Use sum fields= none to remove duplicates and convert the job to one step.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Thu Aug 25, 2011 3:06 pm    Post subject: Reply to: update the trailer count while eliminating duplic
Reply with quote

Hi,There are several ways and several examples too on this forum doing similar thing...

You can use DFSORTs TRLUPD feature for this
Code:

//STEP0100 EXEC PGM=SORT                             
//SYSOUT   DD SYSOUT=*                               
//SORTIN   DD DSN=yourinputfilehere                                       
//SORTOUT  DD DSN=youroutputfilehere
//SYSIN    DD *                                     
 SORT FIELDS=(1,1,CH,A,2,7,CH,A)                     
 SUM FIELDS=(NONE)                                   
 OUTFIL IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,C'Z'),     
 TRLUPD=(2:COUNT=(M11,LENGTH=10)))                   
/*                                             
     

This will give you required output as below...

Code:

AISCDCHNG2011-08-24 -----HEADER   
D010004M                         
D010005A                         
D010006M                         
D010007M                         
D010008M                         
D010009M                         
Z0000000006 ----TRAILER WITH COUNT
Back to top
View user's profile Send private message
sant532

New User


Joined: 02 Jun 2008
Posts: 48
Location: India

PostPosted: Thu Aug 25, 2011 3:09 pm    Post subject: Reply to: update the trailer count while eliminating duplic
Reply with quote

Could you please tell me, on your post does it keeps header as it is?

Can you give the complete syntax, with some example.
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7226

PostPosted: Thu Aug 25, 2011 3:11 pm    Post subject: Re: Reply to: update the trailer count while eliminating du
Reply with quote

sant532 wrote:
[...]

and eliminated duplicate need not to capture in any file.

I need to achive this requirment in one step only. could you please help me here.


I cannot understand either of these points.

How can you have data in your system which you just leave abandoned on the computer-room floor? What do you do, one day, when someone asks about that particular data? Or a part of it?

Imagine this. You have a bug. You get duplicate records. You fix the bug. Throw away the duplicates. A couple of months later, you get a query. You look at the data, query doesn't seem to make sense. You get another. Same thing. Another few over the next months. Never solved.

Or

Same thing, but you realise the date of the transactions is the same, and that particular date rings a bell. You check further with this extra knowledge, and realise that the "fix" was just not quite right... Now what? Restore and re-run to three months ago to get the data to drop it off, but to a file this time, to check to see if it gives you anything...

Or

Same thing, but you check against your log of data fixes, check the audit trails, files, work out the problem, do a new, more thorough, impact analysis, inform everyone, organise the restoration of the five records which were genuinely "duplicate" etc etc. You even have sign-offs that you were not the only one who missed picking up the different scenario hived-off in error.

For this requirement, I'm sure one step is not a problem. If it were though, what are your "rules" for "one step"? An idiotic "ban" or a "huge input file" or something else reasonable?
Back to top
View user's profile Send private message
sant532

New User


Joined: 02 Jun 2008
Posts: 48
Location: India

PostPosted: Thu Aug 25, 2011 3:43 pm    Post subject: Reply to: update the trailer count while eliminating duplic
Reply with quote

This is what in my spool shows.

Code:
********************************* TOP OF DATA **********************************
 SYNCSORT FOR Z/OS  1.3.2.1R    U.S. PATENTS: 4210961, 5117495   (C) 2007 SYNCSO
                                                       z/OS   1.11.0           
 SYSIN :                                                                       
  SORT FIELDS=(1,1,CH,A,2,7,CH,A)                                        0023000
  SUM FIELDS=(NONE)                                                      0024000
  OUTFIL IFTRAIL=(HD=YES,TRLID=(1,1,CH,EQ,C'Z'),                         0025000
         *                                                                     
  TRLUPD=(2:COUNT=(M11,LENGTH=10)))                                      0026000
 WER903I  SYNCSORT 1.3.2.1 IS NOT LICENSED FOR SERIAL B8A36, TYPE 2817 723, LPAR
 WER903I  PRODUCT WILL STOP WORKING IN  43 DAYS UNLESS A VALID KEY IS INSTALLED.
 WER268A  OUTFIL STATEMENT  : SYNTAX ERROR                                     
 WER211B  SYNCSMF  CALLED BY SYNCSORT; RC=0000                                 
******************************** BOTTOM OF DATA ********************************
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Thu Aug 25, 2011 3:44 pm    Post subject:
Reply with quote

See :

http://www.ibmmainframes.com/viewtopic.php?t=33385&highlight=dss10065e
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Thu Aug 25, 2011 11:19 pm    Post subject:
Reply with quote

sant532,

IFTRAIL works fine with DFSORT. However, the WER messages indicate you have Syncsort rather than DFSORT. Syncsort does NOT support IFTRAIL.

This Forum is for DFSORT questions. The JCL Forum is for Syncsort questions. I'm moving this topic to the JCL Forum.
Back to top
View user's profile Send private message
Arun Raj

Moderator


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

PostPosted: Sun Aug 28, 2011 6:24 pm    Post subject:
Reply with quote

sant532,

As Bill had already suggested above, what you're trying to do is definitely doable using Syncsort in one step or 2 steps or whatever.

But it'd would be worth doing a trace back on how this duplicates came into your system and the relevance of duplicate records if there is any.
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 Updating the counters after eliminati... PANDU1 DFSORT/ICETOOL 12 Mon Nov 21, 2016 9:47 am
No new posts -913/-911 Deadlock during UPDATE stat... NoSleep319 DB2 5 Fri Nov 18, 2016 12:37 am
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Updating Cursor row withour using FOR... chandan.inst DB2 15 Tue Nov 08, 2016 11:17 am
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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