File Split using DFSORT or SYNCSORT
Select messages from
# through # FAQ
[/[Print]\]
Goto page Previous  1, 2  :| |:
MVSFORUMS.com -> Job Control Language(JCL)

#16:  Author: Frank YaegerLocation: San Jose PostPosted: Mon Nov 19, 2007 3:26 pm
    —
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.

#17:  Author: eskaysem PostPosted: Thu Jan 10, 2008 5:40 pm
    —
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.

#18:  Author: Frank YaegerLocation: San Jose PostPosted: Thu Jan 10, 2008 5:58 pm
    —
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.

#19:  Author: eskaysem PostPosted: Thu Jan 10, 2008 6:06 pm
    —
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!



MVSFORUMS.com -> Job Control Language(JCL)


output generated using printer-friendly topic mod. All times are GMT - 5 Hours

Goto page Previous  1, 2  :| |:
Page 2 of 2

Powered by phpBB © 2001, 2005 phpBB Group