DFSort Range



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

DFSort Range

Postby knobi » Fri Apr 29, 2011 7:05 am

hello folks, is this situation can be solved with dfsort ??

Input 80fb :
time
------------
00:10:00.000
00:02:00.000
00:00:02.000


Output:

# of records between 0 and 3   =   0002
# of records between 3 and 5   =   0000
# of records higher than   5   =   0001
knobi
 
Posts: 9
Joined: Thu Aug 13, 2009 9:36 am
Has thanked: 0 time
Been thanked: 0 time

Re: DFSort Range

Postby skolusu » Fri Apr 29, 2011 9:11 pm

Knobi,

You need to provide more details. What is the format of the time? HH:MM:SS:nnn ? Is the range every 2 hours ? or 2 mins or 2 secs? Is the time format 12 hour format or 24 hour format?

What is the position of the time field?
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: DFSort Range

Postby knobi » Fri Apr 29, 2011 10:02 pm

Position: input file starts on column 1

Time          => (The format is HH:MM:SS.nnn, but can exceed 24 hours)
------------
00:10:00.300
00:02:00.000
00:00:02.012 
30:00:02.010 
20:00:02.010 
08:10:02.009

Output:
# of records between 0 and 3 Min  =   0000002 recs
# of records between 3 and 5 Min  =   0000000 recs
# of records higher than   5 Min  =   0000004 recs
knobi
 
Posts: 9
Joined: Thu Aug 13, 2009 9:36 am
Has thanked: 0 time
Been thanked: 0 time

Re: DFSort Range

Postby skolusu » Sat Apr 30, 2011 12:04 am

Knobi,

It gets a little trickier to insert a missing range. Inorder to capture the missing range records you need to have a dummy record with the range. Create a 80 byte file with the contents shown for INB ddname. Have the range description in pos 20.

Use the following DFSORT JCL which will give you the desired results

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//INA      DD *                                         
00:10:00.300                                             
00:02:00.000                                             
00:00:02.012                                             
30:00:02.010                                             
20:00:02.010                                             
08:10:02.009 
//INB      DD *                                                   
----+----1----+----2----+----3----+----4----+----5----+----6----+--
                   0 AND 3 MIN                                     
                   3 AND 5 MIN                                     
                   5 AND HIGHER                                   
//SORTOUT  DD SYSOUT=*                                             
//SYSIN    DD *                                                   
  OPTION COPY                                                     
  JOINKEYS F1=INA,FIELDS=(20,1,A)                                 
  JOINKEYS F2=INB,FIELDS=(20,1,A)                                 
  JOIN UNPAIRED                                                   
  REFORMAT FIELDS=(F1:20,12,F2:20,12,?)
                           
  INREC IFTHEN=(WHEN=(25,1,CH,EQ,C'B'),OVERLAY=(25:C'1')),         
  IFTHEN=(WHEN=(25,1,CH,EQ,C'2'),OVERLAY=(25:C'0'))               
                                                                   
  OUTFIL REMOVECC,NODETAIL,BUILD=(80X),                           
  SECTIONS=(13,1,                                                 
  TRAILER3=('# OF RECORDS BETWEEN ',13,12,'  =  ',                 
            TOT=(25,1,ZD,M11,LENGTH=7)))                           
//*                                                               
//JNF1CNTL DD *                                                   
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,8,UFF,M11,LENGTH=6)),           
  IFTHEN=(WHEN=INIT,                                               
  OVERLAY=(08:1,2,ZD,MUL,+3600,ADD,3,2,ZD,MUL,+60,ADD,5,2,ZD,     
              M11,LENGTH=8)),                                     
  IFTHEN=(WHEN=(8,8,ZD,LE,180),OVERLAY=(20:C'0 AND 3 MIN ')),     
  IFTHEN=(WHEN=(8,8,ZD,GT,180,AND,8,8,ZD,LE,300),                 
  OVERLAY=(20:C'3 AND 5 MIN ')),                                   
  IFTHEN=(WHEN=NONE,OVERLAY=(20:C'5 AND HIGHER'))
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post