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 

File Split using DFSORT or SYNCSORT
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Job Control Language(JCL)
View previous topic :: View next topic  
Author Message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Mon Nov 19, 2007 3:26 pm    Post subject: Reply with quote

You were very close - you only missed one required change:

Code:

             3034:SEQNUM,8,PD,START=0,RESTART=(3001,4))),   


should be changed to:

Code:

             3034:SEQNUM,8,PD,START=0,RESTART=(3001,17))),   


You want to restart when the complete 17 byte key (in positions 3001-17) changes. 1,4 will only get you part of the first key.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
eskaysem
Beginner


Joined: 31 Mar 2003
Posts: 29
Topics: 13

PostPosted: Thu Jan 10, 2008 5:40 pm    Post subject: Reply with quote

Thanks Frank for the reply. I just got another problem with it. There are a few reocrds in the dataset that have no change in the date fields for ex:
P1V1C1D1
P1V1C1D2
P2V1C1D1
P3V1C1D1
P3V1C1D2

now since, Key P2 doenot have another date(D2), he grouping is getting wrong. So we need to ignore those records.
So in this case my output should be like

File1:

P1V1C1D1
P3V1C1D1

File 2:
P1V1C1D2
P3V1C1D2


Please help me to get a logic to ignore any kind of records where the P* Key(12 byte wide) doenot have a break in the date key D*(2 byte number), then we need to ignore those records.
_________________
Thanks!,
Santosh Kulkarni
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Thu Jan 10, 2008 5:58 pm    Post subject: Reply with quote

If I understand you correctly, you want to remove records with a unique Px field (e.g. only one P2 record). You can use DFSORT/ICETOOL to put only the dup records in a temporary file and then use that temporary file as input to your existing COPY.

Code:

//S1    EXEC  PGM=ICETOOL                                 
//TOOLMSG DD SYSOUT=*                                     
//DFSMSG  DD SYSOUT=*                                     
//IN DD DSN=...  input file     
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(,PASS)
//OUT1 DD DSN=...  output file1
//OUT2 DD DSN=...  output file2
//TOOLIN DD *                                             
SELECT FROM(IN) TO(T1) ON(1,12,CH) ALLDUPS USING(CTL0)
COPY FROM(T1) USING(CTL1)
//CTL0CNTL DD *
   SORT FIELDS=COPY
/*
//CTL1CNTL DD *
   INREC IFTHEN=(WHEN=INIT,                                 
     OVERLAY=(3001:1,12,3013:24,5,3018:SEQNUM,8,PD,         
             3034:SEQNUM,8,PD,START=0,RESTART=(3001,17))),   
      IFTHEN=(WHEN=(3034,8,PD,EQ,+0),                       
        OVERLAY=(3018:SEQNUM,8,PD)),                         
      IFTHEN=(WHEN=NONE,                                     
        OVERLAY=(3026:SEQNUM,8,PD,                           
         3018:3018,8,PD,SUB,3026,8,PD,TO=PD,LENGTH=8))       
 OUTREC OVERLAY=(3018:3018,8,PD,MOD,+2,TO=ZD,LENGTH=1)       
 OUTFIL FNAMES=OUT1,INCLUDE=(3018,1,ZD,EQ,1),BUILD=(1,3000) 
 OUTFIL FNAMES=OUT2,SAVE,BUILD=(1,3000) 
/*


Note: Since your Px values are already in sorted order, I added SORT FIELDS=COPY for the SELECT so it will do a copy instead of a sort. Copy is more efficient than sort.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
eskaysem
Beginner


Joined: 31 Mar 2003
Posts: 29
Topics: 13

PostPosted: Thu Jan 10, 2008 6:06 pm    Post subject: Reply with quote

To elaborate it furthur I would say, there could be multiple P2 records, but can have same dates.
For ex:
P1V1C1D1
P1V1C1D2
P2V1C1D1
P2V1C2D1
P2V2C1D1
P3V1C1D1
P3V1C1D2

Since there is no variation on P2-D1 combination, we should see the above said result.

Thanks!
_________________
Thanks!,
Santosh Kulkarni
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 -> Job Control Language(JCL) All times are GMT - 5 Hours
Goto page Previous  1, 2
Page 2 of 2

 
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