Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Generating sequence using Sort

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

New User


Joined: 19 Aug 2008
Posts: 6
Location: Chennai-India

PostPosted: Thu Jan 29, 2009 12:32 pm    Post subject: Generating sequence using Sort
Reply with quote

Hi!
We need to generate missing sequence from a given dataset.Rather going for a cobol program ,is that could acheived using sort?

Sequence starts from A00 TO Z99.
Containing [ A00,A01....A99,B00,B01...B99,C00,C01,C02..C99...... Z00,Z01......Z99]


Input file :
A01
A02
A06
A11

Output File: Taking A11 as the maximum value ,the sequence should get generated with in that range.

A00
A03
A04
A05
A07
A08
A09
A10
Back to top
View user's profile Send private message

lohithegde

New User


Joined: 18 May 2008
Posts: 31
Location: Chennai

PostPosted: Thu Jan 29, 2009 3:22 pm    Post subject:
Reply with quote

Hi

this can be vary easily achieved in easytrieve programing

I am not sure usinghow to do in SORT(ICETOOL)

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

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Thu Jan 29, 2009 10:34 pm    Post subject:
Reply with quote

kalpana manohar,


Do you always have 1 alphabet to deal with or more than 1?

can your input be as follows?
Code:

A00
A08
B10
C27
D76
Z99



for the above input do you want to generate as follows?
Code:

A00  thru A08
B01  thru B10
C01  thru C27
D01  thru D76
Z01  thru Z99


What is the LRECL and RECFM of the dataset?
Back to top
View user's profile Send private message
kalpana manohar

New User


Joined: 19 Aug 2008
Posts: 6
Location: Chennai-India

PostPosted: Fri Jan 30, 2009 1:39 pm    Post subject:
Reply with quote

Hi Kolusu,
The sequence will have only one alphabet [A - Z] in position 1 followed by 2 numeric values[00-99].

RECFM = FB
LREC=80

Input
Code:

A00
A08
B10
C27
D76
Z99


Output
Code:


A01 Thru A07
A09 Thru B09     [After A99,the sequence should begin with B00]
B11 Thru C26     [Includes B11-B99,C00-C26]
C28 Thru D75
D77 Thru Z98


Kindly let me know,if the query stated above is clear and for any additional information.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Sat Jan 31, 2009 3:03 am    Post subject: Reply to: Generating sequence using Sort
Reply with quote

kalpana manohar,

The following JCL will give you the desired results. I assumed that you always want to create a sequence (A00,A01....A99,B00,B01...B99,C00,C01,C02..C99...... Z00,Z01......Z99) eliminating the ones you have in your input file.

You can run STEP0100 once and have the results stored in a dataset permanently. And you just need to run step0200.

Step0100 creates all the possible sequence for all the 26 alphabets which would be 2600 records.

Now concatenate this dataset with the your missing sequence dataset and eliminate all dups.

Code:

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
DUMMY RECORD                                               
//SORTOUT  DD DSN=&&T1,DISP=(,PASS),SPACE=(CYL,(1,1),RLSE)
//SYSIN    DD *                                           
  SORT FIELDS=COPY                                         
  OUTFIL REPEAT=100,                                       
  BUILD=(C'A',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'B',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'C',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'D',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'E',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'F',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'G',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'H',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'I',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'J',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'K',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'L',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'M',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'N',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'O',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'P',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'Q',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'R',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'S',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'T',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'U',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'V',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'W',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'X',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'Y',SEQNUM,2,ZD,START=0,INCR=1,/,               
         C'Z',SEQNUM,2,ZD,START=0,INCR=1,80:X)             
/*                                                         
//STEP0200 EXEC PGM=ICETOOL                 
//TOOLMSG  DD SYSOUT=*                     
//DFSMSG   DD SYSOUT=*                     
//IN       DD DSN=&&T1,DISP=SHR
//         DD *             
A00                         
A08                         
B10                         
C27                         
D76                         
Z99                         
//OUT      DD SYSOUT=*                   
//TOOLIN   DD *                             
  SELECT FROM(IN) TO(OUT) ON(1,3,CH) NODUPS
/*
Back to top
View user's profile Send private message
kalpana manohar

New User


Joined: 19 Aug 2008
Posts: 6
Location: Chennai-India

PostPosted: Mon Feb 09, 2009 12:43 pm    Post subject: Reply to: Generating sequence using Sort
Reply with quote

Hi,
Thanks Kolusu.. It worked as desired.
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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us