Manage Learn to apply best practices and optimize your operations.

# Unique sequential numbers for Web-based form

## This code calulates a totally unique, sequential, 8 digit number for Web forms.

This code calulates a totally unique, sequential, 8 digit number for Web forms.

This number also allows for forms that are created at the same time. All forms will be unique accoring to the calulation below.

REQUEST NUMBER CALCULATION

This request number formula will produce a unique sequential number for each request.
EXAMPLE:

```1A44-316I

1  A  44 - 316  I
A  B  CC - CCC  D

A = The current month.
The month of October is X.
The month of November is Y.
The month of December is Z.
October , November , December are represented by letters because they are  2 digit months.

B = The current day.
Two digit days are represented by letters.
Example: day10=A , day11=B , day12=C  etc.

CC-CCC = Number of seconds past 12:00 AM of the current day.
There can be up to 86400 seconds in a day. So there needs to be 5 digits to account for.

D = Random Alpha Character.
To distinguish requests created at exactly the same second.

1 A 44-316 I

1=Month(January)
A=Day(10)
44-316=Time(12:18:36 or 43200+1080+36)
I=random alpha

Code: REM "REQUEST NUMBER CALCULATION";
REM ;
REM "This request number formula will produce a unique sequential number  for each request.";
REM ;
REM ;
REM "1A44-316I = January, 10 12:18:36 PM = 43200+1080+36";
REM ;
REM "1 A  44 - 316  I";
REM "A B  CC - CCC  D";
REM ;
REM ;
REM "A = The current month. ";
REM "The month of October is X.";
REM "The month of November is Y.";
REM "The month of December is Z.";
REM "October , November , December are represented by letters because they are  2 digit months.";
REM ;
REM ;
REM "B = The current day.";
REM "Two digit days are represented by letters.";
REM "Example: day10=A , day11=B , day12=C  etc.";
REM ;
REM ;
REM "CC-CCC = Number of seconds past 12:00 AM of the current day.";
REM "There can be up to 86400 seconds in a day. So there needs to be 5  digits to account for.";
REM ;
REM ;
REM "D = Random Alpha Character.";
REM "To distinguish requests created at exactly the same second.";

REM "Get the current year.";
year:=@Text(@Year(@Now));

REM "Get the current month.";
month:=@Right( ("0"+@Text(@Month(@Now))) ; 2);

REM "Get the current day.";
day:=@Right( ("0"+@Text(@Day(@Now))); 2);

REM "Get the current seconds past 12:00 AM this morning.";
start:=@TextToTime(month+"/"+day+"/"+year+" 00:00:00 AM");
fin:=@Now;
csc:=@Text((fin-start));

REM "Make the month a 1 digit character";
m := @If(
month = "10" ; "X" ;
month = "11" ; "Y" ;
month = "12" ; "Z" ;
@Right(month;1));

REM "Make the day a 1 digit character";
d:=@If(
day="10";"A";
day="11";"B";
day="12";"C";
day="13";"D";
day="14";"E";
day="15";"F";
day="16";"G";
day="17";"H";
day="18";"I";
day="19";"J";
day="20";"K";
day="21";"L";
day="22";"M";
day="23";"N";
day="24";"O";
day="25";"P";
day="26";"Q";
day="27";"R";
day="28";"S";
day="29";"T";
day="31";"U";
day);

REM "Add leading zeros for the current seconds past 12:00 AM if necessary.";  c:=@Right("0000"+csc;5);
c1:=@Left(c;2);
c2:=@RightBack(c;2);

REM "Calculate a random alpha character.";
rand:=@Right(@Unique;1);
r:=@If( rand = "0" ; "A";
rand = "1" ; "B";
rand = "2" ; "C";
rand = "3" ; "D";
rand = "4" ; "E";
rand = "5" ; "F";
rand = "6" ; "G";
rand = "7" ; "H";
rand = "8" ; "I";
rand = "9" ; "J";rand);

REM "Display request number...";
m+d+c1+"-"+c2+r
```
This was last published in January 2002

#### Start the conversation

Send me notifications when other members comment.

## SearchWindowsServer

• ### Azure PowerShell cmdlets monitor, manage VMs

PowerShell gives administrators a way to customize reports that hone in on the details that matter to the business, such as the ...

• ### Windows out-of-band patches overshadow April Patch Tuesday

Microsoft delivered out-of-band security patches to address the Total Meltdown and malware engine exploits as a precursor to its ...

• ### Microsoft Project Honolulu shows promise but needs work

Microsoft Project Honolulu is still in the technical preview stage, but it needs to resolve a number of issues before it's a ...

## Search400

• ### iSeries tutorials

Search400.com's tutorials provide in-depth information on the iSeries. Our iSeries tutorials address areas you need to know about...

• ### V6R1 upgrade planning checklist

When upgrading to V6R1, make sure your software will be supported, your programs will function and the correct PTFs have been ...

• ### Connecting multiple iSeries systems through DDM

Working with databases over multiple iSeries systems can be simple when remotely connecting logical partitions with distributed ...

## SearchDataCenter

• ### Guide to buying server performance monitoring software

Integration, storage and vendor support all affect whether a performance monitoring tool is right for an organization. Mull over ...

• ### How IBM's data science team quickens users' AI projects

In this Q&A, IBM's Seth Dobrin discusses the rising user interest in machine learning and AI projects and the help inexperienced ...

• ### IBM blockchain technology spotlights mainframes

IBM's blockchain offerings aim to ease enterprise IT concerns by combining Z system mainframe hardware with industry-specific ...

## SearchExchange

• ### Cloud-based email security tools barricade entry to Exchange

The pressure is on Exchange administrators to avoid a ransomware outbreak that cripples the on-premises email system. Cloud-based...

• ### Migrating public folders requires extensive planning

Do your homework to find the right option for public folders when making a move to Exchange Online. Here are guidelines to help ...

• ### Using Microsoft Exchange certificates requires planning

Exchange certificates typically require minimal management effort after they have been set up, and they offer a secure means of ...

## SearchContentManagement

• ### How a digital transformation process helped curb reliance on paper

By moving on from paper, the North Carolina Court System and the Texas Animal Health Commission were able to accommodate ...

• ### Intelligent information management is ready for AI, blockchain

A panel discussion at AIIM 2018 looked at how AI, cloud and blockchain will disrupt the intelligent information management space.

• ### SharePoint 2019 on premises the talk of SharePoint Fest D.C.

This episode of the Pipeline podcast breaks down SharePoint users' concerns about data migration, on-premises version support, ...

Close