Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
trushant.w

New User

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

Posted: Mon Jan 20, 2014 7:22 pm    Post subject: Problem in creating sequence

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 "

Pandora-Box

Moderator

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

Posted: Mon Jan 20, 2014 8:10 pm    Post subject:

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')),
trushant.w

New User

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

 Posted: Mon Jan 20, 2014 8:12 pm    Post subject: but without that how can i achieve the second sort sequence
Pandora-Box

Moderator

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

Posted: Mon Jan 20, 2014 8:16 pm    Post subject:

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')),
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

Posted: Mon Jan 20, 2014 8:26 pm    Post subject: Reply to: Problem in creating sequence

 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.
trushant.w

New User

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

 Posted: Mon Jan 20, 2014 11:08 pm    Post subject: 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
Skolusu

Senior Member

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

Posted: Tue Jan 21, 2014 3:59 am    Post subject: Reply to: Problem in creating sequence

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)                                            //*
trushant.w

New User

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

Posted: Tue Jan 21, 2014 3:09 pm    Post subject:

 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
sureshpathi10

Active User

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

Posted: Tue Jan 21, 2014 3:48 pm    Post subject:

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'))
trushant.w

New User

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

Posted: Tue Jan 21, 2014 3:53 pm    Post subject:

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'))
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

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

New User

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

Posted: Tue Jan 21, 2014 4:24 pm    Post subject: Reply to: Problem in creating sequence

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)
Bill Woodger

DFSORT Moderator

Joined: 09 Mar 2011
Posts: 7314

 Posted: Tue Jan 21, 2014 4:36 pm    Post subject: Reply to: Problem in creating sequence Are you sure of GT and LT rather than GE and LE?
trushant.w

New User

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

 Posted: Tue Jan 21, 2014 4:45 pm    Post subject: yes thats the range i need to check
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Problem with OVERLAY - BI on SMF Record Ghellar DFSORT/ICETOOL 4 Sat Dec 01, 2018 9:41 pm UNSTRING problem Apurva Ghogale COBOL Programming 3 Tue Oct 09, 2018 8:01 pm RPG II Problem with unsigned Packed d... Andi1982 All Other Mainframe Topics 6 Tue Sep 11, 2018 6:11 pm Problem with Return or Exit from DCB ... Vishnu Priya M R PL/I & Assembler 6 Thu Aug 23, 2018 9:43 am CICS startup problem John Poulakos CICS 3 Tue Jun 12, 2018 9:08 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us