Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All
I have many long script which is identical to different country . Only some of the line of script are diff. For example SOURCE , LINK_KEY which are diff.
In order to have less error . Does QV allow to comply those common script comply into a libary. So I can keep use them . And this will make my script less messy and neat.
I tried one sample application for you..
Hope you are looking for the same solution.
HTH
Sushil
you can save your scripts in external files and then you can include those files using # include statement..
check the reference manual for using Include statement..
After that try to create some generalized variables which you can embedd in your script..
make changes in your variable for each import...
HTH
Sushil
Hi Sir
It is possible you help me by give me a very simple exsmple ?
ok.. let me try to replicate your senario
I tried one sample application for you..
Hope you are looking for the same solution.
HTH
Sushil
Hi Sushil
Thank for your example on include.
i study your approach , you make use of include text file to load the raw data . But my idea is try to make use of include for replace the follow script.
Pls take note that below 2 group of script , the only line diff is SOURCE_SALES and file name of data file at 3 row and last row of the script , my idea is how to make use of include for the rest of code. except the 2 diff key word.
sales_table:
LOAD left(FileBaseName(), 4) AS Report_dod_1,
'TDSPG' as SOURCE_SALES,
@1:10T as [cust_id],
@50:60T as [date],
@50:60T as [SALES_DATE],
if(@241:248T = '2',@134:147T*-1,@134:147T) as [sales],
left(@11:42T,31) as [company],
@313:343T as [desc]
FROM Q_FCPG09.txt (ansi, fix, no labels, header is 0, record is line);
sales_table:
LOAD left(FileBaseName(), 4) AS Report_dod_1,
'TDSKL' as SOURCE_SALES,
@1:10T as [cust_id],
@50:60T as [date],
@50:60T as [SALES_DATE],
if(@241:248T = '2',@134:147T*-1,@134:147T) as [sales],
left(@11:42T,31) as [company],
@313:343T as [desc]
FROM Q_FCKL09.txt (ansi, fix, no labels, header is 0, record is line);