How to Sort text Data using External Dictionary for Prelodding

Discussions about CSEntry
Post Reply
pradhanra01
Posts: 24
Joined: August 27th, 2017, 2:43 am

How to Sort text Data using External Dictionary for Prelodding

Post by pradhanra01 » June 11th, 2021, 6:00 am

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

Gregory Martin
Posts: 1494
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

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

Post by Gregory Martin » June 14th, 2021, 9:53 am

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.

pradhanra01
Posts: 24
Joined: August 27th, 2017, 2:43 am

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

Post by pradhanra01 » June 14th, 2021, 10:49 am

Thank you so much Gregory Martin

Post Reply