Please Help the Below Scenario, Its Urgent



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Please Help the Below Scenario, Its Urgent

Postby RaniMF » Wed Jul 11, 2012 10:39 am

Hi Folks,

I have a requirement of sequence number generation as shown below. My sequence number should be 3 digit alphanumeric.
Sequence Number should be starts with
001
002
003
004
005
006
007
008
009
Once it reaches 009 then my seq num should be continue like this
0A1
...
0A9
....like wise upto 0Z1 to 0Z9
after that my seq should be like this
AA1 to AA9............like that Az1 to AZ9
after AZ9 my seq should starts with BA1 to BA9.......
like that till ZZ1 to ZZ9

Please help me out of this scenario. in my project we are not using DB2. Thanks in advance!!!!
RaniMF
 
Posts: 1
Joined: Thu Jul 05, 2012 10:47 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Please Help the Below Scenario, Its Urgent

Postby Monitor » Wed Jul 11, 2012 11:07 am

No urgent solutions here!
Your requirement is no very clear: are the numbers to be generated at one run only, be kept between runs etc.
It seems that you want to write a COBOL program to solve it. Why dont you go ahead an tell us if you run into any problems!
If you are looking for a complete solution, thats is not what we do here, thats what consultants are used and payed for.
Monitor
 
Posts: 98
Joined: Wed Jan 18, 2012 8:59 pm
Has thanked: 0 time
Been thanked: 7 times

Re: Please Help the Below Scenario, Its Urgent

Postby chandurokzz » Wed Jul 11, 2012 11:22 am

Hi Rani,

What is the use of this sequence number in ur project?
Does ur process create only sequence number?..

If yes,
u ll have to implement a complex logic to achieve this

can u share some more info about ur process?

Regards,
Chandu
chandurokzz
 
Posts: 10
Joined: Wed Apr 11, 2012 12:49 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Please Help the Below Scenario, Its Urgent

Postby NicC » Wed Jul 11, 2012 12:37 pm

Your other postings have been locked/deleted. instead of spending time doing those posts you would have been better off thinking about your problem and trying things out. You HAVE tried things out, haven't you?!
Provide us with how you are trying to achieve this and where in the process you are going wrong. If posting code wrap it in code tags available by replying using the POSTREPLY button at the bottom left or by using the Full Editor button available from the QuickReply button. Use the Preview button to check that your post is OK. If it is not fix it up and preview agian. Repeat until satisfied. Then use the submit button.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: Please Help the Below Scenario, Its Urgent

Postby BillyBoyo » Wed Jul 11, 2012 1:48 pm

I don't know why anybody ever mentions "urgent". If they'd do a bit of research on the site, they'd see we usually get to things when we can, and usually someone is there fairly quickly.

The only thing which slows it down is the request for Urgency.

I'd have a 27-element table., value 0 and A-Z in one byte, A-Z and 0 in the next byte. When a plain three-digit sequence number "changes" in 10's or 100's, use the table with the current "masked" value for the sequence to obtain the "next" value for the mask.

Do some pseudo-code, work through the processing until you are clear. Run through it with test cases. Design/write/test program.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Please Help the Below Scenario, Its Urgent

Postby BillyBoyo » Wed Jul 11, 2012 2:54 pm

chandurokzz wrote:Hi Rani,

What is the use of this sequence number in ur project?
Does ur process create only sequence number?..

If yes,
u ll have to implement a complex logic to achieve this

can u share some more info about ur process?

Regards,
Chandu


For reasons of clarity and accuracy, we like full English words and correct use of terminology.

This is a site for Beginners and Students. It can easily be a classwork/training exercise.

However, consider the person who arranged for the printing of 3m forms with a three-character box for noting some sequence number. By the time there were 1/4m of the forms left, the "we'll never exceed that" sequence number needed to be "increased". You can't make the box bigger, and there is a cost in trashing 1/4m forms. Plus analysis of system indicates no changes required to hold an alphanumeric field. So, you extend your sequence number by using the letters of the alphabet. You keep the 0-9 because humans are using the forms, and it is much easier to know that a number is in sequence than a letter.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: Please Help the Below Scenario, Its Urgent

Postby chandurokzz » Wed Jul 11, 2012 4:02 pm

Thank You Billy :)
chandurokzz
 
Posts: 10
Joined: Wed Apr 11, 2012 12:49 pm
Has thanked: 1 time
Been thanked: 0 time

Re: Please Help the Below Scenario, Its Urgent

Postby steve-myers » Wed Jul 11, 2012 10:05 pm

Billyboyo's comment about correct terminolgy is dead on. In all fairness, though, "correct terminology" is not always that easy, even for native English apeakers that have been in the field for a long time. I still get it wrong after 40+ years.

In any event, Chandu's use of SMS type short cuts is inappropriate in this forum, even if he is entering the response on an iPhone or iPad type device.
steve-myers
Global moderator
 
Posts: 2105
Joined: Thu Jun 03, 2010 6:21 pm
Has thanked: 4 times
Been thanked: 243 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post