Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to use ALPHANUMERIC as SEQUENTIAL CODE

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming
View previous topic :: :: View next topic  
Author Message
bismark928
Warnings : 1

New User


Joined: 03 Apr 2007
Posts: 1
Location: philippines

PostPosted: Wed Apr 04, 2007 12:32 pm    Post subject: How to use ALPHANUMERIC as SEQUENTIAL CODE
Reply with quote

HI, PEOPLE!
COULD YOU HELP ME ON THIS ONE?....PLEASE..

GENERATE THE TRANSACTION NUMBER CODE THAT COMES AFTER THE LAST ERROR TRANSACTION NUMBER USED IN THE SAME RUN. THE NUMBER CODE SHOULD BE CONTINUOUS FOR EACH RUN. FOR EACH RUN, IT WILL START FROM '1-9' THEN 'A-Z' THEN GOES TO '0' WITH THE NEXT CHARACTER ON THE LEFT INCREMENTING BY 1. THEN THE CHARACTER ON THE RIGHT WILL START AGAIN FROM '1-9' THEN 'A-Z'.
THEN THE CHARACTER ON THE LEFT WILL INCREMENT BY 1 AND THE RIGHT CHARACTER WILL BECOME '0'.


EXAMPLE:

1-9, A-Z, 10-19, 1A-1Z,20-29,2A-2Z,......90-99,9A-9Z,A0-ZZ,100-109,10A-10A,110-119,11A-11Z,......190-199,19A-19Z,1A0-1A9....
1000-ZZZZ.

ASSUME THAT THE TRANSACTION NUMBER CODE WILL NOT EXCEED ZZZZ FOR EACH RUN.


THANKS!!!

Warning: All Caps
Back to top
View user's profile Send private message

agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 686
Location: Earth

PostPosted: Wed Apr 04, 2007 1:02 pm    Post subject:
Reply with quote

This seems to be a very interesting question. I remember to solve similar one in my Engineering. icon_smile.gif
This sequence number comsists of 36 symbols. I will call mod 36 number system. ( I am calling it a number system because I perceive this similar similar note to hex - 16, decimal - 10 , octal -8)
I would take some freedom to make change in this NUMBER system as follows.
Quote:
0-9, A-Z, 10-19, .....

This will make our work easy.
Now,
0 in decimal is 0 in mod 36, 1 is 1 and 10 in decimal is A and similarly 35 in decimal is 'Z' in mod 36.
Getting some hint...?

Generate sequence number in decimal only and 'convert' it in to your mod 36 number.

This you can do by dividing decimal number by 36 ( method should be similar to decimal to hex conversion )


Example: 45 in decimal
45/36 = 1
9
So 45 decimal is 19( mod 36)

56 in decimal
56/36 = 1
20 (remainder) = J so 56 (mod 10 ) = 1J (mod 36)


If anyone has different/easier approach, I will eagerly wait for reply. icon_biggrin.gif
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Wed Apr 04, 2007 9:43 pm    Post subject:
Reply with quote

Hello,


Sounds good to me icon_smile.gif

As a possible continuation to the posted solution, you might make an array of 1-byte entries that contain the values zero thru zee (0-Z). When you divide by 36, use the remainder of the divide as a displacement into that array to quickly get your mod36 "units" position.
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> COBOL Programming All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm
No new posts IMS region inactive - User abend code... gthmrj IMS DB/DC 5 Tue Mar 07, 2017 12:29 pm
No new posts CA Workload Automation event code help vinu78 CA Products 10 Wed Mar 01, 2017 10:05 am
No new posts MAX-RC 88 and Return code 606 in DFH0... lind sh CICS 2 Tue Jan 24, 2017 1:23 pm
No new posts How to Capture the Max return code of... anilkumar922 All Other Mainframe Topics 2 Thu Jan 12, 2017 12:02 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us