Hi Brian,

Could you please with below code.

----------------------------------------------------

Class Sample.TempUtil Extends %RegisteredObject
{

ClassMethod GetSecondUpperCase(pInput As %String) As %String
{
 ;w ##class(Sample.TempUtil).GetSecondUpperCase("GetSecondUpperCase")
 SET stsrtpos=$LOCATE(pInput,"[[:upper:]]{1}",2)
 SET endpos=$LOCATE(pInput,"[[:upper:]]{1}",(stsrtpos+1))
 SET result=$EXTRACT(pInput,stsrtpos,(endpos-1))
 
 quit result
}

}
----------------------------------------------------------------

Regards,

Muni Ganesh

Hi All,

Sorry for the delay in response, I have been far to the computer for few days, that's why I could not respond on this.

Regarding this post,  I have checked with our admin team they said that they keep last 2 days journal files after that those files will be purged. As per my understanding the global has been killed more than 10 days back , so I can't do anything to retrieve the global.

Thanks for all your replies, I will try all your suggestions just for my knowledge .

Regards,

Muni Ganesh G

Hi Raj,

I just tried answer for your question, I have given the code  below. I hope it helps you.

---------------------------------------------------------------------------------------------------------------------------------

   set array=[]
   set obj = {}
   set obj.title="For Whom the Bell Tolls"
   set obj.author="Hemmingway"
   do array.%Push(obj)    

   set obj = {}
   set obj.title="The Invisible Man"
   set obj.author="Ellison"
   do array.%Push(obj)    

   set obj = {}
   set obj.title="Tender is the Night"
   set obj.author="Fitzgerald"
   do array.%Push(obj)    

 set arraylen=0 
 set iter = array.%GetIterator()
   while iter.%GetNext() {
      set arraylen=$I(arraylen)
   }
   
   set MainObj={}
   set MainObj.results=arraylen
   set MainObj.items=array
   
   MainObj.%ToJSON()
----------------------------------------------------------------------------------------------------------------

Output:

{"results":3,"items":[{"title":"For Whom the Bell Tolls","author":"Hemmingway"},{"title":"The Invisible Man","author":"Ellison"},{"title":"Tender is the Night","author":"Fitzgerald"}]}

--------------------------------------------------------------------------------------------------------------------