IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Generating sequence using Sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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
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
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
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
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
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
No new posts how to calculate SUM value for VB fil... DFSORT/ICETOOL 1
Search our Forums:

Back to Top