loadcase problem

Discussions about editing and cleaning data
Forum rules
New release: CSPro 8.0
Post Reply
tbernardo
Posts: 11
Joined: May 27th, 2016, 2:02 am

loadcase problem

Post by tbernardo »

Hi,

I'm having a problem with the loadcase function in a batch edit application. I'd like to fill in occupation codes based on occupation name but the loadcase is not working as expected.
Any clue about what am I doing wrong?

Regards,
Tomas
Attachments
codic.zip
(3.3 KiB) Downloaded 308 times
Gregory Martin
Posts: 1777
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: loadcase problem

Post by Gregory Martin »

You need to specify the IDs when you're searching for a particular case:
if loadcase(OCUPACAO_DICT, OCUPACAO) then
tbernardo
Posts: 11
Joined: May 27th, 2016, 2:02 am

Re: loadcase problem

Post by tbernardo »

Hi Greg,

Even if I specifiy the IDs the loadcase doesn't work.
Regards,

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

Re: loadcase problem

Post by Gregory Martin »

The problem is that your lookup file is not a valid CSPro file. You are clearly constructing it with some other software, so here are three things to keep in mind:

1) The file should have the encoding UTF-8 with BOM. Your file is UTF-8 without BOM.

2) OCUPACAO_ID is not in the right position. In your dictionary, they are supposed to be at 108. Look at the screenshot below. You'll see that some are at 109, others 111, and so on. None are correctly at 108.
tber.png
tber.png (3.06 KiB) Viewed 4398 times
3) A CSPro file cannot contain tabs, which your file does (which you can see in the screenshot with the ->).

If you fix these problems, the code will work.
tbernardo
Posts: 11
Joined: May 27th, 2016, 2:02 am

Re: loadcase problem

Post by tbernardo »

Many thanks Greg. After changing the lookup file, as you advised me, it works perfectly.
Regards,

Tomas
Post Reply