running progress program using unix shell script.

sreekuax

Member
I am having a progress program that i need to run in eB2. But I need to use a shell script and that is the requirement.

Can any one help me ?

sample progress program :

define stream xcim-stream.
define variable m_company like code_cmmt no-undo.
define variable m_name as char format "x(50)" no-undo.
define variable n_name as char format "x(50)" no-undo.
define variable cfilename as char format "x(40)" no-undo.
define variable ctoday as char format "x(8)" no-undo.
for FIRST CODE_mstr WHERE CODE_fldname = "XX_SFDC_COMP"
AND code_value = "QAD_ID"
NO-LOCK :
end.
if available code_mstr then
assign m_company = CAPS(TRIM(CODE_cmmt)).
assign
ctoday = string(today)
ctoday = replace (ctoday, "/","")
m_name = m_company + ctoday
cfilename = "/export/home/scripts/eb2/mqad/spm/data/" + m_name + "-PT_MSTR DAT.csv" .
output stream xcim-stream to value (cfilename) .
PUT STREAM xcim-stream UNFORMATTED
'"' "ERP Product" '"' ";"
'"' "Created By" '"' ";"
'"' "Date on which record created created" '"' ";"
'"' "Change Date" '"' ";"
'"' "Effective From" '"' ";"
'"' "ERP Category" '"' ";"
'"' "Material Type" '"' ";"
'"' "Reporting UOM" '"' ";"
'"' "Commodity ID" '"' ";"
'"' "Unit Price" '"' ";"
'"' "Height" '"' ";"
'"' "Length" '"' ";"
'"' "ERP Supplier" '"' ";"
'"' "Width" '"' ";"
'"' "Language (ISO Code)" '"' ";"
'"' "Medium description" '"' ";"
'"' "Long description" '"'
SKIP.
FOR EACH PT_MSTR NO-LOCK :
export STREAM xcim-stream delimiter ";"
PT_PART
PT_USERID
PT_ADDED
PT_MOD_DATE
PT_ADDED
PT_PROD_LINE
PT_PART_TYPE
PT_UM
PT_COMM_CODE
PT_PRICE
PT_HEIGHT
PT_LENGTH
PT_VEND
PT_WIDTH
PT_DESC1
PT_DESC2
SKIP.
END. /* End of FOR EACH pl_mstr */
OUTPUT CLOSE.
 

sreekuax

Member
hi maxim..

i tried with the script attached.... View attachment qad2spm_sh.txt

i am getting an error as shown below :

log file view ***



* * * * W E L C O M E * * * *
M F G / P R O Release eB2 SP8 as of Nov 1 2004
Manufacturing Management

QAD
6450 Via Real
Carpinteria, CA 93013


(805) 684-6614
(805) 684-1890 FAX

Copyright 1986-2004 QAD Inc. All rights reserved.
This product may not be reproduced or distributed
Active Sessions: 1 Sessions Allowed: 36

User ID: nex8szy
Password:

eB2 MQAD : ustrgjul-sh
mfmenu Main Menu 10/27/10

DISTRIBUTION MANUFACTURING FINANCIAL
1. Items/Sites 13. Product Structures 25. General Ledger
2. Addresses/Taxes 14. Routings/Work Center 26. Multiple Currency
3. Inventory Control 15. Formula/Process 27. Accounts Receivable
4. 16. Work Orders 28. Accounts Payable
5. Purchasing 17. Shop Floor Control 29.
6. 18. Repetitive 30. Cost Management
7. Sales Orders/Invoice 19. Quality Management 31. Cash Management
8. Configured Products 20. Product Line Plan 32. Fixed Assets
9. 21. Resource Plan 33. Enterprise Ops Plan
10. Project Realization 22. Forecast/Master Plan 34.
11. Service/Support 23. Materials Rqmts Plan 35. EDI ECommerce
12. Distribution Plan 24. Capacity Rqmts Plan 36. Manager Functions

Please select a function. F4 or blank to EXIT.

Please select a function. F4 or blank to EXIT. xxspmpl.p
** Unable to open file:
/export/home/scripts/eb2/mqad/spm/data/MQAD102710-PL_MSTR DAT.CSV. Errno=2. (98)

eB2 MQAD : ustrgjul-sh
mfmenu Main Menu 10/27/10

DISTRIBUTION MANUFACTURING FINANCIAL
1. Items/Sites 13. Product Structures 25. General Ledger
2. Addresses/Taxes 14. Routings/Work Center 26. Multiple Currency
3. Inventory Control 15. Formula/Process 27. Accounts Receivable
4. 16. Work Orders 28. Accounts Payable
5. Purchasing 17. Shop Floor Control 29.
6. 18. Repetitive 30. Cost Management
7. Sales Orders/Invoice 19. Quality Management 31. Cash Management
8. Configured Products 20. Product Line Plan 32. Fixed Assets
9. 21. Resource Plan 33. Enterprise Ops Plan
10. Project Realization 22. Forecast/Master Plan 34.
11. Service/Support 23. Materials Rqmts Plan 35. EDI ECommerce
12. Distribution Plan 24. Capacity Rqmts Plan 36. Manager Functions

Please select a function. F4 or blank to EXIT.
Please confirm exit y


********************************************************************************************************
see the error am getting..

"** Unable to open file: /export/home/scripts/eb2/mqad/spm/data/MQAD102710-PL_MSTR DAT.CSV. Errno=2. (98)"

i am able to get this running if i am running it manually from eb2 main window i.e like below :


eB2 MQAD : ustrgjul-sh
mfmenu Main Menu 10/27/10

DISTRIBUTION MANUFACTURING FINANCIAL
1. Items/Sites 13. Product Structures 25. General Ledger
2. Addresses/Taxes 14. Routings/Work Center 26. Multiple Currency
3. Inventory Control 15. Formula/Process 27. Accounts Receivable
4. 16. Work Orders 28. Accounts Payable
5. Purchasing 17. Shop Floor Control 29.
6. 18. Repetitive 30. Cost Management
7. Sales Orders/Invoice 19. Quality Management 31. Cash Management
8. Configured Products 20. Product Line Plan 32. Fixed Assets
9. 21. Resource Plan 33. Enterprise Ops Plan
10. Project Realization 22. Forecast/Master Plan 34.
11. Service/Support 23. Materials Rqmts Plan 35. EDI ECommerce
12. Distribution Plan 24. Capacity Rqmts Plan 36. Manager Functions

Please select a function. F4 or blank to EXIT. xxspmpl.p

this will give the desired out put file to the hardcoded destination in .p but the unix script is not working !!

any comments or ideas ?
 
you can use the following command inside the script/bin/_progress -pf (.pf file name) -p (progress program) where /bin is directory where your progress has been installledNote: please ensure all your .pf files are stored in the specific directory and specify the directory inside the script
 

sreekuax

Member
thanks all for all your efforts and replies...
yesterday I found out what a fool I am.. :)

the PROPATH mentioned in the .sh file is wrong as that of the system... I changed that and it worked..
anyhow I will be posting questions here when i move forward.

Thanks again
 
Top