Focal Point
Monthly Processing dates

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/2311076162

December 14, 2007, 11:03 AM
clawsjhn
Monthly Processing dates
I have a file that automatically runs on a monthly basis. Each month I have to ensure that the dates are updated. I believe there is a date function in FOCUS such as &&YYMD that can be used so that one would not need to go into the file each month and update it.

I do not know much about &&YYMD, so I do not know how I can manipulate it to meet my needs.

For example, I have one program that tracks the movement of inventory like so:

00022 -SET &STARTUSAGE = '200701';
00023 -SET &ENDUSAGE = '200712';
00024 -SET &SFORECAST = '200712';
00025 -SET &EFORECAST = '200811';

**** The STARTUSAGE and ENDUSAGE set the time period that we include the actual inventory transactions in the calculation. This should be the past 12 month time period. (December 1st report should have had 200701 and 200712)
**** The SFORECAST and EFORCAST set the time period that we include the future forecast in the calculation. This should be current month plus next 11 months. (December 1st report should have had 200712 and 200811)

I am not sure how I can get the &&YYMD feature to meet my needs in my programs. Can someone help me with understanding it and how to do a revolving 12 months with it or point me to some documentation/code samples?

I greatly thank you for your time and help.

Thank you.


FOCUS 7.0.8R for AS400 systems
Windows XP SP2
Output: Microsoft Excel 2003
December 14, 2007, 11:20 AM
Prarie
You could play with something like this -

-SET &BEG = DATEMOV(&YYMD, 'BOM', 'A8YYMD');
-SET &END = DATEMOV(&YYMD, 'EOM', 'A8YYMD');


In Focus since 1993. WebFOCUS 7.7.03 Win 2003
Try this:

-SET &ENDUSAGE = EDIT(&YYMD,'999999');;
-SET &STARTUSAGE = AYM(&ENDUSAGE,-11,'I6'); 
 
-SET &SFORECAST = &ENDUSAGE; 
-SET &EFORECAST = AYM(&ENDUSAGE,11,'I6'); 
-TYPE &ENDUSAGE &STARTUSAGE &SFORECAST &EFORECAST 


&YYMD is the system date in your computer.


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
Thanks Ginny. I have just a couple of questions; I'm new to FOCUS. I don't understand what AYM is or I6? Can you help me with what those mean? Also, what does the last line of code do: print out the contents of the variables to the screen?

Sorry, but I am new to FOCUS. I believe this is the approach I would like, but I just want to understand it more. Thank you for your time and help!

Thank you,

John


FOCUS 7.0.8R for AS400 systems
Windows XP SP2
Output: Microsoft Excel 2003
If you're "new to FOCUS" and you "just want to understand it more", then I would suggest looking at the documentation.

AYM is a WebFOCUS Date function. I6 is an integer of 6 digits. This is very basic stuff, so I'd really read the documentation.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
Thanks, Francis.

John, there is a functions manual that you can download from this website. It has lots of functions documented in chapters by type. There are lots on dates. The function that I used, AYM is a 'legacy' date function. There are also smart date functions which I won't get into today.

I6, as Francis mentioned, is a field format. The doc for AYM indicates that I needed to specify a legacy date format.

And yes, -TYPE prints the contents of the variables so that I could see that I had done it correctly. That is a Dialogue Manager command. That will be in the Developing Report Applications manual.

You really need to do some reading. And a little reading points to more reading...

You can also search for topics in the techsupport site, Advanced Search link, and it will point you to things to read.

RIF (Reading is Fun!)


Ginny
---------------------------------
Prod: WF 7.7.01 Dev: WF 7.6.9-11
Admin, MRE,self-service; adapters: Teradata, DB2, Oracle, SQL Server, Essbase, ESRI, FlexEnable, Google
John

there is also a great book that is called 'almost 1001 Ways to Work with Dates in WebFOCUS' it will cost you 25$ but it's worth all the money.
And maybe ask your company to send you to some basic training. It's a bit more than these 25 but you will get a good startup and it will help you better understand all the stuff here.
I started years ago with 1-2-3 (that was something like excel....) And I remember that someone tried to explain me to type "slash" to start the program. I did but nothing happened. A course will be helpful.




Frank

prod: WF 7.6.10 platform Windows,
databases: msSQL2000, msSQL2005, RMS, Oracle, Sybase,IE7
test: WF 7.6.10 on the same platform and databases,IE7

Another thing to remember is that & dates (&YYMD, &MDYY, etc.) are not really dates, they are alphanumeric character strings. As such, you can do all sorts of things. For example, with &YYMD equal to 20071217:
-SET &YR_MTH = &YYMD/100; (yields 200712)
-SET &ADD_5YRS1 = &YYMD+50000; (yields 20121217)
-SET &SUB_5YRS1 = &YYMD-50000; (yields 20021217)
-SET &ADD_5YRS2 = &YR_MTH+500; (yields 201212)
-SET &SUB_5YRS2 = &YR_MTH-500; (yields 200212)

Also, in addition to AYM (which adds and subtracts months) there is AYMD which adds and substracts days.


In FOCUS since 1985. Prod WF 8.0.08 (z90/Suse Linux) DB (Oracle 11g), Self Serv, Report Caster, WebServer Intel/Linux.