IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search Log in to check your private messages Log in
 

List combinations of N items


 
IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Sat Feb 15, 2014 1:01 pm
Reply with quote

Hi,

I have a requirement to generate test data with input like below

Code:

Para_1  Var_1  A
Para_1  Var_1  Test
Para_1  Var_2  B
Para_1  Var_2  Test
Para_1  Var_3  C
Para_1  Var_3  Test
Para_1  Var_4  D
Para_1  Var_4  Test


Expected output is all combinations of each Var*.
Var* should be of 10 bytes (if text is less than 10 bytes, padd it with spaces)
A, B, C, Text... should be of 60 bytes (if text is less than 60 bytes, padd it with spaces)

Expected Output is:

Code:

Para_1Var_1...(Total 10 bytes)..A (Total 60 bytes)...Var_2....B...Var_3...C
Para_1Var_1...(Total 10 bytes)..Test (Total 60 bytes)...Var_2....B...Var_3...C
Para_1Var_1...(Total 10 bytes)..Test (Total 60 bytes)...Var_2....Test...Var_3...C
......
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7312
Location: Inside the Matrix

PostPosted: Sat Feb 15, 2014 3:48 pm
Reply with quote

Can you clarify your sample data, like make everything four bytes, separated by blanks, and ensure that all your combinations are covered in your sample data?
Back to top
View user's profile Send private message
kalukakkad

New User


Joined: 10 Mar 2005
Posts: 81

PostPosted: Sat Feb 15, 2014 7:14 pm
Reply with quote

Code:

Field_1(10 bytes long)       Field_2(10 bytes long)         Field_3(60 bytes long)
Para_1                             Var_1                                A
Para_1                             Var_1                                Test
Para_1                             Var_2                                B
Para_1                             Var_2                                Test
Para_1                             Var_3                                C
Para_1                             Var_3                                Test
Para_1                             Var_4                                D
Para_1                             Var_4                                Test


Sample Output : There can be more combinations
Code:

Para_1                Var_1       A              Var_2               B            Var_3     C       Var_4     D
Para_1                Var_1       Test           Var_2               B            Var_3     C       Var_4     D
Para_1                Var_1       Test           Var_2               Test         Var_3     C       Var_4     D
Para_1                Var_1       Test           Var_2               Test         Var_3     Test    Var_4     D
Para_1                Var_1       Test           Var_2               Test         Var_3     Test    Var_4     Test

Para_1                Var_1       A              Var_2               Test         Var_3     Test    Var_4     Test
Para_1                Var_1       A              Var_2               B            Var_3     Test    Var_4     Test
Para_1                Var_1       A              Var_2               B            Var_3     C       Var_4     Test
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Feb 18, 2014 2:55 am
Reply with quote

kalukakkad,

How many places are you going to post the same question?
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Forum Replies
No new posts List of Active Jobs in CTRL-M JCL & VSAM 1
No new posts Need help in REXX code to list the af... CLIST & REXX 3
No new posts Extracting a list of ALL DSN's on an ... IBM Tools 14
No new posts Dynamically split large DSN list into... CLIST & REXX 14
No new posts recursive SQL to generate list DB2 5

Back to Top