MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Create multiple records

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
sub
Beginner


Joined: 30 Jan 2007
Posts: 20
Topics: 12

PostPosted: Tue Jun 29, 2010 1:23 pm    Post subject: Create multiple records Reply with quote

I have a file which has the first 8 bytes as the customer id.
Code:

12CD1234
23CD3433


I am trying to create a output file that will create
Code:

12CD1234 AACD1234
12CD1234 ABCD1234
12CD1234 ACCD1234
...
12CD1234 AZCD1234
12CD1234 BACD1234
12CD1234 BBCD1234
12CD1234 BCCD1234
...
12CD1234 BZCD1234
...
12CD1234 ZACD1234
12CD1234 ZBCD1234
12CD1234 ZCCD1234
...
12CD1234 ZZCD1234

Similarly for the customer ID 23CD3433 and also for all the customer ID in the input file. The value of the first 2 bytes in the customer ID is being replaced by values starting from AA to ZZ.

Please advise if its possible using sort?

Thanks,
Sub
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12380
Topics: 75
Location: San Jose

PostPosted: Tue Jun 29, 2010 2:14 pm    Post subject: Reply with quote

sub,

The following DFSORT JCL will give you the desired results. 1. There are 26 alphabets and you need 676 (26 X 26) combinations for each alphabet. We use REPEAT parm to create that many records.

Code:

//STEP0100 EXEC PGM=SORT                                         
//SYSOUT   DD SYSOUT=*                                           
//SORTIN   DD *                                                   
12CD1234                                                         
23CD3433                                                         
//SORTOUT  DD SYSOUT=*                                           
//SYSIN    DD *                                                   
  SORT FIELDS=COPY                                               
  OUTFIL REPEAT=676,                                             
  IFTHEN=(WHEN=INIT,BUILD=(1,9,81:SEQNUM,8,ZD,START=676,INCR=1)),
                                                                 
  IFTHEN=(WHEN=INIT,                                             
  OVERLAY=(90:81,8,ZD,DIV,+676,M11,LENGTH=2,                     
           92:+1,ADD,((81,8,ZD,DIV,+26),MOD,+26),M11,LENGTH=2,   
           94:SEQNUM,2,ZD,RESTART=(93,2))),                       
                                                                 
  IFTHEN=(WHEN=INIT,BUILD=(1,9,92,4)),                           
                                                                 
  IFTHEN=(WHEN=INIT,                                             
  FINDREP=(INOUT=(C'01',C'A',C'02',C'B',C'03',C'C',               
                  C'04',C'D',C'05',C'E',C'06',C'F',               
                  C'07',C'G',C'08',C'H',C'09',C'I',               
                  C'10',C'J',C'11',C'K',C'12',C'L',               
                  C'13',C'M',C'14',C'N',C'15',C'O',               
                  C'16',C'P',C'17',C'Q',C'18',C'R',               
                  C'19',C'S',C'20',C'T',C'21',C'U',               
                  C'22',C'V',C'23',C'W',C'24',C'X',               
                  C'25',C'Y',C'26',C'Z'),STARTPOS=10,DO=2)),     
                                                                 
  IFTHEN=(WHEN=INIT,BUILD=(1,11,3,6))                             
//*

_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
sub
Beginner


Joined: 30 Jan 2007
Posts: 20
Topics: 12

PostPosted: Tue Jun 29, 2010 2:50 pm    Post subject: Reply with quote

Thanks Kolusu. The results were as expected.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group