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 sequence number for removing column duplicates

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jemonthomas

New User


Joined: 24 Jul 2006
Posts: 35
Location: india

PostPosted: Mon Jan 23, 2012 6:57 am    Post subject: Need help in sequence number for removing column duplicates
Reply with quote

Hi.

I am trying to remove column duplicates by giving sequence number and reformatting based on that.

INREC BUILD=(1,8,X,10,119,X,131:SEQNUM,3,ZD,RESTART=(1,8))
SORT FIELDS=(1,8,CH,A)
OUTREC IFTHEN=(WHEN=(133,1,ZD,EQ,1),BUILD=(1,133)),
IFTHEN=(WHEN=(133,1,ZD,NE,1),OVERLAY=(1:9X,10:10,124))

This is the code I am using.The problem is that the sequence number is not coming properly so the result is not coming as expected.Could anyone help on this?
Back to top
View user's profile Send private message

saiprasadh

Active User


Joined: 20 Sep 2006
Posts: 154
Location: US

PostPosted: Mon Jan 23, 2012 9:26 am    Post subject:
Reply with quote

Hi jemonthomas,

As per you sort card the sequence number starts from 131 position but you are validating only 133 position . Please use below mentioned sort card and validate your result.

Code:

INREC BUILD=(1,8,X,10,119,X,131:SEQNUM,3,ZD,START=1,INCR=1,RESTART=(1,8))
SORT FIELDS=(1,8,CH,A)
OUTREC IFTHEN=(WHEN=(131,3,ZD,EQ,1),BUILD=(1,133)),
IFTHEN=(WHEN=(131,3,ZD,NE,1),OVERLAY=(1:9X,10:10,124))




Thanks
Sai
Back to top
View user's profile Send private message
jemonthomas

New User


Joined: 24 Jul 2006
Posts: 35
Location: india

PostPosted: Mon Jan 23, 2012 11:07 am    Post subject:
Reply with quote

Hi saiprasadh

Thanks.But still I am facing the same issue.The sequence number is getting restarted from 1 eventhough the key is not changed.I need to restart the sequence number only if the key is changed which is first 8 bytes.Could you please help on this?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7315

PostPosted: Mon Jan 23, 2012 1:13 pm    Post subject: Reply to: Need help in sequence number for removing column d
Reply with quote

If you are using INREC to put your sequence number on, then it is the unsorted file that you are using - which is the reason you notice something is not working. Change it so that it is with the OUTREC,

As saiprasadh has pointed out, you are not looking at the whole seqence number. This will cause you to think that every 10th record is a "new" sequence.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Mon Jan 23, 2012 9:48 pm    Post subject: Reply to: Need help in sequence number for removing column d
Reply with quote

Jemonthomas,

As bill explained your INREC is processed before the SORT. So if your data is unsorted on the Key , then your Sequence number will not be correct.

Check this link which explains how DFSORT process the control cards.

DFSORT Processing

Use the following Control cards which will give you the desired results. I assumed that your input is FB 133 byte

Code:

//SYSIN    DD *                                               
  SORT FIELDS=(1,8,CH,A),EQUALS                               
  OUTREC IFOUTLEN=133,                                         
  IFTHEN=(WHEN=INIT,OVERLAY=(134:SEQNUM,3,ZD,RESTART=(1,8))), 
  IFTHEN=(WHEN=(134,3,ZD,GT,1),OVERLAY=(9X))                   
//*
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts SMTP the current generation number of... Jyothi Kulunde JCL & VSAM 4 Thu May 04, 2017 4:08 pm
No new posts Edit large number of datasets (QSAM) zh_lad TSO/ISPF 3 Tue Apr 04, 2017 6:08 pm
No new posts how to mask the phone number kumarinfy DB2 4 Mon Apr 03, 2017 5:23 pm
No new posts what is meaning of the number in dcl Martylin PL/I & Assembler 2 Thu Mar 09, 2017 7:18 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am


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