PML tricks

Output project names which use certain Aveva PDMS Database

2016-01-05_233319Code:

!dbName = ‘ADMINDB/UNXP_PIPECATA’

!pProjs = PROJECTS

do !pProj values !pProjs
!dDbs = !pProj.dblist()
do !dDb values !dDbs
if( !dbName.eq(!dDb.name) AND !dDb.FOREIGN.eq(‘FOREIGN’))then
!sProj = !pProj.string().substring(-4)
!sIncludedFrom = !dDb.file.part(2,’%’).substring(-4)
$p Database $!dbName exists in project: $!sProj and is included from project $!sIncludedFrom
endif
enddo
enddo

Output:

— Database ADMINDB/UNXP_PIPECATA exists in project: TBB and is included from project: NAD
— Database ADMINDB/UNXP_PIPECATA exists in project: TBA and is included from project: NAD
— Database ADMINDB/UNXP_PIPECATA exists in project: SKH and is included from project: UMP
— Database ADMINDB/UNXP_PIPECATA exists in project: NVK and is included from project: NAD

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s