Antoine_Sauteron_1266

Find the report name out of a RunID and vice versa

Discussion created by Antoine_Sauteron_1266 on Jun 21, 2016
Latest reply on Nov 15, 2016 by Michael_Lowry
Hello,

Here is a little script that will allow you to retrieve which RunID generated a given report file, or which report file you should look for for a given RunID.

: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

Outcomes