BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Rupasree
Obsidian | Level 7
Hello Everyone,

I have a requirement, where campaign code should be C+5 digit.
Right now the code in business context is set as C# which returns the campaign code as C1 and the requirement is to have campaign code as C0001 to C99999.
Where can I set the sequence as 00001 so it is incremented by 1.

Seeking your help for the same.Thanks in advance.


Regards,
Rupa
1 ACCEPTED SOLUTION

Accepted Solutions
JamesAnderson
SAS Employee

Hi pcapazzi, 

 

Unfortunately using multiple # will just result in duplication of the unique sequence number. For example if the sequence was up to 123 and you used CAMP### as the Code Format, the result would be a campaign code of CAMP123123123.

 

Your suggestion of starting at 10000 is the best one I can see, and it doesn't require downstream manipulation of codes in export files and macros etc, and the data in the CDM matches whats in export files.

 

Note that when you get to CAMP99999, then next one will be CAMP100000. 


Regards
James

 

View solution in original post

6 REPLIES 6
Astounding
PROC Star

I would guess you know how to create a variable that increases by 1 each time, and the real question is how to keep the leading zeros.

 

If you need help creating a variable that increases by 1, you'll have to show more of the logic ... when should it increase by 1?  Assuming you have such a variable, but its name is a secret, you could use:

 

campaign_code = 'C' || put(secret_variable, z5.);

pcapazzi
Pyrite | Level 9

I do not see anything in the Admin/User Guides to provide a format with leading zeros. The only shot in the dark I could think of is try CAMP##### as a format. Otherwise start it out at CAMP10000.

 

As Dmitry pointed out in another post you can change the starting number in the SAS Dataset MAMisc. Take his advice in avoiding locks if you update it.

 

https://communities.sas.com/t5/SAS-Customer-Intelligence/How-to-set-the-sequence-number-campaign-cod...

 

Thanks.

JamesAnderson
SAS Employee

Hi pcapazzi, 

 

Unfortunately using multiple # will just result in duplication of the unique sequence number. For example if the sequence was up to 123 and you used CAMP### as the Code Format, the result would be a campaign code of CAMP123123123.

 

Your suggestion of starting at 10000 is the best one I can see, and it doesn't require downstream manipulation of codes in export files and macros etc, and the data in the CDM matches whats in export files.

 

Note that when you get to CAMP99999, then next one will be CAMP100000. 


Regards
James

 

Rupasree
Obsidian | Level 7

Thanks James.

 

I have updated the sequence in MAMisc.

 

Rupasree
Obsidian | Level 7

Hi James,

 

Can i use the same code format for Communication Code as well ?

Because i also have same kind of requirement for Communication Code i.e. COMM+ 5digit.

However, when i changed the Sequence table for CommunicationSK it is not reflecting in MA where as for Campaign Code when i updated the Sequence table for CampaignSK it is working as expected i.e. Campaign Code is C10001.

 

Thanks in advance.

Dmitry_Alergant
Pyrite | Level 9

Hi,

 

Most likely, nobody can tell you what the Campaign Code should be originally in SAS MA and CDM.

Whoever asks that, needs that code to appear the way they need, somewhere.

 

I all the places where this code may surface, you can implement an appropriate transformation instead of using the original code:

 

  • Is Campaign Code exported to an output file?  Don't export Campaign Code. Export a calculated variable instead that transforms it to the way they need. It's simple.

  • Is Campaign Code used as part of a default naming convention for an output file name as a macro variable? Don't use the original Campaign Code. Use some macro language formula to transform Campaign Code to the way you need. It's less simple but doable.
  • Is Campaign Code used in any reports on top of SAS CDM data model?  Don't surface SAS CDM tables there as is. Create database views that transform Campaign Code to the way they need. It's simple.

 

Good luck!

 

-------
Dmitriy Alergant, Tier One Analytics
How to improve email deliverability

SAS' Peter Ansbacher shows you how to use the dashboard in SAS Customer Intelligence 360 for better results.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1671 views
  • 1 like
  • 5 in conversation