Skip to main content
Announcements
SYSTEM MAINTENANCE: Thurs., Sept. 19, 1 AM ET, Platform will be unavailable for approx. 60 minutes.
cancel
Showing results for 
Search instead for 
Did you mean: 
paulyeo11
Master
Master

can I embedded my script ?

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.

1 Solution

Accepted Solutions
sushil353
Master II
Master II

I tried one sample application for you..

Hope you are looking for the same solution.

HTH

Sushil

View solution in original post

5 Replies
sushil353
Master II
Master II

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

paulyeo11
Master
Master
Author

Hi Sir

It is possible you help me by give me a very simple exsmple ?

sushil353
Master II
Master II

ok.. let me try to replicate your senario

sushil353
Master II
Master II

I tried one sample application for you..

Hope you are looking for the same solution.

HTH

Sushil

paulyeo11
Master
Master
Author

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);