IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Problem in creating sequence


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Jan 20, 2014 7:22 pm
Reply with quote

I am using below sort card

Code:
 INCLUDE COND=(39,04,CH,EQ,C'NOUS')                                 
 SORT FIELDS=(214,1,CH,A,215,1,CH,A)                                 
 INREC IFTHEN=(WHEN=(34,4,CH,EQ,C'5793'),OVERLAY=(214:C'1')),       
       IFTHEN=(WHEN=(34,4,CH,EQ,C'5493'),OVERLAY=(214:C'2')),       
       IFTHEN=(WHEN=(34,4,CH,EQ,C'5003'),OVERLAY=(214:C'3')),       
       IFTHEN=(WHEN=NONE,OVERLAY=(214:C'4'))                         
*                                                                   
 INREC IFTHEN=(WHEN=(44,06,CH,GT,C'000000',OR,44,06,CH,GT,C'060060')
       OVERLAY=(215:C'1')),                                         
       IFTHEN=(WHEN=(44,06,CH,GT,C'200000',OR,44,06,CH,GT,C'299999')
       OVERLAY=(215:C'2')),                                         
       IFTHEN=(WHEN=(44,06,CH,GT,C'100000',OR,44,06,CH,GT,C'101608')
       OVERLAY=(215:C'3'))                                           
       IFTHEN=(WHEN=NONE,OVERLAY=(215:C'4'))                         
 OUTREC BUILD=(1,213)               



In the above sort card i have created the sequence of records using IFTHEN for 5793,5493,5003 and its working.

But now i want to create sequence of(pos 44 lenght 6) already sorted date based on some range hence i am using the second IFTHEN but its showing
" DUPLICATE OR CONFLICTING INREC STATEMENT "
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1590
Location: Andromeda Galaxy

PostPosted: Mon Jan 20, 2014 8:10 pm
Reply with quote

Hi,

You are having 2 INREC IFTHEN

Code:
INREC IFTHEN=(WHEN=(34,4,CH,EQ,C'5793'),OVERLAY=(214:C'1')),       
.
.
.                 
*                                                                   
 INREC IFTHEN=(WHEN=(44,06,CH,GT,C'000000',OR,44,06,CH,GT,C'060060')
       OVERLAY=(215:C'1')),                                         
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Jan 20, 2014 8:12 pm
Reply with quote

but without that how can i achieve the second sort sequence
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1590
Location: Andromeda Galaxy

PostPosted: Mon Jan 20, 2014 8:16 pm
Reply with quote

Can't you combine them both like

