[Date Prev][Date Next][Thread Prev][Thread Next]
[Author Index] [Date Index] [Thread Index]
[SQR-USERS Info] [SQRUG Home Page]

RE: [sqr-users] facing problem while running unix command from sqr



Here's a simple example of how I've used "call system:"

! First, set up Unix command as a variable
LET $unix_cmd = '$BANNER_HOME/local/gzpspin.shl $UID $PSWD '||$run_seq_no||'
GZPSPIN'
 
! Now run that command
CALL SYSTEM USING $unix_cmd #status
 
! Handle error
IF not #status = 0
   SHOW {JOBNAME} ' ended in error:'
   SHOW 'Errors exist in gzpspin'
   STOP
END-IF

And a more complex unix_cmd:

! Mail email setup data
IF $who='P'
  STRING 'Email setup data for popsel ' $pop_id by '' into $email_subject
ELSE
  STRING 'Email setup data for ' $faculty_term ' faculty' by '' into
$email_subject
END-IF
STRING '/usr/bin/uuencode' $textfile_name 'gzpemsu.txt | mailx -s"'
$email_subject '"' $email_to by ' ' into $unix_cmd
CALL SYSTEM using $unix_cmd #status


Hope it helps!  You'll obviously need to have your correct unix command (rm,
mv).  But maybe you can use the variable $unix_cmd to set up the actual
filename using timestamp.

Mrs. Penny M. Ginn
Associate Director of Information Technology
Presbyterian College
Clinton, SC  29325   864-833-8212 



-----Original Message-----
From: sqr-users-bounces+pmginn=presby.edu@sqrug.org
[mailto:sqr-users-bounces+pmginn=presby.edu@sqrug.org] On Behalf Of
Rahul_Kumar@adp.com
Sent: Thursday, December 14, 2006 3:44 AM
To: sqr-users@sqrug.org
Subject: [sqr-users] facing problem while running unix command from sqr

Hi,

I am trying to use unix commands in sqr procedure using call system
command....and I hav to del ,rename extension  name  of files whose names
are dynamic(they have timestamp attached to their name) and I don't know I
tried using mv *.bak1 *.bak2 but it didn't worked also I don't know that the
file I am deleting/renaming exists or not but using unix commands for it 

Can anyone resolve this issue....its a urgent one...pls reply

Thankx in advance

Rahul Kumar

AAHC-ACS

-- No trees were killed in the sending of this message. However a large
number of electrons were terribly inconvenienced.

 



-----------------------------------------
This message and any attachments are intended only for the use of
the addressee and may contain information that is privileged and
confidential. If the reader of the message is not the intended
recipient or an authorized representative of the intended
recipient, you are hereby notified that any dissemination of this
communication is strictly prohibited. If you have received this
communication in error, notify the sender immediately by return
email and delete the message and any attachments from your system.

_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users


_______________________________________________
sqr-users mailing list
sqr-users@sqrug.org
http://www.sqrug.org/mailman/listinfo/sqr-users