Creating unique ID

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

Creating unique ID

Maria Suchard
Hello Fellow Listers,

I am hoping you can help me once again.  I am trying to create a unique variable with 6 characters. I am running this code,  I then get this error:

>This command is not valid before a working file has been defined.
>Execution of this command stops.

COMPUTE ID=$CASENUM.
FORMAT ID (F8.0).
EXECUTE.

I would appreciate any help.
Thank you in advance.
Maria
Reply | Threaded
Open this post in threaded view
|

Re: Creating unique ID

David Marso
Administrator
Maybe try opening a data file first?

Maria Suchard wrote
Hello Fellow Listers,

I am hoping you can help me once again.  I am trying to create a unique variable with 6 characters. I am running this code,  I then get this error:

>This command is not valid before a working file has been defined.
>Execution of this command stops.

COMPUTE ID=$CASENUM.
FORMAT ID (F8.0).
EXECUTE.

I would appreciate any help.
Thank you in advance.
Maria
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Creating unique ID

Maria Suchard
The data file was open, it was just not recognizing the data file. I was able to get the code to run, but what I need it to do is allow for the id to be 6 characters in length.  Any suggestions on how I can modify the syntax?

Thanks again!
Reply | Threaded
Open this post in threaded view
|

Re: Creating unique ID

David Marso
Administrator
FORMATS varname (N6) will put result in leading zeros.

Maria Suchard wrote
The data file was open, it was just not recognizing the data file. I was able to get the code to run, but what I need it to do is allow for the id to be 6 characters in length.  Any suggestions on how I can modify the syntax?

Thanks again!
Please reply to the list and not to my personal email.
Those desiring my consulting or training services please feel free to email me.
---
"Nolite dare sanctum canibus neque mittatis margaritas vestras ante porcos ne forte conculcent eas pedibus suis."
Cum es damnatorum possederunt porcos iens ut salire off sanguinum cliff in abyssum?"
Reply | Threaded
Open this post in threaded view
|

Re: Creating unique ID

Maria Suchard
Thank you.  This worked!