Automic Workload Automation

 View Only

Trouver un RunID à partir du nom du rapport et inversement

  • 1.  Trouver un RunID à partir du nom du rapport et inversement

    Posted Jun 21, 2016 10:07 AM
    Bonjour,

    voici un petit script qui vous permettra de retrouver le nom d'un rapport correspondant à un RunID donné, et vice-versa.

    :READ &CHOICE#,"'Report to RunID','RunID to Report'",'Select type of conversion',

    :SWITCH &CHOICE#
    !Convert a report name to a RunID
    :  CASE 'REPORT TO RUNID'
    :      READ &REPORT_NAME#,,,,"M"
    :      SET &ALPHA# = MID ("&REPORT_NAME#", 2, 7)
    :      SET &RUNID# = ALPHA2RUNNR ("&ALPHA#")
    :      SET &RUNID# = FORMAT(&RUNID#)
    :      PRINT Report : &REPORT_NAME# = RunID &RUNID#

    !Convert a RunID to a report name
    :CASE 'RUNID TO REPORT'
    :      READ &RUNID#,,,,"M"
    :      SET &ALPHA# = RUNNR2ALPHA(&RUNID#)
    :      SET &REPORT_NAME#=STR_CAT("O",&ALPHA#)
    :      SET &REPORT_NAME#=STR_CAT(&REPORT_NAME#,".txt")
    :      PRINT RunID : &RUNID# = &REPORT_NAME#
    : ENDSWITCH