Project Creation date/time

Post questions here relative to DataStage Enterprise/PX Edition for such areas as Parallel job design, Parallel datasets, BuildOps, Wrappers, etc.

Moderators: chulett, rschirm, roy

Post Reply
prasad111
Premium Member
Premium Member
Posts: 173
Joined: Fri May 19, 2006 10:53 am

Project Creation date/time

Post by prasad111 »

Hi,

How to know when was project created?... There was a similar post...
Question Based on this post

Can anybody help me to understand, how to get the value for field #7.

When I did

Code: Select all

LIST.DICT UV.ACCOUNT
               Type &
Field......... Field. Field........ Conversion.. Column......... Output Depth & Name.......... Number Definition... Code........ Heading........ Format Assoc..

@ID            ||D   || 0                           || Account        || 10L    ||S ||PASSWORD       ||D    ||1                            ||Password        ||13L    ||S ||@REVISE        ||PH     ||@ID ||PASSWORD
NOTE: To differentiate between the values I have entered || infront of their values
I did smilar search on UV_SCHEMA also.... and tried many queries to run in /bin/uvsh... ...

Code: Select all

select uv.account.@id, uv.account.@record from uv.account, uv_schema where uv.account.@id=uv_schema.schema_name  and uv.account.@id=<project_name>

NOTE: This command was executed in uppercase
Your reply is higly appreciated.

Thanks & Regards
Prasad
Last edited by prasad111 on Wed Feb 18, 2009 10:26 am, edited 2 times in total.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The information is in UV_SCHEMA. But the SQL identifiers (such as table name) are case sensitive. Make sure UV_SCHEMA is in upper case.

Code: Select all

SELECT * FROM UV_SCHEMA;
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prasad111
Premium Member
Premium Member
Posts: 173
Joined: Fri May 19, 2006 10:53 am

Post by prasad111 »

I see only these information in the UV_SCHEMA table

Schema. PROJECT_TEST
Owner.. 323434
Path... /opt//Ascential/DataStage/DSEngine/sql/project_test

is there any other information I should have seen?
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

I don't have a version 7 system at the moment. Can you try these commands?

Code: Select all

LIST.ITEM UV_SCHEMA WITH SCHEMA_NAME = '<<Project name>>';
LIST.ITEM UV.ACCOUNT WITH @ID = '<<Project name>>';
You could, of course, look at the date/time created of the project directory or of the VOC file within it.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prasad111
Premium Member
Premium Member
Posts: 173
Joined: Fri May 19, 2006 10:53 am

Post by prasad111 »

Thanks for the queries

For LIST.ITEM UV_SCHEMA WITH SCHEMA_NAME='PROJECT_TEST'
Output:
PROJECT_TEST
001 23456
002 /Projects/PROJECT_TEST

For LIST.ITEM UV.ACCOUNT WITH @ID='PROJECT_TEST'
Output:
PROJECT_TEST
007 DataStage\7.5\<<HOST_NAME>>\8117
011 /Projects/PROJECT_TEST

I tried to look into the folder for the timestamp, still not sure about the timestamp.... also exploring VOC.

Any more suggestions.

Thanks & Regards
Prasad
Last edited by prasad111 on Wed Feb 18, 2009 5:09 pm, edited 1 time in total.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

In a routine open VOC then use the STATUS statement to fetch it's file information. In the dynamic array returned by STATUS you will be able to find the date and time created. This perforce is the project date/time created.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prasad111
Premium Member
Premium Member
Posts: 173
Joined: Fri May 19, 2006 10:53 am

Post by prasad111 »

Could you please help in getting the information regarding dynamic array

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H 

OPEN 'VOC' TO test.arr THEN PRINT "File Opened" ELSE ABORT
STATUS stat FROM test.arr THEN PRINT stat

field5 = stat<5,1,1>

field15 = stat<15,1,1>
field15= Oconv(field15, "MTHS")

field16 = stat<16,1,1>
field16=OCONV(field16,"D2/")

field17 = stat<17,1,1>

field18 = stat<18,1,1>
field18=OCONV(field18,"D2/")

Call DSExecute("UV", "LIST.ITEM UV.ACCOUNT WITH @ID='PROJECT_TEST' ", Output, SystemReturnCode) 
Print "Total VOC entries selected: ":SystemReturnCode 
Call DSLogInfo('System return code ':SystemReturnCode, "JobControl")

Answer:="FileMode":"~ ":field5:"~ ":"DATE_LAST_MODIFIED":"~ ":field15:"~ ":"TIME_LAST_MODIFIED":"~ ":field16:"~ ":"TIME_DATE_LAST_STATUS_CHANGE":"~ ":field17:"~ ":"DATE_LAST_STATUS_CHANGE":"~ ":field18
Call DSLogInfo('Stat complete output ':stat, "JobControl") 

Call DSLogInfo('Stat output ':Answer, "JobControl") 

