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

Generate a file with all possible relationships.Impossible?


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

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Wed Sep 24, 2008 2:55 pm
Reply with quote

I must thank for the reply on my previous post about combining two files

Now I have a new question, I think is a little bit challenging, and I don't know if it is efficient to do it with DFSORT/ICETOOL.

I only have one file of size 14 (7+7), like this:
Code:
1111111AAAAAAA
2222222BBBBBBB
3333333CCCCCCC
4444444AAAAAAA
4444444BBBBBBB
4444444CCCCCCC
5555555CCCCCCC


What I wanna do is to have an output that gives me all the relationships between the letters and the number, like this:
Code:
1111111AAAAAAA1111111
1111111AAAAAAA4444444
4444444AAAAAAA1111111
4444444AAAAAAA4444444
2222222BBBBBBB2222222
2222222BBBBBBB4444444
4444444BBBBBBB2222222
4444444BBBBBBB4444444
3333333CCCCCCC3333333
3333333CCCCCCC4444444
3333333CCCCCCC5555555
4444444CCCCCCC3333333
4444444CCCCCCC4444444
4444444CCCCCCC5555555
5555555CCCCCCC3333333
5555555CCCCCCC4444444
5555555CCCCCCC5555555


Is this possible? I only have a way to do it and its with COBOL.
Is there a GURU of DFSORT/ICETOOL?

Many thanks.
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Wed Sep 24, 2008 4:58 pm
Reply with quote

Quote:
Is there a GURU of DFSORT/ICETOOL

Yes, it's none but our Moderator, Frank.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Sep 24, 2008 9:35 pm
Reply with quote

Quote:
Is there a GURU of DFSORT/ICETOOL

Yes, it's none but our Moderator, Frank.


Kolusu and I are both DFSORT developers, so that's as close to GURUs as you're going to get on a help board.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Wed Sep 24, 2008 9:37 pm
Reply with quote

rafaelantunes,

You need to explain the "rules" for getting from input to output before anyone can help you.
Back to top
View user's profile Send private message
rafaelantunes

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Thu Sep 25, 2008 1:58 pm
Reply with quote

Fair enough...

Ok.

Lets call things by their name:
Code:
1111111AAAAAAA
2222222BBBBBBB
3333333CCCCCCC
4444444AAAAAAA
4444444BBBBBBB
4444444CCCCCCC
5555555CCCCCCC


This file as numbers and letters.
The numbers are "Operation Number" and the letters are "Invoice Number".

In this file what I am saying is that the invoice "AAAAAAA" was modified in two operations ("1111111" and "4444444"). The invoice "BBBBBBB" was modified on "2222222" and "4444444"... and so one.

One invoice could have one or too many operations, and one operation could have one or many invoices.

What I wanna do (and believe me, I don't know if it is possible) is to have an output that gives me the relationship of the operations by looking at the invoices.

The output is generated by looking to invoice "AAAAAAA" and get all the operations: "1111111" and "4444444".
Then I will say that operation "1111111" is connect with both operations because one time in the future the invoice was modified by both operations.

So I have
Code:
1111111AAAAAAA1111111
1111111AAAAAAA4444444


Now I must replicate the same relationship with operation number "44444444":
Code:
4444444AAAAAAA1111111
4444444AAAAAAA4444444


Now that I have analysed the invoice "AAAAAAA" I will do it for invoice "BBBBBBB" and so on...

I know that this could be hard to explain, but feel free to ask questions.

Any ideas will be great...

Best regards
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Sep 25, 2008 10:08 pm
Reply with quote

rafaelantunes,

You can do this with the new WHEN=GROUP function of DFSORT available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008). I assumed that you can have a max possible variations with each key. If you have more than we can adjust the job.

Code:

