TI process hangs on
Posted: Mon Sep 01, 2014 10:54 am
I am trying to find the subsetcount with below process,it saves fine but just hangs on,infact the server has to be restarted:
Could anybody help me on this one ,Please.
Code: Select all
#****Begin: Generated Statements***
#****End: Generated Statements****
# If the Allsubsets dimension exits then we delete it and again create it.#
IF(DimensionExists('AllSubsets')=1);
DimensionDestroy('AllSubsets');
ENDIF;
DimensionCreate('AllSubsets');
IF(DimensionExists('Dimension_names')=1);
DimensionDestroy('Dimension_names');
endif;
no_dimensions = DIMSIZ('}Dimensions');
DimensionCreate('Dimension_names');
DimensionElementDelete('}Dimensions','Dimension_names');
dim_counter = 1;
WHILE(dim_counter <= no_dimensions);
dim_name=DIMNM('}Dimensions',dim_counter);
# Skip the control dimensions
var1=scan('}',dim_name);
if(var1<>1);
DimensionElementInsert('Dimension_names','',dim_name,'N');
i=0;vFilenew='';
compare='a';
# Search for corresponding folder and .sub file for a dimension
while(compare@<>'');
vFile = WildCardFileSearch( vDataDirectory|'\'| dim_name | '}subs\'| '*.sub',vFilenew) ;
result=fileExists( vDataDirectory | '\'| dim_name | '}subs\'| vFile);
if(vFile@<>'');
if(vFIle@<>'Default.sub');
strlength=LONG(vFile);
vSubsetfinal=DELET(vFile,strlength-3,4);
DimensionElementInsert('AllSubsets','',vSubsetfinal,'N');
endif;
vFilenew=vFile;
endif;
if(vFile@='');compare='';
endif;
END;
endif;
dim_counter = dim_counter +1;
END;
dim_counter=1;
subset_counter=1;
no_dim = DIMSIZ('Dimension_names');
no_subsets = DIMSIZ('AllSubsets');ASCIIOutput(vOutputFile |'\'| 'SubsetCount.csv','Dimension_names','Subset_names');
WHILE(subset_counter<=no_subsets);
subset_name=DIMNM('AllSubsets',subset_counter);
dim_counter_new=1;
WHILE(dim_counter_new<=no_dim);
dim_name1=DIMNM('Dimension_names',dim_counter_new);
var_dim_name = scan('}',dim_name1);
if(var_dim_name<>1);
if(dim_name1@<>'AllSubsets');
#If the subset exists for the dimension then write its name# in front of the dimension name in csv file
if(SubsetExists(dim_name1,subset_name)=1);
ASCIIOutput(vOutputFile |'\'| 'SubsetCount.csv',dim_name1,subset_name);
endif;
endif;
endif;
dim_counter_new=dim_counter_new+1;
END;
subset_counter=subset_counter+1;
END;