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 

ICETOOL: Expressions in STARTREC & ENDREC ?
Goto page Previous  1, 2
 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Sat Jun 04, 2005 8:02 am    Post subject: Reply with quote

Hsubra,

The best way to solve the problem is to go step by step and not directly answer the request.
That
Back to top
View user's profile Send private message
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Sat Jun 04, 2005 8:14 am    Post subject: Reply with quote

I have corrected minor mistakes in the counts in the examples.
Here is an other cntl statments that could be faster. I've removed some HIT=NEXT.
Code:

//ICE0CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,5,ZD)),
        IFTHEN=(WHEN=(1,3,CH,NE,C'END'),
                OVERLAY=(86:SEQNUM,5,ZD,START=0,INCR=1),
                HIT=NEXT),
        IFTHEN=(WHEN=(1,5,CH,NE,C'START'),
                OVERLAY=(91:SEQNUM,5,ZD,START=1,INCR=1),
                HIT=NEXT),
        IFTHEN=(WHEN=(1,5,CH,EQ,C'START'),
                OVERLAY=(81:81,5,ZD,SUB,86,5,ZD,M11,LENGTH=5)),
        IFTHEN=(WHEN=(1,3,CH,EQ,C'END'),
                OVERLAY=(81:81,5,ZD,SUB,91,5,ZD,M11,LENGTH=5)),
        IFTHEN=(WHEN=(86,5,ZD,EQ,91,5,ZD),
                OVERLAY=(81:81,5,ZD,SUB,86,5,ZD,M11,LENGTH=5)),
        IFTHEN=(WHEN=(86,5,ZD,NE,91,5,ZD),
                OVERLAY=(81:C'00000'))
  OUTFIL FNAMES=OUTX,
         OMIT=(81,5,CH,EQ,C'00000'),
         OUTREC=(1,80)
