Control-M on-do condition when Job ended - control-m

I want to add a step(On-Do) to delete a condition in Control-M V7 when a job ends (no matter which result: either OK, NOTOK, exception from OS, etc..). I've accomplished the same in Control-M V9 with the next syntax:
<ON STMT="*" CODE="COMPSTAT EQ ANY">
<DOCOND NAME="MY_CONDITION" ODATE="ODAT" SIGN="DEL" />
</ON>
However, if I implement it in Ctrl-M V7, the code COMPSTAT EQ ANY is not recognized throwing the next validation error:
The On/Statement value 'COMPSTAT EQ ANY' is not valid. Please correct
the definitions to COMPSTAT .
Does anybody know, how to accomplish such an easy task?

The problem is the "ANY". The best way is to cover all options with 2 ons -
On Statement Stmt=* Code=COMPSTAT=0
Do OK
On Statement Stmt=* Code=COMPSTAT!0
Do OK

You can get the result you want changing the filter (write * on code):
Control-M 7 Filter
In only one line

Related

Sabre Scribe Scripting Specifically Looping

Anybody have any tips for looping, and continue? For example, I placed about 2500 pnrs on a queue, and I need to add a remark to each of them. Is it possible for a script to add the remark then move to the next pnr?
For example, I placed about 2500 pnrs on a queue, and I need to add a remark to each of them. Is it possible for a script to add the remark then move to the next pnr?
Loops are supported in Scribe but have to be built manually by creating your own iteration variables and breaking the loop manually when you know the work is complete.
What you are describing is definitely possible, but working in queues can be difficult as there are many possible responses when you try to end the PNRs. You'll have to capture the response to detect whether you need to do something else to get out of the error condition (e.g. if a PNR warning indicates you have to double-end the record).
If possible, its likely simpler to work off the queue by collecting all PNR locators and then looping through that list, adding your remarks, and then ending the PNRs. You'll still have to capture the response to determine if the PNR is actually ended properly, but you won't have to deal with the buggy queue behavior. A basic Scribe loop sample is below. Note that I haven't been a Scribe developer for a while and I did this in Notepad so there might be some errors in here, but hopefully it's a good starting point.
DEFINE [ROW=N:8] ;iteration variable/counter
DEFINE [LOCATOR_FILE=*:60] ;File Path
DEFINE [TEMP_LOCATOR=*:6] ;pnr locator variable, read from the temp file
DEFINE [BREAK=*:1] ;loop breaking variable
OPEN F=[TEMP_LOCATOR] L=0 ;open the file of locators
[BREAK] = ""
[ROW] = 0
REPEAT
[ROW] = [ROW] + 1
[TEMP_LOCATOR] = "" ;Reset temp locator variable, this will break our loop
READ F=[LOCATOR_FILE] R=[ROW] C=1 [TEMP_LOCATOR]
IF $[TEMP_LOCATOR] = 6 THEN ;test length of locator, if this is 6 chars, you have a good one, pull it up and add your remark
»"5YOUR REMARK HERE"{ENTER}«
»ER{ENTER}«
;trap errors
READ F="EMUFIND:" R=0 C=0 [TEMP_LOCATOR] ;read for the locator being present on this screen, which should indicate that the ER was successful - you'll have to trap other errors here though
IF [#SYSTEM_ERROR] = 0 THEN ;this locator was found, ER appears successful
»I{ENTER}« ;Ignore this PNR and move to the next one
ELSE
[BREAK] = "Y" ;error found afeter ER, break loop. Maybe show a popup box or something, up to you
ENDIF
ELSE ;No locator found in file, break the loop
[BREAK] = "Y"
ENDIF
UNTIL [BREAK] = "Y"
CLOSE [LOCATOR_FILE]

Control-M cyclic job keeps running even after failure

There are 2 cyclic jobs A and B such that A is predecessor to B and A runs after every 2 minutes from end while B runs after every 1 minute from end. Problem is job B keeps on re running and failing even after one failure. I thought on adding 'ON STATEMENT * CODE NOTOK DO STOP CYCLIC ' in steps of job B . Will this work? If not,What could be the workaround?
Cheers,
Gourav
CODE = NOTOK is possibly an issue.
ON/DO using the STATEMENT/CODE combination is usually something like -
ON
STATEMENT = *
CODE = your literal error string in here
DO
STOP CYCLIC
e.g. -
ON
STATEMENT = *
CODE = requested file not file found
DO
STOP CYCLIC
the CODE = field should be surrounded by asterix.
If you just want to stop the job once it failed use the below statement in your control-M xml file and reload it or else directly add it to your control-m job. If you have other requirement please let us know.
<ON STMT="*" CODE="NOTOK">
<DOACTION ACTION="SPCYC"/>
</ON>

Else condition in robot framework not running

I am trying run:
Run keyword if ${browser}='chrome' somekeyword
Else if ${browser}='ff' somekeyword
it's giving me a format error I am running as per doc. can anyone suggest the error?
Run Keyword If ${browser}=='chrome' keyword
... ELSE IF ${browser}=='ff' keyword
... ELSE keyword
Keep proper space either tab or 2+ spaces as this may also be the reason as suggested by #Bryan Oakley
Hope this helps if not do post the exact keywords you have used with the error...

Robot Framework - customise log output

I'm using Robot Framework to run some tests from SpiraTest.
At the end of the test, Robot FW logs the final statement this way:
Test 1 |PASS|
1 critical test, 1 passed, 0 failed.
My problem is that the Regular Expression in Spiratest triggers the "0 failed" string in the 2nd row as if the whole test has failed, and this has higher priority with respect to the |PASS| statement in the row above.
For this reason, the test is marked as "failed", even if it passed.
Is there any way to mask the second row of the output?
Many thanks in advance,
gischio
Actually the problem was in the Regex that triggers the Failed status.
I've asked the Spirateam support and I've been told it is enough to add
[0-9][1-]* failed
in the RegEx for Failed.

OSB : Xquery Comparision Failing Intermittently

I have following condition in my OSB proxy.
$body/*[1]/xyzflag eq 'true' and (:some other true conditions:)
The node xyzflag is not even present under node pointed by variable $body.
The condition works as expected (gives false) most of the times. but sometime it gives true.
Anyone has faced this situation? Seems a bug to me. Can some help?
The XQuery expression you are trying is wrong.
e.g. If your XML is looks like below:
<school>
<teacher>
<isClassteacher>Y</isClassteacher>
</teacher>
<teacher>
<isClassteacher>N</isClassteacher>
</teacher>
</school>
Then your expression will be like below:
data($body/teacher[1]/isClassteacher)='Y'
Note: Please make the changes as per your requirement.
Hope this will be helpful.
regards
Asutosh
Try to make it like this:
fn:data($body/[1]/xyzflag)
If you are checking for existence of that node <xyzflag>, I will suggest you to use fn:exists function.
This expression
$body/*[1]/xyzflag = 'true'
will return true if the node <xyzflag> is present. It is not going to bother whether the contents of the node is present or not

Resources