Numbering records repeatedly from 0-9

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

Numbering records repeatedly from 0-9

Mark Webb-3
I would like to number records from 0-9 repeatedly using syntax.

Example

Record    NewVar

1              0

2              1

3              2

4              3

5              4

6              5

7              6

8              7

9              8

10            9

11            0

12            1

13            2

Etc.          Etc.



Any suggestions would be appreciated.

Regards

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Numbering records repeatedly from 0-9

Spousta Jan
Hi Mark,

Compute newvar = mod($casenum-1,10).
form newvar (f8).
Exe.

Merry Christmas,

Jan

-----Original Message-----
From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf Of Mark Webb
Sent: Thursday, December 20, 2007 7:07 AM
To: [hidden email]
Subject: Numbering records repeatedly from 0-9

I would like to number records from 0-9 repeatedly using syntax.

Example

Record    NewVar

1              0

2              1

3              2

4              3

5              4

6              5

7              6

8              7

9              8

10            9

11            0

12            1

13            2

Etc.          Etc.



Any suggestions would be appreciated.

Regards

=====================
To manage your subscription to SPSSX-L, send a message to [hidden email] (not to SPSSX-L), with no body text except the command. To leave the list, send the command SIGNOFF SPSSX-L For a list of commands to manage subscriptions, send the command INFO REFCARD



_____

Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto informací. Jestliže jste tento mail dostali neoprávněně, prosím, uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto přenosem.

This message and any attached files are confidential and intended solely for the addressee(s). Any publication, transmission or other use of the information by a person or entity other than the intended addressee is prohibited. If you receive this in error please contact the sender and delete the message as well as all attached documents. The sender does not accept liability for any errors or omissions as a result of the transmission.

-.- --

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD
Reply | Threaded
Open this post in threaded view
|

Re: Numbering records repeatedly from 0-9

P Das
To avoid problems with negative numbers, use:
Compute newvar = mod($casenum+9,10).

Spousta Jan heeft op donderdag, 20 dec 2007 om 09:28 (Europe/Zurich)
het volgende geschreven:

> Hi Mark,
>
> *Compute newvar = mod($casenum-1,10).
> form newvar (f8).
> Exe.
>
> Merry Christmas,
>
> Jan
>
> -----Original Message-----
> From: SPSSX(r) Discussion [mailto:[hidden email]] On Behalf
> Of Mark Webb
> Sent: Thursday, December 20, 2007 7:07 AM
> To: [hidden email]
> Subject: Numbering records repeatedly from 0-9
>
> I would like to number records from 0-9 repeatedly using syntax.
>
> Example
>
> Record    NewVar
>
> 1              0
>
> 2              1
>
> 3              2
>
> 4              3
>
> 5              4
>
> 6              5
>
> 7              6
>
> 8              7
>
> 9              8
>
> 10            9
>
> 11            0
>
> 12            1
>
> 13            2
>
> Etc.          Etc.
>
>
>
> Any suggestions would be appreciated.
>
> Regards
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except
> the command. To leave the list, send the command SIGNOFF SPSSX-L For a
> list of commands to manage subscriptions, send the command INFO > REFCARD
>
>
>
> _____
>
> Tato zpráva a všechny připojené soubory jsou důvěrné a určené výlučně
> adresátovi(-ům). Jestliže nejste oprávněným adresátem, je zakázáno
> jakékoliv zveřejňování, zprostředkování nebo jiné použití těchto
> informací. Jestliže jste tento mail dostali neoprávněně, prosím,
> uvědomte odesilatele a smažte zprávu i přiložené soubory. Odesilatel
> nezodpovídá za jakékoliv chyby nebo opomenutí způsobené tímto > přenosem.
>
> This message and any attached files are confidential and intended
> solely for the addressee(s). Any publication, transmission or other
> use of the information by a person or entity other than the intended
> addressee is prohibited. If you receive this in error please contact
> the sender and delete the message as well as all attached documents.
> The sender does not accept liability for any errors or omissions as a
> result of the transmission.
>
> -.- --
>
> =====================
> To manage your subscription to SPSSX-L, send a message to
> [hidden email] (not to SPSSX-L), with no body text except
> the
> command. To leave the list, send the command
> SIGNOFF SPSSX-L
> For a list of commands to manage subscriptions, send the command
> INFO REFCARD
>
>
Peter Das

=====================
To manage your subscription to SPSSX-L, send a message to
[hidden email] (not to SPSSX-L), with no body text except the
command. To leave the list, send the command
SIGNOFF SPSSX-L
For a list of commands to manage subscriptions, send the command
INFO REFCARD