Page 1 of 1

Generating a report

PostPosted: Thu Jun 09, 2011 7:13 pm
by javivi
Hi

I have the next file

aaaaaaaaaa pepe lopez 1111 00123.35
aaaaaaaaaa pepe lopez 2222 00100,12
bbbbbbbbbb luis sanche 1111 00222,34
cccccccccccc jose sanz 1111 12345.87
cccccccccccc jose sanz 2222 00345.76

And I nead to produced a report like this


PORTFOLIO NAME ACCOUNT SHARES
-------------- -------------- ------------ -------------
aaaaaaaaaa pepe lopez 1111 00123.35
2222 00100.12
bbbbbbbbbb luis sanche 1111 00222,34
cccccccccccc jose sanz 1111 12345.87
2222 00345.76

It is possible?

Re: Generating a report

PostPosted: Thu Jun 09, 2011 8:33 pm
by BillyBoyo
Have you tried the manuals? The "getting started" has a number of report examples.

Can you put your data in the "code" tags? (grey oblong button above the data-entry box, says "Code") This will preserve your spacing. I assume that the interchange of commas and dots is not part of the requirement, but typos?

Re: Generating a report

PostPosted: Thu Jun 09, 2011 10:42 pm
by Frank Yaeger
javivi,

You can use a DFSORT job like the following to do what you asked for. I assumed your input was already in sorted order as shown in your example. If not, you'll need to replace OPTION COPY with a SORT statement. I wasn't sure of the positions of your fields, so I guessed. Adjust as needed.

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
aaaaaaaaaa   pepe lopez  1111 00123.35
aaaaaaaaaa   pepe lopez  2222 00100.12
bbbbbbbbbb   luis sanche 1111 00222.34
cccccccccccc jose sanz   1111 12345.87
cccccccccccc jose sanz   2222 00345.76
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY
  OUTREC IFOUTLEN=80,
    IFTHEN=(WHEN=GROUP,KEYBEGIN=(1,25),PUSH=(81:SEQ=8)),
    IFTHEN=(WHEN=(81,8,ZD,GT,1),OVERLAY=(1:25X))
  OUTFIL REMOVECC,
    HEADER2=('PORTFOLIO      NAME           ACCOUNT      SHARES',/,
     '-------------- -------------- ------------ -------------'),
   BUILD=(1,13,16:14,12,31:26,4,44:31,8,80:X)
/*


SORTOUT would have:

PORTFOLIO      NAME           ACCOUNT      SHARES             
-------------- -------------- ------------ -------------       
aaaaaaaaaa     pepe lopez     1111         00123.35           
                              2222         00100.12           
bbbbbbbbbb     luis sanche    1111         00222.34           
cccccccccccc   jose sanz      1111         12345.87           
                              2222         00345.76           


If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

http://www.ibm.com/support/docview.wss? ... g3T7000080