//STEP0100 EXEC PGM=ICEMAN                               
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
1111111AAAAAAA                                           
2222222BBBBBBB                                           
3333333CCCCCCC                                           
4444444DDDDDDD                                           
5555555EEEEEEE                                           
4444444AAAAAAA                                           
4444444BBBBBBB                                           
4444444CCCCCCC                                           
5555555CCCCCCC                                           
6666666DDDDDDD                                           
7777777DDDDDDD                                           
8888888DDDDDDD                                           
9999999EEEEEEE                                           
0000000EEEEEEE                                           
AAAAAAAEEEEEEE                                           
BBBBBBBEEEEEEE                                           
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *       
  OPTION EQUALS                                                     
  INREC OVERLAY=(85:1,7)                                           
  SORT FIELDS=(8,7,CH,A,1,7,CH,A)                                   
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(93:SEQNUM,2,ZD,RESTART=(8,7))),
  IFTHEN=(WHEN=GROUP,BEGIN=(93,2,ZD,EQ,1),RECORDS=5,               
    PUSH=(15:85,7)),                                               
  IFTHEN=(WHEN=GROUP,BEGIN=(93,2,ZD,EQ,2),RECORDS=4,               
    PUSH=(22:85,7)),                                               
  IFTHEN=(WHEN=GROUP,BEGIN=(93,2,ZD,EQ,3),RECORDS=3,               
    PUSH=(29:85,7)),                                               
  IFTHEN=(WHEN=GROUP,BEGIN=(93,2,ZD,EQ,4),RECORDS=2,               
    PUSH=(36:85,7)),                                               
  IFTHEN=(WHEN=GROUP,BEGIN=(93,2,ZD,EQ,5),RECORDS=1,               
    PUSH=(43:85,7))                                                 
                                                                   
  OUTFIL IFOUTLEN=21,                             
  IFTHEN=(WHEN=(93,2,ZD,EQ,1),BUILD=(1,22)),     
  IFTHEN=(WHEN=(93,2,ZD,EQ,2),                   
  BUILD=(15,7,8,7,22,7,/,                         
         01,7,8,7,15,7,/,                         
         01,7,8,7,22,7)),                         
  IFTHEN=(WHEN=(93,2,ZD,EQ,3),                   
  BUILD=(15,7,8,7,29,7,/,                         
         22,7,8,7,29,7,/,                         
         01,7,8,7,15,7,/,                         
         01,7,8,7,22,7,/,                         
         01,7,8,7,29,7)),                         
  IFTHEN=(WHEN=(93,2,ZD,EQ,4),                   
  BUILD=(15,7,8,7,36,7,/,                         
         22,7,8,7,36,7,/,                         
         29,7,8,7,36,7,/,                         
         01,7,8,7,15,7,/,                         
         01,7,8,7,22,7,/,                         
         01,7,8,7,29,7,/,                         
         01,7,8,7,36,7)),                         
  IFTHEN=(WHEN=(93,2,ZD,EQ,5),                   
  BUILD=(15,7,8,7,43,7,/,                         
         22,7,8,7,43,7,/,                         
         29,7,8,7,43,7,/,                         
         36,7,8,7,43,7,/,                         
         01,7,8,7,15,7,/,                         
         01,7,8,7,22,7,/,                         
         01,7,8,7,29,7,/,                         
         01,7,8,7,36,7,/,                         
         01,7,8,7,43,7))                         
