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

Multiple reports Generation from a single file


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

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Thu Jun 17, 2010 4:38 pm
Reply with quote

Hello

I have te create several reports from an input file wich has the following fields:

Code:
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O


I need to generate 8 reports from that master file with the following requeriments:

I’ll always sum or summarize the fields M,N,O, they are numeric fields

Code:
Report 0: The base or head report, Sum fields M,N and O for each combination of fields A,B,C,D,E,F,G


From here on, the first 7 fields are always the same, and I need to change the order of the other fields in order to generate the reports. Something like this:

Code:
Report   1: Sum fields M,N and O for each combination of fields A,B,C,D,E,F,G,H,I,J
Report   2: Sum fields M,N and O for each combination of fields A,B,C,D,E,F,G,H,K
Report   3: Sum fields M,N and O for each combination of fields A,B,C,D,E,F,G,H,L
Report 4-A: Sum fields M,N and O for each combination of fields A,B,C,D,E,F,G,H,M,N
Report 4-B: Sum fields M,N and O for each combination of fields A,B,C,D,E,F,G,M,N,K
Report 5-A: Sum fields M,N and O for each combination of fields A,B,C,D,E,F,G,L
Report 5-B: Sum fields M,N and O for each combination of fields A,B,C,D,E,F,G,L,K


I understand the I must sort the record for each field from A through the last one and then use the sum operator for each report, but I was wondering if it could be possible to generate each report with a single read of the master file using the outfil operator, or at least reduce the steps I must use and avoid to use 8 sort/sum steps. I'd like to do that process in a more efficient way, specially when the input file will be considerably big, (from 2 million records on)

We are using symbols, and the file formats requests are the following:

Input file: 655 bytes
Output File: 655 bytes. Each output file must have the same format than the input file, each field will be kept on it’s position, even the summarized fields, and there won’t be overflow of those fields because the amounts are quite small.

Any help would be welcome

Thanks a Lot

Best regards

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

Senior Member


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

PostPosted: Thu Jun 17, 2010 9:55 pm
Reply with quote

ojdiaz wrote:
Report 4-A: Sum fields M,N and O for each combination of fields A,B,C,D,E,F,G,H,M,N
Report 4-B: Sum fields M,N and O for each combination of fields A,B,C,D,E,F,G,M,N,K


ojdiaz,

How is that even possible? It would also help if you can post some sample input and desired output data along with field lengths and formats
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Thu Jun 17, 2010 10:26 pm
Reply with quote

Hi skolosu. My bad. I misscounted some fields for my example. Since I can't edit my previous message, I'll post the request again:

Input Fields

ojdiaz wrote:
Hello

I have te create several reports from an input file wich has the following fields:

Code:
A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q


I need to generate 8 reports from that master file with the following requeriments:

I’ll always sum or summarize the fields O,P,Q they are numeric fields

Code:
Report 0: The base or head report, Sum fields O, P and Q for each combination of fields A,B,C,D,E,F,G


From here on, the first 7 fields are always the same, and I need to change the order of the other fields in order to generate the reports. Something like this:

Code:
Report   1: Sum fields O, P and Q for each combination of fields A,B,C,D,E,F,G,H,I,J
Report   2: Sum fields O, P and Q for each combination of fields A,B,C,D,E,F,G,H,K
Report   3: Sum fields O, P and Q for each combination of fields A,B,C,D,E,F,G,H,L
Report 4-A: Sum fields O, P and Q for each combination of fields A,B,C,D,E,F,G,M,N
Report 4-B: Sum fields O, P and Q for each combination of fields A,B,C,D,E,F,G,M,N,K
Report 5-A: Sum fields O, P and Q for each combination of fields A,B,C,D,E,F,G,L
Report 5-B: Sum fields O, P and Q for each combination of fields A,B,C,D,E,F,G,L,K


I understand the I must sort the record for each field from A through the last one and then use the sum operator for each report, but I was wondering if it could be possible to generate each report with a single read of the master file using the outfil operator, or at least reduce the steps I must use and avoid to use 8 sort/sum steps. I'd like to do that process in a more efficient way, specially when the input file will be considerably big, (from 2 million records on)

We are using symbols, and the file formats requests are the following:

Input file: 655 bytes
Output File: 655 bytes. Each output file must have the same format than the input file, each field will be kept on it’s position, even the summarized fields, and there won’t be overflow of those fields because the amounts are quite small.

Any help would be welcome

Thanks a Lot

Best regards

Oliver


I don't think the Fields Formats are relevant, since we are using Symbols, or maps symbols, so we are using named fields instead of columns positions (as used in SYMNAMES). The input file is FB format, and all fields are of the same format.

We are using the following symbol map:

Code:
KEOACFD1,1,655,CH         
FD1-COD-OPCION,1,2,FI     
FD1-COD-AACC,3,8,PD       
FD1-COD-CLIENTE,11,9,CH   
FD1-XTI-NOCLIEN,20,1,CH   
FD1-COD-BANCO,21,4,CH           A
FD1-COD-BANCA,25,2,FI             B
FD1-COD-TERRITORIO,27,2,FI    C
FD1-COD-ZONA,29,2,FI              D
FD1-COD-OFICINA,31,2,FI         E
FD1-COD-PAIS,33,2,CH       
FD1-COD-GESTOR,35,20,CH      F 
FD1-COD-COLECTIVO,55,8,FI    L
FD1-COD-AREA,63,2,FI     
FD1-COD-AGRUP,65,4,FI           M
FD1-COD-PRODUCTO,69,4,FI    N
FD1-COD-TIPRESP,73,2,FI   
FD1-COD-MODALFC,75,2,FI   
FD1-COD-TIPAC,77,5,CH        G
FD1-COD-OBJETOFC,82,2,FI   
FD1-COD-CRIT1,84,4,FI          H
FD1-COD-CRIT2,88,4,FI          I
FD1-COD-CRIT3,92,4,FI          J
FD1-DES-CRIT1,96,60,CH     
FD1-DES-CRIT2,156,60,CH   
FD1-DES-UNIDAD,216,60,CH   
FD1-QTY-CLITOT,276,8,PD       O
FD1-QTY-CLIASIG,284,8,PD      P
FD1-QTY-CLIGEST,292,8,PD     Q
FD1-QTY-ACCTOT,300,8,PD   
FD1-QTY-ACCASIG,308,8,PD   
FD1-QTY-ACCGEST,316,8,PD   
FD1-QTY-CLTPLAN,324,8,PD   
FD1-QTY-CLTNOGES,332,8,PD 
FD1-QTY-ACCPLAN,340,8,PD   
FD1-QTY-ACCNOGES,348,8,PD 
FD1-DES-CAMPANA,356,60,CH 
FD1-DES-PRODUCTO,416,60,CH
FD1-DES-RESPUESTA,476,60,CH
FD1-DES-MODALIDAD,536,60,CH
FD1-DES-GESTOR,596,60,CH   


