That for both Christoph and Reed for you suggestions.
Unfortunately neither worked as I was generating full blank likes which are not getting detected by '' or STR_TRIM.
I went back to my shell script hat is pulling these licence keys. This script is doing a series of Greps and String commands and was able to put in an IF statement around these commands to make sure I don't get blank lines anymore..
thanks anyway for your help, appreciated...
filetype=`file &MACHINE#`
if [ "$filetype" = "&MACHINE#: data" ]
then
strings &MACHINE# | grep '<LicenseKey>' | awk -v FS="(<LicenseKey>|</LicenseKey>)" '{print $2}'
strings &MACHINE# | grep 'qsauth11.key;1;' | awk -v FS="(qsauth11.key;1;|\r)" '{print $2}'
strings &MACHINE# | grep 'QSAuthorize93.key;1;' | awk -v FS="(QSAuthorize93.key;1;|\r)" '{print $2}'
else
grep '<LicenseKey>' &MACHINE# | awk -v FS="(<LicenseKey>|</LicenseKey>)" '{print $2}'
grep 'qsauth11.key;1;' &MACHINE# | awk -v FS="(qsauth11.key;1;|\r)" '{print $2}'
grep 'QSAuthorize93.key;1;' &MACHINE# | awk -v FS="(QSAuthorize93.key;1;|\r)" '{print $2}'
fi
Original Message:
Sent: 12-13-2019 06:20 AM
From: O'Mullane
Subject: Need some with with a PREP_PROCESS_REPORT
Hi Christoph,
You sent the other posts as "Messages" so they didn't appear on this thread.
Original Message:
Sent: 12-13-2019 02:20 AM
From: Christoph Rekers
Subject: Need some with with a PREP_PROCESS_REPORT
...I don't know why my last post isn't visible...well..-
As I don't have the original file output I put the Unix job report into a text file and used PREP_PROCESS_FILE instead of PREP_PROCESS_REPORT
:set &complete_LICENCE_KEY# = ""
:SET &HND#=PREP_PROCESS_FILE(WIN01, "C:\temp\CR\TTT.txt", "**")
!: : SET &HND# = PREP_PROCESS_REPORT(,,,)
:PROCESS &HND#
: SET &LICENCE_KEY#=GET_PROCESS_LINE(&HND#)
: set &LICENCE_KEY# = str_trim(&LICENCE_KEY#)
: SET &FIRST_CHAR# = SUBSTR(&LICENCE_KEY#, 1, 1)
: SWITCH &FIRST_CHAR#
: CASE '*'
: PRINT '* Skip'
: OTHER
: set &complete_LICENCE_KEY# = str_cat(&complete_LICENCE_KEY#, &LICENCE_KEY#)
: PRINT "INSERTING INTO VARA &complete_LICENCE_KEY#"
: PUT_VAR TOAD_LICENCE_RESULTS, "Licence-Key", &complete_LICENCE_KEY#
: ENDSWITCH
:ENDPROCESS
Original Message:
Sent: 12-12-2019 12:31 PM
From: Reed Byers
Subject: Need some with with a PREP_PROCESS_REPORT
Sounds like your SUBSTR is causing the problem.
Check for a blank line BEFORE doing the substr to get the first character. :)
Something like:
: SET &HND# = PREP_PROCESS_REPORT(,,,)
: PROCESS &HND#
: SET &LICENCE_KEY#=GET_PROCESS_LINE(&HND#)
: IF &LICENCE_KEY# = ''
: PRINT 'Blank Skip'
: ELSE
: SET &FIRST_CHAR# = SUBSTR( &LICENCE_KEY#,1,1)
: SWITCH &FIRST_CHAR#
: CASE '*'
: PRINT '* Skip'
: CASE ' '
: PRINT 'Space Skip'
: OTHER
: PRINT "INSERTING INTO VARA"
: PUT_VAR TOAD_LICENCE_RESULTS &LICENCE_KEY#
: ENDSWITCH
: ENDIF
: ENDPROCESS
Let us know if that works (or not)... :)
------------------------------
Reed Byers
Programmer/Analyst
Oregon State University
Original Message:
Sent: 12-12-2019 10:34 AM
From: O'Mullane
Subject: Need some with with a PREP_PROCESS_REPORT
Hi,
I'm trying to do an PREP_PROCESS_REPORT to pull out Codes.
My report looks like this and I basically want to pull out the 2 codes listed below and inset into a VARA.
I've tried a few things, this being my most recent, but the blank lines are causing me to get this error.
:SET &HND# = PREP_PROCESS_REPORT(,,,)
:PROCESS &HND#
: SET &LICENCE_KEY#=GET_PROCESS_LINE(&HND#)
: SET &FIRST_CHAR# = SUBSTR( &LICENCE_KEY#,1,1)
: SWITCH &FIRST_CHAR#
: CASE '*'
: PRINT '* Skip'
: CASE ''
: PRINT 'Blank Skip'
: CASE ' '
: PRINT 'Space Skip'
: OTHER
: PRINT "INSERTING INTO VARA"
: PUT_VAR TOAD_LICENCE_RESULTS &LICENCE_KEY#
: ENDSWITCH
:ENDPROCESS
I'm sure there is an easier way of doing this but can't figure it out...
John.