Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Problem in creating sequence

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Problem in creating sequence
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

Moderator


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

PostPosted: Mon Jan 20, 2014 8:10 pm    Post subject:
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    Post subject:
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

Moderator


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

PostPosted: Mon Jan 20, 2014 8:16 pm    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7231

PostPosted: Mon Jan 20, 2014 8:26 pm    Post subject: Reply to: Problem in creating sequence
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    Post subject:
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    Post subject: Reply to: Problem in creating sequence
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    Post subject:
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    Post subject:
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    Post subject:
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7231

PostPosted: Tue Jan 21, 2014 3:55 pm    Post subject: Reply to: Problem in creating sequence
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    Post subject: Reply to: Problem in creating sequence
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

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7231

PostPosted: Tue Jan 21, 2014 4:36 pm    Post subject: Reply to: Problem in creating sequence
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts DB2 Streaming Batch Processing Problem Manshadi DB2 4 Sat Sep 24, 2016 12:14 pm
No new posts Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm
No new posts Problem with GETMAIN command amitc23 CICS 6 Thu Sep 01, 2016 1:01 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us