list-datasources-C11.mac 1.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. Dim objApp As Object
  2. Dim objModel As Object
  3. Dim objDataSource As Object
  4. Dim objQuery As Object
  5. Dim objCube As Object
  6. Dim filename as String
  7. Dim folder as String
  8. Dim logfile As String
  9. Sub Main ()
  10. On Error Resume Next
  11. folder = "C:\GlobalCube\System\AUDEV_CARIT\Models"
  12. filename = "s_offene_auftraege.pyj"
  13. rem filename = "f_belege.pyj"
  14. rem publish = "C:\GAPS\Portal\System\Cube_out\temp"
  15. folder = GetField(Command, 1, ",")
  16. filename = GetField(Command, 2, ",")
  17. logfile = GetField(Command, 3, ",")
  18. Set objApp = CreateObject("IBMCognosTransformer.ApplicationCtrl.1")
  19. Set objModel = objApp.OpenModel(folder + "\" + filename)
  20. Open logfile for Output as #1
  21. rem Print objModel.DataSources.Count
  22. For i = 1 to objModel.DataSources.Count
  23. Set objDataSource = objModel.DataSources.Item(i)
  24. If objDataSource.Type = 38 Then
  25. rem Package
  26. For j = 1 to objDataSource.Queries.Count
  27. Set objQuery = objDataSource.Queries.Item(j)
  28. Write #1, objQuery.Name
  29. Next
  30. Exit For
  31. End If
  32. If objDataSource.Type = 6 Then
  33. Write #1, objDataSource.LocalPath
  34. Else
  35. Write #1, objDataSource.Name
  36. End If
  37. rem If objDataSource.Type = 4 Then
  38. rem Print objDataSource.SQLExpression
  39. rem End If
  40. rem Print "--"
  41. Next
  42. Write #1, "--"
  43. Set objCube = objModel.Cubes.Item(1)
  44. Write #1, objCube.MDCFile
  45. Close #1
  46. objModel.Close
  47. rem objApp.Quit
  48. Set objQuery = Nothing
  49. Set objDataSource = Nothing
  50. Set objModel = Nothing
  51. Set objApp = Nothing
  52. End Sub