First case seems full of unwanted records

Discussions about editing and cleaning data
Post Reply
AriSilva
Posts: 594
Joined: July 22nd, 2016, 3:55 pm

First case seems full of unwanted records

Post by AriSilva »

Hi folks,
I have a problem "reformatting" a file using the edit.
The input file has 4 cases.
In the output, all the cases are fine, but for the very first one (case 201), which writes all the record types, even if they do not exist in the input file.
As for the ones that do exist, it writes the maximum number of occurrences.
For example, records
B_MORADORES_SUP has 20 occurrences
Y_VISITA_SUP has 40 occurrences

The other 3 cases look fine.
Attached the whole application, it is a very simple one, it is meant to write a different record key, using the supervisor identity as the first element of the ID.

By the way. what I really needed was an instruction of assigning record contents, that is, copying the whole record, instead of copying fields, I already asked for that, but, Christmas is very far away.
Best
Ari
Attachments
FirstCase.rar
(154.4 KiB) Downloaded 99 times
Best
Ari
Gregory Martin
Posts: 1792
Joined: December 5th, 2011, 11:27 pm
Location: Washington, DC

Re: First case seems full of unwanted records

Post by Gregory Martin »

You do this after writing the first case (in PROC IDS0_EDT):
clear(PDP_15_ENTREVISTA_SUPERVISOR_DICT);
However, that means that the first case has an entire set of record occurrences. I would remove the code from there and instead do this:
PROC PDP_10_ENTREVISTA_LEVEL

preproc

    clear
(PDP_15_ENTREVISTA_SUPERVISOR_DICT);
AriSilva
Posts: 594
Joined: July 22nd, 2016, 3:55 pm

Re: First case seems full of unwanted records

Post by AriSilva »

Thanks, Greg,
It should do the job.
Best
Ari
AriSilva
Posts: 594
Joined: July 22nd, 2016, 3:55 pm

Re: First case seems full of unwanted records

Post by AriSilva »

Thanks, Greg,
It works.
Best
Ari
Post Reply