Précédent   Forum des professionnels en informatique > Logiciels > Solutions d'entreprise > Business Intelligence > SAS > Outils BI
Outils BI Forum d'entraide sur les fonctionnalités spécifiquement liées à la partie Business Intelligence de SAS : DI, EG, infomaps, cubes, WRS
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 27/12/2011, 14h30   #1
Membre du Club
 
Inscription : mars 2008
Messages : 156
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 156
Points : 40
Points : 40
Par défaut Modifier valeur invite dans le vbscript

Bonjour,

Je souhaiterai modifier la valeur d'une invite dans mon script vb (qui lance un projet SASEG).
Je dispose d'un unique paramètre et je voudrais lui passer la date du jour.

Voici le code que j'ai en partie adapté (code trouvé sur le site du support technique SAS) :
Code :
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
 
OPTION Explicit
Dim app
 
Call dowork
 
'shut down the app
If not (app Is Nothing) Then
    app.Quit
    Set app = Nothing
End If
 
 
Sub dowork()
    On Error Resume Next
    '----
    ' Start up Enterprise Guide using the project name
    '----
    Dim prjName
    Dim prjObject
 
    prjName = "\\SUDOUEST\Dev\SAS\Projet.egp"    'Project Name
 
    Set app = CreateObject("SASEGObjectModel.Application.4.3")
    If Checkerror("CreateObject") = True Then
        Exit Sub
    End If
 
    '-----
    ' open the project
    '-----
    SET prjObject = app.Open(prjName,"")
    IF Checkerror("app.Open") = True Then
        Exit Sub
    End IF
 
'---------------------------------
'Begin processing the project
'---------------------------------
 
' Discover the parameters FOR the project
SET parmList = prjObject.Parameters
 
' Get the default value from the first parameter
Set parm = parmList.Item(0)
 
' CHANGE the value of the parameter TO la date du jour AND display the new value.
parm.Value = Date()
 
 
'-------------------------------
'Begin processing the stored process
'-------------------------------
Set spList = prjObject.StoredProcessCollection
 
' Cycle through the list of stored processes AND the parameters FOR each of them.
FOR n=0 TO (spList.Count - 1)
	SET sp = spList.Item(n)
	' Get the list of parameters
	Set spParamList = sp.Parameters
 
	' Process each stored process parameter
      FOR i=0 TO (spParamList.Count - 1)
 
	    SET spParam = spParamList.Item(i)
		' Change the value of the parameter
	    spParam.Value = Date()
 
		' Save the project WITH the updated stored process
	    prjObject.Save
	Next
Next
 
 
    '-----
    ' run the project
    '-----
    prjObject.run
    If Checkerror("Project.run") = True Then
        Exit Sub
    End If
 
 
    '-----
    ' Save the new project
    '-----
    prjObject.Save
    IF Checkerror("Project.Save") = True Then
        Exit Sub
    End IF
 
    '-----
    ' Close the project
    '-----
    prjObject.Close
    If Checkerror("Project.Close") = True Then
        Exit Sub
    End If
 
End Sub
 
Function Checkerror(fnName)
    Checkerror = False
 
    Dim strmsg
    Dim errNum
 
    If Err.Number <> 0 Then
        strmsg = "Error #" & Hex(Err.Number) & vbCrLf & "In Function " & fnName & vbCrLf & Err.Description
        'MsgBox strmsg  'Uncomment this line if you want to be notified via MessageBox of Errors in the script.
        Checkerror = True
    End If
 
End Function

Sans succès, si quelqu'un a une idée...
geofnich est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 28/12/2011, 13h09   #2
Modérateur
 
Homme Samir SELMANE
Consultant en Business Intelligence
Inscription : février 2011
Messages : 1 012
Détails du profil
Informations personnelles :
Nom : Homme Samir SELMANE
Localisation : France

Informations professionnelles :
Activité : Consultant en Business Intelligence
Secteur : Conseil

Informations forums :
Inscription : février 2011
Messages : 1 012
Points : 1 717
Points : 1 717
dans le forom VB
s_a_m est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 29/12/2011, 16h15   #3
Membre du Club
 
Inscription : mars 2008
Messages : 156
Détails du profil
Informations forums :
Inscription : mars 2008
Messages : 156
Points : 40
Points : 40
Merci pour l'info mais je pensais que le problème venait de sas et non de vb (format des dates sous sas)
geofnich est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 03/01/2012, 10h00   #4
Modérateur
 
Homme Samir SELMANE
Consultant en Business Intelligence
Inscription : février 2011
Messages : 1 012
Détails du profil
Informations personnelles :
Nom : Homme Samir SELMANE
Localisation : France

Informations professionnelles :
Activité : Consultant en Business Intelligence
Secteur : Conseil

Informations forums :
Inscription : février 2011
Messages : 1 012
Points : 1 717
Points : 1 717
ton paramètre tu le passes à SAS ou a VB? le .VBS est généré automatiquement par EG, et ce n'est pas SAS qu'il lance mais EG.
s_a_m est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 19h01.


 
 
 
 
Partenaires

Hébergement Web