## Code check

Solved
Super Contributor
Posts: 1,041

# Code check

Hi,

I have the following code and I am getting  the value of MXCNT=1

Could you tell me where I am going wrong???

Accepted Solutions
Solution
‎05-06-2013 01:00 PM
Super User
Posts: 13,498

## Re: Code check

How many values of VPFX do you have for each value of MRN1? If there is only one then that's what's going on. Code without data is a tad hard to diagnosis for specific values.

If you are only looking at the value of the Put statement when LAST then the above is critical for the last combination of MRN1 and VPFX.

If you have more than one value of MRN1 you probably aren't getting what you want uness you only want the count for the last value of MRN1.

All Replies
Solution
‎05-06-2013 01:00 PM
Super User
Posts: 13,498

## Re: Code check

How many values of VPFX do you have for each value of MRN1? If there is only one then that's what's going on. Code without data is a tad hard to diagnosis for specific values.

If you are only looking at the value of the Put statement when LAST then the above is critical for the last combination of MRN1 and VPFX.

If you have more than one value of MRN1 you probably aren't getting what you want uness you only want the count for the last value of MRN1.

Super Contributor
Posts: 1,041

## Re: Code check

There are multiple VPFX for each value of MRN1

Super User
Posts: 8,069

## Re: Code check

You are counting how many copies of a particular VPFX there are.  So if the MAX is 1 then the combination of MRN1 and VPFX uniquely identifies the observation.

Perhaps you wanted FIRST.MRN1 instead of FIRST.VPFX so that you could count the max number of VPFX per MRN1?

🔒 This topic is solved and locked.