So kompiliert er es:
Code:
dcl-proc UM_StmfToStrUni export;
   dcl-pi *n varucs2(300000);
      file varchar(2000) const;  //file incl. Pfad
   end-pi;


dcl-s clobFile sqltype(DBCLOB_FILE);
dcl-s clobDS sqltype(dbclob:300000) ccsid(1200);
dcl-s text varucs2(300000);


clobFile_Name = %trim(file);
clobFile_NL   = %len(%trim(clobFile_Name));
clobFile_FO   = SQFRD;  //Read Only


exec sql set :clobDS = :clobFile;
text = clobDS;


return text;


end-proc;
Geht das auch "speichersparender"? Ich habe ja bereits die Variable clobDS mit 300000 deklariert. Für die Rückgabe benötige ich anscheinend nochmal extra eine passende Variable text mit nochmal 300000 Zeichen.