Flashing MUIU.eu Rom on Xiaomi Redmi 4 Prime

So my recommendation after reading tons of articles is to follow this video.

Essentially there are 2 ways how to move from a custom/vendor ROM to xiaomi.eu ROM. The method which is being used here in the video is to use the Chinese version of PC Suite and the recovery ROM.

  1. The video assumes the device is bricked but if it is not then it is enough just to turn the device into a recovery mode and use a (recovery) rom. To sum up, “flashing recovery ROM using Chinese version of Mi PC Suite in recovery mode.”
  2. Once done the second step is to unlock bootloader. Again the Chinese version helps. But this time I had to click twice, to unlock it.
  3. Download TWRP by cofface and follow its guidelines. End TWRP with “fastboot reboot” from command line.
  4. Lastly flash EU ROM using this.
  5. WIN

Other links:




Redmi 4/Prime/4A thread: http://en.miui.com/forum-119-1.html

Tools: http://en.miui.com/type-119-995.html

Rom: http://en.miui.com/type-119-998.html


[MIUI DEVICE TEAM] Flash / Unbrick Redmi 4/Prime/4A: http://en.miui.com/thread-408889-1-1.html

Bootloader Unlock – Solution for Redmi 4 Pro/Prime (unlocking stuck at 50%): http://en.miui.com/thread-429397-1-1.html

RedMi 4 Prime/Pro Twrp recovery: http://en.miui.com/thread-412204-1-1.html



Stable & Dev Rom: http://en.miui.com/download-320.html


SAS code for replacing missing values with 0 in a folder full of datasets

%macro loopOverDatasets();
/*imho good practice to declare macro variables of a macro locally*/
%local datasetCount datasetName iter inMember;

/*get number of datasets + name of datasets*/
proc sql noprint ;
select count(*)
into: datasetCount
from dictionary.tables
where libname = “EXAM”;

/*initiate loop*/
%let iter=1;
%do %while (&iter.<= &datasetCount.);

proc sql noprint;
select memname
into: datasetName
from dictionary.tables
where libname = “EXAM” and monotonic() eq &iter.;

%put &iter &datasetCount &datasetName &inMember;
/*now you can apply your logic to the dataset*/
data &datasetName.;
set exam.&datasetName.;
array change _numeric_;
do over change;
if change=. then change=0;

%let iter=%eval(&iter.+1);