On 3/14/2013 7:10 AM, Elardus Engelbrecht wrote:
John McKown wrote:

What I do is use REXX. A UNIX REXX shell script is rather easy:

Agreed. REXX can do things an achieve results in one single command line. Use 
the pipe thing to send and receive keywords/parms to different commands.

/* rexx */
today=date('b') /* today's date in base form */
yesterday = today - 1
say date('s',yesterday,'b') /* yesterday in yyyymmdd form */

Will above takes Leap Year in account? I have a version of that example, but 
must receive Julian dates from a product and gives Julian date back, taking 
Leap Year in account.

For example, if today is 2012/03/01, it must accept it as 12061 and gives back 
12060 for 2012/02/29.
And 2013/03/01 must be accepted as 13060 and gives back 13059 as yesterday.

Just something for you to think about...

Groete / Greetings
Elardus Engelbrecht



If you're coding in C, Assembler, COBOL, or PL/I, you can use
the Language Environment date functions, which can do what
you want pretty simply.

  call CEELOCT to get today's date in Lilian format
  subtract 1
  call CEEDATE to convert to a formatted date in a wide
               variety of options

this does account for leap years and such.

It's not a shell command, but you could write a very
short program that returns the output from the CEEDATE
call and then just invoke the program from a shell
script.







--

Kind regards,

-Steve Comstock
The Trainer's Friend, Inc.

303-355-2752
http://www.trainersfriend.com

* To get a good Return on your Investment, first make an investment!
  + Training your people is an excellent investment

* Try our tool for calculating your Return On Investment
    for training dollars at
  http://www.trainersfriend.com/ROI/roi.html

----------------------------------------------------------------------
For IBM-MAIN subscribe / signoff / archive access instructions,
send email to lists...@listserv.ua.edu with the message: INFO IBM-MAIN

Reply via email to