Page 1 of 1

How to Sort text Data using External Dictionary for Prelodding

Posted: June 11th, 2021, 6:00 am
by pradhanra01
Hi Gregory Martin,

While we use preload, data should be sorted based on preloading ID otherwise preload get fail. Here My problem is I am copying required data from other datafile to new data file and using new data for preloading, before preloading I required to sort the data based on ID in external dictionary and copy it to new file otherwise preload get fails.

for example below are data in hhs.dat file
1921101010003
1921101010004
1121101010006
1921101010007
1121101010009
1921101010012
1321101010017
1921101010022
1321101010013

my external dictionary has :
intvid (len=2, start from 1)
hhid (len=11, start from 3)

I require to sort above (txt) data in to below format before preloading...
1121101010006
1121101010009
1321101010017
1321101010013
1921101010003
1921101010004
1921101010007
1921101010012
1921101010022

I have tried below line of command syntax but could not get success...
loadcase(intvhh_dict);
sort(hhid using intvid);


Could you please suggest me how can I achieve my requirement.

Thanks & Regards,
Ramesh Pradhan

Re: How to Sort text Data using External Dictionary for Prelodding

Posted: June 14th, 2021, 9:53 am
by Gregory Martin
The sort function is for sorting groups/records with a single case. If you are interested in sorting multiple cases by ID, you should use the Sort Data tool: https://www.csprousers.org/help/CSSort/ ... _data.html

You can define your sort specifications using the tool. If you want to run the sort from within a data entry application, you can use the execpff function to launch the sort. Starting with CSPro 7.6, you can run Sort Data PFFs on Android.

Re: How to Sort text Data using External Dictionary for Prelodding

Posted: June 14th, 2021, 10:49 am
by pradhanra01
Thank you so much Gregory Martin