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
 

 

Easytrieve - Check count & loop problem

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CA Products
View previous topic :: :: View next topic  
Author Message
Khushboo.goel

New User


Joined: 22 Feb 2011
Posts: 19
Location: india

PostPosted: Fri Mar 04, 2011 2:31 pm    Post subject: Easytrieve - Check count & loop problem
Reply with quote

Hi..

I need to first check if the data in two input files are zero or not.. if not then have to check whether they match or not..

JOB INPUT (UT01 KEY (INF1-ALL-REC) +
VIRT1 KEY (VIR1-ALL-REC))
IF INF1-ALL-REC = 0 OR VIR1-ALL-REC = 0
RETURN-CODE = 8
STOP
END-IF


JOB INPUT (UT01 KEY (INF1-ALL-REC) +
VIRT1 KEY (VIR1-ALL-REC))
IF MATCHED
RETURN-CODE = 0
ELSE
RETURN-CODE = 12
END-IF.


But this code is not working.. Can u let me know where I am wrong
Back to top
View user's profile Send private message

PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Mar 04, 2011 2:40 pm    Post subject:
Reply with quote

If you want to stop when the files are empty you have to use :
STOP EXECUTE
Back to top
View user's profile Send private message
Khushboo.goel

New User


Joined: 22 Feb 2011
Posts: 19
Location: india

PostPosted: Fri Mar 04, 2011 3:14 pm    Post subject:
Reply with quote

Ya have changed that... Its working Thanks :-)

But i have got another problem..

JOB INPUT (UT01 KEY (INF1-ALL-REC) +
VIRT1 KEY (VIR1-ALL-REC))
IF INF1-ALL-REC = 0 OR VIR1-ALL-REC = 0

This gives an error that INVALID FILE REFERENCE - VIRT1

could you help me with this?
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Mar 04, 2011 3:34 pm    Post subject:
Reply with quote

That means that VIRT1 has no active record, and that means that the file is empty.

You could test your file like this :

JOB INPUT UT01
IF RECORD-COUNT = 0
RETURN-CODE = 8
STOP EXECUTE
END-IF
STOP
*
JOB INPUT VIRT1
IF RECORD-COUNT = 0
RETURN-CODE = 8
STOP EXECUTE
END-IF
STOP
*
put here your match/merge activity
Back to top
View user's profile Send private message
Khushboo.goel

New User


Joined: 22 Feb 2011
Posts: 19
Location: india

PostPosted: Fri Mar 04, 2011 4:18 pm    Post subject:
Reply with quote

Thanks Peter.. But I need to check if the value in the file is zero or not.. M nt cheking whether file is empty or not.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Mar 04, 2011 4:22 pm    Post subject:
Reply with quote

Well, if the input file(s) is / are empty then you can't really check anything.

I believe that Peter has given you some good error checking and handling code which you should incorporate where possible.
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Mar 04, 2011 4:39 pm    Post subject:
Reply with quote

Expat,

thanks for the support. But i totally misinterpreted the TS problem.
Thought he was talking about empty files, but its about fields containing zero. So i have to reconsider his problem.
There are these possibilities :

both files match with zero in both fields
they dont match cause 1 of both files could have zero in the field

or

both files match with non zero values
they dont match with non zero values

so the TS has to write some logic around these conditions.
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Mar 04, 2011 4:42 pm    Post subject:
Reply with quote

Peter, at least the OP has the error checking and handling code for free icon_lol.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Mar 04, 2011 4:50 pm    Post subject:
Reply with quote

expat wrote:
Peter, at least the OP has the error checking and handling code for free icon_lol.gif


Well the bill is on its way icon_rolleyes.gif
Back to top
View user's profile Send private message
PeterHolland

Global Moderator


Joined: 27 Oct 2009
Posts: 2422
Location: Netherlands, Amstelveen

PostPosted: Fri Mar 04, 2011 5:04 pm    Post subject:
Reply with quote

Ok, im not in a too bad mood. So the logic could be something like this :

Code:

IF MATCHED
   IF INF1-ALL-REC = 0 AND VIR1-ALL-REC = 0
      RETURN-CODE = 8
      STOP EXECUTE
   END-IF
*  other prcessing   
END-IF
IF NOT MATCHED
   IF UT01 AND INF1-ALL-REC = 0
      RETURN-CODE = 12
      STOP EXECUTE
   END-IF
   IF VIRT1 AND VIR1-ALL-REC = 0
      RETURN-CODE = 16
      STOP EXECUTE
   END-IF
*  other processing
END-IF
Back to top
View user's profile Send private message
Khushboo.goel

New User


Joined: 22 Feb 2011
Posts: 19
Location: india

PostPosted: Tue Mar 08, 2011 10:24 am    Post subject:
Reply with quote

Hi Peter..

Thanks for the code... but its not working :-(

even if the counts are similar they go into the non matched loop :-(

my main objective is :

first to check if both the files contain zero or not.. if yes then return maxcc=8

if not then check if the count in both files are equal.. if yes then return maxcc=0 else maxcc=12..

Please help
Back to top
View user's profile Send private message
Khushboo.goel

New User


Joined: 22 Feb 2011
Posts: 19
Location: india

PostPosted: Tue Mar 08, 2011 10:37 am    Post subject:
Reply with quote

This is my code:


Code:
FILE UT01
INF1-ALL-REC        1  8  N

FILE UT02
INF2-ALL-REC        1  8  N

FILE VIRT1 F(8) VIRTUAL
VIR1-ALL-REC        1  8  N

WS-SUB                         W   8  N VALUE 11

JOB INPUT UT02
    INF2-ALL-REC = INF2-ALL-REC - WS-SUB
    PUT VIRT1 FROM UT02


JOB INPUT (UT01  KEY (INF1-ALL-REC)           +
               VIRT1 KEY (VIR1-ALL-REC))
     IF MATCHED
        IF INF1-ALL-REC = 0 AND VIR1-ALL-REC = 0
           DISPLAY 'MATCHED ZERO'
           RETURN-CODE = 8
           STOP EXECUTE
     *  OTHER PROCESSING
        ELSE
        ELSE
           DISPLAY 'MATCHED'
           RETURN-CODE = 0
           STOP EXECUTE
        END-IF
     ELSE
     IF NOT MATCHED
           DISPLAY 'NT MATCHED'
           RETURN-CODE = 12
           STOP EXECUTE
     END-IF
     END-IF


I am very new to Easytrieve... Please help me out with this..
Back to top
View user's profile Send private message
Khushboo.goel

New User


Joined: 22 Feb 2011
Posts: 19
Location: india

PostPosted: Tue Mar 08, 2011 10:51 am    Post subject:
Reply with quote

Solved my prob :-)

Thankss a lot Peter for your help icon_smile.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


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

PostPosted: Tue Mar 08, 2011 8:53 pm    Post subject: Reply to: Easytrieve - Check count & loop problem
Reply with quote

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

Quote:
Solved my prob :-)
How was the problem solved? It will probably help someone else if you post what caused the problem and how it was fixed.

d
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 -> CA Products All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Check System time(Minute) Using TIME1... balaji81_k DFSORT/ICETOOL 5 Fri Nov 11, 2016 10:53 am
No new posts Problem in Running Query via JCL vickey_dw DB2 3 Tue Oct 18, 2016 11:11 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm


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