Hello all!

I have a new SORT challenge... I have looked up and found out how to use SORT to get the current date and output it, but I need to go further, and could not find this.

I would like to use SORT to generate a file like this that I am using for testing some SQL logic I am working on:
('D001','ccyy-mm-dd','ccyymmdd',ccyymmdd,'cc','yy','mm','dd')

I need this for about 3 months worth of dates. The dates should start either on the 15th of the month, 2 months ago, or 45 days ago (whichever is easier) and go up through the end of the current month (it could even start on the 1st day of 2 months ago if necessary). So for today (June 30), it would have
('D001','2022-04-15','20220415',20220415,'20','22','04','15')
('D002','2022-04-16','20220416',20220416,'20','22','04','16')
. . .
('D077','2022-06-30','20220630',20220630,'20','22','06','30')

I can generate the sequential number, but have trouble with incremental dates or getting the start date. Can Kolusu or someone else help with this? I am sure it is simple with a repeat, but I can't come up with anything.

Thank you and best regards,
Billy Ashton

----------------------------------------------------------------------
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