MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
lal Beginner Joined: 21 Oct 2003 Posts: 70 Topics: 25
Posted: Mon Sep 29, 2008 9:57 am Post subject: Extract specific records
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
amargulies Beginner Joined: 10 Jan 2007 Posts: 123 Topics: 0
Posted: Mon Sep 29, 2008 11:09 am Post subject:
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
lal Beginner Joined: 21 Oct 2003 Posts: 70 Topics: 25
Posted: Mon Sep 29, 2008 2:15 pm Post subject:
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
amargulies Beginner Joined: 10 Jan 2007 Posts: 123 Topics: 0
Posted: Mon Sep 29, 2008 4:07 pm Post subject:
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
lal Beginner Joined: 21 Oct 2003 Posts: 70 Topics: 25
Posted: Mon Sep 29, 2008 4:42 pm Post subject:
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
amargulies Beginner Joined: 10 Jan 2007 Posts: 123 Topics: 0
Posted: Tue Sep 30, 2008 9:39 am Post subject:
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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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
acevedo Beginner Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
Posted: Wed Oct 01, 2008 7:02 am Post subject:
what about?
Code:
INCLUDE COND=(7,8,CH,GE,C'00000000',AND,
7,8,CH,LE,C'99999999')
Back to top
paulkemp Joined: 19 Sep 2008 Posts: 0 Topics: 0
Posted: Wed Oct 01, 2008 8:49 am Post subject:
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 )
Back to top
acevedo Beginner Joined: 03 Dec 2002 Posts: 127 Topics: 0 Location: Europe
Posted: Thu Oct 02, 2008 1:14 am Post subject:
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')
Back to top
amargulies Beginner Joined: 10 Jan 2007 Posts: 123 Topics: 0
Posted: Thu Oct 02, 2008 9:53 am Post subject:
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
lal Beginner Joined: 21 Oct 2003 Posts: 70 Topics: 25
Posted: Fri Oct 03, 2008 1:21 pm Post subject:
Thanks Amargulies & Acevedo for the help.
Back to top
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