How to write a script in unix to get value from SQR?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to write a script in unix to get value from SQR?
# 1  
Old 07-13-2011
How to write a script in unix to get value from SQR?

hi this is naga,

i had created one SQR , but i didnt include the code to get the notification(failure or success ) thats way every time its returning the status=0 SQR was went to success(if it failed also), without touching the code of the SQR can any one help to write script in unix to get Failure or success notification if the process is failed or success..Smilie is it posible to write ? please let me know
# 2  
Old 07-13-2011
I don't know what a SQR is but any program/script should be able to determine a reasonable exit code. If it can't do this, then there is a program/script error which should be fixed. This is improper coding.
And if the program/script itself doesn't know if it is working correct or not and can't tell this, how should another tool/program know better in a proper way?
# 3  
Old 07-13-2011
Hi nagavenkatesh,

You are using SQR with sybase? Can you post what you have, I might be able to help.
# 4  
Old 07-14-2011
hi purdym,

i am using SQR(Structured query report) to pull the data from file to mydatabase, but in that need to get the notification if its failure to run the SQR then failed otherwise success success, but my code always returning the success.. if input file is not there also it seems success..can you help on this ..
if you want will share my code with you
# 5  
Old 07-14-2011
Here is the issue: the SQR program itself it not failing: therefore zero return code.

Your script is failing. You need to test for the failure conditions and have your script output an appropriate message.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Running an SQR from shell script

Hi, I am trying to run an SQR from unix shell script. but the SQr errored out with the following message SQR (1201) Cannot open argument file (2) No such file. Can anybody help me ragrding this. I m using this to run the SQR. $2 is the sqr name and $3 is the parameter file name. sqrun... (1 Reply)
Discussion started by: Aswathy88
1 Replies

2. Shell Programming and Scripting

Need a UNIX/perl script to read and write the data

Hi, I have on Designdocument in that information is stored with in tabular format.I need Perl/unix script to read and write the data using perl script? Regards, Ravi (4 Replies)
Discussion started by: toravi.pentaho
4 Replies

3. Shell Programming and Scripting

How to write text file data to excel using UNIX shell script?

Hi All, I have the requirement in unix shell script. I want to write the "ls -ltr" command out put to excel file as below. Input :text file data : drwxr-xr-x 5 root root 4096 Oct 2 12:26 drwxr-xr-x 2 apx aim 4096 Nov 29 18:40 drwxr-xr-x 5 root root 4096 Oct 2 12:26 drwxr-xr-x... (10 Replies)
Discussion started by: Balasankar
10 Replies

4. Shell Programming and Scripting

Need to write a script to reformat a file in unix but not familiar with unix

unix script must do the fiollowing open a file containing comma delimited records > each record contains 10 fields > removes the 2nd field and use that same field containing fields 2 to 10 the original record after fprocessing should containing fields 1 and 3 a new erecord must be... (10 Replies)
Discussion started by: dwightja
10 Replies

5. Shell Programming and Scripting

How to write a script by using unix commands to down any server

Hi, I need to do frequently server down and up. Every time i am using nearly 5 to 6 commands to down and agin i am using the commands to up. Can anybody help me to write a script to down and up. which i can use once on unix platform it can down later it can up the server. (1 Reply)
Discussion started by: sreerao
1 Replies

6. UNIX for Dummies Questions & Answers

How to write a script by fork() in unix

Hello to UNIX Champs, Can any body help me out to write the script using fork() thru shell scripting.....i am a layman to fork(), so please give me the link or any scripts which will help me out to know the details about fork. (1 Reply)
Discussion started by: manas_ranjan
1 Replies

7. Shell Programming and Scripting

how to write examination(multiple choice) script in unix

Hi, I am unable to get idea, how to write the script like multiple choice exam model script , how to specify the welcome to the exam(name) and if he select option then it has to enter into the exam , then choosing the answers,next question and going to previous question. Thanks & Regards ... (0 Replies)
Discussion started by: palreddy7
0 Replies

8. UNIX for Advanced & Expert Users

Passing values from SQR to UNIX

UNIX script running a SQR program.... no problem passing values to SQR program... trying to pass values back to UNIX.... I'm currently creating a file from the SQR program and then using the Unix READ command to read the file and retrieve the value.... Is there an easier way to pass the... (2 Replies)
Discussion started by: seeuinoz
2 Replies

9. UNIX for Dummies Questions & Answers

SQR to UNIX

UNIX script running a SQR program.... passing values to SQR program... trying to pass values back to UNIX.... I'm currently creating a file from the SQR program and then using the Unix READ command to read the file and retrieve the value.... Is there an easier way to pass the values back from... (0 Replies)
Discussion started by: seeuinoz
0 Replies

10. UNIX for Dummies Questions & Answers

Changing persmissions for output file in UNIX box with SQR.

I am trying to change permissions on an output file from an sqr. The file is pushed out into a directory on the unix box. I am using the following code in the sqr to accomplish this. if $OUTPUT <> '' let $unix_call = 'chmod 664 '||$OUTPUT show $unix_call CALL SYSTEM Using... (1 Reply)
Discussion started by: evengetsteven
1 Replies
Login or Register to Ask a Question