I have a very weird behavior going on and I cannot understand it. I am pulling down some json and processing it and it randomly fails for trailing garbage but the json coming from the service is correct.
What I found is it appears that when I clear my variable it isn't, don't' really understand it. Have to use debug and monitor the memory in order to see it but once I changed from clear to *Blanks everything works.
All code in a loop to grab orders until there is no more.
What I found is it appears that when I clear my variable it isn't, don't' really understand it. Have to use debug and monitor the memory in order to see it but once I changed from clear to *Blanks everything works.
All code in a loop to grab orders until there is no more.
Code:
[FONT=Calibri][FONT=Consolas][COLOR=red]clear[/COLOR][/FONT][FONT=Consolas][COLOR=black] returnData[/COLOR][/FONT][FONT=Consolas][COLOR=purple]; // fails with extra } at the end from the previous request[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=black]returnData [/COLOR][/FONT][FONT=Consolas][COLOR=purple]=[/COLOR][/FONT] [FONT=Consolas][COLOR=olive]*Blanks[/COLOR][/FONT][FONT=Consolas][COLOR=purple]; // Works just fine[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=black]rc [/COLOR][/FONT][FONT=Consolas][COLOR=purple]=[/COLOR][/FONT][FONT=Consolas][COLOR=black] http_url_get_raw[/COLOR][/FONT][FONT=Consolas][COLOR=purple]([/COLOR][/FONT][FONT=Consolas][COLOR=black][URL="url:fd:%25Paddr(incoming):300"]url:fd:%Paddr(incoming):300[/URL][/COLOR][/FONT][FONT=Consolas][COLOR=purple]);[/COLOR][/FONT][/FONT] docNode = yajl_buf_load_tree( %addr( returnData )+2 :%Size(returnData) :errMsg); [FONT=Calibri][FONT=Consolas][COLOR=teal]//************************************************** *****************************************[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=teal]//Incoming - process incoming http request data[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=teal]//************************************************** *****************************************[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=purple]Dcl-Proc[/COLOR][/FONT][FONT=Consolas][COLOR=black] Incoming[/COLOR][/FONT][FONT=Consolas][COLOR=purple];[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=red]Dcl-Pi[/COLOR][/FONT][FONT=Consolas][COLOR=black] *n [/COLOR][/FONT][FONT=Consolas][COLOR=maroon]int[/COLOR][/FONT][FONT=Consolas][COLOR=purple]([/COLOR][/FONT][FONT=Consolas][COLOR=blue]10[/COLOR][/FONT][FONT=Consolas][COLOR=purple]);[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=black]fd [/COLOR][/FONT][FONT=Consolas][COLOR=maroon]int[/COLOR][/FONT][FONT=Consolas][COLOR=purple]([/COLOR][/FONT][FONT=Consolas][COLOR=blue]10[/COLOR][/FONT][FONT=Consolas][COLOR=purple])[/COLOR][/FONT] [FONT=Consolas][COLOR=maroon]value[/COLOR][/FONT][FONT=Consolas][COLOR=purple];[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=black]data [/COLOR][/FONT][FONT=Consolas][COLOR=maroon]char[/COLOR][/FONT][FONT=Consolas][COLOR=purple]([/COLOR][/FONT][FONT=Consolas][COLOR=blue]65535[/COLOR][/FONT][FONT=Consolas][COLOR=purple])[/COLOR][/FONT] [FONT=Consolas][COLOR=maroon]options[/COLOR][/FONT][FONT=Consolas][COLOR=purple]([/COLOR][/FONT][FONT=Consolas][COLOR=olive]*varsize[/COLOR][/FONT][FONT=Consolas][COLOR=purple]);[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=black]len [/COLOR][/FONT][FONT=Consolas][COLOR=maroon]int[/COLOR][/FONT][FONT=Consolas][COLOR=purple]([/COLOR][/FONT][FONT=Consolas][COLOR=blue]10[/COLOR][/FONT][FONT=Consolas][COLOR=purple])[/COLOR][/FONT] [FONT=Consolas][COLOR=maroon]value[/COLOR][/FONT][FONT=Consolas][COLOR=purple];[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=red]End-Pi[/COLOR][/FONT][FONT=Consolas][COLOR=purple];[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=black]http_xlate[/COLOR][/FONT][FONT=Consolas][COLOR=purple]([/COLOR][/FONT][FONT=Consolas][COLOR=black]len[/COLOR][/FONT][FONT=Consolas][COLOR=purple]:[/COLOR][/FONT][FONT=Consolas][COLOR=black]data[/COLOR][/FONT][FONT=Consolas][COLOR=purple]:[/COLOR][/FONT][FONT=Consolas][COLOR=black]to_ebcdic[/COLOR][/FONT][FONT=Consolas][COLOR=purple]);[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=black]returnData [/COLOR][/FONT][FONT=Consolas][COLOR=purple]=[/COLOR][/FONT] [FONT=Consolas][COLOR=blue]%Trim[/COLOR][/FONT][FONT=Consolas][COLOR=purple]([/COLOR][/FONT][FONT=Consolas][COLOR=black]returnData[/COLOR][/FONT][FONT=Consolas][COLOR=purple])[/COLOR][/FONT] [FONT=Consolas][COLOR=purple]+[/COLOR][/FONT] [FONT=Consolas][COLOR=blue]%Subst[/COLOR][/FONT][FONT=Consolas][COLOR=purple]([/COLOR][/FONT][FONT=Consolas][COLOR=black]data[/COLOR][/FONT][FONT=Consolas][COLOR=purple]:[/COLOR][/FONT][FONT=Consolas][COLOR=blue]1[/COLOR][/FONT][FONT=Consolas][COLOR=purple]:[/COLOR][/FONT][FONT=Consolas][COLOR=black]len[/COLOR][/FONT][FONT=Consolas][COLOR=purple]);[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=purple]Return[/COLOR][/FONT][FONT=Consolas][COLOR=black] len[/COLOR][/FONT][FONT=Consolas][COLOR=purple];[/COLOR][/FONT][/FONT] [FONT=Calibri][FONT=Consolas][COLOR=purple]End-Proc;[/COLOR][/FONT][/FONT]
Comment