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
```

#### Start the conversation

Send me notifications when other members comment.

## SearchWindowsServer

• ### Using Azure AD conditional access for tighter security

The cloud-based identity and access management service does not come with certain defensive features turned on by default, which ...

• ### PowerShell 7 features admins should examine

The next version of the administrative tool introduces several features, including a new cmdlet to assist with troubleshooting ...

• ### Battle lines over Windows Server 2008 migration drawn

Microsoft and AWS stepped up their ongoing battle promoting a variety of Windows Server 2008 migration tools in hopes of luring ...

## 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

• ### Co-location data center market moves closer to the edge

Data center co-location provides companies a way to expand and diversify their infrastructure. The market is growing to increase ...

• ### A guide to data center maintenance outsourcing

Data centers have a lot of moving mechanical parts to maintain. It's beneficial to leave electrical and fire system upkeep to the...

• ### Top data center skills admins can use in 2020

The 2019 tech job sector saw consistent growth and job availability. In 2020, admins should develop expertise on cloud ...

## SearchContentManagement

• ### 4 popular content collaboration platforms to consider

Companies need to be organized if they want to be efficient. Content collaboration platforms are useful, but first, ensure that ...

• ### AI can enhance content security with a bit of planning

Microsoft and Box both use AI technologies to keep content secure in the cloud. But before using such tools, businesses first ...

• ### Ex-SAP exec steers Episerver CMS toward digital experience market

Alex Atzberger discusses leaving the helm of SAP's CX platform to become Episerver CEO. Now, Episerver looks to reinvent itself ...

Close