This might be a question I really should know the answer to, but as I have tried almost everything with little success, I have to ask. I am simply wondering if
there is a way to use relative references to files in syntax rather than using absolute references? An example: instead of
GET FILE='J:\Arkiv\internt\allm_statistik\2011\ dotplot\data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. I would like to have something like
GET FILE='data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. After all, the syntax file is located within the same folder, so it should be possible to use a relative address, shouldn't it? The purpose is not only to get a neater syntax file, but also to make it easier
to wrap all connected files together (data, syntax, graphics template,…) and send the whole package back to my clients. Robert
Robert Lundqvist
|
file handle dotplot/name =
'J:\Arkiv\internt\allm_statistik\2011\ dotplot'
get file = 'dotplot\data.sav'
hth, g.
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Robert Lundqvist Sent: 29 June 2011 07:54 To: [hidden email] Subject: File references? This might be a question I really should know the answer to, but as I have tried almost everything with little success, I have to ask. I am simply wondering if
there is a way to use relative references to files in syntax rather than using absolute references? An example: instead of
GET FILE='J:\Arkiv\internt\allm_statistik\2011\ dotplot\data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. I would like to have something like
GET FILE='data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. After all, the syntax file is located within the same folder, so it should be possible to use a relative address, shouldn't it? The purpose is not only to get a neater syntax file, but also to make it easier
to wrap all connected files together (data, syntax, graphics template,…) and send the whole package back to my clients. Robert The University of Aberdeen is a charity registered in Scotland, No SC013683. |
In reply to this post by Robert L
Hi Robert CD (Change Directory) is what you want. After issuing the CD command you can use relative paths. eg CD 'J:\Arkiv\internt\allm_statistik\2011\ dotplot’. GET FILE='data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. Garry Gelade From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Robert Lundqvist This might be a question I really should know the answer to, but as I have tried almost everything with little success, I have to ask. I am simply wondering if there is a way to use relative references to files in syntax rather than using absolute references? An example: instead of GET FILE='J:\Arkiv\internt\allm_statistik\2011\ dotplot\data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. I would like to have something like GET FILE='data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. After all, the syntax file is located within the same folder, so it should be possible to use a relative address, shouldn't it? The purpose is not only to get a neater syntax file, but also to make it easier to wrap all connected files together (data, syntax, graphics template,…) and send the whole package back to my clients. Robert |
In reply to this post by Robert L
What’s wrong with opening the relevant folder and double-clicking on the *.sav file? The syntax gets saved anyway and it saves a few key-depressions. If you save the *.sps syntax files, you can edit them all, save them in the same folder and send the whole thing to your client. Output files optional as SPSS is so fast it usually only takes seconds to reproduce them. John F Hall From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Robert Lundqvist This might be a question I really should know the answer to, but as I have tried almost everything with little success, I have to ask. I am simply wondering if there is a way to use relative references to files in syntax rather than using absolute references? An example: instead of GET FILE='J:\Arkiv\internt\allm_statistik\2011\ dotplot\data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. I would like to have something like GET FILE='data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. After all, the syntax file is located within the same folder, so it should be possible to use a relative address, shouldn't it? The purpose is not only to get a neater syntax file, but also to make it easier to wrap all connected files together (data, syntax, graphics template,…) and send the whole package back to my clients. Robert |
In reply to this post by Robert L
There are two solutions here. To
set the location that things should be relative to, use the SPSS CD command
to change the working directory.
Second, check out file handles (FILE HANDLE). These let you define symbolic location references that can be used in file specifications, so you only need to set it once. HTH, Jon Peck Senior Software Engineer, IBM [hidden email] new phone: 720-342-5621 From: Robert Lundqvist <[hidden email]> To: [hidden email] Date: 06/29/2011 12:56 AM Subject: [SPSSX-L] File references? Sent by: "SPSSX(r) Discussion" <[hidden email]> This might be a question I really should know the answer to, but as I have tried almost everything with little success, I have to ask. I am simply wondering if there is a way to use relative references to files in syntax rather than using absolute references? An example: instead of GET FILE='J:\Arkiv\internt\allm_statistik\2011\ dotplot\data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. I would like to have something like GET FILE='data.sav'. DATASET NAME DataSet1 WINDOW=FRONT. After all, the syntax file is located within the same folder, so it should be possible to use a relative address, shouldn't it? The purpose is not only to get a neater syntax file, but also to make it easier to wrap all connected files together (data, syntax, graphics template,…) and send the whole package back to my clients. Robert |
Free forum by Nabble | Edit this page |