/*

Alain
Back to top
View user's profile Send private message
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Sun Jun 05, 2005 7:47 am    Post subject: Reply with quote

Still thinking of it, my previous post can be modified a bit for a probable faster execution : assuming that doing a sub arithmetic is slower than a direct SEQNUM. The fact is I don't have a file big enough to test this.
Sorry for that.
Code:

//ICE0CNTL DD *
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,5,ZD)),
        IFTHEN=(WHEN=(1,3,CH,NE,C'END'),
                OVERLAY=(86:SEQNUM,5,ZD,START=0,INCR=1),
                HIT=NEXT),
        IFTHEN=(WHEN=(1,5,CH,NE,C'START'),
                OVERLAY=(91:SEQNUM,5,ZD,START=1,INCR=1),
                HIT=NEXT),
        IFTHEN=(WHEN=(1,5,CH,EQ,C'START'),
                OVERLAY=(81:SEQNUM,5,ZD,START=1,INCR=1)), <- HERE
        IFTHEN=(WHEN=(1,3,CH,EQ,C'END'),
                OVERLAY=(81:SEQNUM,5,ZD,START=1,INCR=1)), <- HERE
        IFTHEN=(WHEN=(86,5,ZD,EQ,91,5,ZD),
                OVERLAY=(81:81,5,ZD,SUB,86,5,ZD,M11,LENGTH=5)),
        IFTHEN=(WHEN=(86,5,ZD,NE,91,5,ZD),
                OVERLAY=(81:C'00000'))
  OUTFIL FNAMES=OUTX,
         OMIT=(81,5,CH,EQ,C'00000'),
         OUTREC=(1,80)

Alain
Back to top
View user's profile Send private message
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Mon Jun 06, 2005 4:23 pm    Post subject: Reply with quote

Once more...
My previous post shows how to remove unwanted records AND the possibility to be able to use a key group, unique between the groups for a SPLICE, later, for example. It means multi passes.
Here is a simplified way from a COPY, to only remove unwanted records with no further passes.
Code:

1       0000100001
START   00002     
A       0000300002
END          00003
1       0000400004
2       0000500005
START   00006     
A       0000700006
B       0000800007
END          00008
1       0000900009
2       0001000010
3       0001100011
START   00012     
A       0001300012
B       0001400013
C       0001500014
END          00015
1       0001600016

Code:

//ICE0CNTL DD *                                         
  INREC  IFTHEN=(WHEN=(1,3,CH,NE,C'END'),               
                 OVERLAY=(81:SEQNUM,5,ZD,START=1,INCR=1),
                 HIT=NEXT),                             
         IFTHEN=(WHEN=(1,5,CH,NE,C'START'),             
                 OVERLAY=(86:SEQNUM,5,ZD,START=1,INCR=1))
  OUTFIL FNAMES=OUTX,                                   
         OMIT=(81,5,ZD,EQ,86,5,ZD),                     
         OUTREC=(1,80)                                   
/*

Hoping all of that is still clear
Back to top
View user's profile Send private message
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Thu Jun 09, 2005 2:53 pm    Post subject: Reply with quote

The last post gave me the idea to improve the one I posted before the last by removing one IFTHEN.
The logic changes a bit : the synchronisation between ColC & ColD means that the records to remove;
the desynchronisation, the records to keep.
The group key is ColB.
Code:

ColA    ColB  ColC  ColD
A       00001 00001 00001
START   00001 00002     
A       00001 00003 00002
END     00001       00003
A       00005 00004 00004
A       00006 00005 00005
START   00002 00006     
A       00002 00007 00006
B       00002 00008 00007
END     00002       00008
A       00011 00009 00009
A       00012 00010 00010
A       00013 00011 00011
START   00003 00012     
A       00003 00013 00012
B       00003 00014 00013
C       00003 00015 00014
END     00003       00015
A       00019 00016 00016

Code:

//ICE0CNTL DD *                                               
  INREC  IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,5,ZD)),         
         IFTHEN=(WHEN=(1,3,CH,NE,C'END'),                     
                 OVERLAY=(86:SEQNUM,5,ZD,START=1,INCR=1),     
                 HIT=NEXT),                                   
         IFTHEN=(WHEN=(1,5,CH,NE,C'START'),                   
                 OVERLAY=(91:SEQNUM,5,ZD,START=1,INCR=1),     
                 HIT=NEXT),                                   
         IFTHEN=(WHEN=(1,5,CH,EQ,C'START'),                   
                 OVERLAY=(81:SEQNUM,5,ZD,START=1,INCR=1)),     
         IFTHEN=(WHEN=(1,3,CH,EQ,C'END'),                     
                 OVERLAY=(81:SEQNUM,5,ZD,START=1,INCR=1)),     
         IFTHEN=(WHEN=(86,5,ZD,NE,91,5,ZD),                   
                 OVERLAY=(81:81,5,ZD,SUB,91,5,ZD,M11,LENGTH=5))
  OUTFIL FNAMES=OUTX,                                         
         OMIT=(86,5,ZD,EQ,91,5,ZD),                           
         OUTREC=(1,80)                                         
/*

Alain
Back to top
View user's profile Send private message
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Fri Jul 08, 2005 4:55 pm    Post subject: Reply with quote

I hadn't tried how dfsort would react if I substracted a num value to a blank (for HDR & TRL). Well, a blank is treated as a zero and that's mean that the last IFTHEN from the last post could be removed and the OMIT changed to an INCLUDE.
Code:

//ICE0CNTL DD *
  INREC  IFTHEN=(WHEN=INIT,
                 OVERLAY=(81:SEQNUM,5,ZD)),
         IFTHEN=(WHEN=(1,3,CH,NE,C'HDR'),
                 OVERLAY=(86:SEQNUM,5,ZD),
                 HIT=NEXT),
         IFTHEN=(WHEN=(1,3,CH,NE,C'TRL'),
                 OVERLAY=(91:SEQNUM,5,ZD),
                 HIT=NEXT),
         IFTHEN=(WHEN=(1,3,CH,EQ,C'HDR'),
                 OVERLAY=(81:SEQNUM,5,ZD)),
         IFTHEN=(WHEN=(1,3,CH,EQ,C'TRL'),
                 OVERLAY=(81:SEQNUM,5,ZD))
  OUTFIL FNAMES=OUTX,
         INCLUDE=(86,5,ZD,NE,91,5,ZD),
                  OVERLAY=(81:81,5,ZD,SUB,86,5,ZD,M11,LENGTH=5)
/*

Alain
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: Fri Jul 08, 2005 6:05 pm    Post subject: Reply with quote

Blanks are treated as zero for ZD because the X'40' is treated as a zone of 4 (ignored) in all but the last byte, a sign of 4 (positive) in the last byte, and a digit of 0 in all bytes.
_________________
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
Alain Benveniste
Beginner


Joined: 04 May 2003
Posts: 92
Topics: 4
Location: Paris, France

PostPosted: Sun Jul 17, 2005 11:06 am    Post subject: Reply with quote

The previous post gives a good result but the group key is invalid.
Here is the correction.
Code:

//ICE0CNTL DD *                                           
  INREC  IFTHEN=(WHEN=INIT,                               
                 OVERLAY=(81:SEQNUM,5,ZD)),               
         IFTHEN=(WHEN=(1,3,CH,NE,C'HDR'),                 
                 OVERLAY=(86:SEQNUM,5,ZD),               
                 HIT=NEXT),                               
         IFTHEN=(WHEN=(1,3,CH,NE,C'TRL'),                 
                 OVERLAY=(91:SEQNUM,5,ZD),               
                 HIT=NEXT),                               
         IFTHEN=(WHEN=(1,3,CH,EQ,C'HDR'),                 
                 OVERLAY=(81:SEQNUM,5,ZD,5X'F0',5X'40')),
         IFTHEN=(WHEN=(1,3,CH,EQ,C'TRL'),                 
                 OVERLAY=(81:SEQNUM,5,ZD,86:5X'F0'))     
  OUTFIL FNAMES=OUTX,                                     
         INCLUDE=(86,5,CH,NE,91,5,CH),                   
         BUILD=(1,80,81:81,5,ZD,SUB,86,5,ZD,M11,LENGTH=5)
/*

Sorry for that.
Alain
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
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