Hi Phil Use the date format to your advantage
clear v vdate set v vdate text = '20020214' set date format YYYYMMDD set v vdate date set date format MMDDYYYY set v vdate text vdate = 02142002 the date format also carries through in unload formats "unload as ascii" you could even get wild and set a computed column = (ctxt(datecolumn)) and whatever you set the dateformat to will reflect automatically in the database. Ben Johansen ----- Original Message ----- From: "Phil Nolette" <[EMAIL PROTECTED]> To: "Rbase-L (E-mail)" <[EMAIL PROTECTED]> Sent: Monday, February 11, 2002 9:00 PM Subject: A faster way is appreciated > I am faced with a date problem that was not in the intial design. The date > was going to be defaulted to the conversion date but the value in the row > will now have to be converted in 94,000 rows of data of which there are nine > columns with date values which is being passed as eight characters > (YYYYMMDD). > I have created a routine that will be used to parse and convert the date > prior to writing the record. (Not all records will be converted and not in > their original format - they are being made into load transactions for > SQLOADER). > > I have tested this application and it works but I am concerned about time. > Can anyone see a faster way? > -------------------------------------------------------------------------- -- > ----- > -- Program: DCONV.RMD > -- Purpose: Receives an eight character representation of a date (YYYYMMDD) > and formats it to a date variable + > -- for loading into an Oracle date format (YYYY-MM-DD) > -- RBase Date Setting is: MMDDYYYY > > clear all variables > > -- This variable will be passed from the calling program > set var vin_date text = '99999999' > > -- Parse the 8 position text value for date > SET VAR vyr = (SGET(.vin_date,4,1)) > SET VAR vmos = (SGET(.vin_date,2,5)) > SET VAR vday = (SGET(.vin_date,2,7)) > > if vmos = '99' then > set var vmos = '12' > endif > if vday = '99' then > set var vday = '31' > endif > > set var vnewdate2 = (RDATE (INT(.vmos),INT(.vday),INT(.vyr))) > > clear all variables except vnewdate2 > -- This will be passed back to the calling program > write .vnewdate2 > > return > > Phil > [EMAIL PROTECTED] > > ================================================ > TO SEE MESSAGE POSTING GUIDELINES: > Send a plain text email to [EMAIL PROTECTED] > In the message body, put just two words: INTRO rbase-l > ================================================ > TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] > In the message body, put just two words: UNSUBSCRIBE rbase-l > ================================================ > TO SEARCH ARCHIVES: > http://www.mail-archive.com/rbase-l%40sonetmail.com/ > > ================================================ TO SEE MESSAGE POSTING GUIDELINES: Send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: INTRO rbase-l ================================================ TO UNSUBSCRIBE: send a plain text email to [EMAIL PROTECTED] In the message body, put just two words: UNSUBSCRIBE rbase-l ================================================ TO SEARCH ARCHIVES: http://www.mail-archive.com/rbase-l%40sonetmail.com/
