create a separate file

Discussions about CSEntry
prabhustat
Posts: 72
Joined: March 17th, 2012, 10:46 am

Re: create a separate file

Post 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
Attachments
MDR_TB_LF 1.zip
(19.03 KiB) Downloaded 287 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: create a separate file

Post 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.
prabhustat
Posts: 72
Joined: March 17th, 2012, 10:46 am

Re: create a separate file

Post 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
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: create a separate file

Post by josh »

Just:

writecase(MDR_EXT_DICT);
prabhustat
Posts: 72
Joined: March 17th, 2012, 10:46 am

Re: create a separate file

Post by prabhustat »

Thanks, working fine....
jfigueroa
Posts: 100
Joined: August 28th, 2014, 12:46 pm

Re: create a separate file

Post 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.
prabhustat
Posts: 72
Joined: March 17th, 2012, 10:46 am

Re: create a separate file

Post 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
Attachments
MDR_TB.zip
(25.71 KiB) Downloaded 282 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: create a separate file

Post 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.
Post Reply