Topic
2 replies Latest Post - ‏2012-11-06T23:27:27Z by Kalicharan
Kalicharan
Kalicharan
49 Posts
ACCEPTED ANSWER

Pinned topic DELETE FIELD Command not working

‏2012-11-04T07:41:56Z |
Hi, iam trying to delete the field membership from my Environment Variables.

These are the variations of code that i have tried so far.

1. DELETE FIELD Environment.Variables.membership;

2. MOVE cursor TO Environment.Variables.membership;
DELETE FIELD cursor;

3. SET Environment.Variables.membership VALUE = NULL;

4. SET Environment.Variables.membership = NULL;

My debugger output still shows that membership is still there. Below is the snapshot from my debugger.

Environment

Variables
InputType:CHARACTER:NONMQ
System:CHARACTER:XXXXX
MsgType:CHARACTER:PERSON_DECEASED
UseDate:CHARACTER:N
membership
MEMBERSHIP_ID:DECIMAL:XXXXXX
MEMBERSHIP_END_DATE:TIMESTAMP:java.util.GregorianCalendar
SOURCE_OWNER_MASTER_ID:DECIMAL:XXXX
ORG_UNIT_ID:DECIMAL:XXXXXX
CONTRACT_ID:DECIMAL:XXXXX
REF_PRIMARY_ASSNMNT_TYPE_ID:DECIMAL:1
If i use the following command it works
SET Environment.Variables = NULL;

but i want to know if that will free up the memory. I heard that DELETE FIELD command helps free up memory. Any help on this would be helpful.
Updated on 2012-11-06T23:27:27Z at 2012-11-06T23:27:27Z by Kalicharan
  • kimbert@uk.ibm.com
    kimbert@uk.ibm.com
    515 Posts
    ACCEPTED ANSWER

    Re: DELETE FIELD Command not working

    ‏2012-11-06T21:28:25Z  in response to Kalicharan
    I suggest that you disconnect the debugger and put in a Trace node. The debugger may not be showing you the true situation.

    DELETE FIELD is the best option if your goal is to free up the memory.
    • Kalicharan
      Kalicharan
      49 Posts
      ACCEPTED ANSWER

      Re: DELETE FIELD Command not working

      ‏2012-11-06T23:27:27Z  in response to kimbert@uk.ibm.com
      Hi Kimbert thanks for response.

      Here is what is happening. I have an XML in the below format

      <abc>
      <item></item>
      <item></item>
      <item></item>
      </abc>
      <efc>
      </efc>

      I want to delete all of <item> tags so that the output is

      <abc>
      </abc>
      <efc>
      </efc>

      if i use

      DELETE FIELD OutputRoot.XMLNSC.abc.item[]; (it throws an error)

      if i use

      DELETE FIELD OutputRoot.XMLNSC.abc.item (it just deletes the first item tag. I have to put this command in an WHILE loop to get rid of all the item tags)

      Is there a better way for this?

      My 2nd quest is:

      I read DELETE FIELD frees up memory immediately. when will be the memory be freed up if we the below command

      SET OutputRoot.XMLNS.abc = NULL;

      Thanks in advance for your response.