Get average through WRKQRY

2505 pts.
Tags:
.CSV files
AS/400
WRKQRY
I have a file which has daily balances. I need to find the Average of the daily balance as the last record. I have selected the report summary functions from WRKQRY and have given (2=Average) on the desired field. I have selected the output type as 3 = data base file. After this if I take a F5 I can see the Average, But when I actually runs the query, the average is not coming. If I select output as printer, I can see the average. But the requirement is to send the report as .CSV format. So I need the result in Database itself. Please help me

Software/Hardware used:
AS400

Answer Wiki

Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Discuss This Question: 3  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • CharlieBrowne

    Have you thought of switching over to SQL?

    There are so many more options available to you and WRKQRY is no longer being enhanced.

    41,380 pointsBadges:
    report
  • Splat
    Do you happen to have break levels defined on the query?  If so, ensure Suppress summaries is set to N.

    Then, when you're past the immediate problem, follow CharlieBrowne's suggestion.
    7,635 pointsBadges:
    report
  • RegnadKcin57
    According to "Suppress Summaries - Help", the choice specifies
    "for this break level, whether summary values (if any summary
     functions were selected) are to be suppressed
     for displayed or printed reports."
    Note how the option is not applicable to *OUTFILE.

    For output to a database file, the Average is represented
    by data in a generated column, but the Output Form must be
    "Summary only" instead of "Detail"; i.e. producing summary
    records vs just the detail rows. That specification can be
    saved in the *QRYDFN object, or specified on the RUNQRY
    command invocation with OUTTYPE(*OUTFILE) OUTFORM(*SUMMARY).
    The generated column has a suffix of "02" for an Average.
    95 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following