Editing of CASEID

Discussions about editing and cleaning data
Post Reply
YFT_CBSD
Posts: 48
Joined: January 3rd, 2023, 12:36 am

Editing of CASEID

Post by YFT_CBSD »

Hi how can i batch edit the BSN in caseID?

For Example:
Case ID length is 6.

city bsn
02 0001
02 0003
02 0007
02 0101

I want to batch edit it to be arranged like this:
city bsn
02 4001
02 4002
02 4003
02 4004
justinlakier
Posts: 152
Joined: November 21st, 2022, 4:41 pm

Re: Editing of CASEID

Post by justinlakier »

Hello,

This depends on how complex your edit is. It seems that the edit pattern here is that only the order is maintained when the new BSN is assigned, with the first item being assigned the ID 4001, the second being 4002, and so on. For this, you can use an incrementing global variable as in the following example.

Code: Select all

PROC GLOBAL
numeric renumberedCaseID = 4000;

PROC ID_LEVEL
BSN = inc(renumberedCaseID);
If the edit pattern is more complex, you might have your batch app copy cases over to a new external file (such as a .dat text file) with modified IDs to process. However this renumbering seems simple and sequential, which can be solved with the renumbering code above.

Hope this helps,
Justin
Post Reply