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
 

 

alphanumeric sequence generation

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sivaprasad.gadhi

New User


Joined: 21 Aug 2012
Posts: 17
Location: india

PostPosted: Mon Mar 21, 2016 1:09 am    Post subject: alphanumeric sequence generation
Reply with quote

I have the following requirement.Can you please help.

NOW sequence number is 10-12 ( 3 bytes) - 10TH BITE IS alphabetic and 11-12 are numeric and control break is on field starting from character 5 and length of 5.whenever control break changes sequence number starts again from beginning. In new requirement they want to make this sequence number as alphanumeric and increment and new sequence start from BAA instead of AAA( A sequence is using for some other purpose). New sequence should be like BAA,BAB,BAC.....BAZ,BBA,BBB,..BZZ,...BA1,BA2,BA3...etc

Input file:

Code:
704812345B01 XXXXXXXXXXXXXXXXXX
704812345B02 XXXXXXXXXXXXXXXXXX
704812345B03 XXXXXXXXXXXXXXXXXX
.
,
.
.
704812345B98 XXXXXXXXXXXXXXXXXX
704812345B99 XXXXXXXXXXXXXXXXXX
704812345C01 XXXXXXXXXXXXXXXXXX
704812345C03 XXXXXXXXXXXXXXXXXX
 
704856789B01 XXXXXXXXXXXXXXXXXX
704856789B02 XXXXXXXXXXXXXXXXXX
.
.
.
704856789B98 XXXXXXXXXXXXXXXXXX
704856789B99 XXXXXXXXXXXXXXXXXX
704856789C01 XXXXXXXXXXXXXXXXXX
704856789C03 XXXXXXXXXXXXXXXXXX
 

OUTPUT ( As part of bussiness requirement sequence number is making alphanumeric and should start from BAA:

Code:
704812345BAA XXXXXXXXXXXXXXXXXX
704812345BAB XXXXXXXXXXXXXXXXXX
704812345BAC XXXXXXXXXXXXXXXXXX
.
,
.
.
704812345BAZ XXXXXXXXXXXXXXXXXX
704812345BBA XXXXXXXXXXXXXXXXXX
704812345BBB XXXXXXXXXXXXXXXXXX
704812345BBC XXXXXXXXXXXXXXXXXX
 
704856789BAA XXXXXXXXXXXXXXXXXX
704856789BAB XXXXXXXXXXXXXXXXXX
.
.
.
704856789BAZ XXXXXXXXXXXXXXXXXX
704856789BBA XXXXXXXXXXXXXXXXXX
704856789BBB XXXXXXXXXXXXXXXXXX
704856789BBC XXXXXXXXXXXXXXXXXX
 

I have looked in to DFSORT sequence generation and using control break but i have not seen option of alphanumeric sequence generation.This is one time conversion of file.Is it possible with DFSORT or syncsort? if not how can i achieve this using cobol?

Thanks for your help

Regards
siva
Back to top
View user's profile Send private message

Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Mon Mar 21, 2016 10:25 pm    Post subject:
Reply with quote

I am not sure about dfsort but it is more like a logical concern to achieve.

Try this approach with DB2 functions (if you have access/installed) for generating the unique combinations:
Code:
 select  'A' || CHR(ASCII('A')+1)from sysibm.sysdummy1


perform this in loop till 26 times then change 'A' to 'B' and perform the above query 26 tmes and so on till you get 'ZZ'.
Once you reach 'ZZ" then perform below loop till Z99 with the same logic as above
Code:
  select  strip('A' || char(0 + 1)) from sysibm.sysdummy1
Back to top
View user's profile Send private message
sivaprasad.gadhi

New User


Joined: 21 Aug 2012
Posts: 17
Location: india

PostPosted: Tue Mar 22, 2016 4:56 am    Post subject:
Reply with quote

Data is present in sequential file and we do not use DB2.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 1712
Location: UK

PostPosted: Tue Mar 22, 2016 4:51 pm    Post subject:
Reply with quote

Quote:
sequential file

you mean sequential dataset
Back to top
View user's profile Send private message
sivaprasad.gadhi

New User


Joined: 21 Aug 2012
Posts: 17
Location: india

PostPosted: Tue Mar 22, 2016 8:00 pm    Post subject: Reply to: alphanumeric sequence generation
Reply with quote

Yes input is in Sequential dataset and is of length 80 bytes
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Thu Mar 24, 2016 1:36 am    Post subject:
Reply with quote

Meanwhile, you could quickly write a program instead and get this done.
Back to top
View user's profile Send private message
sivaprasad.gadhi

New User


Joined: 21 Aug 2012
Posts: 17
Location: india

PostPosted: Thu Mar 24, 2016 2:51 am    Post subject:
Reply with quote

Can you please suggest pseudocode for program to achieve the above functionality?
Back to top
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Mar 24, 2016 5:53 am    Post subject: Reply to: alphanumeric sequence generation
Reply with quote

See if this gives you some clues.
Back to top
View user's profile Send private message
Rohit Umarjikar

Senior Member


Joined: 21 Sep 2010
Posts: 1609
Location: NY,USA

PostPosted: Thu Mar 24, 2016 9:06 pm    Post subject:
Reply with quote

If this is one time then why don't you hardcode in dfsort?
For e.g. 01 -->AA, 02-->AB, 03-->AC and so on....till 99. and write those many IFTHEN sentences and use overlay to replace 01 with AA and so on by grouping them. I think that is the easiest way to replace the ranges
Quote:
Can you please suggest pseudocode for program to achieve the above functionality?

refer here
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Sequence number add in SORT pshongal SYNCSORT 3 Fri Sep 02, 2016 3:32 pm
No new posts Random Password (in string format) ge... ezhavendhan COBOL Programming 10 Mon Aug 29, 2016 3:18 pm
This topic is locked: you cannot edit posts or make replies. Alphanumeric to Numeric move on UNIX mistah kurtz COBOL Programming 16 Wed Jul 27, 2016 8:47 pm
No new posts alphanumeric sequence generation sivaprasad.gadhi COBOL Programming 6 Wed Mar 30, 2016 3:03 am
No new posts To determine the range on a Alphanume... Prasanth Kumar COBOL Programming 3 Mon Feb 15, 2016 9:35 am


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