f



RUNNING QUERY USING AS400

HOW CAN I USE AS 400 TO RUN A QUERY TO CHANGE OTHER QUERY DATES. CAN IT BE DONE EVERY DAY AT WORK I HAVE TO CHANGE OVER 100 QUERY DATES INSTEAD I WANT TO CREATE ONE QUERY TO RUN AND CHANGE THOSE 100 QUERY DATES. PLEASE HELP. 
0
lano
9/10/2016 2:37:59 AM
comp.sys.ibm.as400.misc 9219 articles. 3 followers. Post Follow

4 Replies
447 Views

Similar Articles

[PageSpeed] 31

Il giorno sabato 10 settembre 2016 04:38:01 UTC+2, lano dubz ha scritto:
> HOW CAN I USE AS 400 TO RUN A QUERY TO CHANGE OTHER QUERY DATES. CAN IT BE DONE EVERY DAY AT WORK I HAVE TO CHANGE OVER 100 QUERY DATES INSTEAD I WANT TO CREATE ONE QUERY TO RUN AND CHANGE THOSE 100 QUERY DATES. PLEASE HELP.

Hi,
in the query definition you can use a variable (eg. :RUNDATE) with prefix :
and run the query with STRQMQRY command  specifyng the value of date to use
(eg.  SETVAR((RUNDATE datevalue))

DinoB
0
dinobusillo
9/12/2016 7:37:08 AM
On Friday, September 9, 2016 at 10:38:01 PM UTC-4, lano dubz wrote:
> HOW CAN I USE AS 400 TO RUN A QUERY TO CHANGE OTHER QUERY DATES. CAN IT B=
E DONE EVERY DAY AT WORK I HAVE TO CHANGE OVER 100 QUERY DATES INSTEAD I WA=
NT TO CREATE ONE QUERY TO RUN AND CHANGE THOSE 100 QUERY DATES. PLEASE HELP=
..

Hi, Dinob. thanks for the advise as it relates to running a query to change=
 other query dates. but i need you to break it down a little more to me sin=
ce I'm also fairly new to the whole AS400. PLEASE RESPOND ASAP IM IN WORK N=
OW AND I COULD TRY IT ON OUR TEST ENVIRONMENT. DO U HAVE AN EMAIL I COULD G=
ET YOU ON I WANNA SHARE SOME SCREEN SHOTS I TOOK.
0
lano
9/16/2016 1:20:08 AM
On Friday, September 9, 2016 at 10:38:01 PM UTC-4, lano dubz wrote:
> HOW CAN I USE AS 400 TO RUN A QUERY TO CHANGE OTHER QUERY DATES. CAN IT B=
E DONE EVERY DAY AT WORK I HAVE TO CHANGE OVER 100 QUERY DATES INSTEAD I WA=
NT TO CREATE ONE QUERY TO RUN AND CHANGE THOSE 100 QUERY DATES. PLEASE HELP=
..

1) The operating system is called IBM i.  You will get really old informati=
on if you search with 'AS/400'.  The full documentation for IBM i is here: =
http://www.ibm.com/support/knowledgecenter/ssw_ibm_i

2) Query is intended to extract data, not as a general purpose programming =
language.  You might be able to create a query that will update other query=
's selection criteria, but it will be a huge amount of work, and not really=
 suited to someone who is new to the platform.  A better option is to take =
Dino's advice and instead of hard-coding the date in each query, use a vari=
able which is then set by the calling CL program (or from the command line =
if that is how you run the queries).

> but i need you to break it down a little more to me since I'm also fairly=
 new to the whole AS400. PLEASE RESPOND ASAP IM IN WORK NOW AND I COULD TRY=
 IT ON OUR TEST ENVIRONMENT. DO U HAVE AN EMAIL I COULD GET YOU ON I WANNA =
SHARE SOME SCREEN SHOTS I TOOK.

3) This forum / group is not really set up to 'respond ASAP'.  There will b=
e a delay between each post, as people are in different time zones, and rea=
d their mail at different times of the day.

4) ALL CAPS MEANS YOU ARE SHOUTING.

  --buck
0
Buck
9/16/2016 3:12:39 PM
On 15-Sep-2016 20:20 -0600, lano dubz wrote:
> On 09-Sep-2016 21:37 -0600, lano dubz wrote:
>>
>> How can I use AS/400 to run a query to change other query dates?

Presumably "run a query" refers to the Query Definition (QRYDFN) object 
type, as would be created by the Query/400 [aka IBM i Query] feature; 
and "run", either via the Option-9=Run within the Work With Queries 
(WRKQRY) interface, or via the Run Query (RUNQRY) command [optionally 
with the Record Selection Prompting (RCDSLT) feature requested].

>>
>> Can it be done every day?  At work I have to change over 100 query
>> dates.
>> Instead, I want to create one query to run, and [ed: �to have that
>> one query?] change those 100 query dates.
>>

As Buck replied, the Query/400 feature is a Report Writer, not a 
programming feature by which /changes/ can be made to other objects; 
running a query can replace or add /data/ to a database file, but can 
not effect other *change* activity,

 From the description of what is desired, I infer what might be best 
[per /daily/ need for change], is to change the [�apparently ~100?] 
query objects to reference the CURRENT_DATE instead of referencing a 
literal-date value?

>
> Dinob. thanks for the advise as it relates to running a query to
> change other query dates.

   That reply 
[https://groups.google.com/d/msg/comp.sys.ibm.as400.misc/Gm_nbqo9_oE/9EIqDnpjAQAJ] 
suggesting the possibility to use a /variable/ name is specific to 
reference to the _date_ value in the Select Records option from the 
Define The Query panel.  As well, the important caveat for restrictions 
and limitations on the support of the Start Query Management Query 
(STRQMQRY) feature was left unmentioned; the ability to /run a query/ 
via the alternate QM report writer must not be presumed to be generally 
functional, and any query for which such alternative interface might be 
utilized should first be reviewed with the Analyze Query (ANZQRY) 
feature to verify what functions might not be available and thus how the 
results might not be desirable.

> but I need you to break it down a little more to me since I'm also
> fairly new to the whole AS400.
>
> Please respond ASAP; I'm at work now and I could try it on our test
> environment.  Do you have an email I could reach you on?

USENET is not really a good place to seek /urgent/ assistance; that is 
the domain of your service provider, though in this case, for apparent 
usage support vs defect support.

If the topic is really Query/400, then I might be one of the best 
resources to assist; I worked on the product for some years, but I have 
been busy with other things of late, and typically I will respond most 
timely to topics that provide good [background] information\details 
about the issue.  In this topic, we do not even know for sure what 
"query" feature is being utilized.

This may be far too late of a response, but if there is still an issue 
to be resolved, do post a followup; but first, see the below:

> I want to share some screen shots I took.

Again, if the topic is the IBM i Query feature: The Option-6=Print from 
the Work With Queries (WRKQRY) feature provides text output, and the 
5250 host-print also provides text output such that any /screen shots/ 
need not be taken as images; if images were really deemed valuable over 
text [though I can not imagine how images could be better], then there 
are numerous places on the web where such data can be posted and shared.

-- 
Regards, Chuck
0
CRPence
9/22/2016 2:51:52 PM
Reply: