MIDRANGE dot COM Mailing List Archive



Home » MIDRANGE-L » September 2003

Re: Need help hot to distinguish btw 2 members



fixed

Murali

You need to have a literal that is different for each query. You can define a result field, I think, with a literal value, then use that in your query.

Have you considered QM queries? This is even easier, IMO, in SQL, which is what a *QMQRY runs. This would be a union of 2 select statements. And you can use a QM form (*QMFORM) to get the report. STRQMQRY is the command to use - even allows easy use of substitution variables in your CL.

Like

select 'T', ACCOUNT, DESC, EXCH, DATE from TRANSACTIONS
union
select 'P', ACCOUNT, DESC, EXCH, DATE from POSITIONS
order by DATE     (or whatever you use)

If you have the SQL development kit, try STRQM - it can have an interface very similar to Query/400 until you are more used to SQL.

No extra output files, very clean.

Just a thought.

HTH

Vern

At 03:52 AM 9/25/2003 +0000, you wrote:
hi all,
below is my cl program,iam generating spool file for user sake in third query.my program is working fine and generating correct report.
my problem is ,is there anyway i can distiguish between TRANSACTIONS and POSITIONS in the final report.since iam adding POSITIONS to the TRANSACTIONS ,user is unable to find where exactly POSITIONS starts in the final report (ysusprep).Below is the final report.Please try to help me how do i distinuish btw these TRANSACTION &POSITIONS..can anybody help?
------------------------------------------------------------------------
PGM
/* FOR TRANSACTIONS */
RUNQRY QRY(YNGTEST/YSUSPQRY1) +
QRYFILE((QS36FSUR/GMICMFF1) +
(QS36FSUR/GMITRNF1)) OUTTYPE(*OUTFILE) +
OUTFILE(YNGTEST/YSUSPREP *FIRST *RPLMBR)
/* FOR POSITIONS */
RUNQRY QRY(YNGTEST/YSUSPQRY2) +
QRYFILE((QS36FSUR/GMICMFF1) +
(QS36FSUR/GMIPOSF1)) OUTTYPE(*OUTFILE) +
OUTFILE(YNGTEST/YSUSPREP *FIRST *ADDMBR)
RUNQRY QRY(YNGTEST/YSUSPQRY3)
ENDPGM
------------------------------------------------------------------------


------------------------- YSUSPREP-----------------------
ACCOUNT   DESC                            EXCH         DATE
69999999  DEC 03 TSE 10 YR JGB             24    20,030,918
69999999  DEC 03 TSE TOPIX                 24    20,030,918
69999999  DEC 03 TSE TOPIX                 24    20,030,918
69999999  DEC 03 TSE TOPIX                 24    20,030,918
69999999  DEC 03 TSE TOPIX                 24    20,030,918
69999999  DEC 03 TSE TOPIX                 24    20,030,918







Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2014 by MIDRANGE dot COM and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available here. If you have questions about this, please contact