AppWorx, Dollar Universe and Sysload Community

Expand all | Collapse all

[Solved] Failure of Task with error ‘99 was unexpected at this time’

Anon Anon

Anon AnonJun 29, 2013 12:18 PM

  • 1.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Feb 14, 2013 11:17 AM
    Hi
    Everyone,

    i have a task which execute a set of batch commands, the session was working fine for few days,
    unfortunately it failed yesterday,  the job log says [b]‘99 was unexpected at this time’[/b] . and today it executed successfully, dont know why it is failing after 2-3 days.

    My session has "[color=#ff0000][b]Header[/b][/color] uproc[color=#ff0000][b]-[/b][/color]Original uproc which executes commands[color=#ff0000][b]-[/b][/color][color=#0000ff][b]Trailer"[/b][/color] uproc, the job is [color=#ff0000][u]failing at header uproc[/u][/color]
    my header/Uproc/trailer uproc has this script below,  could you please help me in correcting my script, thanks in advance.

    on [color=#008000][b]UNIVIEWER CONSOLE 3.0.14[/b][/color]

    [b][color=#ff0000]Header Uproc script:[/color]
    set
    %uxexe%uxsleep 5
    set Resexe=0[/b]

    [color=#0000ff][b]Uproc script:[/b][/color]
    [b]REM Template for a Windows uproc: Command depending on AREA[/b]
    [b]REM Initialize by default to FAILURE
    set RESEXE=1
    set RETURN_CODE=1[/b]
    [b]REM Process diferentiated per area
    if %S_SOCIETE%==HUMDEV (
       set SERVERNAME=%TESTSERVERNAME%
    )[/b]
    [b]if %S_SOCIETE%==HUMQAS (
       set SERVERNAME=%QASERVERNAME%
    )[/b]
    [b]if %S_SOCIETE%==HUMPRD (
       set SERVERNAME=%PRODSERVERNAME%
    )[/b]

    [b]@echo off
    FOR /F "TOKENS=1* DELIMS= " %%A IN ('DATE/T') DO SET CDATE=%%B
    FOR /F "TOKENS=1,2 eol=/ DELIMS=/ " %%A IN ('DATE/T') DO SET mm=%%B
    FOR /F "TOKENS=1,2 DELIMS=/ eol=/" %%A IN ('echo %CDATE%') DO SET dd=%%B
    FOR /F "TOKENS=2,3 DELIMS=/ " %%A IN ('echo %CDATE%') DO SET yyyy=%%B
    SET date=%yyyy%%mm%%dd%
    @echo off
    :BEGIN[/b]
    [b]copy \\SERVER\intelinsideoutbound\CTRx_PA_%date%.csv
    del \\SERVER\intelinsideoutbound\ftp.txt
    echo open FTP SITE>> \[u][color=#0000ff]\SERVER\intelinsideoutbound\[/color][/u]ftp.txt
    echo USERID>> \[u][color=#0000ff]\SERVER\intelinsideoutbound\[/color][/u]ftp.txt
    echo PASSWORD>> \[u][color=#0000ff]\SERVER\intelinsideoutbound\[/color][/u]ftp.txt
    echo ascii
    echo hash
    echo cd />> \[u][color=#0000ff]\SERVER\intelinsideoutbound\[/color][/u]ftp.txt
    echo put \[u][color=#0000ff]\SERVER\intelinsideoutbound[/color][/u]\CTRx_PA_%date%.csv  >> \[u][color=#0000ff]\SERVER\intelinsideoutbound\[/color][/u]ftp.txt[/b]
    [b]echo bye>> \\[u][color=#0000ff]SERVER\intelinsideoutbound\[/color][/u]ftp.txt
    %windir%\system32\ftp.exe -s:[b]\[u][color=#0000ff]\SERVER\intelinsideoutbound[/color][/u][/b]\ftp.txt[/b]

    [b]goto END[/b]
    [b]:END[/b]
    [b]SET RESEXE=%errorlevel%[/b]

    [b][b][color=#ff0000]Trailer Uproc script:[/color]
    set
    %uxexe%uxsleep 5
    set Resexe=0[/b][/b]

    [b][b]Thanks & Regards[/b][/b]
    [b][b]Harikrishna Giramoni[/b][/b]


  • 2.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Feb 14, 2013 12:10 PM
    Hello,

    I think someone has to restart the job in step 99, before you see the log.
    Your script does not manages step 99 ( %UXEXE%\uxset step "99" ) , hence the error message.

    You may still be seen in the "monitoring jobs" the "history trace " of the job (not the job log) , with the message he was to rerun at step 99.


  • 3.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Feb 14, 2013 02:41 PM
    Hi
    Sophie

    Thanks for the quick reply , below is the History Trace, i am unable to understand where exactly it is erroring out, could you please explain me briefly

    [color=#ff8c00][b]HISTORY TRACE:[/b][/color]
    9/02/2013 21:00:01 Start Condition Check
                           Processing Date 09/02/2013
    09/02/2013 21:00:01 Submitted in BATCH Q: SYS_BATCH                         
                           under ENTRY N°  : 001260
    VAR : TESTSERVERNAME     
    LOUAPPWDS300
    09/02/2013 21:00:02 BATCH starting
    Job aborted or killed during execution
    09/02/2013 21:05:01 *** TASK ENDED ABNORMALLY  ***
       Session Number   Uproc       Number  M.U.        Aut.Proc.Dt Date  Time   E
    ANS0S_T999 0000251  ANS0H_T000 0001255 A_ANS0      115 08022013 08022013 210002 T
    *** Uproc ABORTED, Completion Instructions were not executed ***


  • 4.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Feb 15, 2013 03:28 AM
    Harikrishna,

    Can you trace the job (just put a "set" at the beginning of the script) and launch it again? You'll then have more info in the job log.

    Octavie


  • 5.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Feb 15, 2013 02:13 PM
    Hi
    octavie,

    Thanks , i will try to put "set" and let you know about the job log details.

    Thanks  & Regards
    Harikrishna


  • 6.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Feb 18, 2013 03:41 AM
    Hi Harikrishna,

    this looks like a scripting "issue", not a DU problem.

    Usually 99 relates to the use of step 99 (as mentioned by soso), that can take place in the Uprocs script or the ante uproc and post uproc scripts if they exist.

    What you need to do is to trace the job actions (as suggested by Octavie) so you know from where exactly the error originates. This has nothing to do with DU, but with the execution of a script. The "echo off" that appear in the scripts may be a problem and you may have to comment them temporarily.

    Michel


  • 7.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Feb 18, 2013 09:54 AM
    Hi
    Michel,

    Thanks for the reply, could you please give me an idea how to comment "echo off"  temporarily.

    Thanks
    Harikrishna


  • 8.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Feb 21, 2013 04:50 PM
    Hi,

    Sure. Like commenting any command on Windows, adding "rem " before the command.

    Michel


  • 9.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Mar 04, 2013 06:27 PM
    I cant remember off the top of my head but are you not missing a \  on the line (I am not sure off the top of my head if the $U variables have a \ on the end of the contents right now).

    [b]%uxexe%uxsleep 5[/b]
    so it should be:-
    [b]%uxexe%\uxsleep 5[/b]

    Other than that it looks fine in the body of the header uproc - It could be an error in the ante-uproc (if you have one); try putting an echo at the top of your uproc body so you can see where your ante-uproc execution stops and your execution starts (you may wish to put one at the end also so as it could be the error is reported from the post_uproc if you have one of those also).

    Your main uproc has some issues I would address also:-

    1:  use /I on if statements to make them case insensitive.

    2. Enclose comparisons in quotes or you will get a syntax error if the variable is empty e.g. [b]if "%S_SOCIETE%"=="HUMDEV" ([/b]

    3. You are using the variable "date" which is bad practice as this is a system variable. In general you should never assign values to DATE, TIME or ERRORLEVEL as you could get unexpected results.

    4. You can use %date% to get the date instead of date /t

    5. You can use dos substrings to break down the date if you have a known format  e.g. to get 20130403 from a date in the format 04/03/2013 you can use the sequence  %date:~-4%%date:~3,2%%date:~0,2%

    6. The dollar universe command uxdat does some nice date functions for you (better if you cannot rely on the system locale); details are in the command reference manual.

    7. You set your servername based upon your $S_SOCIETE% but you never use your variable (May be a work in progress).


    A general word of advice would be to seperate your exit points for when an error occurs or for a normal exit. e.g. have :END for normal exist and :Error_End.  This gives you easy and maintainable scope to add debug code etc to be displayed in the event of an Error being encountered. GOTO :END if no error has been caught or GOTO :ERROR_END  if an error is caught (catch the error by testing the %ErrorLevel% in your code).

    E.G.:-

    :END
    ECHO ***** %S_PROCEXE% Exists Normally  *****
    SET RESEXE=0
    GOTO :EOF

    :ERROR_END
    ECHO ***** %S_PROCEXE% Ended with Error ! *****
    SET
    SET RESEXE=%ERRORLEVEL%
    GOTO :EOF


  • 10.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Apr 04, 2013 06:47 AM
    Hi Harikrishna,

    could you solve the issue with the assistance of the trace?

    Michel


  • 11.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Jun 29, 2013 12:18 PM
    Hi there,

    any update?


  • 12.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Aug 06, 2013 07:03 AM
    Hello,
    I need to execute a .bat file through dollar universe..The batch file is that of an etl job..I am quite new to this scheduler.. Can someone validate the below command because I do not possess the scheduler to test this? Note that the first two lines is the batch file command of the etl job.

    C:\PROGRA~2\SAPBUS~1\DATASE~1/bin/AL_RWJ~1.EXE  "C:\ProgramData\SAP BusinessObjects\Data Services/log/JS_01/" -w  "inet:US1:3555"  -E " -PLocaleUTF8  -SUS1 -NsecEnterprise -Q"DSREPO" -UAdministrator -PYWRtaW4xMjM  -G"ac87e07e_3a0d_4cc5_8c9c_c773e131eda0" -t5 -T14 -LocaleGV   -CtBatch -CmUS1 -CaAdministrator -CjUSM1 -Cp3555 "

    if %ERRORLEVEL% GTR 0 (
         set errorMsg=Error executing batch file
         goto Error
         )

    set exitCode=0
    goto End

    :Error
    echo ***** ERROR ENCOUNTERED *****
    echo %errorMsg%
    set exitCode=1

    :End
    set RESEXE=%exitCode%


  • 13.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Aug 06, 2013 10:45 AM
    Rajna,

    You should start a new thread rather than hijack another,  this way the admins can mark the threads as resolved when the individual issue is resolved and then lock the thread for reference.

    If you wish to start a new thread I will be happy to comment on the above code there.

    Thanks


  • 14.  [Solved] Failure of Task with error ‘99 was unexpected at this time’

    Posted Aug 06, 2013 11:42 AM
    Agreed. I have created the new topic 'Trigger an ETL batch Job'. Could you respond to that?