/*


For complete details on the WHEN=GROUP function and the other new functions available with PTF UK90013, see:

Use [URL] BBCode for External Links


Hope this helps...

Cheers
Back to top
View user's profile Send private message
rafaelantunes

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Fri Sep 26, 2008 2:48 pm
Reply with quote

Ok...

I have a few comments:
a) I think I do not have the new WHEN=GROUP function of DFSORT as it return an error while running your code exactly at that line of code;
b) You assumed that I have a max possible variations, but... I don't... I mean I can jump in with a number because that number could be huge... One million? Two million... I don't know. What I can say is that I now have 20.000.000 of operations and it rises in average 8.000.000/year;
c) In your code you have added letters as operations numbers...
Code:
0000000EEEEEEE                                           
AAAAAAAEEEEEEE                                           
BBBBBBBEEEEEEE
This doesn't happen.
d) I put this question here but I really don't know if it is possible... icon_cry.gif

Maybe if we copied the input file and sort them by invoice number... like this

File 1
Code:
1111111AAAAAAA
4444444AAAAAAA
2222222BBBBBBB
4444444BBBBBBB
3333333CCCCCCC
4444444CCCCCCC
5555555CCCCCCC


And file 2 as equal as file 1 described above.

Can we do a mix between the two files?

Example: The first line of file 1 will repeat as the number of invoice appers on file 2.
Giving me the output:
Code:
1111111AAAAAAA1111111
1111111AAAAAAA4444444


Then I will read the second line and apply the same logic... and so on.

Can this help?

I don't know if it a good solution make an exact copy of the file... but... I'm out of ideas...

Best regards and many thanks
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Fri Sep 26, 2008 3:21 pm
Reply with quote

You can do this with SAS using SQL logic for cartesian (?) joins.
Code:

OPTIONS NOCENTER SOURCE SOURCE2;                   
                                                   
DATA OUT01 OUT02;                                   
  INFILE    OPTSIN;                                 
  INPUT     @01   PART1      $7.                   
            @08   PART2      $7.;                   
  RUN;                                             
                                                   
PROC SQL NOPRINT;                                   
  CREATE  TABLE OUT03 AS                           
  SELECT DISTINCT A.PART1, A.PART2, B.PART1 AS PART3
   FROM  OUT01 AS A, OUT02 AS B                     
   WHERE A.PART2 = B.PART2;                         
  RUN;                                             
                                                   
PROC SORT DATA=OUT03 NODUPS;                       
  BY PART1 PART3 PART3;                             
  RUN;                                             

DATA OUT04;                     
  SET OUT03;                   
  FILE  OUTFIL;
  VAROUT = PART1!!PART2!!PART3;
  PUT @01 VAROUT;
  RUN;                         
                               
PROC PRINT NOOBS;               
  RUN;                         


And in the OUTFIL DD we have
Code:

1111111AAAAAAA1111111
1111111AAAAAAA4444444
2222222BBBBBBB2222222
2222222BBBBBBB4444444
3333333CCCCCCC3333333
3333333CCCCCCC4444444
3333333CCCCCCC5555555
4444444AAAAAAA1111111
4444444BBBBBBB2222222
4444444CCCCCCC3333333
4444444AAAAAAA4444444
4444444BBBBBBB4444444
4444444CCCCCCC4444444
4444444CCCCCCC5555555
5555555CCCCCCC3333333
5555555CCCCCCC4444444
5555555CCCCCCC5555555
Back to top
View user's profile Send private message
rafaelantunes

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Fri Sep 26, 2008 4:07 pm
Reply with quote

I can't do it with SAS...

Sorry... I understand that you wanna help, but I can not implement that solution.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Fri Sep 26, 2008 8:31 pm
Reply with quote

Hello,

Quote:
as it return an error while running your code
You need to post the error message (including the message id).

Quote:
I can't do it with SAS...
Is there some business reason why not?

What is the problem with the code that already meets your requirement? If i understood correctly, you already have code working?
Back to top
View user's profile Send private message
rafaelantunes

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Fri Sep 26, 2008 9:06 pm
Reply with quote

Quote:
You need to post the error message (including the message id).

Here it goes:
Code:
ICE143I 0 BLOCKSET     SORT  TECHNIQUE SELECTED                                 
ICE250I 0 VISIT http://www.ibm.com/storage/dfsort FOR DFSORT PAPERS, EXAMPLES AND MORE
ICE000I 1 - CONTROL STATEMENTS FOR 5694-A01, Z/OS DFSORT V1R5 - 19:11 ON THU SEP 25, 2008 -
            OPTION EQUALS                                                       
            INREC OVERLAY=(85:1,7)                                             
            SORT FIELDS=(8,7,CH,A,1,7,CH,A)                                     
            OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(93:SEQNUM,2,ZD,RESTART=(8,7))),   
            IFTHEN=(WHEN=GROUP,BEGIN=(93,2,ZD,EQ,1),RECORDS=5,                 
                         $                                                     
ICE007A 0 SYNTAX ERROR                                                         
              PUSH=(15:85,7)),                                                 
              $                                                                 
ICE005A 0 STATEMENT DEFINER ERROR                                               
            IFTHEN=(WHEN=GROUP,BEGIN=(93,2,ZD,EQ,2),RECORDS=4,                 
            $                                                                   
ICE005A 0 STATEMENT DEFINER ERROR                                               
              PUSH=(22:85,7)),                                                 
              $                                                                 
ICE005A 0 STATEMENT DEFINER ERROR                                               
            IFTHEN=(WHEN=GROUP,BEGIN=(93,2,ZD,EQ,3),RECORDS=3, 
            $                                                   
ICE005A 0 STATEMENT DEFINER ERROR                               
              PUSH=(29:85,7)),                                 
              $                                                 
ICE005A 0 STATEMENT DEFINER ERROR                               
            IFTHEN=(WHEN=GROUP,BEGIN=(93,2,ZD,EQ,4),RECORDS=2, 
            $                                                   
ICE005A 0 STATEMENT DEFINER ERROR                               
              PUSH=(36:85,7)),                                 
              $                                                 
ICE005A 0 STATEMENT DEFINER ERROR                               
            IFTHEN=(WHEN=GROUP,BEGIN=(93,2,ZD,EQ,5),RECORDS=1, 
            $                                                   
ICE005A 0 STATEMENT DEFINER ERROR                               
              PUSH=(43:85,7))                                   
              $                                                 
ICE005A 0 STATEMENT DEFINER ERROR                               
             OUTFIL IFOUTLEN=21,                               
             IFTHEN=(WHEN=(93,2,ZD,EQ,1),BUILD=(1,22)),         
             IFTHEN=(WHEN=(93,2,ZD,EQ,2),     
             BUILD=(15,7,8,7,22,7,/,         
                    01,7,8,7,15,7,/,         
                    01,7,8,7,22,7)),         
             IFTHEN=(WHEN=(93,2,ZD,EQ,3),     
             BUILD=(15,7,8,7,29,7,/,         
                    22,7,8,7,29,7,/,         
                    01,7,8,7,15,7,/,         
                    01,7,8,7,22,7,/,         
                    01,7,8,7,29,7)),         
             IFTHEN=(WHEN=(93,2,ZD,EQ,4),     
             BUILD=(15,7,8,7,36,7,/,           
                    22,7,8,7,36,7,/,           
                    29,7,8,7,36,7,/,           
                    01,7,8,7,15,7,/,           
                    01,7,8,7,22,7,/,           
                    01,7,8,7,29,7,/,           
                    01,7,8,7,36,7)),           
             IFTHEN=(WHEN=(93,2,ZD,EQ,5),     
             BUILD=(15,7,8,7,43,7,/,         
                    22,7,8,7,43,7,/,                       
                    29,7,8,7,43,7,/,                       
                    36,7,8,7,43,7,/,                       
                    01,7,8,7,15,7,/,                       
                    01,7,8,7,22,7,/,                       
                    01,7,8,7,29,7,/,                       
                    01,7,8,7,36,7,/,                       
                    01,7,8,7,43,7))                         
                                                           
ICE751I 0 C5-K24705 C6-K90007 C7-K90000 C8-K90007 E7-K24705
ICE052I 3 END OF DFSORT                                     

Quote:
Is there some business reson why not?

Yes... I believe so... Since when I asked my superiors about that possibility the answer was "Out of question"... I don't know why... sorry.

Quote:
What is the problem with the code that already meets your requirement? If i understood correctly, you already have code working?

Don't know if I understood your comment but... if you were refering about my actual solution that is by running a COBOL program, than I must say that it works, but has a few disavantages:
a) Time for implementation (I have to implement about 8/10 programs since the data is diferent (size, type, etc...)
b) Future maintenance, it's easier to do maintenance on only the JCLs rather than COBOL (recompile, envoriments, etc.)
c) The execution time... Its not fast...

Any ideas?
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Sat Sep 27, 2008 12:08 am
Reply with quote

Hello,

It may be that you are not using the most current dfsort ptf. If you run any sort that runs successful and post the complete ICE201I message, we will be able to see which ptf level is installed.

Quote:
Since when I asked my superiors about that possibility the answer was "Out of question"...
That would not be a business reason, but a just a statement of preference (which you may have to accept, unfortunately icon_neutral.gif ).

Quote:
a) Time for implementation (I have to implement about 8/10 programs since the data is diferent (size, type, etc...)
b) Future maintenance, it's easier to do maintenance on only the JCLs rather than COBOL
Sorry, but i disagree with these. If the code is already working and the other requirements are the same except they have different input, it should be faster to clone the already working code to use the new attributes than go thru all of the control statements and modify them to the new data positions. If you are not available, will the expectation be that the DFSORT developers perform maintenance on the processes . . .
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Sat Sep 27, 2008 3:04 am
Reply with quote

rafaelantunes,

That error message indicates you do not have z/OS DFSORT V1R5 PTF UK90013 (July, 2008). If you want to use WHEN=GROUP, ask your System Programmer to install that PTF (it's free).

Kolusu and I are on vacation today. So he probably won't see/respond to your latest post until Monday. If you like, you could send him a note offline (skolusu@us.ibm.com) asking him to respond on Monday indicating if you'll be able to use WHEN=GROUP or not.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Sep 30, 2008 3:02 am
Reply with quote

rafaelantunes,

I can change the job to use splice and get the results but it is also limited to the number of variations you can have for EACH KEY

Quote:

You assumed that I have a max possible variations, but... I don't... I mean I can jump in with a number because that number could be huge... One million? Two million... I don't know. What I can say is that I now have 20.000.000 of operations and it rises in average 8.000.000/year;


Wow. 20 million variations for each key? Are you telling me the file size or each KEY can have a 20,000,000 variations ? That is a lot of variations.

what is the max no: of operations a single Invoice can have? If it is under reasonable number (25) then we can do using SORT. If you have more than that then you probably are better off writing a program.
Back to top
View user's profile Send private message
rafaelantunes

New User


Joined: 10 May 2007
Posts: 32
Location: Portugal

PostPosted: Wed Oct 01, 2008 8:29 pm
Reply with quote

Yes... Unfortunatly I do have more than 25 possible relations...
In some cases is one million...

arcvns did sent me a possible solution that works with the example that I gave at the begining of the topic, altough with the real files, it takes forever and then it abends with out of space reason.

I do believe that the most right decision is to writing a COBOL program.

Many thanks for all your help in all my posts.

Best regards
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top