Home » Infrastructure » Unix » Shell script is erring out with NLS
Shell script is erring out with NLS [message #411821] Tue, 07 July 2009 00:56 Go to next message
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 #411835 is a reply to message #411821] Tue, 07 July 2009 02:03 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Don't pass "$RESP_NAME" to the script.
Try passing responsibility_id and get the responsibility_name in the script like before.

By
Vamsi
Re: How to get Responsibility name in shell script. [message #411840 is a reply to message #411821] Tue, 07 July 2009 02:29 Go to previous messageGo to next message
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: How to get Responsibility name in shell script. [message #411853 is a reply to message #411840] Tue, 07 July 2009 02:52 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
I understand that.
What CONCSUB is doing with that RESP_NAME parameter?
I suspect your executable, CONCSUB is not able to handle the nls value.
Post the code of CONCSUB.

By
Vamsi
Re: Shell script is erring out with NLS [message #411859 is a reply to message #411821] Tue, 07 July 2009 03:32 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 Go to previous messageGo to next message
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 #411883 is a reply to message #411821] Tue, 07 July 2009 04:19 Go to previous messageGo to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
hi,
yes..here is the problem....
your current logic not working here.....

u need to develop a new logic......
as CONCURRENT word is common in both output string.....need to retrieve conc_request_id based on this word.

thanks
dpk
Re: Shell script is erring out with NLS [message #411969 is a reply to message #411821] Tue, 07 July 2009 06:24 Go to previous messageGo to next message
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 #412065 is a reply to message #411969] Tue, 07 July 2009 10:47 Go to previous messageGo to next message
vamsi kasina
Messages: 2112
Registered: October 2003
Location: Cincinnati, OH
Senior Member
Frankly speaking, this is not an Oracle question at all.
Anyway, you can rewrite your logic to print the log message something like
Quote:
Report Request: 4479624 request has been Submitted for CONCURRENT TEST_REPORT Normal completion.
Report Request id: 4479624
so that the translation won't change the place of the request_id.

If you are not satisfied with this, better search for a Unix forum rather than this forum.

By
Vamsi
Re: Shell script is erring out with NLS [message #412157 is a reply to message #411821] Wed, 08 July 2009 01:06 Go to previous messageGo to next message
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 #412182 is a reply to message #411821] Wed, 08 July 2009 02:32 Go to previous messageGo to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
hi,
use this
XML_PUB_REQUEST_ID=`echo $XML_PUB_REQUEST |tr -s " "| cut -d" " -f2|tr -d '"'`

let me know that this working correctly for English language also or for German only.

Thanks
dpk
Re: Shell script is erring out with NLS [message #412195 is a reply to message #412182] Wed, 08 July 2009 03:41 Go to previous messageGo to next message
suman.g
Messages: 89
Registered: June 2009
Member
Hi Deepak,

Thanks, it's working with solution suggested by you.I had used double quotes (") instead of single quotes (') Sad.

One more solution I got is
XML_PUB_REQUEST_ID=`echo $XML_PUB_REQUEST |tr -s " "|cut -d" " -f2|sed s/\"//g`

Many thanks,
Suman
Re: Shell script is erring out with NLS [message #412199 is a reply to message #411821] Wed, 08 July 2009 03:51 Go to previous messageGo to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Hi,
yup...both r fine....
But i think these solutions are static (for German language) only.
You need a second approach for English language.

thanks
dpk
Re: Shell script is erring out with NLS [message #412206 is a reply to message #412199] Wed, 08 July 2009 04:00 Go to previous messageGo to next message
ThomasG
Messages: 3212
Registered: April 2005
Location: Heilbronn, Germany
Senior Member
Why don't you just set NLS_LANG to English in the script, so that CONCSUB will always run in English?

Re: Shell script is erring out with NLS [message #412218 is a reply to message #411821] Wed, 08 July 2009 04:29 Go to previous messageGo to next message
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 #412242 is a reply to message #411821] Wed, 08 July 2009 06:11 Go to previous messageGo to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Hi,
try this...

XML_PUB_REQUEST_ID=`echo $XML_PUB_REQUEST |tr -cd ':digit:'|tr -d '"'`

No if-else condition required..

thanks
dpk
Re: Shell script is erring out with NLS [message #412276 is a reply to message #411821] Wed, 08 July 2009 07:52 Go to previous messageGo to next message
suman.g
Messages: 89
Registered: June 2009
Member
Hi Deepak,

Output is coming like:
Report Request: Submitted request 4479990 for CONCURRENT XXAUB XXAUB_ACCON_HR_IF_REP Normal completion
Report Request id: ittdtti --instead of 4479990
Please check!!

Regards,
Suman
Re: Shell script is erring out with NLS [message #412366 is a reply to message #411821] Wed, 08 July 2009 23:33 Go to previous messageGo to next message
kecd_deepak
Messages: 52
Registered: December 2007
Member
Hi..
may be due to some other issue...

Its working fine 4 me...

thanks
dpk
icon14.gif  Re: Shell script is erring out with NLS [message #412544 is a reply to message #411821] Thu, 09 July 2009 22:54 Go to previous messageGo to next message
suman.g
Messages: 89
Registered: June 2009
Member
Hi All,

My program is working without any errors and warnings...

Thanks a lot Vamsi Sir, Deepak and others who have given their valuable suggestions.

You all are doing very good job.
I have learnt many things till now and hoping same for future.

Thank you all.

Suman





Re: Shell script is erring out with NLS [message #579495 is a reply to message #412544] Tue, 12 March 2013 12:14 Go to previous messageGo to next message
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 Go to previous message
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
Previous Topic: Privilege Delegation problem
Next Topic: Can I delete *.trc / *.trm files.
Goto Forum:
  


Current Time: Sat Nov 23 18:09:50 CST 2024