We are SUMMING all the fields that has QTY in them, but for the exapmle I used only 3 fields, and I need to keep it positions, and the keys, what i named A through N are the ones identified above. As for formats, well, the input and output files should have the record length in the symbol map and all the fields must remain in their positions

I hope this helps, if not, I'll be glad to add some more info

Thanks a lot

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

Senior Member


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

PostPosted: Thu Jun 17, 2010 11:13 pm
Reply with quote

ojdiaz,

What is the symbolic name which corresponds to Field K?
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Fri Jun 18, 2010 1:04 pm
Reply with quote

Sorry. That would be Symbol FD1-COD-TIPRESP
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Fri Jun 18, 2010 4:27 pm
Reply with quote

I'm sorry for the double post, but now I need to generate again several new reports. In the same previous scenario, I need to generate Aggregate reports, that is, totals for sevearl leves. Something like this:

Code:
Report 1: Sum fields O, P and Q for each combination of fields A
Report 2: Sum fields O, P and Q for each combination of fields A,B
Report 3: Sum fields O, P and Q for each combination of fields A,B,C
Report 4: Sum fields O, P and Q for each combination of fields A,B,C,D
Report 5: Sum fields O, P and Q for each combination of fields A,B,C,D,E
Report 6: Sum fields O, P and Q for each combination of fields A,B,C,D,E,F


I'm almost sure that I can accomplish this with Outfil, but I'cant seem to be able to make it work propperly. Any ideas?

Thanks in advance

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

Senior Member


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

PostPosted: Fri Jun 18, 2010 9:56 pm
Reply with quote

ojdiaz,

Is this a new request or the old request is modified to this? or are these 2 different requests?
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Sat Jun 19, 2010 12:34 am
Reply with quote

I'm sorry I wasn't clear before. The first request remains and this last request was a new complement to the first one, so basically I need to generate both scenarios. That is the reports I detailed first and those on my previous message


Thanks a lot

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

Senior Member


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

PostPosted: Sat Jun 19, 2010 1:54 am
Reply with quote

ojdiaz,

The following DFSORT JCL will give you the desired results. The trick here is to concatenate the same input dataset as many reports you want but seperate them with a header.

Using WHEN=GROUP we sequnce the records 1,2,3,.... 8 and then depending on that number we populate the keys to be sorted at the end of every record. Now we have the key to be sorted at a common place and perform the summing

this is how the contents will look at pos 656 to 705

Code:

ID  K01 K02 K03 K04 K05 K06 K07 K08 K09 K10         
--  --- --- --- --- --- --- --- --- --- ---         
1   A   B   C   D   E   F   G                       
... all records with id =1

2   A   B   C   D   E   F   G   H   I   J           
... all records with id =2

3   A   B   C   D   E   F   G   H   K               
... all records with id =3                         

4   A   B   C   D   E   F   G   H   L               
... all records with id =4

5   A   B   C   D   E   F   G   M   N               
... all records with id =5                         

6   A   B   C   D   E   F   G   M   N   K           
... all records with id =6                         

7   A   B   C   D   E   F   G   L                   
... all records with id =7                         

8   A   B   C   D   E   F   G   L   K               
... all records with id =8                         


using the ID and combined key sort we sum O, P , and Q

We use the same ID to split and write the various reports.

Code:

//STEP0100 EXEC PGM=SORT                                     
//SYSOUT   DD SYSOUT=*                                       
//SORTIN   DD *                                             
//SORTOUT  DD DSN=&&HDR,DISP=(,PASS),SPACE=(TRK,(1,0),RLSE) 
//SYSIN    DD *                                             
  SORT FIELDS=COPY                                           
  OUTFIL REMOVECC,BUILD=(655X),                             
  HEADER1=(3C'$',276:3X'000000000000000C')                   
//*
//STEP0200 EXEC PGM=SORT   
//SYSOUT   DD SYSOUT=*     
//SYMNAMES DD DSN=your symbols datasets,DISP=SHR
//*
//SORTIN   DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your input FB 655 byte file,DISP=SHR   
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your input FB 655 byte file,DISP=SHR   
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your input FB 655 byte file,DISP=SHR   
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your input FB 655 byte file,DISP=SHR   
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your input FB 655 byte file,DISP=SHR   
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your input FB 655 byte file,DISP=SHR   
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your input FB 655 byte file,DISP=SHR   
//         DD DSN=&&HDR,DISP=SHR,VOL=REF=*.STEP0100.SORTOUT     
//         DD DSN=your input FB 655 byte file,DISP=SHR   
//RPT0     DD SYSOUT=*                                         
//RPT1     DD SYSOUT=*                                         
//RPT2     DD SYSOUT=*                                         
//RPT3     DD SYSOUT=*                                         
//RPT4A    DD SYSOUT=*                                         
//RPT4B    DD SYSOUT=*                                         
//RPT5A    DD SYSOUT=*                                         
//RPT5B    DD SYSOUT=* 
//SYSIN    DD *                                                       
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(657:FD1-COD-BANCO,FD1-COD-BANCA,   
  FD1-COD-TERRITORIO,FD1-COD-ZONA,FD1-COD-OFICINA,FD1-COD-GESTOR,     
  FD1-COD-TIPAC)),                                                     
  IFTHEN=(WHEN=GROUP,BEGIN=(1,3,CH,EQ,C'$$$'),PUSH=(656:ID=1)),       
                                                                       
  IFTHEN=(WHEN=(656,1,ZD,EQ,2),                                       
  OVERLAY=(694:FD1-COD-CRIT1,FD1-COD-CRIT2,FD1-COD-CRIT3)),           
                                                                       
  IFTHEN=(WHEN=(656,1,ZD,EQ,3),                                       
  OVERLAY=(694:FD1-COD-CRIT1,FD1-COD-TIPRESP)),                       
                                                                       
  IFTHEN=(WHEN=(656,1,ZD,EQ,4),                                       
  OVERLAY=(694:FD1-COD-CRIT1,FD1-COD-COLECTIVO)),                     
                                                                       
  IFTHEN=(WHEN=(656,1,ZD,EQ,5),                                       
  OVERLAY=(694:FD1-COD-AGRUP,FD1-COD-PRODUCTO)),                       
                                                                       
  IFTHEN=(WHEN=(656,1,ZD,EQ,6),                                       
  OVERLAY=(694:FD1-COD-AGRUP,FD1-COD-PRODUCTO,FD1-COD-TIPRESP)),       
                                                                       
  IFTHEN=(WHEN=(656,1,ZD,EQ,7),                                       
  OVERLAY=(694:FD1-COD-COLECTIVO)),                                   
                                                                       
  IFTHEN=(WHEN=(656,1,ZD,EQ,8),                                       
  OVERLAY=(694:FD1-COD-COLECTIVO,FD1-COD-TIPRESP))                     
                                                                       
  SORT FIELDS=(656,50,BI,A),EQUALS                                     
  SUM FIELDS=(FD1-QTY-CLITOT,FD1-QTY-CLIASIG,FD1-QTY-CLIGEST)         
                                                                       
  OUTFIL FNAMES=RPT0,BUILD=(KEOACFD1),               
  INCLUDE=(656,1,ZD,EQ,1,AND,1,3,CH,NE,C'$$$')       
                                                     
  OUTFIL FNAMES=RPT1,BUILD=(KEOACFD1),               
  INCLUDE=(656,1,ZD,EQ,2,AND,1,3,CH,NE,C'$$$')       
                                                     
  OUTFIL FNAMES=RPT2,BUILD=(KEOACFD1),               
  INCLUDE=(656,1,ZD,EQ,3,AND,1,3,CH,NE,C'$$$')       
                                                     
  OUTFIL FNAMES=RPT3,BUILD=(KEOACFD1),               
  INCLUDE=(656,1,ZD,EQ,4,AND,1,3,CH,NE,C'$$$')       
                                                     
  OUTFIL FNAMES=RPT4A,BUILD=(KEOACFD1),               
  INCLUDE=(656,1,ZD,EQ,5,AND,1,3,CH,NE,C'$$$')       
                                                     
  OUTFIL FNAMES=RPT4B,BUILD=(KEOACFD1),               
  INCLUDE=(656,1,ZD,EQ,6,AND,1,3,CH,NE,C'$$$')       
                                                     
  OUTFIL FNAMES=RPT5A,BUILD=(KEOACFD1),               
  INCLUDE=(656,1,ZD,EQ,7,AND,1,3,CH,NE,C'$$$')       
                                                     
  OUTFIL FNAMES=RPT5B,BUILD=(KEOACFD1),               
  INCLUDE=(656,1,ZD,EQ,8,AND,1,3,CH,NE,C'$$$')       
