Thanks Arun. My input date file has date in three formats:
YYMMDD, DDMMYY, YYDDD
Yes I can use YYMMDD format for this particular step (input file).
However, I have to write lots of steps to change the date on different input files, all have different date format. This would mean, for each input file, I will have to create symbol file.
I was hoping TOJUL and TOGREG will allow to get all the formats I need.
What is the idea of full mess-up when dealing with SYMNAMES in your task???
What is the role, or any benefit from your MYDATE???
Now you get what you have requested: at position 15 there is your original date, while converted date goes right next to it.
I want to re use SYSNAMES dataset to populate date on different files.
I want to user to provide date
Yes, I know but I didn't know how to convert date same time at position 15.
What is the idea of full mess-up when dealing with SYMNAMES in your task???
What is the role, or any benefit from your MYDATE???
Now you get what you have requested: at position 15 there is your original date, while converted date goes right next to it.
I want to re use SYSNAMES dataset to populate date on different files.
I want to user to provide date
Yes, I know but I didn't know how to convert date same time at position 15.
Thanks.
Please note file is VB.
Split the two of them (value substitution, and date conversion)
1) either into INREC + OUTREC,
2) or into separate WHEN=...,OVERLAY= groups
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
zh_lad wrote:
Thanks Arun. My input date file has date in three formats:
YYMMDD, DDMMYY, YYDDD
Yes I can use YYMMDD format for this particular step (input file).
However, I have to write lots of steps to change the date on different input files, all have different date format. This would mean, for each input file, I will have to create symbol file.
I was hoping TOJUL and TOGREG will allow to get all the formats I need.
How about creating 3 different date symbols corresponding to each date format, write all of them in your SYMNAMES once and then use whichever you want in the subsequent steps.
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
What bone head designed the contents of this data set? Well, that's something we will never know. Not 20 years ago our industry went through considerable pain to resolve issues with two digit dates and we still have boneheads putting 2 digit years into data. Resolving the same issues in the 2090s will be even more of a nightmare than the Y2K issues in the 1990s. At least 2000 was a leap year. 2100 is not.
The sort products have built in tools to transform two digit years to correct 4 digit years. These tools will not work correctly in 20 or 30 years, but they work correctly now. Find these tools in your sort product documentation and use them.
Dates expressed as yyddd have often been called a "Julian" date. This is not correct. A Julian date is a date expressed, for the most part, like any other date.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
zh_lad wrote:
yeah.
I have built is from DDMMYY (P8,L6).
Code:
C'MYDATEG6,''',8,4,C'20',12,2,C'''',/,
Thanks.
You could do the conversion just once from YYDDD to CCYYMMDD and then in the output, just rearrange the data as you need instead of trying to convert for each symbol.
One last question on this thread.
Is there a way I can draw or convert date into DD-MMM-YY (e.g. 19-JUN-18) or similar format where first three letters of month is displayed?
I understand I can have conditional check on MM (06) to populate first three bytes of month name (in this case JUN).
One last question on this thread.
Is there a way I can draw or convert date into DD-MMM-YY (e.g. 19-JUN-18) or similar format where first three letters of month is displayed?
I understand I can have conditional check on MM (06) to populate first three bytes of month name (in this case JUN).
FINDREP= must convert digits enclosed in separators. Otherwise also days, and/or years, and/or combinations of days/months/years could be converted to month names!
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
sergeyken wrote:
FINDREP= must convert digits enclosed in separators. Otherwise also days, and/or years, and/or combinations of days/months/years could be converted to month names!
Enclosing in separators is not really required. If you notice the control statements above, only the month portion is OVERLAYed at pos-81 and the FINDREP scanning is set to start at pos-81 to convert the month(mm) to JAN, FEB, etc... The rest of the data would remain unaffected.
FINDREP= must convert digits enclosed in separators. Otherwise also days, and/or years, and/or combinations of days/months/years could be converted to month names!
Enclosing in separators is not really required. If you notice the control statements above, only the month portion is OVERLAYed at pos-81 and the FINDREP scanning is set to start at pos-81 to convert the month(mm) to JAN, FEB, etc... The rest of the data would remain unaffected.
Not recommended, and non-flexible approach. Such methods, in general, are the main reasons why modern software requires monthly/weekly/daily/hourly updates, while old stable programs do work for years and years without problems.
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
The STARTPOS ENDPOS subparameters are there just to serve this very purpose. Ie. To limit the FIND REPLACE to specific positions. I don't see how it will be a non flexible approach. And old stable programs working for several years without any problems has nothing to do with this.