MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Extract specific records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
lal
Beginner


Joined: 21 Oct 2003
Posts: 70
Topics: 25

PostPosted: Mon Sep 29, 2008 9:57 am    Post subject: Extract specific records Reply with quote

Hi Friends,
I have set of duplicate records as shown below. Here first 5 digits are the key which will be duplicates. I want all the duplicate rows which has the numeric second column (starts from 7th columns for the length of 8).


12345,
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Mon Sep 29, 2008 11:09 am    Post subject: Reply with quote

If there is always a duplicate for each record, and they are already in sorted order, then you can try the following:
Code:
//SYSIN DD *             
   SORT FIELDS=COPY             
   INCLUDE COND=(7,8,ZD,EQ,NUM)
/*

_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
lal
Beginner


Joined: 21 Oct 2003
Posts: 70
Topics: 25

PostPosted: Mon Sep 29, 2008 2:15 pm    Post subject: Reply with quote

Hi Amargulies,
Thanks, I tried that but I am getting the following error. Looks like it doesn't like the syntax when I use NUM. Can you please help

SYSIN :
SORT FIELDS=COPY
INCLUDE COND=(7,8,ZD,EQ,NUM)
*
WER268A INCLUDE STATEMENT : SYNTAX ERROR
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Mon Sep 29, 2008 4:07 pm    Post subject: Reply with quote

Support for NUM was included in SyncSort for z/OS 1.3. Which release of SyncSort are you running?
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
lal
Beginner


Joined: 21 Oct 2003
Posts: 70
Topics: 25

PostPosted: Mon Sep 29, 2008 4:42 pm    Post subject: Reply with quote

That's the culprit, our syncsort version is SYNCSORT FOR Z/OS 1.2.3.1R. So is there any other way I can achieve it.
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Tue Sep 30, 2008 9:39 am    Post subject: Reply with quote

Try this:
Code:
//SYSIN DD *                                       
  SORT FIELDS=COPY                                 
  INCLUDE COND=((7,1,ZD,EQ,0,OR,7,1,ZD,EQ,1,OR,   
     7,1,ZD,EQ,2,OR,7,1,ZD,EQ,3,OR,7,1,ZD,EQ,4,OR,   
     7,1,ZD,EQ,5,OR,7,1,ZD,EQ,6,OR,7,1,ZD,EQ,7,OR,   
     7,1,ZD,EQ,8,OR,7,1,ZD,EQ,9),AND,               
    (8,1,ZD,EQ,0,OR,8,1,ZD,EQ,1,OR,8,1,ZD,EQ,2,OR,   
     8,1,ZD,EQ,3,OR,8,1,ZD,EQ,4,OR,8,1,ZD,EQ,5,OR,   
     8,1,ZD,EQ,6,OR,8,1,ZD,EQ,7,OR,8,1,ZD,EQ,8,OR,   
     8,1,ZD,EQ,9),AND,                               
    (9,1,ZD,EQ,0,OR,9,1,ZD,EQ,1,OR,9,1,ZD,EQ,2,OR,   
     9,1,ZD,EQ,3,OR,9,1,ZD,EQ,4,OR,9,1,ZD,EQ,5,OR,   
     9,1,ZD,EQ,6,OR,9,1,ZD,EQ,7,OR,9,1,ZD,EQ,8,OR,   
     9,1,ZD,EQ,9),AND,                               
    (10,1,ZD,EQ,0,OR,10,1,ZD,EQ,1,OR,10,1,ZD,EQ,2,OR,
     10,1,ZD,EQ,3,OR,10,1,ZD,EQ,4,OR,10,1,ZD,EQ,5,OR,
     10,1,ZD,EQ,6,OR,10,1,ZD,EQ,7,OR,10,1,ZD,EQ,8,OR,
     10,1,ZD,EQ,9),AND,                             
    (11,1,ZD,EQ,0,OR,11,1,ZD,EQ,1,OR,11,1,ZD,EQ,2,OR,
     11,1,ZD,EQ,3,OR,11,1,ZD,EQ,4,OR,11,1,ZD,EQ,5,OR,
     11,1,ZD,EQ,6,OR,11,1,ZD,EQ,7,OR,11,1,ZD,EQ,8,OR,
     11,1,ZD,EQ,9),AND,                             
    (12,1,ZD,EQ,0,OR,12,1,ZD,EQ,1,OR,12,1,ZD,EQ,2,OR,
     12,1,ZD,EQ,3,OR,12,1,ZD,EQ,4,OR,12,1,ZD,EQ,5,OR,
     12,1,ZD,EQ,6,OR,12,1,ZD,EQ,7,OR,12,1,ZD,EQ,8,OR,
     12,1,ZD,EQ,9),AND,                             
    (13,1,ZD,EQ,0,OR,13,1,ZD,EQ,1,OR,13,1,ZD,EQ,2,OR,
     13,1,ZD,EQ,3,OR,13,1,ZD,EQ,4,OR,13,1,ZD,EQ,5,OR,
     13,1,ZD,EQ,6,OR,13,1,ZD,EQ,7,OR,13,1,ZD,EQ,8,OR,
     13,1,ZD,EQ,9),AND,                             
    (14,1,ZD,EQ,0,OR,14,1,ZD,EQ,1,OR,14,1,ZD,EQ,2,OR,
     14,1,ZD,EQ,3,OR,14,1,ZD,EQ,4,OR,14,1,ZD,EQ,5,OR,
     14,1,ZD,EQ,6,OR,14,1,ZD,EQ,7,OR,14,1,ZD,EQ,8,OR,
     14,1,ZD,EQ,9))                                 
/*       

_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Wed Oct 01, 2008 7:02 am    Post subject: Reply with quote

what about?

Code:

INCLUDE COND=(7,8,CH,GE,C'00000000',AND,
              7,8,CH,LE,C'99999999')   


Question
Back to top
View user's profile Send private message
paulkemp



Joined: 19 Sep 2008
Posts: 0
Topics: 0

PostPosted: Wed Oct 01, 2008 8:49 am    Post subject: Reply with quote

Acevedo,
C'1ABCDEF' would be accepted by your check for example. You would have to do the check on each byte individually.
Regards,
Paul (my first post Mr. Green )
Back to top
View user's profile Send private message
acevedo
Beginner


Joined: 03 Dec 2002
Posts: 127
Topics: 0
Location: Europe

PostPosted: Thu Oct 02, 2008 1:14 am    Post subject: Reply with quote

yeap, it seems I'm too slooooooow, I'm not at work and I should not post any non-tested code...sorry, but... what about?

Code:
OPTION COPY                                           
INCLUDE COND=(07,1,CH,GE,C'0',AND,07,1,CH,LE,C'9',AND,
              08,1,CH,GE,C'0',AND,08,1,CH,LE,C'9',AND,
              09,1,CH,GE,C'0',AND,09,1,CH,LE,C'9',AND,
              10,1,CH,GE,C'0',AND,10,1,CH,LE,C'9',AND,
              11,1,CH,GE,C'0',AND,11,1,CH,LE,C'9',AND,
              12,1,CH,GE,C'0',AND,12,1,CH,LE,C'9',AND,
              13,1,CH,GE,C'0',AND,13,1,CH,LE,C'9',AND,
              14,1,CH,GE,C'0',AND,14,1,CH,LE,C'9')   


Question
Back to top
View user's profile Send private message
amargulies
Beginner


Joined: 10 Jan 2007
Posts: 123
Topics: 0

PostPosted: Thu Oct 02, 2008 9:53 am    Post subject: Reply with quote

Yes, this much simplified version will work as well.
_________________
Alissa Margulies
SyncSort Mainframe Product Services
201-930-8260
zos_tech@syncsort.com
Back to top
View user's profile Send private message Send e-mail
lal
Beginner


Joined: 21 Oct 2003
Posts: 70
Topics: 25

PostPosted: Fri Oct 03, 2008 1:21 pm    Post subject: Reply with quote

Thanks Amargulies & Acevedo for the help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group