Column heading issue with RUNQRY in CL

2505 pts.
Tags:
AS/400
CL Program
I have a CL program which has a RUNQRY. I have two input files and I have defined the result fields. I have given an expression and I have used column heading. The issue is after executing the query, if I do a RUNQRY on the outfile, I am not able to see the column headings of the defined fields. Instead it shows the field names there. Can anyone help me here?

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: 6  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
  • TomLiotta
    Can anyone help me here?   We can help. First, we need to see the query definition. Then we need to see the RUNQRY statement. For now, since there is nothing for us to look at, there is no help we can give.   Tom
    125,585 pointsBadges:
    report
  • RamvishakRamesh
    SELECT                                                                          ALL       T01.fld1, T01.FLD2, T01.fLD3, T01.fLD3, t02.RATE AS                  MASRATE, fLd3*(RATE) AS SGD_BAL                                 FROM      QTEMP/FILEA T01,                                                         Mylib/FileB T02                Here I have used the heading MASRATE and  SGD_BAL for Rate and Rate * Fld3. But it is not reflected in the outfile. I checked the outfile using Runqry from command line. If any thing more is required, feel free to ask.
    2,505 pointsBadges:
    report
  • RamvishakRamesh
    Can any one help me ?
    2,505 pointsBadges:
    report
  • TomLiotta
    I don't quite understand. The original question says the problem is with RUNQRY, but you are showing SQL, and RUNQRY doesn't use SQL. Can you explain how those are related? Are you showing the query after it was converted to SQL? Also, when you say that you are "not able to see the column headings", where are you not seeing them? Column headings would be output by a report writer. A SELECT statement only selects rows; it doesn't do anything with column headers. What report writer are you using? -- Tom
    125,585 pointsBadges:
    report
  • RamvishakRamesh
    I have 2 runqry statements in my CL program. First query's outfile is used as second query's input. First query is what I copied in previous post. Under Define resuld field session of Wrkqry, for fields MASRATE and SGD_BAL, I have used the column heading part and mentioned column heading as 'MAS Rate' and 'Balance - SGD' respectively. My outfile is OutF1 and this is the input to second query. Second query select and sequence the fields based on some condition. Second Query's outfile is OutF2. After the 2 query, there is a CRTCSVDTA FROMFILE(QTEMP/OutF2) TOFILE(QTEMP/OUTCSVF) COLHDG(*COLHDG) FLDDEL(',') STRDEL('') RPLSTRDEL(''). If I take the CSV output, I am not able to see the column headings MAS Rate and Balance - SGD
    2,505 pointsBadges:
    report
  • TomLiotta
    Ah, since you're using CRTCSVDTA, you'll have to ask Martin Rowe, the developer. It's not a system command; it's a 3rd-party function. See [ http://www.dbg400.net/foswiki/bin/view/DBG400/CrtCsvDta ] for details. -- Tom
    125,585 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