×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Count function

Count function

Count function

(OP)
I am relatively new to WebFocus and am trying to write a report utilizing multiple joins from mainframe datasets through the EDA relational gateway.  My synonyms are set up correctly and my initial join is performed fine.  When I use the report painter to count a specified field by userid the function works intermittently.

Using the following code results in data being returned correctly:

TABLE FILE MAF203
COUNT *
BY USERID
HEADING
"PAGE <TABPAGENO "
WHERE ( ACTIVITYTYPE EQ '4' )
AND ( CHANGEDFIELD EQ '12' );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SET ONLINE-FMT HTML
END


However, when I use the same code removing the * with a fieldname I receive an error.

TABLE FILE MAF203
COUNT ACCTNUM
BY USERID
HEADING
"PAGE <TABPAGENO "
WHERE ( ACTIVITYTYPE EQ '4' )
AND ( CHANGEDFIELD EQ '12' );
ON TABLE SET PAGE-NUM OFF
ON TABLE NOTOTAL
ON TABLE SET ONLINE-FMT HTML
END


The error I receive is :
(FOC003) THE FIELDNAME IS NOT RECOGNIZED: CNT.USRUSERID
A word which is assumed to be the name of a data field does not appear on the list of names or aliases for the file.  Check the spelling of the fieldname.
(FOC009) INCOMPLETE REQUEST STATEMENT
The request statement is terminated with an END, RUN, semicolon (;), or end-of-file before the request is complete.


Why would I receive an error using the same exact code except for one word, when counting every field works?  I receive the same errors utilizing the SUM CNT.ACCTNUM BY USERID syntax as well.  

Any help would be greatly appreciated.

Thanks!!

ehagan

RE: Count function

(OP)
I believe there may have been a problem counting the instances due to the type of the field, alphanumeric.  So in order to rectify this, I wrote a define statement on the table and ran it as a sum(counter) by userid.

DEFINE FILE MAF203
INSCOUNTER/I5=1;
END

TABLE FILE MAF203
SUM
     INSCOUNTER
     
BY
     USERID
WHERE ( ACTIVITYTYPE EQ '4' )
AND ( CHANGEDFIELD EQ '12' );
ON TABLE NOTOTAL
END

This seems to have worked.   

Thanks :)

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close