pvishnup
21st May 2003, 20:26
Hi All,

I need to handle the following scenario:

I have a flat file which i need to import to a dummy baan table using baan exchange.

Once the file is imported, it has to be pushed to a different archive directory making room for next file with the same name to import.

Can anyone say how to handle this?

Thanks in advance
Priya :cool:

NPRao
21st May 2003, 21:02
Hi VP,

Please complete your user profile with regards to the Baan software version, Database software and OS version. This will help other members when diagnosing your problem.

You can use the tools function - file.mv() (http://www.baanboard.com/programmers_manual_baanerp_help_functions_directory_file_operations_file_mv).

you might consider to write an exchange script to move after the data is loaded or write a 3-GL or Unix shell script to move the files into different directories and setup in a job.

baanlegend
21st May 2003, 21:07
Create a condition script and add after import. Pass the file name to this condition script and use the file.mv(source, target) to move the file to archive directory

pvishnup
21st May 2003, 21:24
I can write a 3GL to move the files. Can you explain how to add the 3GL to the Job? :-(

~VP

NPRao
21st May 2003, 21:25
Simple, make a session linked with 3-GL script and no form attached to it. You can only sessions or shell scripts to jobs. :p

pvishnup
21st May 2003, 21:37
Hey Prashanth,

I can make a job for Import session and another job for this file shifting. But i want to run the second job only when the first one is successful. Can you also please let me know how to do this?

Thanks

VP

baanlegend
21st May 2003, 21:50
You can probably create a single session to zoom.to the Import session passing the arguments and then check the exchange table to verify the status.

If the status is successful, you can zoom.to the session where you want to move the files.

NPRao
21st May 2003, 22:04
Vishnu,
i want to run the second job only when the first one is successful.
Start Job Data (ttaad5500m000) for that company. mark the job, then sesssion by job (ttaad5501m000), then double click the session, then you can see the option - Action on Error

pvishnup
21st May 2003, 23:54
thanks baanlegend and prashanth

i have one more doubt. I work with Baan 4c2.

I wrote a 3gl and created a new session and attached the 3gl script to it without creating any form. To attach this session to the Job, i need to select the option "Make Job" from the menu which is disabled.

I think to make it enable, in forms, from standard options i should enable the Make Job option which is now not possible as i have not attached form to the session.

now how can i make a job for this session?
Thanks in advance

~vp

baanlegend
21st May 2003, 23:58
You need either type 2 or type 4 form for enabling the Make Job. You may have to regenerate the session and add the script.

NPRao
22nd May 2003, 01:43
[or]

just add a display field so that the form isnt empty and you can enable the standard option - "add to job".

You can also add the following piece of code based on BaaN-4 series syntax -

group.1:
init.group:
if not (api.mode or job.process or background) then
get.screen.defaults()
endif
start.process()


or you can code it in the choice sections -

40 run.job Run job of session 1234 1234 1234