Code:
INREC IFTHEN=(WHEN=(34,4,CH,EQ,C'5793',AND,(44,06,CH,GT,C'000000',OR,44,06,CH,GT,C'060060')),
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Mon Jan 20, 2014 8:26 pm
Reply with quote

Code:
       IFTHEN=(WHEN=(44,06,CH,GT,C'000000',OR,44,06,CH,GT,C'060060')
       OVERLAY=(215:C'1')),                                         
       IFTHEN=(WHEN=(44,06,CH,GT,C'200000',OR,44,06,CH,GT,C'299999')
       OVERLAY=(215:C'2')),                                         
       IFTHEN=(WHEN=(44,06,CH,GT,C'100000',OR,44,06,CH,GT,C'101608')
       OVERLAY=(215:C'3'))                                           
       IFTHEN=(WHEN=NONE,OVERLAY=(215:C'4'))                         


Your conditions are confusion. What are you trying to do? Each of the second part of the OR is already covered by the first part.

You can only have one INREC, but you can have lots of IFTHENs on an INREC (or OUTREC or OUTFIL).

The IFTHEN=(WHEN=(logexp processing stops when one is satisfied. To take two different conditions on a single record into account you'll have to look at HIT=NEXT, but work out what you want your IFTHENs to say first.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Mon Jan 20, 2014 11:08 pm
Reply with quote

Thanks Pandora and bill for your replies

Sorry i have used wrong conditions second one is LT

But if i want to check for both inclusive value that is
from range 000000 to 060060 for first ifthen
200000 to 299999 for second Ifthen and so on


then which operators i should use
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Tue Jan 21, 2014 3:59 am
Reply with quote

Look up the keyword HIT=NEXT and you should be able to get the desired results. Understand the code given instead of blindly copying it and you will be able to modify it for future design changes.

something like this

Code:

//SYSIN    DD *                                                   
  INCLUDE COND=(39,4,CH,EQ,C'NOUS')                             
                                                                 
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(214:C'44')),                   
  IFTHEN=(WHEN=(34,4,CH,EQ,C'5793'),OVERLAY=(214:C'1'),HIT=NEXT),
  IFTHEN=(WHEN=(34,4,CH,EQ,C'5493'),OVERLAY=(214:C'2'),HIT=NEXT),
  IFTHEN=(WHEN=(34,4,CH,EQ,C'5003'),OVERLAY=(214:C'3'),HIT=NEXT),
  IFTHEN=(WHEN=(44,6,CH,GT,C'000000',OR,44,6,CH,LT,C'060060'), 
       OVERLAY=(215:C'1')),                                       
  IFTHEN=(WHEN=(44,6,CH,GT,C'200000',OR,44,6,CH,LT,C'299999'), 
       OVERLAY=(215:C'2')),                                       
  IFTHEN=(WHEN=(44,6,CH,GT,C'100000',OR,44,6,CH,LT,C'101608'), 
       OVERLAY=(215:C'3'))                                       
                                                                 
  SORT FIELDS=(214,1,CH,A,215,1,CH,A)                             
                                                                 
  OUTREC BUILD=(1,213)                                           
//*                                                               
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Tue Jan 21, 2014 3:09 pm
Reply with quote

Code:
 *INCLUDE COND=(39,04,CH,EQ,C'NOUS')                                   
 *     SORT FIELDS=(214,1,CH,A,215,1,CH,A)                             
       SORT FIELDS=(214,1,CH,A)                                         
        INREC IFTHEN=(WHEN=INIT,OVERLAY=(214:C'44')),                   
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5525'),OVERLAY=(214:C'1'),HIT=NEXT),
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5526'),OVERLAY=(214:C'2'),HIT=NEXT),
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5122'),OVERLAY=(214:C'3'),HIT=NEXT),
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5513'),OVERLAY=(214:C'4'),HIT=NEXT),
        IFTHEN=(WHEN=(34,4,CH,NE,C'5525',OR,34,4,CH,NE,C'5526',OR,     
                      34,4,CH,NE,C'5122',OR,34,4,CH,NE,C'5513'),       
                            OVERLAY=(214:C'5'))       



When i am using above code i am getting only 5 at col 214 eevn though 5525,5526 records are present
Back to top
View user's profile Send private message
sureshpathi10

Active User


Joined: 03 May 2010
Posts: 154
Location: Kuala Lumpur

PostPosted: Tue Jan 21, 2014 3:48 pm
Reply with quote

I don't understand what are you trying to do... but anyway...

Code:
IFTHEN=(WHEN=(34,4,CH,NE,C'5525',OR,34,4,CH,NE,C'5526',OR,     
                      34,4,CH,NE,C'5122',OR,34,4,CH,NE,C'5513'),       
                            OVERLAY=(214:C'5'))


the above OVERLAY will override the data of position 214 populated by below code
Code:
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5525'),OVERLAY=(214:C'1'),HIT=NEXT),
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5526'),OVERLAY=(214:C'2'),HIT=NEXT),
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5122'),OVERLAY=(214:C'3'),HIT=NEXT),
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5513'),OVERLAY=(214:C'4'),HIT=NEXT),


Becuase, you've mentioned 'NE' and 'OR', So all the data will fall into this. Please try to understand and code. We've already discussed here.

If you still want to try with your code use this
Code:

IFTHEN=(WHEN=(34,4,CH,NE,C'5525',AND,34,4,CH,NE,C'5526',AND,     
                      34,4,CH,NE,C'5122',AND,34,4,CH,NE,C'5513'),       
                            OVERLAY=(214:C'5'))
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Tue Jan 21, 2014 3:53 pm
Reply with quote

Thanks Suresh

Below is corrected one

Code:
 *INCLUDE COND=(39,04,CH,EQ,C'NOUS')                                     
       SORT FIELDS=(214,1,CH,A,215,1,CH,A)                               
        INREC IFTHEN=(WHEN=INIT,OVERLAY=(214:C'56')),                   
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5525'),OVERLAY=(214:C'1'),HIT=NEXT), 
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5526'),OVERLAY=(214:C'2'),HIT=NEXT), 
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5122'),OVERLAY=(214:C'3'),HIT=NEXT), 
        IFTHEN=(WHEN=(34,4,CH,EQ,C'5513'),OVERLAY=(214:C'4'),HIT=NEXT)
 *      IFTHEN=(WHEN=(34,4,CH,NE,C'5525',OR,34,4,CH,NE,C'5526',OR,       
 *                    34,4,CH,NE,C'5122',OR,34,4,CH,NE,C'5513'),         
 *                          OVERLAY=(214:C'5'))     
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Tue Jan 21, 2014 3:55 pm
Reply with quote

It is very hard to keep up when you keep changing things.

That is because you have told it to. IF ( A NE B ) OR ( A NE C ) will always be true, because A can only have one value, so is either not equal to one of the values, or both.

If you are trying to say "it is not one of the above" then you can look at WHEN=INIT to set an initial value ("5") or WHEN=NONE.

Your second set of IFTHENs are again missing. If they are to return, ensure you run thru what you want. What you showed previously still does not make sense, although Kolusu has shown you how to implement it anyway. Seems from your latest that you were just wasting his time.
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Tue Jan 21, 2014 4:24 pm
Reply with quote

Sorry Bill.
But now i got data as per requirement.
Thanks to all for your help.Here is my working sort card

Code:
SORT FIELDS=(214,1,CH,A,215,1,CH,A)                             
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(214:C'56')),                 
  IFTHEN=(WHEN=(34,4,CH,EQ,C'5525'),OVERLAY=(214:C'1'),HIT=NEXT),
  IFTHEN=(WHEN=(34,4,CH,EQ,C'5526'),OVERLAY=(214:C'2'),HIT=NEXT),
  IFTHEN=(WHEN=(34,4,CH,EQ,C'5122'),OVERLAY=(214:C'3'),HIT=NEXT),
  IFTHEN=(WHEN=(34,4,CH,EQ,C'5513'),OVERLAY=(214:C'4'),HIT=NEXT),
                                                                 
                                                                 
  IFTHEN=(WHEN=((44,06,ZD,GT,000000,AND,44,06,ZD,LT,060066),     
            OR,(44,06,ZD,GT,063967,AND,44,06,ZD,LT,100000)),     
  OVERLAY=(215:C'1')),                                           
                                                                 
  IFTHEN=(WHEN=(44,06,ZD,GT,200000,AND,44,06,ZD,LT,299999),     
  OVERLAY=(215:C'2')),                                           

 IFTHEN=(WHEN=((44,06,ZD,GT,100000,AND,44,06,ZD,LT,101608),       
           OR,(44,06,ZD,GT,100000,AND,44,06,ZD,LT,101609),       
           OR,(44,06,ZD,GT,101709,AND,44,06,ZD,LT,170205),       
           OR,(44,06,ZD,GT,170306,AND,44,06,ZD,LT,199999)),       
 OVERLAY=(215:C'3')),                                             
                                                                 
 IFTHEN=(WHEN=((44,06,ZD,GT,300000,AND,44,06,ZD,LT,349999),       
           OR,(44,06,ZD,GT,420000,AND,44,06,ZD,LT,429999),       
           OR,(44,06,ZD,GT,500000,AND,44,06,ZD,LT,569999),       
           OR,(44,06,ZD,GT,620000,AND,44,06,ZD,LT,659999)),       
 OVERLAY=(215:C'4')),                                             
                                                                 
 IFTHEN=(WHEN=(44,06,ZD,GT,350000,AND,44,06,ZD,LT,350999),       
 OVERLAY=(215:C'5'))                                             
                                                                 
OUTREC BUILD=(1,213)             
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Tue Jan 21, 2014 4:36 pm
Reply with quote

Are you sure of GT and LT rather than GE and LE?
Back to top
View user's profile Send private message
trushant.w

New User


Joined: 22 Sep 2013
Posts: 81
Location: pune india

PostPosted: Tue Jan 21, 2014 4:45 pm
Reply with quote

yes thats the range i need to check
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts problem in select max when executing ... IMS DB/DC 6
No new posts Sysncsort - Justification problem SYNCSORT 6
No new posts XML Parsing in COBOL creating "h... COBOL Programming 0
No new posts Creating additional seqnum/Literal wh... DFSORT/ICETOOL 4
No new posts Creating a single-record file with CO... DFSORT/ICETOOL 8
Search our Forums:

Back to Top