cancel
Showing results for 
Search instead for 
Did you mean: 

Zip File in BODS

Former Member
0 Kudos

Hallo Experts,

My requirement is to Zip a file in BODS ,Any Idea

Thanks

Accepted Solutions (0)

Answers (5)

Answers (5)

former_member198401
Active Contributor

You can refer to below link

http://stackoverflow.com/questions/20485419/batch-file-script-to-zip-files

Use the Exec() function to execute the script placed on folder

Regards

Arun Sasi

0 Kudos

Hi All,

my requirement is to zip one text file of location and other location. i m using below command but it is not working. Can anyone please assist on this.

print(exec('C:\Program Files (x86)\WinZip\WINZIP32.EXE','-o -yb E:\Job_Exec_Repo\PRJ_AUTOMATION_POP_POS\DATA_FILES\FILE*.* E:\Job_Exec_Repo\PRJ_AUTOMATION_POP_POS\ZIP_FILES\FILE'||$G_TYCO_WEEK_BEG_DT||'-'||$G_TYCO_WEEK_END_DT||'',8));

Do i need to use as below for Program Files (x86) folder location? becuase i had an issue when using 7zip and below worked for me.

C:\PROGRA~1\WinZip\WINZIP32.EXE

Thanks,

Abdulrasheed.

0 Kudos

any views on this. Here is the latest script i am using it but no luck. I could achieve this activity by 7Zip but client would like to zip a file using Winzip due to limitation at the target server. Please advise. Thanks

print(exec('cmd',C:\\Progra~1\\WinZip\\WZZIP.EXE || ' -o -yb "'||'E:\Job_Exec_Repo\PRJ_AUTOMATION_POP_POS\ZIP_FILES\product_mdp_sort_tcpn_feed_to_endeca'||$G_TYCO_WEEK_BEG_DT||'-'||$G_TYCO_WEEK_END_DT||'" "'||'E:\Job_Exec_Repo\PRJ_AUTOMATION_POP_POS\DATA_FILES\product_mdp_sort_tcpn_feed_to_endeca*.*',8));

former_member528599
Discoverer
0 Kudos

Hi Guru's,

I am Zipping a file - this works.

exec('7z.exe', 'a "[$$Zip_Dir]"[$GV_Nom0].7z \"[$$Dir]"[$GV_Nom0][$$FichierExt] ' ,8);

What I need it to do is to stop the process if it is not able to complete the command for some reason. I have tried to make this =$Cmd_Return, but this is what I get:

3396 4324 PRINTFN 2017-11-17 13:52:18 Cmd_Return " 1: 7-Zip [64] 16.04 : Copyright (c) 1999-2016 Igor Pavlov : 2016-10-04 Open archive:
3396 4324 PRINTFN 2017-11-17 13:52:18 \\da\ZIP\Z.7z -- Path = \\da\ZIP\Z.7z Type = 7z Physical Size = 32Headers Size = 0
3396 4324 PRINTFN 2017-11-17 13:52:18 Method = LZMA2:12 Solid = - Blocks = 0 Scanning the drive: 0 file, 0 bytes (1 KiB) Updating archive:
3396 4324 PRINTFN 2017-11-17 13:52:18 \\da\ZIP\Z.7z Items to compress: 0 Files read from disk: 0 Archive size: 505 bytes (1 KiB) Everything
3396 4324 PRINTFN 2017-11-17 13:52:18 is Ok"

Not sure how to tell it to take the flag 1 error code and tell it to

raise_exception_ext('Error in file or path', 1); which then sends it to the catch to exit with an error, we don't want the process to continue and complete as successful. Can someone help?

Former Member
0 Kudos

Make use of .zip exe using EXEC function..e.g EXEC('Location of ZIP EXE including ZIP.EXE','ZIP COMMAND');

former_member208402
Active Contributor
0 Kudos

May be you need to implement a windows script or vb script which can ZIP a file and execute the script in BODS.