|
For the archives:
In the custom program, define a single output result with correct length.
When defining the parameter to AJS, leave the "parameter data" empty, and
supply your program. Here is the program I wrote to determine "last month's
year", basically the AJS format *QYY(M-1).
-----start rpgle program ajsyy1
// 7 Dec 2006 - Loyd Goodbar
// Altiris 11711
// Custom AJS date parameter program to provide "last month's
year."
d ajsyy1 pr extpgm('AJSYY1')
d outyearchar 4a
d ajsyy1 pi
Entry plist
d outyearchar 4a
d workdate s d datfmt(*iso) inz(*sys)
/free
workdate -= %months(1);
outyearchar = %char(%subdt(workdate:*years));
*inlr = *on;
return;
/end-free
-----end rpgle program ajsyy1
Loyd Goodbar
Senior programmer/analyst
BorgWarner
TS Water Valley
662-473-5713
-----Original Message-----
From: Goodbar, Loyd (Water Valley)
Sent: Thursday, December 07, 2006 10:17
To: midrange-l@xxxxxxxxxxxx
Subject: Parameter question with Advanced Job Scheduler
Does anyone know how to create an Advanced Job Scheduler date parameter with
the equivalent data of *QYY(M-1)? I only need the year portion of a date,
but it needs to represent "last month's" year. For example, if run on
1/1/2007, it would calculate the year for December 2006. This is feeding a
command that takes separate month and year components. I also tried
something like *QYY(*QMDYY(M-1)) that failed; and defining another parameter
as "last month" and trying to insert that into the parameter, also failed.
The parameter data is acting as if when I define the output as *QYY, I can
only perform calculations in terms of years because that's all being output.
Has anyone used the "program to process" when defining a parameter, with an
example?
Thanks,
Loyd
Loyd Goodbar
Senior programmer/analyst
BorgWarner
TS Water Valley
662-473-5713
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.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 on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.