Page 2 of 2

Re: create a separate file

Posted: August 9th, 2016, 6:38 am
by prabhustat
Thanks Jose/Jfigureoa, the problem rectified, the id items is capturing now, but I want write some more variables, I try to write the same process but the error is coming
ERROR: Variable(s) length do not agree with dictionary id-length near line 13 in STATUS_OF_THE_PATIENT_27TH_MONTF procedure

The program
CURRENT_STATUS_OF_THE = CURRENT_STATUS_OF_THE_PATIENT;
STATUS_OF_THE_PATIENT_3RD_M = STATUS_OF_THE_PATIENT_3RD_MONT;
STATUS_OF_THE_PATIENT_6TH_M =STATUS_OF_THE_PATIENT_6TH_MONW;
STATUS_OF_THE_PATIENT_9TH_M = STATUS_OF_THE_PATIENT_9TH_MONW;
STATUS_OF_THE_PATIENT_12TH_M = STATUS_OF_THE_PATIENT_12TH_MONW;
STATUS_OF_THE_PATIENT_15TH_M = STATUS_OF_THE_PATIENT_15TH_MONY;
STATUS_OF_THE_PATIENT_18TH_M = STATUS_OF_THE_PATIENT_18TH_MONZA;
STATUS_OF_THE_PATIENT_21ST_M = STATUS_OF_THE_PATIENT_21ST_MONTB;
STATUS_OF_THE_PATIENT_24TH_M= STATUS_OF_THE_PATIENT_24TH_MONTD;
STATUS_OF_THE_PATIENT_27TH_M = STATUS_OF_THE_PATIENT_27TH_MONTF;
if not loadcase(MDR_EXT_DICT,LFSTATE_CODE1,LFDISTRICTS_CODE1,MONTIL1,DATE_YEARL1,MDR_CASE_UNIQUEL1,SESSION1) then
writecase(MDR_EXT_DICT,CURRENT_STATUS_OF_THE,STATUS_OF_THE_PATIENT_3RD_M,STATUS_OF_THE_PATIENT_6TH_M,STATUS_OF_THE_PATIENT_9TH_M,STATUS_OF_THE_PATIENT_12TH_M,STATUS_OF_THE_PATIENT_15TH_M,STATUS_OF_THE_PATIENT_18TH_M,STATUS_OF_THE_PATIENT_21ST_M,STATUS_OF_THE_PATIENT_24TH_M,STATUS_OF_THE_PATIENT_27TH_M);
endif;
Even I have checked the length of the variables both dictionary have same length, I don’t know were the error is happening. Will you please suggest, It would be great help. I have enclosed the program for your reference.

Thanks in advance.

Prabhu

Re: create a separate file

Posted: August 9th, 2016, 9:34 am
by josh
The problem is with the writecase statement. You do not pass the record variables to writecase. You can optionally pass it the id-variables but it is usually not needed. Writecase will write out whatever the current values of the dictionary variables are in memory. So you can simply do: writecase(MDR_EXT_DICT). This will save whatever values are in the variables for your external dictionary (CURRENT_STATUS_OF_THE, STATUS_OF_THE_PATIENT_3RD_M,...).

I'm not sure why you are trying to do a writecase directly after the loadcase. This will not do anything really since loadcase will fill in the variables for the dictionary and then writecase will write them out with the same values. Usually you do loadcase, modify one or more of the values and then do a writecase.

Re: create a separate file

Posted: August 9th, 2016, 1:45 pm
by prabhustat
Thanks Josh, Ru saying like that

Code: Select all

CURRENT_STATUS_OF_THE = CURRENT_STATUS_OF_THE_PATIENT;
writecase(MDR_EXT_DICT,CURRENT_STATUS_OF_THE);
but still i am getting the error of

ERROR: Variable(s) length do not agree with dictionary id-length near line 3 in CURRENT_STATUS_OF_THE_PATIENT procedure

Thanks in advance.

Prabhu

Re: create a separate file

Posted: August 9th, 2016, 2:57 pm
by josh
Just:

writecase(MDR_EXT_DICT);

Re: create a separate file

Posted: August 10th, 2016, 5:26 am
by prabhustat
Thanks, working fine....

Re: create a separate file

Posted: August 10th, 2016, 11:10 am
by jfigueroa
Thanks Josh.

I didn´t had tried using writecase function without passing the id variables.
It´s good to know it.

Great prabhustat, glad to hear your problem was solved.

Re: create a separate file

Posted: August 22nd, 2016, 1:35 am
by prabhustat
Thanks, write case working fine. Now the issue I am facing on load case. I try to address, on load cases from the write case file.

Code: Select all

PROC IDS0_FORM
LFSTATE_CODE1=LFSTATE_CODE;
LFDISTRICTS_CODE1=LFDISTRICTS_CODE;
MONTIL1=MONTIL;
DATE_YEARL1=DATE_YEARL;
MDR_CASE_UNIQUEL1=MDR_CASE_UNIQUEL;

if loadcase(MDR_EXT_DICT, LFSTATE_CODE, LFDISTRICTS_CODE, MONTIL,DATE_YEARL,MDR_CASE_UNIQUEL)= 0 then
	errmsg("Still yet no line listing form entered");
	endif;

                                    and 

PROC CURRENT_STATUS_OF_THE_PATIENT
preproc
if loadcase(MDR_EXT_DICT, LFSTATE_CODE, LFDISTRICTS_CODE, MONTIL,DATE_YEARL,MDR_CASE_UNIQUEL) = 1 then
	CURRENT_STATUS_OF_THE_PATIENT = CURRENT_STATUS_OF_THE_PATIENTA;
   	skip to STATUS_OF_THE_PATIENT_3RD_MONT;
	endif;
I try to get the values from the previous case, so I write the file and want to load. I have enclosed the application for your reference. I don’t know where I missing will you please help out.

Thanks,

Prabhu

Re: create a separate file

Posted: August 25th, 2016, 7:34 pm
by josh
You have more id-items in your dictionary than you do in your loadcase statement. All those status flags probably should not be id-items and should be part of the record instead.