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

IF loop is not working ,going inside loop without check cond


IBM Mainframe Forums -> CA Products
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
nkreddy5

New User


Joined: 06 May 2008
Posts: 7
Location: BANGALORE

PostPosted: Fri Nov 07, 2008 5:34 am
Reply with quote

Hi ,

Here is the code which iam trying to find out the duplicates successquily in my input file..i have coded as below.but if loop is not getting considered and going continously with out taking if loop into consideration..
can you please suggest how can i proceed.

Code:
FILE INPUT1                                   
   INPUT1-REC                   1  400  A     
   SE                           1   10  A     
   REF                          15  09  A     
   PERIOD                       30  4   A     
   CARD                         40  17  A     
   AMOUNT                       65  12  A     
FILE OUTPUT1                                 
   OUTPUT1-REC                  1  400  A     
DEFINE   WS-SE1        W                 10  A     
DEFINE   WS-REF1       W                 09  A     
DEFINE   WS-PERIOD1    W                 4   A     
DEFINE   WS-CARD1      W                 17  A     
DEFINE   WS-AMOUNT1    W                 12  A     
DEFINE   WS-SE2        W                 10  A     
DEFINE   WS-REF2       W                 09  A     
DEFINE   WS-PERIOD2    W                 4   A     
DEFINE   WS-CARD2      W                 17  A     
DEFINE   WS-AMOUNT2    W                 12  A     

****************************************************************     
WS-IND           W   07 A                                             
*******************************************************************   
*      A C T I V I T Y   S E C T I O N                               
*********************************************************************
JOB INPUT NULL                                                       
   GET INPUT1                                                         
   WS-SE1 = SE                                                       
   WS-REF1 = REF                                                     
   WS-PERIOD1 = PERIOD                                               
   WS-CARD1 = CARD                                                   
   WS-AMOUNT1 = AMOUNT                                               
   DO WHILE NOT EOF INPUT1                                           
    GET INPUT1                                                       
    WS-SE2 = SE                                                       
    WS-REF2 = REF                                                     
    WS-PERIOD2 = PERIOD                                               
    WS-CARD2 = CARD                                                   
    WS-AMOUNT2 = AMOUNT                                               
    IF (SE ¬= WS-SE1) AND (REF ¬= WS-REF1) AND (CARD ¬= WS-CARD1)     
     IF (PERIOD ¬= WS-PERIOD1) AND (AMOUNT ¬= WS-AMOUNT1)             
      DISPLAY 'ORG'                                                   
      WS-SE1 = WS-SE2                                               
      WS-REF1 = WS-REF2                                             
      WS-PERIOD1 = WS-PERIOD2                                       
      WS-CARD1 = WS-CARD2                                           
      WS-AMOUNT1 = WS-AMOUNT2                                       
     END-IF                                                         
    END-IF                                                         
    IF (SE = WS-SE1) AND (REF = WS-REF1) AND (CARD = WS-CARD1)     
     IF (PERIOD = WS-PERIOD1) AND (AMOUNT = WS-AMOUNT1)             
      DISPLAY 'DUP'                                                 
      OUTPUT1-REC = INPUT1-REC                                     
      PUT OUTPUT1                                                   
     END-IF                                                         
    END-IF                                                         
   END-DO                                                           
    STOP                                                           


Please let me know if i hve to provide any other informmation..

Thanks,
karthik
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Nov 07, 2008 6:43 am
Reply with quote

Hello,

Quote:
but if loop is not getting considered and going continously with out taking if loop into consideration..
I do not understand what this is telling me.

What is at the bottom of the Easytrieve listing?

Does the process abend due to a time out (going continuously)?

Does the process create incorrect output - if yes, show the incorrect output and what it should be.

Is there some reason that JOB INPUT INPUT1 was not used (which is much more common tha GET)?

The code issues GETs but does not check eof after the read.

How many records does "input1" contain?

It may help if you post the jcl for this step.
Back to top
View user's profile Send private message
nkreddy5

New User


Joined: 06 May 2008
Posts: 7
Location: BANGALORE

PostPosted: Mon Nov 10, 2008 8:53 pm
Reply with quote

Hi Dick,

Thanks for reply.
I got know why my if loop is not working..because in the input file i have in between records hex variables are embeeded in input file.
So,if loop didnt work for me.

When i gave hex variable input file.my above coding will not consider the if loop and will jsut go through the code.

Job will not abend..just it will all records in input with out considering the contdtions which i have coded thru if loop.

Thanks,
Karthik
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Mon Nov 10, 2008 10:46 pm
Reply with quote

Good to hear it is working - thank you for letting us know icon_smile.gif

d
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 -> CA Products

 


Similar Topics
Topic Forum Replies
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
This topic is locked: you cannot edit posts or make replies. REXX - Do - Not able to LOOP CLIST & REXX 10
No new posts PD not working for unsigned packed JO... DFSORT/ICETOOL 5
Search our Forums:

Back to Top