Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref

Author Message
bismark928
Warnings : 1

New User

Joined: 03 Apr 2007
Posts: 1
Location: philippines

 Posted: Wed Apr 04, 2007 12:32 pm    Post subject: How to use ALPHANUMERIC as SEQUENTIAL CODE 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

agkshirsagar

Active Member

Joined: 27 Feb 2007
Posts: 686
Location: Earth

Posted: Wed Apr 04, 2007 1:02 pm    Post subject:

This seems to be a very interesting question. I remember to solve similar one in my Engineering.
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.
dick scherrer

Site Director

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

 Posted: Wed Apr 04, 2007 9:43 pm    Post subject: Hello, Sounds good to me 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.
 All times are GMT + 6 Hours
 Page 1 of 1

Search our Forum:

 Topic Author Forum Replies Posted Similar Topics Comparing two sequential files Mohan Kothakota COBOL Programming 14 Mon Apr 16, 2018 6:35 pm Getting GG return code abdulrafi IMS DB/DC 2 Tue Apr 10, 2018 12:31 pm IMS error U4038 while executing my PL... abdulrafi IMS DB/DC 2 Thu Feb 08, 2018 1:05 pm Conditional setting of return-code af... sanvan COBOL Programming 9 Wed Jan 31, 2018 11:05 pm ISSUE IN copying Sequential file reco... thesumitk JCL & VSAM 2 Wed Dec 13, 2017 3:07 pm

 © 2003-2017 IBM MAINFRAME Software Support Division
 Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us