MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SAS Date Conversion to DB2 Format

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
jayram99
Beginner


Joined: 16 Aug 2004
Posts: 52
Topics: 21
Location: falls church.va,usa

PostPosted: Wed Jun 25, 2008 9:09 am    Post subject: SAS Date Conversion to DB2 Format Reply with quote

Hi,

The Below query executed in SPUFI, The result is

2008-06-04-13.29.59.999999
Code:

***************************************************
SELECT
COALESCE(MAX(CHAR(DT_PROCSS_END)),CURRENT TIMESTAMP - 1 DAY)
AS DTPRCEND
FROM EN19M1.PROCSS_CYCL WHERE NAME_PROCSS = 'PCWD5706' WITH UR;
****************************************************


The Same query if used in SAS Code as belowCode:

CREATE TABLE MAX_DATE AS
SELECT
DTPRCEND
FROM CONNECTION TO DEVODS3R(
SELECT
COALESCE(MAX(CHAR(DT_PROCSS_END)),CURRENT TIMESTAMP - 1 DAY)
AS DTPRCEND
FROM EN19M1.PROCSS_CYCL
FOR FETCH ONLY
);

%PUT &SQLXMSG;

DISCONNECT FROM DEVODS3R;
/QUIT;
PROC PRINT DATA=MAX_DATE;
RUN;

The Output is as Below.
Output :
Code:

04JUN2008:13:29:59.999999
***************************************************

After execting the above SAS code, need to write to Output File in DB2 Format as below.

2008-06-04-13.29.59.999999


Appreciate your Help.

Jayaram
Back to top
View user's profile Send private message Yahoo Messenger MSN Messenger
dbzTHEdinosauer
Supermod


Joined: 20 Oct 2006
Posts: 1411
Topics: 26
Location: germany

PostPosted: Wed Jun 25, 2008 9:16 am    Post subject: Reply with quote

are you sure that sas will only deliver that type of timestamp?
_________________
Dick Brenholtz
American living in Varel, Germany
Back to top
View user's profile Send private message
expat
Intermediate


Joined: 01 Mar 2007
Posts: 475
Topics: 9
Location: Welsh Wales

PostPosted: Fri Jun 27, 2008 4:56 am    Post subject: Reply with quote

It is possible, as I have done this or something similar in the past.

Hopefully have my libraries uploaded on Monday to see if I have an example.
_________________
If it's true that we are here to help others,
then what exactly are the others here for ?
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group