Tst scripts
where can i get test script writing and execution for GL,AP,AR Modules
To use that syntax (expdp /) you have to configure an Oracle user "identified externally"
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_8003.htm#i2065278
http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14200/statements_8003.htm#i2094003
See this example on my test machine : db102 DB has an external user, while test DB hasn't :
[ora102 work db102]$ export ORACLE_SID=db102
[ora102 work db102]$ expdp /
Export: Release 10.2.0.1.0 - Production on Friday, 03 November, 2006 11:13:07
Copyright (c) 2003, 2005, Oracle. All rights reserved.
Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production
With the Partitioning, OLAP and Data Mining options
[ora102 work db102]$ export ORACLE_SID=test
[ora102 work test]$ expdp /
Export: Release 10.2.0.1.0 - Production on Friday, 03 November, 2006 11:13:24
Copyright (c) 2003, 2005, Oracle. All rights reserved.
UDE-00008: operation generated ORACLE error 1017
ORA-01017: invalid username/password; logon denied
Username:
Similar Messages
-
How I run a shell script from the scheduler on 10.2.0.2.0 ?
Hello Oracle People,
I'd like to run a shell script from the Scheduler in my 10g database.
Right now it is a simple shell script.
Eventually it will wrap RMAN commands to back up my DB.
I wrote a simple pl/sql script to create a job:
-- cr_job10.sql
BEGIN
DBMS_SCHEDULER.CREATE_JOB (
job_name => 'my_backup_job',
job_type => 'EXECUTABLE',
job_action => '/h/oracle/scripts/tst.sh',
start_date => '06-SEP-07 5.33.00PM US/Pacific',
repeat_interval => 'FREQ=DAILY',
end_date => '08-SEP-07 4.00.00PM US/Pacific',
enabled => TRUE,
comments => 'My Backup Job');
END;
I see no errors when I run the above procedure.
I checked DBA_SCHEDULER_JOBS and the job is in there.
The scheduler, though, errors out with an error which I see in a trace file:
/h/oracle/admin/orcl/bdump/orcl_j000_22396.trc
Oracle Database 10g Enterprise Edition Release 10.2.0.2.0 - Production
With the Partitioning, OLAP and Data Mining options
ORACLE_HOME = /h/oracle/product/10r2
System name: SunOS
Node name: sol
Release: 5.10
Version: Generic_118855-14
Machine: i86pc
Instance name: orcl
Redo thread mounted by this instance: 1
Oracle process number: 15
Unix process pid: 22396, image: oracle@sol (J000)
*** ACTION NAME:(MY_BACKUP_JOB) 2007-09-06 17:33:00.175
*** MODULE NAME:(DBMS_SCHEDULER) 2007-09-06 17:33:00.175
*** SERVICE NAME:(SYS$USERS) 2007-09-06 17:33:00.175
*** CLIENT ID:() 2007-09-06 17:33:00.175
*** SESSION ID:(140.13520) 2007-09-06 17:33:00.175
*** 2007-09-06 17:33:00.175
ORA-12012: error on auto execute of job 53267
ORA-27369: job of type EXECUTABLE failed with exit code: 274662
I googled on this:
ORA-27369: job of type EXECUTABLE failed with exit code: 274662
Google returned only 1 hit.
There, I see some evidence that I need to configure something inside
of Oracle to run shell scripts from the scheduler, but possibly just
for machines running windows. I'm running Solaris.
Do any of you know what I need to configure inside of Oracle to
run shell scripts from the scheduler?
-OwenHello people,
I should have added this bit of information:
"The script runs fine from oracle's crontab."
"The script runs fine from a shell owned by oracle."
I'm getting responses telling me to check my env variables and permissions
which would be helpful to a UNIX novice.
I have a feeling that no one is using the scheduler to run RMAN scripts.
Tim Hall suggested I take a close look at these files:
$ORACLE_HOME/rdbms/admin/externaljob.ora
$ORACLE_HOME/bin/extJob
Currently I'm setup like this:
bash sol root /h/oracle/product/10r2/bin 31 #
bash sol root /h/oracle/product/10r2/bin 31 # ll $ORACLE_HOME/rdbms/admin/externaljob.ora
-rw-r--r-- 1 root dba 52 Sep 7 15:29 /h/oracle/product/10r2/rdbms/admin/externaljob.ora
bash sol root /h/oracle/product/10r2/bin 32 #
bash sol root /h/oracle/product/10r2/bin 32 # cat $ORACLE_HOME/rdbms/admin/externaljob.ora
# externaljob.ora
run_user = rman
run_group = rman
bash sol root /h/oracle/product/10r2/bin 33 #
bash sol root /h/oracle/product/10r2/bin 33 #
bash sol root /h/oracle/product/10r2/bin 33 #
bash sol root /h/oracle/product/10r2/bin 33 # ll $ORACLE_HOME/bin/ext*
-rwsr-x--- 1 rman dba 30388 Sep 21 2006 /h/oracle/product/10r2/bin/extjob*
-rwsr-x--- 1 rman dba 30392 Sep 21 2006 /h/oracle/product/10r2/bin/extjobo*
-rwsr-x--- 1 rman dba 34468 Sep 21 2006 /h/oracle/product/10r2/bin/extproc*
-rwxr-xr-x 1 oracle dba 300 Sep 21 2006 /h/oracle/product/10r2/bin/extusrupgrade*
bash sol root /h/oracle/product/10r2/bin 34 #
bash sol root /h/oracle/product/10r2/bin 34 #
bash sol root /h/oracle/product/10r2/bin 34 #
On my system, the user 'nobody' has no shell so I cannot use nobody.
I created a user named rman:
bash sol root /h/oracle/product/10r2/bin 34 #
bash sol root /h/oracle/product/10r2/bin 34 #
bash sol root /h/oracle/product/10r2/bin 34 # su - rman
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$
$ id
uid=220(rman) gid=220(rman)
$
$
$ date
Fri Sep 7 16:30:03 PDT 2007
$
$
Jared points out that rman needs access to extproc:
$ ls -la /h/oracle/product/10r2/bin/extproc
-rwsr-x--- 1 rman dba 34468 Sep 21 2006 /h/oracle/product/10r2/bin/extproc
$
$
Here is a demo of rman running his script:
bash sol root /h/oracle/product/10r2/bin 35 # su - rman
Sun Microsystems Inc. SunOS 5.10 Generic January 2005
$
$
$ ls
scripts
$
$
$ scripts/tst.sh
$
$
$ cat scripts/tst.sh
#! /bin/sh
/usr/bin/date > /tmp/tst.sh.out.txt 2>&1 &
exit 0
$
$
$ cat /tmp/tst.sh.out.txt
Fri Sep 7 16:31:23 PDT 2007
$
$ rm /tmp/tst.sh.out.txt
$
I am focused on this error:
ORA-27369: job of type EXECUTABLE failed with exit code: 274662
And I am focused on this exit code: 274662
What does 274662 mean?
If the Scheduler gives me an error like "274662" rather than some English,
it's obvious to me the Scheduler is a POS and I should not use it.
And of course,
If I cannot run RMAN from Oracle Scheduler, I'll use cron.
-Owen -
How to send Smartform and Script in email?
hi myself Devendra,
i ve some queries....regarding the Script and Smartform.
1- Can any body tell me how to send Script as well as Smartform layout in mail output.
I ve created script and smartform for the PO confirmation.
2- If i want to send both script and smartform layout of the PO, whenever created,automatically to the Vendor,then what i ve to do.Hey,
REPORT zemail_gm.
*********Variable Declarations *****************************
DATA: gv_form_name TYPE rs38l_fnam, " Used to store the function module generated by Smartform
gv_bin_filesize TYPE i, " Store the file size
gv_pos TYPE i,
gv_len TYPE i,
gv_tab_lines TYPE i.
********Constants *******************************************
Data : gc_text(11) type c value 'Form Output',
gc_tst(3) type c value 'TST',
gc_testing(7) type c value 'Testing'.
*********Work Area Declarations *****************************
DATA: gs_docdata TYPE sodocchgi1, " Data of an object which can be changed
gs_ctrlop TYPE ssfctrlop, " Smart Forms: Control structure
gs_outopt TYPE ssfcompop, " SAP Smart Forms: Smart Composer (transfer) options
gs_otfdata TYPE ssfcrescl, " Smart Forms: Return value at end of form printing
gs_reclist TYPE somlreci1, " SAPoffice: Structure of the API Recipient List
gs_pdf_tab TYPE tline, " Workarea for SAP Script Text Lines
gs_objbin TYPE solisti1, " SAPoffice: Single List with Column Length 255
gs_objpack TYPE sopcklsti1. " SAPoffice: Description of Imported Object Components
*********Internal tables Declarations *****************************
DATA: gt_reclist TYPE TABLE OF somlreci1, " SAPoffice: Structure of the API Recipient List
gt_pdf_tab TYPE TABLE OF tline, " SAPscript: Text Lines
gt_otf TYPE TABLE OF itcoo, " OTF Structure
gt_objbin TYPE TABLE OF solisti1, " SAPoffice: Single List with Column Length 255
gt_objpack TYPE TABLE OF sopcklsti1. " SAPoffice: Description of Imported Object Components
CLEAR : gv_form_name,
gs_ctrlop,
gs_outopt,
gs_otfdata,
gv_bin_filesize,
gv_pos,
gv_len,
gv_tab_lines.
START-OF-SELECTION.
Generate Function Module name
CALL FUNCTION 'SSF_FUNCTION_MODULE_NAME'
EXPORTING
formname = 'ZPDF_G'
IMPORTING
fm_name = gv_form_name
EXCEPTIONS
no_form = 1
no_function_module = 2
OTHERS = 3.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Assigning values to Form Control Structure and Form Composer
gs_ctrlop-getotf = 'X'.
gs_ctrlop-no_dialog = 'X'.
gs_outopt-tdnoprev = 'X'.
Getting the OTFDATA
CALL FUNCTION gv_form_name
EXPORTING
control_parameters = gs_ctrlop
output_options = gs_outopt
user_settings = 'X'
IMPORTING
job_output_info = gs_otfdata
EXCEPTIONS
formatting_error = 1
internal_error = 2
send_error = 3
user_canceled = 4
OTHERS = 5.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Assigning the OTFDATA to OTF Structure table
CLEAR gt_otf.
gt_otf] = gs_otfdata-otfdata[.
Convert the OTF DATA to SAP Script Text lines
CLEAR gt_pdf_tab.
CALL FUNCTION 'CONVERT_OTF'
EXPORTING
format = 'PDF'
max_linewidth = 132
IMPORTING
bin_filesize = gv_bin_filesize
TABLES
otf = gt_otf
lines = gt_pdf_tab
EXCEPTIONS
err_max_linewidth = 1
err_format = 2
err_conv_not_possible = 3
OTHERS = 4.
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ENDIF.
Assigning the Description of the object sent in the mail
CLEAR gs_docdata.
gs_docdata-obj_name = gc_tst.
gs_docdata-obj_descr = gc_testing.
Assigning the email id to Structure of the API Recipient List table
CLEAR : gt_reclist, gs_reclist.
gs_reclist-receiver = '<give the mail id of the receiver'.
gs_reclist-rec_type = 'U'.
APPEND gs_reclist TO gt_reclist.
Passing the SAP Script text lines to SAPoffice: Single List with Column Length 255 table
CLEAR : gs_objbin, gs_pdf_tab.
LOOP AT gt_pdf_tab INTO gs_pdf_tab.
gv_pos = 255 - gv_len.
IF gv_pos > 134. "length of pdf_table
gv_pos = 134.
ENDIF.
gs_objbin+gv_len = gs_pdf_tab(gv_pos).
gv_len = gv_len + gv_pos.
IF gv_len = 255. "length of out (contents_bin)
APPEND gs_objbin TO gt_objbin.
CLEAR: gs_objbin, gv_len.
IF gv_pos < 134.
gs_objbin = gs_pdf_tab+gv_pos.
gv_len = 134 - gv_pos.
ENDIF.
ENDIF.
ENDLOOP.
IF gv_len > 0.
APPEND gs_objbin TO gt_objbin.
ENDIF.
Filling the details in SAPoffice: Description of Imported Object Components table
DESCRIBE TABLE gt_objbin LINES gv_tab_lines.
CLEAR gs_objbin.
READ TABLE gt_objbin INTO gs_objbin INDEX gv_tab_lines.
IF sy-subrc = 0.
gs_objpack-doc_size = ( gv_tab_lines - 1 ) * 255 + STRLEN( gs_objbin ).
gs_objpack-transf_bin = 'X'.
gs_objpack-head_start = 1.
gs_objpack-head_num = 0.
gs_objpack-body_start = 1.
gs_objpack-body_num = gv_tab_lines.
gs_objpack-doc_type = 'PDF'.
gs_objpack-obj_name = 'ATTACHMENT'.
gs_objpack-obj_descr = 'test'.
APPEND gs_objpack TO gt_objpack.
ENDIF.
Sending the Form Output in the PDF format to email
CALL FUNCTION 'SO_NEW_DOCUMENT_ATT_SEND_API1'
EXPORTING
document_data = gs_docdata
put_in_outbox = 'X'
commit_work = 'X'
TABLES
packing_list = gt_objpack
contents_bin = gt_objbin
receivers = gt_reclist
EXCEPTIONS
too_many_receivers = 1
document_not_sent = 2
document_type_not_exist = 3
operation_no_authorization = 4
parameter_error = 5
x_error = 6
enqueue_error = 7
OTHERS = 8
IF sy-subrc 0.
MESSAGE ID sy-msgid TYPE sy-msgty NUMBER sy-msgno
WITH sy-msgv1 sy-msgv2 sy-msgv3 sy-msgv4.
ELSE.
WRITE 'Sent Successfully'.
ENDIF.
SUBMIT rsconn01
WITH mode EQ 'INT'
AND RETURN.
END-OF-SELECTION.Regards,
Midhun Abraham
Edited by: Midhun Abraham on Oct 12, 2008 4:06 AM -
Event registration using scripting
Hi
Has anyone been involved in the implementation of event registration using the scripting module?
If yes,please reply asap
rgds
NaveenAnother suggestion, the following VI is a wrapper for Traverse for GObjects VI and allows you to specify the name of the object you want. I always use this VI, I never use the Open VI Object Reference function, for the reasons tst mentioned:
vi.lib\Utility\traverseref.llb\TRef Find Object By Label.vi
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman -
Add event cases to an event structure using scripting
Hello,
Iam trying to (using scripting) update an event structure (add event cases) on a vi that is not on memory.
i get error 1054 The specified object was not found.
here is a picture of it.
any help in this will be greatly apreaciated.
Solved!
Go to Solution.Another suggestion, the following VI is a wrapper for Traverse for GObjects VI and allows you to specify the name of the object you want. I always use this VI, I never use the Open VI Object Reference function, for the reasons tst mentioned:
vi.lib\Utility\traverseref.llb\TRef Find Object By Label.vi
Darren Nattinger, CLA
LabVIEW Artisan and Nugget Penman -
Unix script error while mail the pdf file.
Hi all,
I want to do a mail in pdf format via a unix script. for that i used the following query:
# Verplichte variabelen
inputname="dago130r.rdf"
outputname="$DATOUT/dago130rDC.pdf"
mailto="$MAIL_INKOOP_DC"
subject="Opgeloste PV's per Category Manager"
params="p_datum_1='08-08-2006' p_ind_dc_of_rz='D'"
# Opgeloste PV's per Category Manager
# Start script.
# Vanaf hier hoeft in principe niets gewijzigd te worden.
mymail () {
local tmp=$DATTMP/$$.txt
cat "$mailbody" > $tmp 2>/dev/null
do_unix "uuencode $outputname $(basename $outputname) >> $tmp"
check_success
do_unix "mailx -s '$subject' -c '$mailcc' -r '$replyto' '$mailto' < $tmp"
check_success
header
perform "$inputname R DESFORMAT=PDF DESTYPE=FILE DESNAME=$outputname $params"
check_success exit
mymail
footer
exit_check "$total_success"
When i execute this query it will make the pdf file in the output folder as well as in the tmp folder as a text file. but after that it will give me error in the log file as follows.:
09/08/06-11:13:19 [ 25178] -- perform: Successful completion of dago130r.rdf R DESFORMAT=PDF DESTYPE=FILE DESNAME=/appl/tst/ah01/dago/dat/out/dago130rDC.pdf p_datum_1='08-08-2006' p_ind_dc_of_rz='D'
09/08/06-11:13:19 [ 25178] -- do_unix: Successful completion of uuencode /appl/tst/ah01/dago/dat/out/dago130rDC.pdf dago130rDC.pdf >> /appl/tst/ah01/dago/dat/tmp/25178.txt
[ 25178] ,/appl/tst/ah01/dago/dat/tmp/25178.txt,: No such file or directory
[ 25178] "/appl/tst/ah01/dago/home/dead.letter" 1/1
[ 25178]
09/08/06-11:13:19 [ 25178] -- ERROR do_unix: mailx -s 'Opgeloste PV's per Category Manager' -c '' -r '' '[email protected]' < /appl/tst/ah01/dago/dat/tmp/25178.txt returned 1
09/08/06-11:13:19 [ 25178] --
I am not getting why this script not taking the file from the tmp folder and why this error comes??
please help me to go out of this problem.Hi Bhavik,
Please can you tell how you are executing this script. ?
./scritpname or sh scriptname
Can you try the script removing local while declaring the tmp variable ?
naghu -
Perl versus other "scripting" languages when doing string operations
I've been told that perl is a "scripting" language like the other languages mentioned in this forum.
If that's true, can these other languages handle the following spec as well as perl can? (See spec at end of this post.)
Or is perl stronger in string operations than the other scripting languages mentioned here?
Here's the spec:
1. I give your program a twenty-letter alphabet (any twenty letter alphabet)
For example:
ABCDEFGHIJKLMNOPQRST
2. I also give your program four groups (any four groups) of letters in this alphabet:
For example:
s: A,B,C,D,E
p: F,G,H,I,J
d: K,L,M,N,O
e: P,Q,R,S,T
3. I also give your program a sequence over the twenty-letter alphabet that I gave you in Step (1) above:
For example:
ABCDEFGHIJKLMNOPQRSTSRQPONMLKJIHGFEDCBA
4. Given this sequence,you search for pairs of adjacent letters (x,y) where X and y are from different groups (the groups defined in Step (2) above.)
Also, you return the results of this search by giving me back the following two strings:
ABCD(EF)GHI(JK)LMN(OP)QRSTSRQ(PO)NML(KJ)IHG(FE)DCBA
ABCD(sp)GHI(pd)LMN(de)QRSTSRQ(ed)NML(dp)IHG(ps)DCBA
5. Note: if I give you a sequence that contains "overlapping" ordered pairs like:
...EFK...
then you ignore the second ordered pair. That is, you return:
...(EF)KOK - here is the final stuff on the "C" side.
To execute the program, the command line is:
20let.exe file1.txt file2.txt file3.txt > fileout.txt
Below, I've provided:
a) source code 20let.c
b) sample input file1.txt
c) sample input file2.txt
d) sample input file3.txt
e) output fileout.txt generated from these input files.
As soon as Bill finishes the perl version of the source code, I'll post that also.
source code of 20let.c
// 20let.c5
#include <stdio.h>
#include <stdlib.h>
int T[333],A[99999],G[333],B[99999],C[99999],N[299999],P[99999];
int n1,n2,f,p,x1,x2,n,m,a,b,c,i,j,k,x,y,z;
int E[233][233];
FILE *file;
int substrings(int x1,int x2);
int main(int argc, char*argv[]) {
if(argc<3){
printf("\nusage:20let protein-file nucleotide-file pairs-include-file\n\n");
printf("marks amino-acid-pairs from different groups in protein-file\n");
printf("iff they are in the include-file\n");
exit(1);
//----------------define the groups G['I'] = 's', e.g.
x='s'; G['I']=x;G['M']=x;G['V']=x;G['A']=x;G['G']=x;
x='p'; G['F']=x;G['L']=x;G['P']=x;G['W']=x;G['W']=x;
x='d'; G['H']=x;G['Q']=x;G['D']=x;G['E']=x;G['E']=x;
x='t'; G['S']=x;G['T']=x;G['Y']=x;G['N']=x;G['C']=x;G['K']=x;G['R']=x;
//----------------the 4 bases T['a'] = 0 thru 3
for(x=0;x<222;x++)
T[x]=-999;
T['a']=0;T['c']=1;T['g']=2;T['t']=3;
T['A']=0;T['C']=1;T['G']=2;T['T']=3;
for(i=65;i<70;i++)G<i>='s';
for(i=70;i<75;i++)G<i>='p';
for(i=75;i<80;i++)G<i>='d';
for(i=80;i<85;i++)G<i>='t';
//---------------- read include-file file3 xxxyyy pairs E[x][y] of interest
f=0;
for(x=0;x<222;x++)
for(y=0;y<222;y++)
E[x][y]=0;
if((file=fopen(argv[3],"rb"))==NULL){
printf("\ncan't open exclude-file %s\n",argv[1]);exit(1);
mq1: if(feof(file))
goto mq3;
x=fgetc(file);y=fgetc(file);x=fgetc(file);
x=T[fgetc(file)]*16+T[fgetc(file)]*4+T[fgetc(file)];
y=T[fgetc(file)]*16+T[fgetc(file)]*4+T[fgetc(file)];
if(x<64 && x>=0 && y<64 && y>=0){
E[x][y]=1;
f++;
mq2: if(feof(file))
goto mq3;
a=fgetc(file);
if(a!=10)
goto mq2;
goto mq1;
mq3: fclose(file);
//------------------read amino-acid file file1 == P array
if((file=fopen(argv[1],"rb"))==NULL){
printf("\ncan't open file %s\n",argv[1]);exit(1);}
p=0;
m1p: if(feof(file))
goto m2p;
p++;
P[p]=fgetc(file);
if(G[P[p]]==0)
p--;
goto m1p;
m2p:;
fclose(file);
//------------------read nucleotide file file2 == N array
if((file=fopen(argv[2],"rb"))==NULL){
printf("\ncan't open file %s\n",argv[1]);exit(1);
n=0;
m1n: if(feof(file))
goto m2n;
n++;
N[n]=fgetc(file);
if(N[n]!='a' && N[n]!='c' && N[n]!='g' && N[n]!='t')
n--;
goto m1n;
m2n:;
fclose(file);
//for(i=1;i<=p;i++)printf("%c",P<i>);printf("\n");
//for(i=1;i<=n;i++)printf("%c",N<i>);printf("\n");
//printf("%i include-pairs %i nucleotides %i proteins\n",f,n,p);
//------------1st line------------------ B<i> = result
m=0;
for(i=1;i<=p;i++){
n1=T[N[i*3-2]]*16+T[N[i*3-1]]*4+T[N[i*3]];
n2=T[N[i*3+1]]*16+T[N[i*3+2]]*4+T[N[i*3+3]];
//printf("\ni=%i p=%i n1=%i n2=%i\n",i,p,n1,n2);
if(E[n1][n2]<1 || G[P<i>]==G[P[i+1]] /* || i==n */){
printf("%c",P<i>);
m++;
B[m]=P<i>;
goto m3;
printf("(%c%c)",P<i>,P[i+1]);
i++;
m++;
B[m]='(';
m++;
B[m]=P[i-1];
m++;
B[m]=P<i>;
m++;
B[m]=')';
//printf("(%c)%c",G[A<i>],G[A[i+1]]);i++;
m3:;
printf("\n");
//------------2nd line------------------ C<i> = result
m=0;
for(i=1;i<=p;i++){
n1=T[N[i*3-2]]*16+T[N[i*3-1]]*4+T[N[i*3]];
n2=T[N[i*3+1]]*16+T[N[i*3+2]]*4+T[N[i*3+3]];
if(E[n1][n2]<1 || G[P<i>]==G[P[i+1]] /* || i==n */){
printf("%c",P<i>);
m++;
C[m]=P<i>;
goto m4;
printf("(%c%c)",G[P<i>],G[P[i+1]]);
i++;
m++;
C[m]='(';
m++;
C[m]=G[P[i-1]];
m++;
C[m]=G[P<i>];
m++;
C[m]=')';
//printf("(%c)%c",G[A<i>],G[A[i+1]]);i++;
m4:;
printf("\n");
//for(i=1;i<=m;i++)printf("%c",B<i>);printf("\n");
//------------3rd line------------------ printf only
m=0;
for(i=1;i<=p;i++){
n1=T[N[i*3-2]]*16+T[N[i*3-1]]*4+T[N[i*3]];
n2=T[N[i*3+1]]*16+T[N[i*3+2]]*4+T[N[i*3+3]];
if(E[n1][n2]<1 || G[P<i>]==G[P[i+1]] /* || i==n */){
printf("%c%c%c",N[i*3-2],N[i*3-1],N[i*3]);
goto m33;
printf("(%c%c%c%c%c%c)",N[i*3-2],N[i*3-1],N[i*3],N[i*3+1],N[i*3+2],N[i*3+3]);
i++;
m33:;
printf("\n");
//--------------substrings------------
substrings(20,29);
substrings(30,39);
substrings(40,49);
substrings(50,59);
substrings(60,69);
return 0;
int substrings(int x1,int x2)
printf("\n");
printf("lengths %i - %i : \n",x1,x2);
for(i=1; i<p; i++)
for (j=i+x1; j<i+x2; j++) {
if (C<i>>95 && C[j]>95) { // if lc letter in line2
for(x=i;x<=j;x++)
printf("%c",C[x]);
printf("|");
for(x=i;x<=j;x++)
if(B[x]>44) // if not () in line 1
printf("%c",B[x]);
printf("|");
for(x=i;x<=j;x++)
if(C[x]>95) // if lc letter line2
printf("%c",C[x]);
printf("\n");}
input file1.txt
MKKHTDQPIADVQGSPDTRH
IAIDRVGIKAIRHPVLVADK
DGGSQHTVAQFNMYVNLPHN
FKGTHMSRFVEILNSHEREI
SVESFEEILRSMVSRLESDS
GHIEMTFPYFVNKSAPISGV
KSLLDYEVTFIGEIKHGDQY
GFTMKVIVPVTSLCPCSKKI
SDYGAHNQRSHVTISVHTNS
FVWIEDVIRIAEEQASCELF
GLLKRPDEKYVTEKAYNNPK
FVEDIVRDVAEILNHDDRID
AYVVESEBFESIHNHSAYAL
IERD
input file2.txt
atgaaaaaacatactgatcaacctatcgctgatgtgcagggctcaccggataccagacat
atcgcaattgacagagtcggaatcaaagcgattcgtcacccggttctggtcgccgataag
gatggtggttcccagcataccgtggcgcaatttaatatgtacgtcaatctgccacataat
ttcaaagggacgcatatgtcccgttttgtggagatactaaatagccacgaacgtgaaatt
tcggttgaatcatttgaagaaattttgcgctccatggtcagcaggctggaatcagattcc
ggccatattgaaatgacttttccctacttcgtcaataaatcagcccctatctcaggtgta
aaaagcttgctggattatgaggtaacctttatcggcgaaattaaacatggcgatcaatat
gggtttaccatgaaggtgatcgttcctgttaccagcctgtgcccctgctccaagaaaata
tccgattacggtgcgcataaccagcgttcacacgtcaccatttctgtacacactaacagc
ttcgtctggattgaggacgttatcagaattgcggaagaacaggcctcatgcgaactgttc
ggtctgctgaaacggccggatgaaaaatatgtcacagaaaaggcctataacaatccgaaa
tttgtcgaagatatcgtccgtgatgtcgccgaaatacttaatcatgatgaccggatagat
gcctatgttgttgaatcagaaaactttgaatccatacataatcactctgcatacgcactg
atagagcgcgac
input file3.txt
FA tttgcc
FA ttcgcc
FA tttgct
FA ttcgct
LK ttaaaa
LK ttgaaa
LK ttaaag
LK ttgaag
LS ctgctc
LS ctgctt
LS ctactc
LS ctactt
LT ctcacc
LT ctcact
LT cttacc
LT cttact
LY ctctac
LY ctctat
LY ctttac
LY ctttat
LG ctcggc
LG ctcggt
LG cttggc
LG cttggt
IP attccc
IP attcct
IP atcccc
IP atccct
IP attcca
IP attccg
IP atccca
IP atcccg
ML atgctc
ML atgctt
ML atgctc
ML atgctt
VL gtgctg
VL gtgcta
VL gtactg
VL gtacta
VS gtgtcc
VS gtatct
VS gtgtcc
VS gtatct
VT gtcacc
VT gtcact
VT gttacc
VT gttact
VS gtcagc
VS gtcagt
VS gttagc
VS gttagt
SL tcgctg
SL tcgcta
SL tcactg
SL tcacta
SP tctcca
SP tctccg
SP tcccca
SP tccccg
PV ccggtg
PV ccggta
PV ccagtg
PV ccagta
PG cccggc
PG cccggt
PG cctggc
PG cctggt
TL acgctg
TL acgcta
TL acactg
TL acacta
TP acgccg
TP acgcca
TP acaccg
TP acacca
AL gcttta
AL gctttg
AL gcctta
AL gccttg
AP gcgccg
AP gcgcca
AP gcaccg
AP gcacca
AP gctcca
AP gctccg
AP gcccca
AP gccccg
AN gctaat
AN gctaac
AN gccaat
AN gccaac
AS gccagc
AS gccagt
AS gctagc
AS gctagt
YP tatccg
YP tatcca
YP tacccg
YP taccca
HP catccg
HP catcca
HP cacccg
HP caccca
QR cagcga
QR cagcgg
QR caacga
QR caacgg
DL gatttg
DL gattta
DL gacttg
DL gactta
EN gaaaat
EN gaaaac
EN gagaat
EN gagaac
EK gaaaaa
EK gaaaag
EK gagaaa
EK gagaag
ER gagcga
ER gagcgg
ER gaacga
ER gaacgg
WR tggcga
WR tggcgg
RV cgggtg
RV cgggta
RV cgagtg
RV cgagta
RW cggtgg
RW cgatgg
SG agtgga
SG agtggg
SG agcgga
SG agcggg
GF ggtttt
GF ggtttc
GF ggcttt
GF ggcttc
GL gggctg
GL gggcta
GL ggactg
GL ggacta
GY gggtat
GY gggtac
GY ggatat
GY ggatac
GY ggttat
GY ggttac
GY ggctat
GY ggctac
GK ggaaaa
GK ggaaag
GK gggaaa
GK gggaag
GK ggcaag
GK ggcaaa
GK ggtaag
GK ggtaaa
GW ggctgg
GW ggttgg
GR gggcgg
GR gggcga
GR ggacgg
GR ggacga
GS ggcagc
GS ggcagt
GS ggtagc
GS ggtagt
output fileout.txt
MKKHTDQPIADVQGSPDTRHIAIDRVGIKAIR(HP)VLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSM(VS)RLESDSGHIEMTFPYFVNKSAPISGVKSLLDYEVTFIGEIKHGDQYGFTMKVIVP(VT)SLCPCSKKISDYGAHNQRSH(VT)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(EK)YVT(EK)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(EF)ESIHNHSAYALIERD
MKKHTDQPIADVQGSPDTRHIAIDRVGIKAIR(dp)VLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSM(st)RLESDSGHIEMTFPYFVNKSAPISGVKSLLDYEVTFIGEIKHGDQYGFTMKVIVP(st)SLCPCSKKISDYGAHNQRSH(st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt)YVT(dt)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(dp)ESIHNHSAYALIERD
atgaaaaaacatactgatcaacctatcgctgatgtgcagggctcaccggataccagacatatcgcaattgacagagtcggaatcaaagcgattcgt(cacccg)gttctggtcgccgataaggatggtggttcccagcataccgtggcgcaatttaatatgtacgtcaatctgccacataatttcaaagggacgcatatgtcccgttttgtggagatactaaatagccacgaacgtgaaatttcggttgaatcatttgaagaaattttgcgctccatg(gtcagc)aggctggaatcagattccggccatattgaaatgacttttccctacttcgtcaataaatcagcccctatctcaggtgtaaaaagcttgctggattatgaggtaacctttatcggcgaaattaaacatggcgatcaatatgggtttaccatgaaggtgatcgttcct(gttacc)agcctgtgcccctgctccaagaaaatatccgattacggtgcgcataaccagcgttcacac(gtcacc)atttctgtacacactaacagcttcgtctggattgaggacgttatcagaattgcggaagaacaggcctcatgcgaactgttcggtctgctgaaacggccggat(gaaaaa)tatgtcaca(gaaaag)gcctataacaatccgaaatttgtcgaagatatcgtccgtgatgtcgccgaaatacttaatcatgatgaccggatagatgcctatgttgttgaatca(gaaaac)tttgaatccatacataatcactctgcatacgcactgatagagcgc
lengths 20 - 29 :
st)SLCPCSKKISDYGAHNQRSH(s|VTSLCPCSKKISDYGAHNQRSHV|sts
st)SLCPCSKKISDYGAHNQRSH(st|VTSLCPCSKKISDYGAHNQRSHVT|stst
t)SLCPCSKKISDYGAHNQRSH(s|TSLCPCSKKISDYGAHNQRSHV|ts
t)SLCPCSKKISDYGAHNQRSH(st|TSLCPCSKKISDYGAHNQRSHVT|tst
lengths 30 - 39 :
st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(d|VTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDE|std
t)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(d|TISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDE|td
t)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt|TISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEK|tdt
dt)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(d|EKAYNNPKFVEDIVRDVAEILNHDDRIDAYVVESE|dtd
dt)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(dp|EKAYNNPKFVEDIVRDVAEILNHDDRIDAYVVESEF|dtdp
t)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(d|KAYNNPKFVEDIVRDVAEILNHDDRIDAYVVESE|td
t)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(dp|KAYNNPKFVEDIVRDVAEILNHDDRIDAYVVESEF|tdp
lengths 40 - 49 :
st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt)YVT(d|VTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEKYVTE|stdtd
st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt)YVT(dt|VTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEKYVTEK|stdtdt
t)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt)YVT(d|TISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEKYVTE|tdtd
t)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt)YVT(dt|TISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEKYVTEK|tdtdt
dt)YVT(dt)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(d|EKYVTEKAYNNPKFVEDIVRDVAEILNHDDRIDAYVVESE|dtdtd
dt)YVT(dt)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(dp|EKYVTEKAYNNPKFVEDIVRDVAEILNHDDRIDAYVVESEF|dtdtdp
t)YVT(dt)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(d|KYVTEKAYNNPKFVEDIVRDVAEILNHDDRIDAYVVESE|tdtd
t)YVT(dt)AYNNPKFVEDIVRDVAEILNHDDRIDAYVVES(dp|KYVTEKAYNNPKFVEDIVRDVAEILNHDDRIDAYVVESEF|tdtdp
lengths 50 - 59 :
t)RLESDSGHIEMTFPYFVNKSAPISGVKSLLDYEVTFIGEIKHGDQYGFTMKVIVP(s|SRLESDSGHIEMTFPYFVNKSAPISGVKSLLDYEVTFIGEIKHGDQYGFTMKVIVPV|ts
lengths 60 - 69 :
dp)VLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSM(s|HPVLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSMV|dps
dp)VLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSM(st|HPVLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSMVS|dpst
p)VLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSM(s|PVLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSMV|ps
p)VLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSM(st|PVLVADKDGGSQHTVAQFNMYVNLPHNFKGTHMSRFVEILNSHEREISVESFEEILRSMVS|pst
st)RLESDSGHIEMTFPYFVNKSAPISGVKSLLDYEVTFIGEIKHGDQYGFTMKVIVP(st|VSRLESDSGHIEMTFPYFVNKSAPISGVKSLLDYEVTFIGEIKHGDQYGFTMKVIVPVT|stst
st)SLCPCSKKISDYGAHNQRSH(st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(d|VTSLCPCSKKISDYGAHNQRSHVTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDE|ststd
st)SLCPCSKKISDYGAHNQRSH(st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt|VTSLCPCSKKISDYGAHNQRSHVTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEK|ststdt
t)SLCPCSKKISDYGAHNQRSH(st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(d|TSLCPCSKKISDYGAHNQRSHVTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDE|tstd
t)SLCPCSKKISDYGAHNQRSH(st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt|TSLCPCSKKISDYGAHNQRSHVTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEK|tstdt
t)SLCPCSKKISDYGAHNQRSH(st)ISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPD(dt)YVT(d|TSLCPCSKKISDYGAHNQRSHVTISVHTNSFVWIEDVIRIAEEQASCELFGLLKRPDEKYVTE|tstdtd
Edited by: David Halitsky on Mar 18, 2008 4:21 AM
Edited by: David Halitsky on Mar 18, 2008 4:22 AM -
Scripting Polymorphi​c VI
I have successfully created a script that creates a number of interop VIs to C# Classes and their methods (with a lot of help from tst & DFGray... Sev had a little in there too).
Now I need to create a script that will create the Polymorphic VI that will wrap all of those.
After I get the new polymorphic created, I want to turn on the "Show Selecttor by default", populate the menu name and selector name, but I can't seem to find the "Target Class" of "PolymorphicVI" to go from the Generic VI Reference to get to the more specific class and thus reveal the properties that I should then have available.
Any hints as to what the "path" is?
Thanks,
DanI think you might have two problems here -
Getting a list of the classes in the DLL (although I'm assuming there's some .NET code which can help with that, for instance - http://stackoverflow.com/questions/1315665/c-list-all-classes-in-assembly).
The class, if memory serves, is only represented as a string. If the .NET class is not already in the list (which I believe requires it to be registered in the GAC), it probably cannot be loaded using a path. Unless the constructor node has a special property or method for loading by path, you might have a problem.
Potential solutions:
Save a VI with only the node in it linked to a class. Then see if you can see the class path in the VI's binary data and replace it. This might or might not work.
Automate the browsing action with a program such as AutoIt and control that from LV for each of the classes. I have no idea if that's even possible.
Try to take over the world! -
Powershell: how to run vbs script with switches.
Background: To remove a specific service, I usually log into a server, go to path c$\Program files\HP... find a specific vbs, and run it using CMD.exe.
Now, I'm new to powershell, so I'm looking into automating this job. When I use CMD, I run cscript path\serviceinstall.vbs
-r.
How do I add cscript switches to powershell?
IF
((test-path -path "servername\C$\Program Files\...") -eq "true")
invoke-command -scriptblock ""servername\C$\Program Files\...\serviceinstall.vbs -r?1. You cannot run VBS as a scriptblock.
2. If youactually were to have read the full help ypu would have seen how to use the command.
3. Given you initial questin and the vague answers you gave there is nothing any could do to help you.
If you do not give accurate information you will not likely get answers that are helpful.
I recommend starting at the beginning and learning PowerShell basics. If you had done that you would know that a script block is not a quoted string with vbscript in it or the path to a file.
When working with any technology it is important to read the instructions carefully. It is also useful to knowhow to do basic research on the technology you are trying to learn.
There are 15 examples in PowerShell V2 for Invoke-Command. Here they are as captured directly from PowerShell V2. (The is no update-help on V2. All help is built in.)
-------------------------- EXAMPLE 1 --------------------------
C:\PS>invoke-command -filepath c:\scripts\test.ps1 -computerName Server01
Disks: C:, D:, E:
Status: Warning, Normal, Normal
Description
This command runs the Test.ps1 script on the Server01 computer.
The command uses the FilePath parameter to specify a script that is located on the local computer. The script runs
on the remote computer and the results are returned to the local computer.
-------------------------- EXAMPLE 2 --------------------------
C:\PS>invoke-command -computername server01 -credential domain01\user01 -scriptblock {get-culture}
Description
This command runs a Get-Culture command on the Server01 remote computer.
It uses the ComputerName parameter to specify the computer name and the Credential parameter to run the command in
the security context of "Domain01\User01," a user with permission to run commands. It uses the ScriptBlock paramete
r to specify the command to be run on the remote computer.
In response, Windows PowerShell displays a dialog box that requests the password and an authentication method for t
he User01 account. It then runs the command on the Server01 computer and returns the result.
-------------------------- EXAMPLE 3 --------------------------
C:\PS>$s = new-pssession -computername server02 -credential domain01\user01
C:\PS> invoke-command -session $s -scriptblock {get-culture}
Description
This example runs the same "Get-Culture" command in a session (a persistent connection) on the Server02 remote comp
uter. Typically, you create a session only when you are running a series of commands on the remote computer.
The first command uses the New-PSSession cmdlet to create a session on the Server02 remote computer. Then, it saves
the session in the $s variable.
The second command uses the Invoke-Command cmdlet to run the Get-Culture command on Server02. It uses the Session p
arameter to specify the session saved in the $s variable.
In response, Windows PowerShell runs the command in the session on the Server02 computer.
-------------------------- EXAMPLE 4 --------------------------
C:\PS>invoke-command -computername Server02 -scriptblock {$p = get-process powershell}
C:\PS> invoke-command -computername Server02 -scriptblock {$p.virtualmemorysize}
C:\PS>
C:\PS> $s = new-pssession -computername Server02
C:\PS> invoke-command -session $s -scriptblock {$p = get-process powershell}
C:\PS> invoke-command -session $s -scriptblock {$p.virtualmemorysize}
17930240
Description
This example compares the effects of using ComputerName and Session parameters of Invoke-Command. It shows how to u
se a session to run a series of commands that share the same data.
The first two commands use the ComputerName parameter of Invoke-Command to run commands on the Server02 remote comp
uter. The first command uses the Get-Process command to get the PowerShell process on the remote computer and to sa
ve it in the $p variable. The second command gets the value of the VirtualMemorySize property of the PowerShell pro
cess.
The first command succeeds. But, the second command fails because when you use the ComputerName parameter, Windows
PowerShell creates a connection just to run the command. Then, it closes the connection when the command is complet
e. The $p variable was created in one connection, but it does not exist in the connection created for the second co
mmand.
The problem is solved by creating a session (a persistent connection) on the remote computer and by running both of
the related commands in the same session.
The third command uses the New-PSSession cmdlet to create a session on the Server02 computer. Then it saves the ses
sion in the $s variable. The fourth and fifth commands repeat the series of commands used in the first set, but in
this case, the Invoke-Command command uses the Session parameter to run both of the commands in the same session.
In this case, because both commands run in the same session, the commands succeed, and the $p value remains active
in the $s session for later use.
-------------------------- EXAMPLE 5 --------------------------
C:\PS>$command = { get-eventlog -log "windows powershell" | where {$_.message -like "*certificate*"} }
C:\PS> invoke-command -computername S1, S2 -scriptblock $command
Description
This example shows how to enter a command that is saved in a local variable.
When the entire command is saved in a local variable, you can specify the variable as the value of the ScriptBlock
parameter. You do not have to use the "param" keyword or the ArgumentList variable to submit the value of the local
variable.
The first command saves a Get-Eventlog command in the $command variable. The command is formatted as a script block
The second command uses the Invoke-Command cmdlet to run the command in $command on the S1 and S2 remote computers.
-------------------------- EXAMPLE 6 --------------------------
C:\PS>invoke-command -computername server01, server02, TST-0143, localhost -configurationname MySession.PowerShell
-scriptblock {get-eventlog "windows powershell"}
Description
This example demonstrates how to use the Invoke-Command cmdlet to run a single command on multiple computers.
The command uses the ComputerName parameter to specify the computers. The computer names are presented in a comma-s
eparated list. The list of computers includes the "localhost" value, which represents the local computer.
The command uses the ConfigurationName parameter to specify an alternate session configuration for Windows PowerShe
ll and the ScriptBlock parameter to specify the command.
In this example, the command in the script block gets the events in the Windows PowerShell event log on each remote
computer.
-------------------------- EXAMPLE 7 --------------------------
C:\PS>$version = invoke-command -computername (get-content machines.txt) -scriptblock {(get-host).version}
Description
This command gets the version of the Windows PowerShell host running on 200 remote computers.
Because only one command is run, it is not necessary to create persistent connections (sessions) to each of the com
puters. Instead, the command uses the ComputerName parameter to indicate the computers.
The command uses the Invoke-Command cmdlet to run a Get-Host command. It uses dot notation to get the Version prope
rty of the Windows PowerShell host.
To specify the computers, it uses the Get-Content cmdlet to get the contents of the Machine.txt file, a file of com
puter names.
These commands run synchronously (one at a time). When the commands complete, the output of the commands from all o
f the computers is saved in the $version variable. The output includes the name of the computer from which the data
originated.
-------------------------- EXAMPLE 8 --------------------------
C:\PS>$s = new-pssession -computername Server01, Server02
C:\PS> invoke-command -session $s -scriptblock {get-eventlog system} -AsJob
Id Name State HasMoreData Location Command
1 Job1 Running True Server01,Server02 get-eventlog system
C:\PS> $j = Get-Job
C:\PS> $j | format-list -property *
HasMoreData : True
StatusMessage :
Location : Server01,Server02
Command : get-eventlog system
JobStateInfo : Running
Finished : System.Threading.ManualResetEvent
InstanceId : e124bb59-8cb2-498b-a0d2-2e07d4e030ca
Id : 1
Name : Job1
ChildJobs : {Job2, Job3}
Output : {}
Error : {}
Progress : {}
Verbose : {}
Debug : {}
Warning : {}
StateChanged :
C:\PS> $results = $j | Receive-Job
Description
These commands run a background job on two remote computers. Because the Invoke-Command command uses the AsJob para
meter, the commands run on the remote computers, but the job actually resides on the local computer and the results
are transmitted to the local computer.
The first command uses the New-PSSession cmdlet to create sessions on the Server01 and Server02 remote computers.
The second command uses the Invoke-Command cmdlet to run a background job in each of the sessions. The command uses
the AsJob parameter to run the command as a background job. This command returns a job object that contains two ch
ild job objects, one for each of the jobs run on the two remote computers.
The third command uses a Get-Job command to save the job object in the $j variable.
The fourth command uses a pipeline operator (|) to send the value of the $j variable to the Format-List cmdlet, whi
ch displays all properties of the job object in a list.
The fifth command gets the results of the jobs. It pipes the job object in $j to the Receive-Job cmdlet and stores
the results in the $results variable.
-------------------------- EXAMPLE 9 --------------------------
C:\PS>$MWFO-LOg = Microsoft-Windows-Forwarding/Operational
C:\PS> invoke-command -computername server01 -scriptblock {param($log, $num) get-eventlog -logname $log -newest $nu
m} -ArgumentList $MWFO-log, 10
Description
This example shows how to include the values of local variables in a command run on a remote computer.
The first command saves the name of the Microsoft-Windows-Forwarding/Operational event log in the $MWFO-Log variabl
e.
The second command uses the Invoke-Command cmdlet to run a Get-EventLog command on the Server01 remote computer tha
t gets the 10 newest events from the Microsoft-Windows-Forwarding/Operational event log on Server01.
This command uses the "param" keyword to create two variables, $log and $num, that are used as placeholders in the
Get-EventLog command. These placeholders have arbitrary names that do not need to match the names of the local vari
ables that supply their values.
The values of the ArgumentList parameter demonstrate the two different ways to specify values in the argument list.
The value of the $log placeholder is the $MFWO-Log variable, which is defined in the first command. The value of t
he $num variable is 10.
Before the command is sent to the remote computer, the variables are replaced with the specified values.
-------------------------- EXAMPLE 10 --------------------------
C:\PS>invoke-command -computername S1, S2 -scriptblock {get-process powershell}
PSComputerName Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
S1 575 15 45100 40988 200 4.68 1392 powershell
S2 777 14 35100 30988 150 3.68 67 powershell
C:\PS> invoke-command -computername S1, S2 -scriptblock {get-process powershell} -HideComputerName
Handles NPM(K) PM(K) WS(K) VM(M) CPU(s) Id ProcessName
575 15 45100 40988 200 4.68 1392 powershell
777 14 35100 30988 150 3.68 67 powershell
Description
This example shows the effect of using the HideComputerName parameter of Invoke-Command.
The first two commands use the Invoke-Command cmdlet to run a Get-Process command for the PowerShell process. The o
utput of the first command includes the PsComputerName property, which contains the name of the computer on which t
he command ran. The output of the second command, which uses the HideComputerName parameter, does not include the P
sComputerName column.
Using the HideComputerName parameter does not change the object. You can still use the Format cmdlets to display th
e PsComputerName property of any of the affected objects.
-------------------------- EXAMPLE 11 --------------------------
C:\PS>invoke-command -comp (get-content servers.txt) -filepath c:\scripts\sample.ps1 -argumentlist Process, Service
Description
This example uses the Invoke-Command cmdlet to run the Sample.ps1 script on all of the computers listed in the Serv
ers.txt file. The command uses the FilePath parameter to specify the script file. This command allows you to run th
e script on the remote computers, even if the script file is not accessible to the remote computers.
When you submit the command, the content of the Sample.ps1 file is copied into a script block and the script block
is run on each of the remote computers. This procedure is equivalent to using the ScriptBlock parameter to submit t
he contents of the script.
-------------------------- EXAMPLE 12 --------------------------
C:\PS>$LiveCred = Get-Credential
C:\PS> Invoke-Command -ConfigurationName Microsoft.Exchange `
-ConnectionUri https://ps.exchangelabs.com/powershell `
-Credential $LiveCred -Authentication Basic `
-scriptblock {Invoke-Command {Set-Mailbox dan -DisplayName "Dan Park"}
Description
This example shows how to run a command on a remote computer that is identified by a URI (Internet address). This p
articular example runs a Set-Mailbox command on a remote Exchange server. The backtick (`) in the command is the Wi
ndows PowerShell continuation character.
The first command uses the Get-Credential cmdlet to store Windows Live ID credentials in the $LiveCred variab the c
redentials dialog box appears, enter Windows Live ID credentials.
The second command uses the Invoke-Command cmdlet to run a Set-Mailbox command. The command uses the ConfigurationN
ame parameter to specify that the command should run in a session that uses the Microsoft.Exchange session configur
ation. The ConnectionURI parameter specifies the URL of the Exchange server endpoint.
The credential parameter specifies tle. Whenhe Windows Live credentials stored in the $LiveCred variable. The Authe
nticationMechanism parameter specifies the use of basic authentication. The ScriptBlock parameter specifies a scrip
t block that contains the command.
-------------------------- EXAMPLE 13 --------------------------
C:\PS>$max = New-PSSessionOption -MaximumRedirection 1
C:\PS> Invoke-Command -ConnectionUri https://ps.exchangelabs.com/powershell `
-scriptblock {Invoke-Command {Get-Mailbox dan} `
-AllowRedirection -SessionOption $max
Description
This command shows how to use the AllowRedirection and SessionOption parameters to manage URI redirection in a remo
te command.
The first command uses the New-PSSessionOption cmdlet to create a PSSessionOpption object that it saves in the $max
variable. The command uses the MaximumRedirection parameter to set the MaximumConnectionRedirectionCount property
of the PSSessionOption object to 1.
The second command uses the Invoke-Command cmdlet to run a Get-Mailbox command on a remote server running Microsoft
Exchange Server. The command uses the AllowRedirection parameter to provide explicit permission to redirect the co
nnection to an alternate endpoint. It also uses the SessionOption parameter to specify the session object in the $m
ax variable.
As a result, if the remote computer specified by the ConnectionURI parameter returns a redirection message, Windows
PowerShell will redirect the connection, but if the new destination returns another redirection message, the redir
ection count value of 1 is exceeded, and Invoke-Command returns a non-terminating error.
-------------------------- EXAMPLE 14 --------------------------
C:\PS>$so = New-PSSessionOption -SkipCACheck
PS C:\> invoke-command $s { get-hotfix } -SessionOption $so -credential server01\user01
Description
This example shows how to create and use a SessionOption parameter.
The first command uses the New-PSSessionOption cmdlet to create a session option. It saves the resulting SessionOpt
ion object in the $so parameter.
The second command uses the Invoke-Command cmdlet to run a Get-Hotfix command remotely. The value of the SessionOpt
ion parameter is the SessionOption object in the $so variable.
-------------------------- EXAMPLE 15 --------------------------
C:\PS>enable-wsmanCredSSP -delegate server02
C:\PS> connect-wsman Server02
C:\PS> set-item wsman:\server02*\service\auth\credSSP -value $true
C:\PS> $s = new-pssession server02
C:\PS> invoke-command -session $s -script {get-item \\Net03\Scripts\LogFiles.ps1} -authentication credssp -credenti
al domain01\admin01
Description
This example shows how to access a network share from within a remote session.
The command requires that CredSSP delegation be enabled in the client settings on the local computer and in the ser
vice settings on the remote computer. To run the commands in this example, you must be a member of the Administrato
rs group on the local computer and the remote computer.
The first command uses the Enable-WSManCredSSP cmdlet to enable CredSSP delegation from the Server01 local computer
to the Server02 remote computer. This configures the CredSSP client setting on the local computer.
The second command uses the Connect-WSman cmdlet to connect to the Server02 computer. This action adds a node for t
he Server02 computer to the WSMan: drive on the local computer, allowing you to view and change the WS-Management s
ettings on the Server02 computer.
The third command uses the Set-Item cmdlet to change the value of the CredSSP item in the Service node of the Serve
r02 computer to True. This action enables CredSSP in the service settings on the remote computer.
The fourth command uses the New-PSSession cmdlet to create a PSSession on the Server02 computer. It saves the PSSes
sion in the $s variable.
The fifth command uses the Invoke-Command cmdlet to run a Get-Item command in the session in $s that gets a script
from the Net03\Scripts network share. The command uses the Credential parameter and it uses the Authentication para
meter with a value of CredSSP.
I suggest spending som etime learning the basics. It will save you a lot of frustration in the future.
¯\_(ツ)_/¯ -
How to delete the members in one dimension use the maxl script
i have question that i want to delete the members in one dimension useing the maxl script, but i do not know how to do it. can the maxl delete the members in one dimension? if can, please provide an sample script, thank you so mcuh.
MaxL does not have commands to alter an outline directly, except the reset command which can delete all dimensions but not members selectively. The best you could do would be to run a rules file (import dimensions) using a file that contains the members you want to keepload rule for the dimension. As typical the warning is to test this first before you do it on a production database
-
Unable to capture the adf table column sort icons using open script tool
Hi All,
I am new to OATS and I am trying to create script for testing ADF application using open script tool. I face issues in recording two events.
1. I am unable to record the event of clicking adf table column sort icons that exist on the column header. I tried to use the capture tool, but that couldn't help me.
2. The second issue is I am unable to capture the panel header text. The component can be identified but I was not able to identify the supporting attribute for the header text.Hi keerthi,
1. I have pasted the code for the first issue
web
.button(
122,
"/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1824fhkchs_6']/web:form[@id='pt1:_UISform1' or @name='pt1:_UISform1' or @index='0']/web:button[@id='pt1:MA:0:n1:1:pt1:qryId1::search' or @value='Search' or @index='3']")
.click();
adf
.table(
"/web:window[@index='0' or @title='Manage Network Targets - Oracle Communications Order and Service Management - Order and Service Management']/web:document[@index='0' or @name='1c9nk1ryzv_6']/web:ADFTable[@absoluteLocator='pt1:MA:n1:pt1:pnlcltn:resId1']")
.columnSort("Ascending", "Name" );
} -
If statement in Custom Calculation Script
I have 16 fields and if even one of them ="1" I have to list it in another field. I do not want to count or sum. If one of those fields has a 1 in it I just want the other field to display Y and if none have a 1 I want that field to display N.
Please help.
Thank you in advance~mjcYou need to write a compound logical statement to evaluate all of the values and that statement needs to evaluate to true or false.
Do you know how to write JavaScript?
Do you know how to enter JavaScript calculations into a form field?
For custom calculation of the text field I could write something like:
// define an array of the field names to check
var aNames = new Array("Text1", "Text2", "Text3", "Text4",
"Text5", "Text6", "Text7", "Text8",
"Text9", "Text10", "Text11", "Text12",
"Text13", "Text14", "Text15", "Text16");
// define a logical variable that is true if any field has a value of 1 - default is false or no field has a value of 1
var bMatch = false;
// value for text field
var TextValue = 0;
// logical value of field being equal to 1 test
var FieldIs1 = false;
// loop through all the fields and test the fields value
for(i = 0; i < aNames.length; i++) {
// logically OR the result of field i value equal to true with bMatch
// get the value of field
TextValue = this.getField( aNames[i] ).value;
// test the value of the field
FieldIs1 = Number(TextValue) == 1
// logically OR the 2 values
bMatch = FieldIs1 | bMatch;
} // end field processing
// set the field value
if(bMatch == true) {
event.value = "Y";
} else {
event.value = "N";
You will need to change the field names to match your fields. You can add more field name or remove field names as needed and the script will adjust for the number of field names. -
Hi All,
I have written the below If statement in SAP scripts but when i execute the same the controll doent check the second line entries. If firtst line doesnot satisfy it goes to the else part. Kindly suggest what is wrong in this..
/: IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
/: &T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
/: &T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
/: &T156T-BWART& = '343' OR &T156T-BWART& = '344'.
/: ELSE
/: ENDIF.Hi neha,
Try to use the '/E' fo rnext line
/E->Extended line
Here is a code:
/: IF &T156T-BWART& = '321' OR &T156T-BWART& = '322' OR
/E &T156T-BWART& = '349' OR &T156T-BWART& = '350' OR
/E &T156T-BWART& = '312' OR &T156T-BWART& = '326' OR
/E &T156T-BWART& = '343' OR &T156T-BWART& = '344'.
/: ELSE
/: ENDIF.
Hope this helps you.
Regards,
Rajani -
Installation Problem on 11g, RHEL 5 - Unable to generate temporary script
Hello all,
This is for the first time i am encountering this kind of error on 11g. Half way through installation i get this error.
All parameters set correct, used the official installation technique (works fine previously), except for this time i am getting a weird error, which does not allow me to continue with the installation.
Please help.
Environment
Oracle 11g
RHEL 5
Error on GUI -
OUI-10053: Unable to generate temporary script: {0}. Unable to continue install
Error on command prompt -
OUI-10053:Unable to generate temporary script: /u01/app/oraInventory/orainstRoot.sh. Unable to continue install.
Help appreciated.
ThanksHi Monu Koshy
Can you please control the user rights and also the df ?
ls -al /u01/app/oraInventory/
df -h /u01/app/oraInventory/
Regards,
Hub -
SAMPLE RECEIVING OPEN INTERFACE SCRIPT(ROI 이용자를 위한 SCRIPT)
제품: MFG_PO
작성날짜 : 2006-05-11
SAMPLE RECEIVING OPEN INTERFACE SCRIPT(ROI 이용자를 위한 SCRIPT)
================================================================
PURPOSE
Receiving Open Interface(ROI)를 좀더 쉽게 사용할 수 있도록 만들어진
tool이라고 할 수 있다. 이 script를 이용을 통해 user는 PO no, user id,
Org id를 입력하면 script는 PO에서 최소한의 data를 가져와 receiving
transaction을 생성하기 위해 ROI에 data를 입력한다.
Receiving Transaction Processor는 insert 된 data를 실행한다.
Explanation
Instructions:
1.Script exroi.sql을 local computer에 copy 하거나 sqlplus 환경의 text
edior에 script 내용을 cut&paste 한다.
2.사용가능한 PO no, User id, Org id를 결정한다.
3.sqlplus prompt에서 아래와 같이 입력한다.
SQL> @ezroi.sql
4.PO no, User id, Org id를 입력하라는 prompt를 볼 수 있을 것이다.
5.exroi.sql script를 관련된 PO data를 가져와 rcv_headers_interface 및
rcv_transactions_interface tables에 insert 한다.
만일 PO shipment lind이 closed, cancelled, fully received 되었다면
ROI table에 data를 insert 하지 않는다.
Note: 이 script가 data를 validate 하진 않으며,ROI API 자체 validation
이 실행될 뿐이다.
6.Script가 끝나면 Receiving Transaction Processor를 실행하여 insert 된
lines을 처리할 수 있다. Transaction Status Summary 화면을 통해 실행된
line이 pending 인지 error 상태인지 확인할 수 있다.
Notes:
1.Org_id parameter 값을 찾는법:
a) Application에 접속, Help> Diagnostics> Examine으로 이동.
Block:$Profile$, Field: ORG_ID 를 선택한다.
b) ORG_ID 값을 note 해 놓고 ORG_ID prompt시 이 값을 입력한다.
2.User_Name parameter 값을 찾는법:
a) Application에 접속, Help> Diagnostics> Examine으로 이동.
Block:$Profile$, Field: USER_NAME 를 선택한다.
b) USER_NAME 값을 note 해 놓고 USER_NAME prompt시 이 값을 입력한다.
Example
"eZROI.sql' script...
--*** eZROI ***
--*** by ***
--*** Preston D. Davenport ***
--*** Oracle Premium Applications Support ***
--*** Oracle Worldwide Global Support Services ***
--*** Date: 23-JUL-2003 - Beta release ***
--*** Date: 09-SEP-2003 - Rev A Added multi- ***
--*** shipment line capability ***
--*** Parameters: ***
--*** ORG_ID Organization ID ***
--*** USER_NAME FND User Name ***
--*** PO_NUMBER Purchase Order Number ***
--*** This script intended for a standard Purchase ***
--*** Order document to be inserted into the Oracle ***
--*** Receiving Open Interface (ROI) via the standard ***
--*** Oracle open interface api for a simple Receive ***
--*** transaction. ***
--*** Note: This script only considers open Purchase ***
--*** Orders. This script will not allow over- ***
--*** receipt, cancelled or closed PO's to be ***
--*** inserted into the ROI and received ***
CLEAR BUFFER
SET VERIFY OFF
SET LINESIZE 140
SET PAGESIZE 60
SET ARRAYSIZE 1
SET SERVEROUTPUT ON SIZE 100000
SET FEEDBACK OFF
SET ECHO OFF
DECLARE
X_USER_ID NUMBER;
X_PO_HEADER_ID NUMBER;
X_VENDOR_ID NUMBER;
X_SEGMENT1 NUMBER;
X_ORG_ID NUMBER;
X_LINE_NUM NUMBER;
BEGIN
DBMS_OUTPUT.PUT_LINE('***ezROI RCV API Insert Script***');
SELECT PO_HEADER_ID , VENDOR_ID , SEGMENT1 , ORG_ID
INTO X_PO_HEADER_ID , X_VENDOR_ID , X_SEGMENT1 , X_ORG_ID
FROM PO_HEADERS_ALL
WHERE SEGMENT1 = '&PO_NUMBER'
AND ORG_ID = &ORG_ID;
SELECT USER_ID INTO X_USER_ID
FROM FND_USER
WHERE USER_NAME = UPPER('&USER_NAME');
INSERT INTO RCV_HEADERS_INTERFACE
HEADER_INTERFACE_ID ,
GROUP_ID ,
PROCESSING_STATUS_CODE ,
RECEIPT_SOURCE_CODE ,
TRANSACTION_TYPE ,
LAST_UPDATE_DATE ,
LAST_UPDATED_BY ,
LAST_UPDATE_LOGIN ,
VENDOR_ID ,
EXPECTED_RECEIPT_DATE ,
VALIDATION_FLAG
SELECT
RCV_HEADERS_INTERFACE_S.NEXTVAL ,
RCV_INTERFACE_GROUPS_S.NEXTVAL ,
'PENDING' ,
'VENDOR' ,
'NEW' ,
SYSDATE ,
X_USER_ID ,
0 ,
X_VENDOR_ID ,
SYSDATE ,
'Y'
FROM DUAL;
DECLARE
CURSOR PO_LINE IS
SELECT PL.ITEM_ID , PL.PO_LINE_ID , PL.LINE_NUM ,
PLL.QUANTITY , PL.UNIT_MEAS_LOOKUP_CODE ,
MP.ORGANIZATION_CODE , PLL.LINE_LOCATION_ID ,
PLL.CLOSED_CODE , PLL.QUANTITY_RECEIVED ,
PLL.CANCEL_FLAG, PLL.SHIPMENT_NUM
FROM PO_LINES_ALL PL ,
PO_LINE_LOCATIONS_ALL PLL ,
MTL_PARAMETERS MP
WHERE PL.PO_HEADER_ID = X_PO_HEADER_ID
AND PL.PO_LINE_ID = PLL.PO_LINE_ID
AND PLL.SHIP_TO_ORGANIZATION_ID = MP.ORGANIZATION_ID;
BEGIN
FOR CURSOR1 IN PO_LINE LOOP
IF CURSOR1.CLOSED_CODE IN ('APPROVED','OPEN')
AND CURSOR1.QUANTITY_RECEIVED < CURSOR1.QUANTITY
AND NVL(CURSOR1.CANCEL_FLAG,'N') = 'N'
THEN
INSERT INTO RCV_TRANSACTIONS_INTERFACE
INTERFACE_TRANSACTION_ID ,
GROUP_ID ,
LAST_UPDATE_DATE ,
LAST_UPDATED_BY ,
CREATION_DATE ,
CREATED_BY ,
LAST_UPDATE_LOGIN ,
TRANSACTION_TYPE ,
TRANSACTION_DATE ,
PROCESSING_STATUS_CODE ,
PROCESSING_MODE_CODE ,
TRANSACTION_STATUS_CODE ,
PO_LINE_ID ,
ITEM_ID ,
QUANTITY ,
UNIT_OF_MEASURE ,
PO_LINE_LOCATION_ID ,
AUTO_TRANSACT_CODE ,
RECEIPT_SOURCE_CODE ,
TO_ORGANIZATION_CODE ,
SOURCE_DOCUMENT_CODE ,
DOCUMENT_NUM ,
HEADER_INTERFACE_ID ,
VALIDATION_FLAG
SELECT
RCV_TRANSACTIONS_INTERFACE_S.NEXTVAL ,
RCV_INTERFACE_GROUPS_S.CURRVAL ,
SYSDATE ,
X_USER_ID ,
SYSDATE ,
X_USER_ID ,
0 ,
'RECEIVE' ,
SYSDATE ,
'PENDING' ,
'BATCH' ,
'PENDING' ,
CURSOR1.PO_LINE_ID ,
CURSOR1.ITEM_ID ,
CURSOR1.QUANTITY ,
CURSOR1.UNIT_MEAS_LOOKUP_CODE ,
CURSOR1.LINE_LOCATION_ID ,
'RECEIVE' ,
'VENDOR' ,
CURSOR1.ORGANIZATION_CODE ,
'PO' ,
X_SEGMENT1 ,
RCV_HEADERS_INTERFACE_S.CURRVAL ,
'Y'
FROM DUAL;
DBMS_OUTPUT.PUT_LINE('PO line: '||CURSOR1.LINE_NUM||' Shipment: '||CURSOR1.SHIPMENT_NUM||' has been inserted into ROI.');
ELSE
DBMS_OUTPUT.PUT_LINE('PO line '||CURSOR1.LINE_NUM||' is either closed, cancelled, received.');
END IF;
END LOOP;
DBMS_OUTPUT.PUT_LINE('*** ezROI COMPLETE - End ***');
END;
COMMIT;
END;
SET VERIFY ON
Reference Documents
Note 245334.1I have the same problem on ESXI 5.5 for over a month now, tried the patches, tried the LTS kernel which others say results in an immediate result without patches, nothing seems to work and nobody seems to be able to offer a solution.
Did you make any progress ??
Error! Build of vmblock.ko failed for: 3.10.25-1-lts (x86_64)
Consult the make.log in the build directory
/var/lib/dkms/open-vm-tools/2013.09.16/build/ for more information.
make[2]: *** No rule to make target '/var/lib/dkms/open-vm-tools/2013.09.16/build/vmblock/linux/inode', needed by '/var/lib/dkms/open-vm-tools/2013.09.16/build/vmblock/vmblock.o'. Stop.
Makefile:1224: recipe for target '_module_/var/lib/dkms/open-vm-tools/2013.09.16/build/vmblock' failed
make[1]: *** [_module_/var/lib/dkms/open-vm-tools/2013.09.16/build/vmblock] Error 2
make[1]: Leaving directory '/usr/src/linux-3.10.25-1-lts'
Makefile:120: recipe for target 'vmblock.ko' failed
Last edited by crankshaft (2014-01-10 11:32:32)
Maybe you are looking for
-
I have downloaded a PDF of a big map and am trying to print it with Preview app. However, Preview will either scale the image down to a page, or print one page clipped, but I can't find a way to get it to paginate printing all the pages needed to cov
-
I have table Like contract_ref_no contract_type realized_internal_gmr_ref_no 53909-P P GMR-3584 102585-S S GMR-3584 51289-p p GMR-1869 104586-S S GMR-1869 57182-P P GMR-2890 102588-S S GMR-2890 I want to display order depending on purchase order(cont
-
TNS: lost contact error consuming https web services
Hi, I'm trying this piece of pl/sql code and I'm getting TNS: lost contact error while trying to retrieve soap response. What could be wrong? I'm using oracle 10.2.0.1.0 database. Thanks in advance. declare envio varchar2(32767); peticion UTL_HTTP.re
-
Began seeing this popup only recently, around end of Feb 2015 when a Firefox update installed on mac.
-
Is there a virus on iMac 2011 from email
how do I know if I got a virus from email