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

How to generate a report with DFSORT


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

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Tue Feb 27, 2007 6:07 am
Reply with quote

Hi All icon_smile.gif ,

I have two input files of LRECL=80 with data as below.

Input File 1: The value of fourth column 'P indicates Production'

AAAP
BBBP
CCCP
DDDP

Input File 2: The value of fourth column 'T indicates Test'

AAAT
BBBT
CCCT

I would like to have two output files as below.

Output File 1: This file should have report as below.

******************************************
There are 4 production and 3 test records found.

A) Production records:

AAAP
BBBP
CCCP
DDDP


B) Test records:

AAAT
BBBT
CCCT

******************************************

Output File 2:

This file need to have a copy of all records from Input Files 1 & 2 and with LRECL=132 (First 80 bytes of data remaining 52 with spaces)


Is is possible to acheive the above in single step with DFSORT/ICETOOL?

Thanks in Advance

Regards,
Ramanan R
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 27, 2007 7:11 am
Reply with quote

Ramanan ,

Correct me if I am wrong, but it seems that you are asking for the two input files to be merged producing two output files.

The first output file (a printed report?) will contain all the production records from file 1 and all the test records from file 2 with an lrecl of 80.

The second output file (another printed report?) will contain all the production records from file 1 and all the test records from file 2 with an lrecl of 132; 80 bytes of the input date and 52 bytes of blank padding.

Do you want them sorted or reordered in any way?

What sort and format of headers and trailers are you expecting?

Any sub-totals or grouping?

Bill
Back to top
View user's profile Send private message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Tue Feb 27, 2007 7:27 am
Reply with quote

William,

Thanks for your reply.

Exactly the same, i want the two input files to be merged.

No need of sorting/reordering or sub-totals of records.

As mentioned in my previous post, i want the Output file 1 with data exactly within two lines of asterik lines and the second one with exactly the same way as you described.

Thanks once again,
Ramanan R
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3156
Location: Tucson AZ

PostPosted: Tue Feb 27, 2007 7:45 am
Reply with quote

Ramanan

Redrose wrote:
As mentioned in my previous post, i want the Output file 1 with data exactly within two lines of asterik lines and the second one with exactly the same way as you described.
Since I described both output files exactly the same (except for the lrecl), are you saying that, except for the lrecl, both outputs will look exactly the same?
No headers, no trailers, no "lines of asterik", right?

One more thing, do you want the contents of file 1 just followed by the contents of file 2, as in just concatenate and copy?

Bill
Back to top
View user's profile Send private message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Tue Feb 27, 2007 8:23 am
Reply with quote

William,

Sorry for the confusion.

The Output file 1 should have the data as in code window as below.
with headers and records from both Input 1 & 2.

Code:
There are 4 production and 3 test records found.

A) Production records:

AAAP
BBBP
CCCP
DDDP


B) Test records:

AAAT
BBBT
CCCT


The Output file 2 should have merged records from input 1 & 2 but with LRECL=132.

Thanks,
Ramanan R
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: Tue Feb 27, 2007 9:53 pm
Reply with quote

Ramanan R,

Here's a DFSORT/ICETOOL job that will do what you asked for:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN  DD DSN=...  input file1 (FB/80)
//        DD DSN=...  input file2 (FB/80)
//SYMP DD DSN=&&SP,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYMT DD DSN=&&ST,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL FNAMES=SYMP,REMOVECC,NODETAIL,
    INCLUDE=(4,1,CH,EQ,C'P'),
    TRAILER1=(C'P_CT,''',COUNT=(EDIT=(T)),C'''')
  OUTFIL FNAMES=SYMT,REMOVECC,NODETAIL,
    INCLUDE=(4,1,CH,EQ,C'T'),
    TRAILER1=(C'T_CT,''',COUNT=(EDIT=(T)),C'''')
/*
//S2    EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//SYMNAMES DD DSN=&&SP,DISP=(OLD,PASS)
//         DD DSN=&&ST,DISP=(OLD,PASS)
//INP  DD DSN=...  input file1 (FB/80)
//INT  DD DSN=...  input file2 (FB/80)
//RPT1 DD DISP=MOD,DSN=...  output file1
//RPT2 DD DISP=MOD,DSN=...  output file2
//TOOLIN   DD    *
COPY FROM(INP) USING(CTL1)
COPY FROM(INT) USING(CTL2)
/*
//CTL1CNTL DD *
  OUTFIL FNAMES=RPT1,REMOVECC,
    HEADER1=('There are ',P_CT,' production and ',T_CT,
      ' test records found.',/,X,/,
      'A) Production records:',/)
  OUTFIL FNAMES=RPT2,OVERLAY=(132:X)
/*
//CTL2CNTL DD *
  OUTFIL FNAMES=RPT1,REMOVECC,
    HEADER1=(/,X,/,'B) Test records:',/)
  OUTFIL FNAMES=RPT2,OVERLAY=(132:X)
/*
Back to top
View user's profile Send private message
Redrose
Currently Banned

New User


Joined: 06 Mar 2006
Posts: 19

PostPosted: Wed Feb 28, 2007 3:54 am
Reply with quote

Frank,

Thanks for your help

Regards,
Ramanan R
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 Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts Generate random number from range of ... COBOL Programming 3
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top