//*
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Sat Jun 19, 2010 3:48 am
Reply with quote

ojdiaz wrote:
I'm sorry I wasn't clear before. The first request remains and this last request was a new complement to the first one, so basically I need to generate both scenarios. That is the reports I detailed first and those on my previous message


Thanks a lot

Oliver


ojdiaz,

use the following DFSORT JCL to generate the Aggregate reports.

Code:

//STEP0100 EXEC PGM=SORT       
//SYSOUT   DD SYSOUT=*         
//SYMNAMES DD DSN=your symbols datasets,DISP=SHR
//SORTIN   DD DSN=your input FB 655 byte file,DISP=SHR
//REPORT1  DD SYSOUT=*                                   
//REPORT2  DD SYSOUT=*                                   
//REPORT3  DD SYSOUT=*                                   
//REPORT4  DD SYSOUT=*                                   
//REPORT5  DD SYSOUT=*                                   
//REPORT6  DD SYSOUT=*                                   
//REPORT7  DD SYSOUT=*                                   
//REPORT8  DD SYSOUT=*                                   
//SYSIN    DD *                                           
  SORT FIELDS=(FD1-COD-BANCO,A,                           
               FD1-COD-BANCA,A,                           
               FD1-COD-TERRITORIO,A,                     
               FD1-COD-ZONA,A,                           
               FD1-COD-OFICINA,A,                         
               FD1-COD-GESTOR,A),EQUALS                   

  OUTFIL FNAMES=REPORT1,REMOVECC,NODETAIL,BUILD=(80X),                 
  SECTIONS=(FD1-COD-BANCO,                                             
  TRAILER3=(FD1-COD-BANCO,X,                                           
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                       
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                     
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                       
                                                                       
  OUTFIL FNAMES=REPORT2,REMOVECC,NODETAIL,BUILD=(80X),                 
  SECTIONS=(FD1-COD-BANCO,FD1-COD-BANCA,                               
  TRAILER3=(FD1-COD-BANCO,X,FD1-COD-BANCA,X,                           
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                       
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                     
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                       
                                                                       
  OUTFIL FNAMES=REPORT3,REMOVECC,NODETAIL,BUILD=(80X),                 
  SECTIONS=(FD1-COD-BANCO,FD1-COD-BANCA,FD1-COD-TERRITORIO,             
  TRAILER3=(FD1-COD-BANCO,X,FD1-COD-BANCA,X,FD1-COD-TERRITORIO,X,       
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                       
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                     
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                       
                                                                       
  OUTFIL FNAMES=REPORT4,REMOVECC,NODETAIL,BUILD=(80X),                 
  SECTIONS=(FD1-COD-BANCO,FD1-COD-BANCA,FD1-COD-TERRITORIO,             
            FD1-COD-ZONA,                                               
  TRAILER3=(FD1-COD-BANCO,X,FD1-COD-BANCA,X,FD1-COD-TERRITORIO,X,       
            FD1-COD-ZONA,X,                                             
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                       
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                     
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                       
                                                                       
  OUTFIL FNAMES=REPORT5,REMOVECC,NODETAIL,BUILD=(80X),               
  SECTIONS=(FD1-COD-BANCO,FD1-COD-BANCA,FD1-COD-TERRITORIO,         
            FD1-COD-ZONA,FD1-COD-OFICINA,                           
  TRAILER3=(FD1-COD-BANCO,X,FD1-COD-BANCA,X,FD1-COD-TERRITORIO,X,   
            FD1-COD-ZONA,X,FD1-COD-OFICINA,X,                       
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                   
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                   
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                   
                                                                     
  OUTFIL FNAMES=REPORT6,REMOVECC,NODETAIL,BUILD=(80X),               
  SECTIONS=(FD1-COD-BANCO,FD1-COD-BANCA,FD1-COD-TERRITORIO,         
            FD1-COD-ZONA,FD1-COD-OFICINA,FD1-COD-GESTOR,             
  TRAILER3=(FD1-COD-BANCO,X,FD1-COD-BANCA,X,FD1-COD-TERRITORIO,X,   
            FD1-COD-ZONA,X,FD1-COD-OFICINA,X,FD1-COD-GESTOR,X,       
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                   
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                   
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))         
//*
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Thu Jun 24, 2010 3:37 pm
Reply with quote

Hi Skolosu.

Thanks a lot for your support

Sadly, I can't use the When=Group option, because the shop where I'm installing the software doesn't has the DFSORT product updated, and they don't seem to be eager tu update it. I really don't understand why, but well, they are the customer. Anyway, I tried the Outfil trailer3 approach for the aggregate report, but i'm getting an error that i can't seem to be able to solve, and I think it would be a major problem for this. Here is the Sort step & card I'm Using:


Code:
//SORT04   EXEC PGM=SORT                                               
//SYMNAMES DD DSN=DAL.DESA.SYSIN(KEOASFD1),DISP=SHR                     
//SYMNOUT  DD SYSOUT=*                                                 
//SORTIN   DD DSN=ABTKEOA.INPXD05X.XOAJ181F,DISP=SHR                   
//SORTOUT  DD DSN=ABTKEOA.INPXD05X.XOAJ181G.OJDH,                       
//            DISP=(NEW,CATLG,DELETE),                                 
//            SPACE=(CYL,(150,50),RLSE),                               
//            DCB=(RECFM=FB,BLKSIZE=0)                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=(FD1-COD-BANCO,A,FD1-COD-BANCA,A,FD1-COD-TERRITORIO,A,   
               FD1-COD-ZONA,A,FD1-COD-OFICINA,A,FD1-COD-GESTOR,A,       
               FD1-COD-TIPAC,A),EQUALS                                 
  OUTFIL FNAMES=SORTOUT,REMOVECC,NODETAIL,BUILD=(655X),                 
  SECTIONS=(FD1-COD-BANCO,FD1-COD-BANCA,                     
  TRAILER3=(FD1-COD-OPCION,FD1-COD-AACC,FD1-COD-CLIENTE,               
            FD1-XTI-NOCLIEN,FD1-COD-BANCO,                             
            FD1-COD-BANCA,FD1-COD-TERRITORIO,FD1-COD-ZONA,             
            FD1-COD-OFICINA,FD1-COD-PAIS,FD1-COD-GESTOR,               
            FD1-COD-COLECTIVO,FD1-COD-AREA,FD1-COD-AGRUP,       
            FD1-COD-PRODUCTO,FD1-COD-TIPRESP,FD1-COD-MODALFC,   
            FD1-COD-TIPAC,FD1-COD-OBJETOFC,FD1-COD-CRIT1,       
            FD1-COD-CRIT2,FD1-COD-CRIT3,FD1-DES-CRIT1,         
            FD1-DES-CRIT2,FD1-DES-UNIDAD,                       
            TOT=(FD1-QTY-CLITOT,PD,LENGTH=8),                   
            TOT=(FD1-QTY-CLIASIG,PD,LENGTH=8),                 
            TOT=(FD1-QTY-CLIGEST,PD,LENGTH=8),                 
            TOT=(FD1-QTY-ACCTOT,PD,LENGTH=8),                   
            TOT=(FD1-QTY-ACCASIG,PD,LENGTH=8),                 
            TOT=(FD1-QTY-ACCGEST,PD,LENGTH=8),                 
            TOT=(FD1-QTY-CLTPLAN,PD,LENGTH=8),                 
            TOT=(FD1-QTY-CLTNOGES,PD,LENGTH=8),                 
            TOT=(FD1-QTY-ACCPLAN,PD,LENGTH=8),                 
            TOT=(FD1-QTY-ACCNOGES,PD,LENGTH=8),                 
            FD1-DES-CAMPANA,FD1-DES-PRODUCTO,FD1-DES-RESPUESTA,
            FD1-DES-MODALIDAD,FD1-DES-GESTOR))                 


and this are the errors I'm getting

Code:
ICE270I 0 PROCESSING SYMNAMES STATEMENTS                                                                                 
ICE280I 1 ORIGINAL STATEMENTS FROM SYSIN    FOLLOW                                                                       
            SORT FIELDS=(FD1-COD-BANCO,A,FD1-COD-BANCA,A,FD1-COD-TERRITORIO,A,                                           
                         FD1-COD-ZONA,A,FD1-COD-OFICINA,A,FD1-COD-GESTOR,A,                                             
                         FD1-COD-TIPAC,A),EQUALS                                                                         
            OUTFIL FNAMES=SORTOUT,REMOVECC,NODETAIL,BUILD=(655X),                                                       
            SECTIONS=(FD1-COD-BANCO,FD1-COD-BANCA,                                                                       
            TRAILER3=(FD1-COD-OPCION,FD1-COD-AACC,FD1-COD-CLIENTE,                                                       
                      FD1-XTI-NOCLIEN,FD1-COD-BANCO,                                                                     
                      FD1-COD-BANCA,FD1-COD-TERRITORIO,FD1-COD-ZONA,                                                     
                      FD1-COD-OFICINA,FD1-COD-PAIS,FD1-COD-GESTOR,                                                       
                      FD1-COD-COLECTIVO,FD1-COD-AREA,FD1-COD-AGRUP,                                                     
                      FD1-COD-PRODUCTO,FD1-COD-TIPRESP,FD1-COD-MODALFC,                                                 
                      FD1-COD-TIPAC,FD1-COD-OBJETOFC,FD1-COD-CRIT1,                                                     
                      FD1-COD-CRIT2,FD1-COD-CRIT3,FD1-DES-CRIT1,                                                         
                      FD1-DES-CRIT2,FD1-DES-UNIDAD,                                                                     
                      TOT=(FD1-QTY-CLITOT,PD,LENGTH=8),                                                                 
                      TOT=(FD1-QTY-CLIASIG,PD,LENGTH=8),                                                                 
                      TOT=(FD1-QTY-CLIGEST,PD,LENGTH=8),                                                                 
                      TOT=(FD1-QTY-ACCTOT,PD,LENGTH=8),                                                                 
                      TOT=(FD1-QTY-ACCASIG,PD,LENGTH=8),                                                                 
                      TOT=(FD1-QTY-ACCGEST,PD,LENGTH=8),                                                                 
                      TOT=(FD1-QTY-CLTPLAN,PD,LENGTH=8),                                                                 
                      TOT=(FD1-QTY-CLTNOGES,PD,LENGTH=8),                                                               
                      TOT=(FD1-QTY-ACCPLAN,PD,LENGTH=8),                                                                 
                      TOT=(FD1-QTY-ACCNOGES,PD,LENGTH=8),                                                               
                      FD1-DES-CAMPANA,FD1-DES-PRODUCTO,FD1-DES-RESPUESTA,                                               
                      FD1-DES-MODALIDAD,FD1-DES-GESTOR))                                                                 
ICE282I 0 PERFORMING SYMBOL SUBSTITUTION AS NEEDED                                                                       
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 - 07:00 ON THU JUN 24, 2010 -                             
           SORT FIELDS=(21,4,CH,A,25,2,FI,A,27,2,FI,A,29,2,FI,A,31,2,FI,A,35,20,C*                                       
                         H,A,77,5,CH,A),EQUALS                                                                           
           OUTFIL FNAMES=SORTOUT,REMOVECC,NODETAIL,BUILD=(655X),SECTIONS=(21,4,FD*                                       
                         1-COD-BANCA,TRAILER3=(FD1-COD-OPCION,FD1-COD-AACC,FD1-CO*                                       
                         $                                                                                               
ICE223A 0 REPORT FIELD ERROR                                                                                             
                         D-CLIENTE,FD1-XTI-NOCLIEN,FD1-COD-BANCO,FD1-COD-BANCA,FD*                                       
                         1-COD-TERRITORIO,FD1-COD-ZONA,FD1-COD-OFICINA,FD1-COD-PA*                                       
                         IS,FD1-COD-GESTOR,FD1-COD-COLECTIVO,FD1-COD-AREA,FD1-COD*                                       
                         -AGRUP,FD1-COD-PRODUCTO,FD1-COD-TIPRESP,FD1-COD-MODALFC,*                                       
                         FD1-COD-TIPAC,FD1-COD-OBJETOFC,FD1-COD-CRIT1,FD1-COD-CRI*                                       
                         T2,FD1-COD-CRIT3,FD1-DES-CRIT1,FD1-DES-CRIT2,FD1-DES-UNI*                                       
                         DAD,TOT=(FD1-QTY-CLITOT,PD,LENGTH=8),TOT=(FD1-QTY-CLIASI*                                       
                         G,PD,LENGTH=8),TOT=(FD1-QTY-CLIGEST,PD,LENGTH=8),TOT=(FD*                                       
                         1-QTY-ACCTOT,PD,LENGTH=8),TOT=(FD1-QTY-ACCASIG,PD,LENGTH*                                       
                         =8),TOT=(FD1-QTY-ACCGEST,PD,LENGTH=8),TOT=(FD1-QTY-CLTPL*                                       
                         AN,PD,LENGTH=8),TOT=(FD1-QTY-CLTNOGES,PD,LENGTH=8),TOT=(*                                       
                         FD1-QTY-ACCPLAN,PD,LENGTH=8),TOT=(FD1-QTY-ACCNOGES,PD,LE*                                       
                         NGTH=8),FD1-DES-CAMPANA,FD1-DES-PRODUCTO,FD1-DES-RESPUES*                                       
                         TA,FD1-DES-MODALIDAD,FD1-DES-GESTOR))                                                           
ICE751I 0 C5-K26318 C6-K90007 C7-K90000 C8-K23476 E7-K24705                                                             
ICE052I 3 END OF DFSORT                                                                                                 


This happens to me whenever i write more than one symbol field in the SECTIONS parameter, so i guessing, and the manual seems to point in that direction, that I can't use more than a single field per echa SECTION/TRAILER3 part of an outfil report.

any help with this?

thanks in advance
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Jun 24, 2010 9:55 pm
Reply with quote

Quote:
This happens to me whenever i write more than one symbol field in the SECTIONS parameter, so i guessing, and the manual seems to point in that direction, that I can't use more than a single field per echa SECTION/TRAILER3 part of an outfil report.

any help with this?


ojdiaz,

You don't have the PTF UK90013 (July, 2008) which supports multiple fields on sections without specifying the default keyword of SKIP=0L. Use the following control cards for aggregate reports
Code:

//SYSIN    DD *                                                         
  SORT FIELDS=(FD1-COD-BANCO,A,                                         
               FD1-COD-BANCA,A,                                         
               FD1-COD-TERRITORIO,A,                                   
               FD1-COD-ZONA,A,                                         
               FD1-COD-OFICINA,A,                                       
               FD1-COD-GESTOR,A),EQUALS                                 
                                                                       
  OUTFIL FNAMES=REPORT1,REMOVECC,NODETAIL,BUILD=(80X),                 
  SECTIONS=(FD1-COD-BANCO,                                             
  TRAILER3=(FD1-COD-BANCO,X,                                           
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                       
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                     
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                       
                                                                       
  OUTFIL FNAMES=REPORT2,REMOVECC,NODETAIL,BUILD=(80X),                 
  SECTIONS=(FD1-COD-BANCO,SKIP=0L,                                     
            FD1-COD-BANCA,                                             
  TRAILER3=(FD1-COD-BANCO,X,FD1-COD-BANCA,X,                           
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                       
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                     
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                       
                                                                       
  OUTFIL FNAMES=REPORT3,REMOVECC,NODETAIL,BUILD=(80X),                 
  SECTIONS=(FD1-COD-BANCO,SKIP=0L,                                     
            FD1-COD-BANCA,SKIP=0L,                                     
            FD1-COD-TERRITORIO,                                         
  TRAILER3=(FD1-COD-BANCO,X,FD1-COD-BANCA,X,FD1-COD-TERRITORIO,X,       
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                       
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                     
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                       
                                                                       
  OUTFIL FNAMES=REPORT4,REMOVECC,NODETAIL,BUILD=(80X),                 
  SECTIONS=(FD1-COD-BANCO,SKIP=0L,                                     
            FD1-COD-BANCA,SKIP=0L,                                     
            FD1-COD-TERRITORIO,SKIP=0L,                                 
            FD1-COD-ZONA,                                               
  TRAILER3=(FD1-COD-BANCO,X,FD1-COD-BANCA,X,FD1-COD-TERRITORIO,X,       
            FD1-COD-ZONA,X,                                             
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                       
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                     
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                       
                                                                       
  OUTFIL FNAMES=REPORT5,REMOVECC,NODETAIL,BUILD=(80X),                 
  SECTIONS=(FD1-COD-BANCO,SKIP=0L,                                     
            FD1-COD-BANCA,SKIP=0L,                                     
            FD1-COD-TERRITORIO,SKIP=0L,                                 
            FD1-COD-ZONA,SKIP=0L,                                       
            FD1-COD-OFICINA,                                           
  TRAILER3=(FD1-COD-BANCO,X,FD1-COD-BANCA,X,FD1-COD-TERRITORIO,X,       
            FD1-COD-ZONA,X,FD1-COD-OFICINA,X,                           
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                       
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                     
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                       
                                                                       
  OUTFIL FNAMES=REPORT6,REMOVECC,NODETAIL,BUILD=(80X),                 
  SECTIONS=(FD1-COD-BANCO,SKIP=0L,                                     
            FD1-COD-BANCA,SKIP=0L,                                     
            FD1-COD-TERRITORIO,SKIP=0L,                                 
            FD1-COD-ZONA,SKIP=0L,                                       
            FD1-COD-OFICINA,SKIP=0L,                                   
            FD1-COD-GESTOR,                                             
  TRAILER3=(FD1-COD-BANCO,X,FD1-COD-BANCA,X,FD1-COD-TERRITORIO,X,       
            FD1-COD-ZONA,X,FD1-COD-OFICINA,X,FD1-COD-GESTOR,X,         
            TOT=(FD1-QTY-CLITOT,M11,LENGTH=12),X,                       
            TOT=(FD1-QTY-CLIASIG,M11,LENGTH=12),X,                     
            TOT=(FD1-QTY-CLIGEST,M11,LENGTH=12)))                       
//*


PS: I would appreciate if you can spell my username correctly.
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Thu Jun 24, 2010 9:56 pm
Reply with quote

ojdiaz,

Here is an alternative way of getting multiple reports without using WHEN=GROUP

Code:

//SYSIN    DD *                                                         
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(657:FD1-COD-BANCO,FD1-COD-BANCA,     
  FD1-COD-TERRITORIO,FD1-COD-ZONA,FD1-COD-OFICINA,FD1-COD-GESTOR,       
  FD1-COD-TIPAC,706:SEQNUM,8,ZD)),                                     
  IFTHEN=(WHEN=(1,3,CH,EQ,C'$$$'),OVERLAY=(706:SEQNUM,8,ZD)),           
  IFTHEN=(WHEN=(1,3,CH,NE,C'$$$'),OVERLAY=(714:SEQNUM,8,ZD,             
  706:706,8,ZD,SUB,714,8,ZD,M11,LENGTH=8),HIT=NEXT),                   
                                                                       
  IFTHEN=(WHEN=(706,8,ZD,EQ,2),                                         
  OVERLAY=(694:FD1-COD-CRIT1,FD1-COD-CRIT2,FD1-COD-CRIT3)),             
                                                                       
  IFTHEN=(WHEN=(706,8,ZD,EQ,3),                                         
  OVERLAY=(694:FD1-COD-CRIT1,FD1-COD-TIPRESP)),                         
                                                                       
  IFTHEN=(WHEN=(706,8,ZD,EQ,4),                                         
  OVERLAY=(694:FD1-COD-CRIT1,FD1-COD-COLECTIVO)),                       
                                                                       
  IFTHEN=(WHEN=(706,8,ZD,EQ,5),                                         
  OVERLAY=(694:FD1-COD-AGRUP,FD1-COD-PRODUCTO)),                       
                                                                       
  IFTHEN=(WHEN=(706,8,ZD,EQ,6),                                         
  OVERLAY=(694:FD1-COD-AGRUP,FD1-COD-PRODUCTO,FD1-COD-TIPRESP)),       
                                                                       
  IFTHEN=(WHEN=(706,8,ZD,EQ,7),                                         
  OVERLAY=(694:FD1-COD-COLECTIVO)),                                     
                                                                       
  IFTHEN=(WHEN=(706,8,ZD,EQ,8),                                         
  OVERLAY=(694:FD1-COD-COLECTIVO,FD1-COD-TIPRESP))                     
                                                                       
  SORT FIELDS=(713,1,CH,A,657,49,CH,A),EQUALS                           
  SUM FIELDS=(FD1-QTY-CLITOT,FD1-QTY-CLIASIG,FD1-QTY-CLIGEST)           
                                                                       
  OUTFIL FNAMES=RPT0,BUILD=(KEOACFD1),                       
  INCLUDE=(713,1,ZD,EQ,1,AND,1,3,CH,NE,C'$$$')               
                                                             
  OUTFIL FNAMES=RPT1,BUILD=(KEOACFD1),                       
  INCLUDE=(713,1,ZD,EQ,2,AND,1,3,CH,NE,C'$$$')               
                                                             
  OUTFIL FNAMES=RPT2,BUILD=(KEOACFD1),                       
  INCLUDE=(713,1,ZD,EQ,3,AND,1,3,CH,NE,C'$$$')               
                                                             
  OUTFIL FNAMES=RPT3,BUILD=(KEOACFD1),                       
  INCLUDE=(713,1,ZD,EQ,4,AND,1,3,CH,NE,C'$$$')               
                                                             
  OUTFIL FNAMES=RPT4A,BUILD=(KEOACFD1),                       
  INCLUDE=(713,1,ZD,EQ,5,AND,1,3,CH,NE,C'$$$')               
                                                             
  OUTFIL FNAMES=RPT4B,BUILD=(KEOACFD1),                       
  INCLUDE=(713,1,ZD,EQ,6,AND,1,3,CH,NE,C'$$$')               
                                                             
  OUTFIL FNAMES=RPT5A,BUILD=(KEOACFD1),                       
  INCLUDE=(713,1,ZD,EQ,7,AND,1,3,CH,NE,C'$$$')               
                                                             
  OUTFIL FNAMES=RPT5B,BUILD=(KEOACFD1),                       
  INCLUDE=(713,1,ZD,EQ,8,AND,1,3,CH,NE,C'$$$')               
//*
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: Thu Jun 24, 2010 9:58 pm
Reply with quote

With the latest DFSORT PTFs, you can use multiple SECTION fields that way.

Since you don't have the latest DFSORT PTF, try using SKIP=0L between the SECTION fields like this:


Code:

  SECTIONS=(FD1-COD-BANCO,SKIP=0L,FD1-COD-BANCA,     
  TRAILER3=(...


(I'm just commenting on your SECTIONS operand, not your entire job.)
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Thu Jun 24, 2010 10:20 pm
Reply with quote

Thanks a Lot Frank and Skolusu. That worked just fine. I was able to generate the aggregate report as needed and also the multiple reports. BTW, just a Question. What does it menas PTF? I know the updates to the Sort product are named like that, but what does that mean?

As Usual, Frank, Skolusu, thanks a lot for your support. Each time i come here I learn a lot of useful things icon_biggrin.gif

And finally, Skolusu, I'm so sorry I misspelled your name. I read it wrongly the first time and it got stuck on my head like that
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: Thu Jun 24, 2010 10:29 pm
Reply with quote

A PTF is a change to a release in the service stream. For example, z/OS DFSORT V1R10 became available in September, 2008. Any fixes or additions to that release were/will be shipped as PTFs and all of the PTFs will be "rolled" into the next release. PTF stands for Program Temporary Fix.
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Thu Jun 24, 2010 10:43 pm
Reply with quote

Thanks a Lot Frank. I'll keept asking this customer though to update to the latest PTF, since I'm eager to test the new Joinkeys function and still haven't got the chance... We are installing software in 5 countries from here. I hope the next one where will be installing is updated icon_neutral.gif
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Tue Jun 29, 2010 3:05 pm
Reply with quote

Hello! I'm sorry to botter you guys again, but I'm going through the manuals and I can't seem to find the answer.

I have a Doubt when it comes to the execution of sort, given the results I'm obtainng after this sort card, for the previous request I made in this same thread about aggregate reports:

Code:

SORT FIELDS=(FD1-COD-BANCO,A,FD1-COD-BANCA,A,FD1-COD-TERRITORIO,A,
             FD1-COD-ZONA,A,FD1-COD-OFICINA,A,FD1-COD-GESTOR,A,   
             FD1-COD-TIPAC,A),EQUALS                             
OUTFIL FNAMES=SORT001,REMOVECC,NODETAIL,                         
OVERLAY=(FD1-COD-BANCA:+0,BI,LENGTH=2,                           
         FD1-COD-TERRITORIO:+0,BI,LENGTH=2,                       
         FD1-COD-ZONA:+0,BI,LENGTH=2,                             
         FD1-COD-OFICINA:+0,BI,LENGTH=2,                         
         FD1-COD-GESTOR:20X,655:X),                               
SECTIONS=(FD1-COD-BANCO,SKIP=0L,FD1-COD-TIPAC,                   
TRAILER3=(FD1-COD-OPCION,FD1-COD-AACC,FD1-COD-CLIENTE,           
          FD1-XTI-NOCLIEN,FD1-COD-BANCO,                         
          FD1-COD-BANCA,FD1-COD-TERRITORIO,FD1-COD-ZONA,         
          FD1-COD-OFICINA,FD1-COD-PAIS,FD1-COD-GESTOR,           
          FD1-COD-COLECTIVO,FD1-COD-AREA,FD1-COD-AGRUP,           
          FD1-COD-PRODUCTO,FD1-COD-TIPRESP,FD1-COD-MODALFC,       
          FD1-COD-TIPAC,FD1-COD-OBJETOFC,FD1-COD-CRIT1,           
          FD1-COD-CRIT2,FD1-COD-CRIT3,FD1-DES-CRIT1,             
          FD1-DES-CRIT2,FD1-DES-UNIDAD,                           
          TOT=(FD1-QTY-CLITOT,TO=PD),                             
          TOT=(FD1-QTY-CLIASIG,TO=PD),                       
          TOT=(FD1-QTY-CLIGEST,TO=PD),                       
          TOT=(FD1-QTY-ACCTOT,TO=PD),                       
          TOT=(FD1-QTY-ACCASIG,TO=PD),                       
          TOT=(FD1-QTY-ACCGEST,TO=PD),                       
          TOT=(FD1-QTY-CLTPLAN,TO=PD),                       
          TOT=(FD1-QTY-CLTNOGES,TO=PD),                     
          TOT=(FD1-QTY-ACCPLAN,TO=PD),                       
          TOT=(FD1-QTY-ACCNOGES,TO=PD),                     
          FD1-DES-CAMPANA,FD1-DES-PRODUCTO,FD1-DES-RESPUESTA,
          FD1-DES-MODALIDAD,FD1-DES-GESTOR))                 


The question or problem is: When i'm generating the aggregate reports, the fields not included in the aggregate, are supossed to be initializes, that is, zero for num fields or spaces for char fields. Hence, i though on using Outfil Overlay, which is supossed to execute before the HEADER/TRAILER options in the sort Processing diagram, however, the fields I overlayed are still coming out with in information in the Trailer3 records. My doubt is: This overlay option only affects the detail and no the HEADER/DETAILS? Here is an example of an output data set:

Code:

COD-OPCION         COD-AACC COD-CLIENTE XTI-NOCLIEN COD-BANCO COD-BANCA COD-TERRITORIO COD-ZONA COD-OFICINA COD-PAIS COD-GESTOR                  COD-COLECTIVO COD-AREA   COD-AGRUP COD-PRODUCTO COD-TIPRESP 
        Ñ2               Ñ3 Ñ4          Ñ5          Ñ6               Ñ7             Ñ8       Ñ9         Ñ10 Ñ11      Ñ12                                   Ñ13      Ñ14         Ñ15          Ñ16         Ñ17
    BI 1:2           PD 3:8 AN 11:9     AN 20:1     AN 21:4     BI 25:2        BI 27:2  BI 29:2     BI 31:2 AN 33:2  AN 35:20                          BI 55:8  BI 63:2     BI 65:4      BI 69:4     BI 73:2
    <---+> <---+----1----+> <---+--->   -           <-->         <---+>         <---+>   <---+>      <---+> <>       <---+----1----+----> <---+----1----+---->   <---+> <---+----1>  <---+----1>      <---+>
****  Top of data  ****                                                 ****  Top of data  ****                                           ****  Top of data  ****                                           
         0             4831 004011855   0           0017           9305           9101     9001         109 AR       ECGESP3                              9801        0           1            1           0
         0             3729 007250744   0           0017           9305           9101     9001         109 AR       ECGESP3                              6402        0           1            2           0
         0             4842 004013018   0           0017           9305           9101     9001         109 AR       ECGESP3             


I need that the ouput fields in the report are initialized as the Overlay says. I have the whole TRAILER3 in a control Card, and the final sort step will be something like this:

Code:

//SORT04   EXEC PGM=SORT                                               
//SYMNAMES DD DSN=DAL.DESA.SYSIN(KEOASFD1),DISP=SHR                     
//SYMNOUT  DD SYSOUT=*                                                 
//SORTIN   DD DSN=ABTKEOA.INPXD05X.XOAJ181F,DISP=SHR                   
//SORT001  DD DSN=ABTKEOA.INPXD05X.XOAJ181G.OJDH1,                     
//            DISP=(NEW,CATLG,DELETE),                                 
//            SPACE=(CYL,(150,50),RLSE),                               
//            DCB=(RECFM=FB,BLKSIZE=0)                                 
//SORT002  DD DSN=ABTKEOA.INPXD05X.XOAJ181G.OJDH2,                     
//            DISP=(NEW,CATLG,DELETE),                                 
//            SPACE=(CYL,(150,50),RLSE),                               
//            DCB=(RECFM=FB,BLKSIZE=0)                                 
//SYSPRINT DD SYSOUT=*                                                 
//SYSOUT   DD SYSOUT=*                                                 
//SYSIN    DD *                                                         
  SORT FIELDS=(FD1-COD-BANCO,A,FD1-COD-BANCA,A,FD1-COD-TERRITORIO,A, 
               FD1-COD-ZONA,A,FD1-COD-OFICINA,A,FD1-COD-GESTOR,A,     
               FD1-COD-TIPAC,A),EQUALS                               
  OUTFIL FNAMES=SORT001,REMOVECC,NODETAIL,                           
  OVERLAY=(FD1-COD-BANCA:+0,BI,LENGTH=2,                             
           FD1-COD-TERRITORIO:+0,BI,LENGTH=2,                         
           FD1-COD-ZONA:+0,BI,LENGTH=2,                               
           FD1-COD-OFICINA:+0,BI,LENGTH=2,                           
           FD1-COD-GESTOR:20X,655:X),                                 
  SECTIONS=(FD1-COD-BANCO,SKIP=0L,FD1-COD-TIPAC,                     
//         DD DSN=GDES.XE19961.JCL.CNTL(KEOAS181),DISP=SHR           
//         DD*                                                       
  OUTFIL FNAMES=SORT002,REMOVECC,NODETAIL,BUILD=(655X),               
  OVERLAY=(FD1-COD-TERRITORIO:+0,BI,LENGTH=2,                         
           FD1-COD-ZONA:+0,BI,LENGTH=2,                               
           FD1-COD-OFICINA:+0,BI,LENGTH=2,                           
           FD1-COD-GESTOR:20X,655:X),                                 
  SECTIONS=(FD1-COD-BANCO,SKIP=0L,FD1-COD-BANCA,SKIP=0L,FD1-COD-TIPAC,
//         DD DSN=GDES.XE19961.JCL.CNTL(KEOAS181),DISP=SHR           
//         DD*                                                       


And so on forth for each agregate that goes up to the FD1-COD-GESTOR field.

So to conclude, can this be achieved with the outfil options?

Thanks a lot in advance

Best regards

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

Senior Member


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

PostPosted: Tue Jun 29, 2010 10:29 pm
Reply with quote

Quote:

My doubt is: This overlay option only affects the detail and no the HEADER/DETAILS? Here is an example of an output data set:


Yes. The Header and trailer records take into consideration the OUTREC/INREC fields instead of OUTFIL fields. So you need initialize the fields using INREC?OUTREC which would apply for all the reports instead of doing it individually for each report. If you need to initialize for different values for different reports , code the default values at the end of each record and pick them according to your needs on trailer3. Make sure to set the length to the length you want on OUTFIL

Moreover you are using the parm 'NODETAIL", So none of the records you overlaid using OUTFIL OVERLAY are actually are written out.
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Wed Jun 30, 2010 1:17 pm
Reply with quote

Thanks a Lot Skolusu. Actually I don't need the details but each total line, so what I did meanwhile was to use the first Field, FD1-COD-BANCA, to initialize it for a different value for each report, 1, 2, 3, 4... and so forth, and in a subsequent SORT Step, I merged all the reports/trailer3 together, and with an IFTHEN by this field, I overlaid all the fields in the report accordingly. It's two steps, but i guess it is easier to maintain later for other persons other than me that are not so familiarized with the Sort utility.

Basically, most people around here use only to sort Fields, and ocasionally, merge files or format records in the output. Icetool is the somthing like an urban, not to mention IFTHEN which people usually don't believe it works... ¬¬ icon_eek.gif
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Wed Jun 30, 2010 9:42 pm
Reply with quote

ojdiaz wrote:
Actually I don't need the details but each total line, so what I did meanwhile was to use the first Field, FD1-COD-BANCA, to initialize it for a different value for each report, 1, 2, 3, 4... and so forth, and in a subsequent SORT Step, I merged all the reports/trailer3 together, and with an IFTHEN by this field, I overlaid all the fields in the report accordingly. It's two steps, but i guess it is easier to maintain later for other persons other than me that are not so familiarized with the Sort utility.


You can do the same in single step . why waste resources? write comments on how the job is processing. There is NO need to use 2 steps. Let me know if you need help setting up the default values for each report.

ojdiaz wrote:
Basically, most people around here use only to sort Fields, and ocasionally, merge files or format records in the output. Icetool is the somthing like an urban, not to mention IFTHEN which people usually don't believe it works... ¬¬ icon_eek.gif


Sad to hear that
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 Jun 30, 2010 10:17 pm
Reply with quote

Quote:
not to mention IFTHEN which people usually don't believe it works...


And what do they base that "belief" on? I find the assumption that IFTHEN doesn't work highly insulting, being I was the one who wrote the code for it. It works just fine, and if I do say so myself, is one of the most useful things ever added to DFSORT! Sounds like you work in a shop full of idiots. icon_evil.gif
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: Wed Jun 30, 2010 10:42 pm
Reply with quote

Hello,

Quote:
not to mention IFTHEN which people usually don't believe it works...
For lots of rather incompetent people it is easier to say that something doesn't work rather than admit they don't know how to use it. . .
Back to top
View user's profile Send private message
ojdiaz

New User


Joined: 19 Nov 2008
Posts: 98
Location: Spain

PostPosted: Thu Jul 01, 2010 9:07 pm
Reply with quote

Hello:

I'm sorry for all of the off-topic that is about to be released. Pleas indulge me this rant icon_redface.gif

Skolusu wrote:
ojdiaz wrote:
Actually I don't need the details but each total line, so what I did meanwhile was to use the first Field, FD1-COD-BANCA, to initialize it for a different value for each report, 1, 2, 3, 4... and so forth, and in a subsequent SORT Step, I merged all the reports/trailer3 together, and with an IFTHEN by this field, I overlaid all the fields in the report accordingly. It's two steps, but i guess it is easier to maintain later for other persons other than me that are not so familiarized with the Sort utility.


You can do the same in single step . why waste resources? write comments on how the job is processing. There is NO need to use 2 steps. Let me know if you need help setting up the default values for each report.

ojdiaz wrote:
Basically, most people around here use only to sort Fields, and ocasionally, merge files or format records in the output. Icetool is the somthing like an urban, not to mention IFTHEN which people usually don't believe it works... ¬¬ icon_eek.gif


Sad to hear that


Thanks a lot for your support Skolusu, but I don't really want you guyst to think I'm asking you to do my job. I understand your idea to set the defautl values at the end of the record and then choose them in the output trailer3, as a matter of fact, I tested it and it worked great, however, as I need to merge all the records later again in a single file, the second step is not a waste of processing, however, as I asked a few co-workers, the code looks complicated enough for people around here, because, as I mentioned before, people around are quite "stubborn", by lack of a better word, when it comes to maintain or see code they "don't know". Change resistance, perhaps?

The JCL is quite well commented, if I might said so myself, however, as an example, if a person here doesn't knows what the SPLICE operator does, they just won't look at it on a manual, but rather find someone to explain it and change for them, or if they know functionaly what it does step does, replace it by a cobol program. It is a continuous headache for me, who always is looking for new and improved ways for doing things, that's why I loved this forum when i discoverd it, and that's why i have learnt soo much in the past 2 years

I think porple around here is like that, becouse in this country, and in this area of work, almost no one speaks or cares for english language, in fact there is around this stupid national feeling that everything should be translated, and if you ask me, English is the default language for computer sciences.


Frank Yaeger wrote:
Quote:
not to mention IFTHEN which people usually don't believe it works...


And what do they base that "belief" on? I find the assumption that IFTHEN doesn't work highly insulting, being I was the one who wrote the code for it. It works just fine, and if I do say so myself, is one of the most useful things ever added to DFSORT! Sounds like you work in a shop full of idiots. icon_evil.gif


You wrote the IFTHEN code? Then you have been my savior countless times Frank, becouse I Agree. It is the most useful thing i had found and it has helped me countless times. Not to mention it helped me improve my development times.

dick scherrer wrote:
Hello,

Quote:
not to mention IFTHEN which people usually don't believe it works...
For lots of rather incompetent people it is easier to say that something doesn't work rather than admit they don't know how to use it. . .


I think what Dick says is quite true. I mean, most people who works in IT around here, don't even have a degree on computer sciences. I still don't understand why i work next to Chemical engineers, or Biologist, among many other different kind of persons who don't even know formally how to write a program. It is frustrating to train people who doesn't even know what a "DO WHILE" or "PERFORM UNTIL" is... a waste of my time if you ask me. This is a shop full of idiots? Maybe, I'd say is a country where the feeling is: Let's do this as we always have done it, and don't change anything since we already know how it works that way.

Seriously, is frustrating, for me, as a Systems Engineer who happens to be Project Leader now to deal with managers who don't even care about performance issues or best practices, and instead all they care is for delivery dates. Well, maybe is an evil plot to sell later optimization projects... sheeeeshh.. I Hope I don't grow up to be like that ¬_¬

Anyway, I'm sorry for all the Off-topic, but i needed to let it out of me. I'll keep my belief and line of work that I don't have to use "regular" tools becouse others don't know how to use them. The hell with them and their mediocrity. If they don't know something, study it or read the manual.

Anyway, thanks again for everything guys. Seriously. I think your shop would be my dream job *sighs*
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10872
Location: italy

PostPosted: Thu Jul 01, 2010 9:29 pm
Reply with quote

a bit of ranting never hurt anybody icon_biggrin.gif
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 Goto page 1, 2  Next

 


Similar Topics
Topic Forum Replies
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts Access to non cataloged VSAM file JCL & VSAM 18
Search our Forums:

Back to Top