I guess you need to be on a more current version of UD than 6.1 for this
to work.  DYMD[4,2,2] works just fine but everything I've tried is
proving that in this version, anyway, there MUST be a delimiter between
the parts of the date.  It does not matter what delimiter as I've tried
space, period, slash, even a comma but for both ICONV and OCONV adding a
quote of any type, null/space/dash/etc, to the numeric only gives
undesired results.

I have to strip out the delimiter in OCONV results and make sure some
kind of delimiter is there for ICONV to get me back to the internal date
value.

An interesting note is using the OCONV(IDATE,'D-YMD[2,2,2]') format, the
dash can be replaced with the digits 5 to 9 but using the digits 0 to 4
result in an output delimited with a space.  Would have been acceptable
(and nice) to have been able to get 13003011 but oh well.  I guess I
could use 'D5YMD[2,2,2]' to give me the value 13503511 just as well.

Fun with dates!

BobW

-----Original Message-----
From: u2-users-boun...@listserver.u2ug.org
[mailto:u2-users-boun...@listserver.u2ug.org] On Behalf Of Charles
Stevenson
Sent: Monday, March 11, 2013 8:08 AM
To: U2 Users List
Subject: Re: [U2] ISO Date Format

By the way, you can also completely eliminate the dash (or slash, etc.)
delimiters:

OCONV( "16507"   , "DYMD[4'',2'',2]" )  -->  "20130311"
ICONV( "20130311", "DYMD[4'',2'',2]" )  -->  "16507"

Notice that ICONV'ing the OCONV'd or OCONV'ing the ICONVd result gets
you bat to where you started.  That makes it particularly useful in dict
conversion fields.


I learned that on this list, but I do not remember from whom. There are
too many people I've learned from.

cds


On 11 March 2013 13:56, Jeff Schasny <jscha...@gmail.com> wrote:
>> Has anyone come up with an OCONV string that will product an ISO 
>> standard date (YYYY-MM-DD)? After a vendor insisted on this last week

>> I ended up creating a subroutine called by an I descriptor but it 
>> seems like there should be an easier way. A quick trip through the 
>> Universe Basic manual, my old Prime Info-Basic manual, and Pick
>> Basic: A programmer's guide didn't shed any light.

_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users
_______________________________________________
U2-Users mailing list
U2-Users@listserver.u2ug.org
http://listserver.u2ug.org/mailman/listinfo/u2-users

Reply via email to