CLOSE test.arr
Ans=0
Currently I am getting the output as [Where the time and date will print the time when this routine runs]
FileMode~ 33277~ DATE_LAST_MODIFIED~ 12:45:12pm~ TIME_LAST_MODIFIED~ 02/25/09~ TIME_DATE_LAST_STATUS_CHANGE~ 45912~ DATE_LAST_STATUS_CHANGE~ 02/25/09

I am missing something near the status or with call DSEXECUTE statement (how to get the details of the corresponding project)... any suggestion is appreciated.
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

The project name can be had from the system variable @ACCOUNT, because this code will be executed from within the project.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prasad111
Premium Member
Premium Member
Posts: 173
Joined: Fri May 19, 2006 10:53 am

Post by prasad111 »

I changed from @ID to @ACCOUNT still no difference

Code: Select all

Call DSExecute("UV", "LIST.ITEM UV.ACCOUNT WITH @ACCOUNT='PROJECT_TEST' ", Output,SystemReturnCode)
Output:
FileMode~ 33277~ DATE_LAST_MODIFIED~ 02:02:30pm~ TIME_LAST_MODIFIED~ 02/25/09~ TIME_DATE_LAST_STATUS_CHANGE~ 50550~ DATE_LAST_STATUS_CHANGE~ 02/25/09

My more concern was on this step, is it really getting the project created date..[I guess some logic is missing/syntax incorrect]

Code: Select all

OPEN 'VOC' TO test.arr THEN PRINT "File Opened" ELSE ABORT 
STATUS stat FROM test.arr THEN PRINT stat 
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

No, not in a query.

Direct.

ProjectName = @ACCOUNT

You appear to be mightily confused, however. A report from the UV.ACCOUNT table will never be the number of VOC entries selected.

What - precisely - are you trying to accomplish? A list of project names? Verifying the existence of a project called PROJECT_TEST? What?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prasad111
Premium Member
Premium Member
Posts: 173
Joined: Fri May 19, 2006 10:53 am

Post by prasad111 »

Thanks for the reply..

Yes, I am confused..... I am not sure the open VOC is giving me the right value[or am I extracting the right value]
Is the ProjectName=@ACCOUNT should be added at the beginning(as present in the code) -- if yes still gives me the current date time in the output. To elaborate......the routine is giving me the output of when the file was modified /Projects/PROJECT_TEST/VOC,
but that doesn't tell me when the Project created.

Code: Select all

$INCLUDE DSINCLUDE JOBCONTROL.H 
PROJECT_TEST=@ACCOUNT
OPEN 'VOC' TO test.arr THEN PRINT "File Opened" ELSE ABORT 
STATUS stat FROM test.arr THEN PRINT stat 

field5 = stat<5,1,1> 
field15 = stat<15,1,1> 
field15= Oconv(field15, "MTHS") 
field16 = stat<16,1,1> 
field16=OCONV(field16,"D2/") 
field17 = stat<17,1,1> 
field18 = stat<18,1,1> 
field18=OCONV(field18,"D2/") 

Answer:="FileMode":"~ ":field5:"~ ":"DATE_LAST_MODIFIED":"~ ":field15:"~ ":"TIME_LAST_MODIFIED":"~ ":field16:"~ ":"TIME_DATE_LAST_STATUS_CHANGE":"~ ":field17:"~ ":"DATE_LAST_STATUS_CHANGE":"~ ":field18 
Call DSLogInfo('Stat output ':Answer, "JobControl") 

CLOSE test.arr 
Ans=0
I have removed the UV.ACCOUNT details from the code,[I was trying to search something in the complete UV.ACCOUNT table list]

Thanks & Regards
Prasad
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

On checking the manual, I found that field #18 is the date created when executed on Windows systems. Much of my recent work has been on Windows-based servers, hence my earlier advice.

So how about executing ls -cl VOC and parsing the date out of that? Does your UNIX support the -c option (date created) for ls ?
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prasad111
Premium Member
Premium Member
Posts: 173
Joined: Fri May 19, 2006 10:53 am

Post by prasad111 »

Thanks for the reply.

In project folder, ls -cl gives:

Code: Select all

$ ls -l VOC
-rwxrwxr-x    1 dsadm    dstage     260096 Mar 18 14:45 VOC
$ ls -cl VOC
-rwxrwxr-x    1 dsadm    dstage     260096 Mar 18 14:45 VOC
where,
-c with -lt: sort by, and show, ctime (time of last modification of
file status information) with -l: show ctime and sort by name
otherwise: sort by ctime

Is there any other way I find the information of the project created timestamp?

Thanks
Prasad
ray.wurlod
Participant
Posts: 54607
Joined: Wed Oct 23, 2002 10:52 pm
Location: Sydney, Australia
Contact:

Post by ray.wurlod »

Inspect something whose status is not likely to have changed since the project was created. ls -lc EXAMPLE1.SOURCE is a good candidate.
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
prasad111
Premium Member
Premium Member
Posts: 173
Joined: Fri May 19, 2006 10:53 am

Post by prasad111 »

Yes for some projects it gave me the right answer, for some it gave me the dates which were modified (not created)......

I guess this is the only way, we can find the project created date for some project but not for all.
Post Reply