Shell script is erring out with NLS [message #411821] |
Tue, 07 July 2009 00:56 |
suman.g
Messages: 89 Registered: June 2009
|
Member |
|
|
Hi,
Good Morning....
Now I have one more requirement, I am calling two more concurrent programs(one report and one publisher to publish the xml output) internally in this shell script using command:
To call XML Report
CONCSUB "$LOGIN" "SQLAP" "$RESP_NAME" "$USRNM" WAIT="Y" "CONCURRENT" "APPLICATION_SHORT_NAME"
"CP_SHORT_NAME" > $XML_REP_TMP_FILE
To call XML Publisher publisher
CONCSUB "$LOGIN" "SQLAP" ""$RESP_NAME" "$USRNM" WAIT="Y" "CONCURRENT" "APPLICATION_SHORT_NAME"
"CP_SHORT_NAME" "$XML_REP_REQUEST_ID" "APPLICATION_ID" "TEMPLATE_NAME" "\"\"" "N" "RTF" "PDF" > $XML_PUB_TMP_FILE
I want to get the requests id of Report as it's needed to pass for publisher program to publish this report and also need to get the request id of publisher program to get the out file.
I am using the below command to get the request id of Report and publisher.
XML_REP_REQUEST_ID=`head -1 $XML_REP_TMP_FILE | cut -f3 -d' '`
XML_PUB_REQUEST_ID=`head -1 $XML_PUB_TMP_FILE | cut -f3 -d' '`
The problem I am facing is that it's working fine with English language login but giving error with German login while getting request id.
And giving error below..
cp: cannot access /out path/ofür.out
where 'für' is coming in place of request id.(with German login)
I used the below code to fix it but it's failing when we submit the program simultaneously or with very short time gap.
select max(REQUEST_ID)
from fnd_conc_req_summary_v
where PROGRAM_SHORT_NAME like 'PROGRAM_SHORT_NAME;
Please suggest something...
Many Thanks.
Suman
|
|
|
|
Re: How to get Responsibility name in shell script. [message #411840 is a reply to message #411821] |
Tue, 07 July 2009 02:29 |
suman.g
Messages: 89 Registered: June 2009
|
Member |
|
|
Sir,
Problem with getting Responsibility name has been resolved by the solution given by you but now, my concerm here is to get the request_id of the concurrent program submitted using CONCSUB method.
Using command `head -1 $XML_REP_TMP_FILE | cut -f3 -d' '` to get request id, working fine with English login but it's returning 'für' instead of request_id with German login.
Regards,
Suman
|
|
|
|
Re: Shell script is erring out with NLS [message #411859 is a reply to message #411821] |
Tue, 07 July 2009 03:32 |
kecd_deepak
Messages: 52 Registered: December 2007
|
Member |
|
|
Hi,
i used this syntax in my scripts, and it working fine for me.
conc_req_id=`grep CONCURRENT ${conc_tmp_file}|cut -d ' ' -f3`
can u please attach your temporary file (XML_REP_TMP_FILE) here, so that it would easy 4 us to identify the difference in the file when we login from German login.
Thanks
dpk
|
|
|
Re: Shell script is erring out with NLS [message #411863 is a reply to message #411821] |
Tue, 07 July 2009 03:36 |
suman.g
Messages: 89 Registered: June 2009
|
Member |
|
|
Quote: | What CONCSUB is doing with that RESP_NAME parameter?
| This is passed as parameter to submit the concurrent program in RESP_NAME responsibility only.
currently I am using code below for calling report:
XML_REP_REQUEST=`CONCSUB "$LOGIN" "SQLAP" "$RESP_NAME" "$USRNM" WAIT="Y" "CONCURRENT" "APPLICATION_SHORT_NAME"
"CP_SHORT_NAME"`
echo Report Request: $XML_REP_REQUEST --to print value in log file
XML_REP_REQUEST_ID=`echo $XML_REP_REQUEST |tr -s " " | cut -d" " -f3` --select the third field for request id
echo Report Request id: $XML_REP_REQUEST_ID --to print value in log file
values with English login:
Report Request: Submitted request 4479624 for CONCURRENT TEST_REPORT Normal completion
Report Request id: 4479624
and values with German login:
Report Request: Prozess "4479620" für "CONCURRENT TEST_REPORT " gestartet Normal beendet
Report Request id: für
now question is what I use to get the request id correctly with any language login.
Suggest something ...
Many thanks,
Suman
|
|
|
Re: Shell script is erring out with NLS [message #411879 is a reply to message #411863] |
Tue, 07 July 2009 04:17 |
|
vamsi kasina
Messages: 2112 Registered: October 2003 Location: Cincinnati, OH
|
Senior Member |
|
|
Quote: | values with English login:
Report Request: Submitted request 4479624 for CONCURRENT TEST_REPORT Normal completion
Report Request id: 4479624
and values with German login:
Report Request: Prozess "4479620" für "CONCURRENT TEST_REPORT " gestartet Normal beendet
Report Request id: für
| I'm not sure what needs to be done.
But the way you are getting the request_id is wrong, as you can see in German login your request id is present as second word, not the third one.
By
Vamsi
[Updated on: Tue, 07 July 2009 04:17] Report message to a moderator
|
|
|
|
Re: Shell script is erring out with NLS [message #411969 is a reply to message #411821] |
Tue, 07 July 2009 06:24 |
suman.g
Messages: 89 Registered: June 2009
|
Member |
|
|
Yes Vamsi/Deepak..
I can not use 'cut command' with particular field position here to get request id as request id positiona are different for different languages.
Can anybody suggest me the logic or code for the problem I am facing.
Thanks in adnavce.
Suman
|
|
|
|
Re: Shell script is erring out with NLS [message #412157 is a reply to message #411821] |
Wed, 08 July 2009 01:06 |
suman.g
Messages: 89 Registered: June 2009
|
Member |
|
|
Hi All,
@Vamsi Sir: I am not able to write logic to have request id at first place as it's position is changing with language and i don't have good knowledge of unix.
Problem Description:
XML_REP_REQUEST=`CONCSUB "$LOGIN" "SQLAP" "$RESP_NAME" "$USRNM" WAIT="Y" "CONCURRENT" "APPLICATION_SHORT_NAME"
"CP_SHORT_NAME"`
echo Report Request: $XML_REP_REQUEST --to print value in log file while execution the value of 'XML_REP_REQUEST' is 'Prozess "4479620" für "CONCURRENT TEST_REPORT " gestartet Normal beendet'
I am storing the sub string '4479620' of variable XML_REP_REQUEST in variable 'XML_REP_REQUEST' using code below:
XML_PUB_REQUEST_ID=`echo $XML_PUB_REQUEST |tr -s " "| cut -d" " -f2|tr -d """` But it's returning "4479620" instead of 4479620.
Any idea where I am doing mistake.
Many thanks,
Suman
|
|
|
|
|
|
|
Re: Shell script is erring out with NLS [message #412218 is a reply to message #411821] |
Wed, 08 July 2009 04:29 |
suman.g
Messages: 89 Registered: June 2009
|
Member |
|
|
Yes Thomas, I can set the NLS_LANGUAGE to English but sometime it doesn't display German characters properly.
Actaully I am getting the request id based on the languages using code below:
XML_REP_REQUEST=`CONCSUB "$LOGIN" "SQLAP" "$RESP_NAME" "$USRNM" WAIT="Y" "CONCURRENT" "APPL_SHORT_NAME"
"CP_SHORT_NAME"`
echo Report Request: $XML_REP_REQUEST
echo "${XML_REP_REQUEST}" | grep "Submitted" >/dev/null 2>&1
if [ "$?" -eq "0" ]; then
XML_REP_REQUEST_ID=`echo $XML_REP_REQUEST |tr -s " "| cut -d" " -f3`
else
XML_REP_REQUEST_ID=`echo $XML_REP_REQUEST |tr -s " "| cut -d" " -f2|tr -d '"'`
fi
echo Report Request id: $XML_REP_REQUEST_ID
Thanks & Regards,
Suman
|
|
|
|
|
|
|
Re: Shell script is erring out with NLS [message #579495 is a reply to message #412544] |
Tue, 12 March 2013 12:14 |
|
avinashkumar
Messages: 2 Registered: March 2013 Location: Hyderabad
|
Junior Member |
|
|
Hi Friends,
I am facing the same issue while extracting the request id in Japanese Language.
However below code is working fine for English Language.
The Value of test_prog is
English Lang : = Submitted request 457758 for CONCURRENT XXTST XXTST_CUST_ERROR_REP
XML_PUB_REQUEST_ID=`echo $aa |tr -s " " | cut -d" " -f3`
The is extracting Value 457758 correctly.
The Value of test_prog is
Japanese Lang : = CONCURRENT XXTST XXTST_CUST_ERROR_REP の要求 457770 が発行されました。
Please help to get the Request Id for the Japanese Language without hard coding .
I have an idea can we extract only numerical value from string ..? However the string contain only one numerical value(Request Id) ...!
Please help to provide the correct solution ....
Regards,
Avinash Kumar
[Updated on: Tue, 12 March 2013 12:25] Report message to a moderator
|
|
|
Re: Shell script is erring out with NLS [message #579904 is a reply to message #579495] |
Sun, 17 March 2013 02:32 |
|
avinashkumar
Messages: 2 Registered: March 2013 Location: Hyderabad
|
Junior Member |
|
|
Hi Friends
Below Solution Can be solved AS Follows.
My Problem has resolved as per below solution .
Solution by Sanjeeva
English Lang =
echo "Submitted request 457758 for CONCURRENT XXCBS XXCBS_CUST_ERROR_REP " | tr -cd [:digit:]
Ans Is : 457758
Japanese Lang =
echo "CONCURRENT XX XX_CUST_ERROR_REP の要求 457770 が発行されました。" | tr -cd [:digit:]
Ans Is = 457770
Thank You.
Regards,
Avinash Kumar
|
|
|