$$ 取日期和时间的函数是 SDATE() / STIME() ,但是取出来的格式是year/month/day  hour:minute:second
$$ Windows文件名不允许使用斜杠和冒号等特殊字符,所以需要用ELEMNT函数来实现将这些特殊符号去掉
DECL/COMMON,CHAR,255, PartNum, MeasDate, MeasTime, ReportPath
DECL/COMMON,CHAR,255, DateYear, DateMonth, DateDay, TimeHour, TimeMinite, TimeSecond
$$ input Part Number here , Replace 'PartNum';
PartNum = ASSIGN/ 'PartNum'
MeasDate = ASSIGN/ SDATE()
DateYear = ASSIGN/ELEMNT(1,'/',MeasDate)
DateMonth = ASSIGN/ELEMNT(2,'/',MeasDate)
DateDay = ASSIGN/ELEMNT(3,'/',MeasDate)
MeasDate = ASSIGN/ CONCAT(DateYear, DateMonth, DateDay)
MeasTime = ASSIGN/ STIME()
TimeHour = ASSIGN/ELEMNT(1,':',MeasTime)
TimeMinite = ASSIGN/ELEMNT(2,':',MeasTime)
TimeSecond = ASSIGN/ELEMNT(3,':',MeasTime)
MeasTime = ASSIGN/ CONCAT (TimeHour, TimeMinite, TimeSecond)
ReportPath = ASSIGN/ CONCAT( 'C:\RationalDMIS\Output\', PartNum, '_' , MeasDate,'_', MeasTime, '.PDF')

DID(PdfOutput) = DEVICE/STOR, ReportPath
OPEN/DID(PdfOutput),FDATA,V(defaultformat),OUTPUT,OVERWR
CLOSE/DID(PdfOutput)