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

How to create multiple Reports with DFSORT?


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

New User


Joined: 07 Nov 2006
Posts: 13
Location: Thiruvanathapuram

PostPosted: Wed Mar 14, 2007 4:39 pm
Reply with quote

Hi All,
I have a file like

Code:

003ding 067 12
001dong 123 14
002dish 123 13


I have to sort the the file with respect to 1st field and get an output report as

Code:

REPORT   page     date     time

Number      Name      E-no    Id
---------   -------   ------  ----
001         dong      123     14
002         dish      123     13
003         ding      067     12


and also sort the same w.r.t the last field and get a similar report with the heading as above.

Can you please suggest a JCL with DFSORT utility satisfying the above requirement??

Awaiting your sooner reply,

Thanking you
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Mar 14, 2007 4:47 pm
Reply with quote

I dont think more than one report (in your case two) can be created in single step. I feel you need two steps for your requirement.

Corrections are always welcome.
Back to top
View user's profile Send private message
youayshu
Currently Banned

New User


Joined: 07 Nov 2006
Posts: 13
Location: Thiruvanathapuram

PostPosted: Wed Mar 14, 2007 4:51 pm
Reply with quote

Hi murmohk1,
Two steps is ok, But I need it in a single JCl. only thats the condition. Can u suggest the same?
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1436
Location: Bangalore,India

PostPosted: Wed Mar 14, 2007 4:56 pm
Reply with quote

Here is the code which generates report for you -


Assumed your IP and OP files are 80 in length

Code:
 

SORT FIELDS=(1,3,ch,a)        * sort number in ascending order

 OUTFIL REMOVECC,

   HEADER1=(10:C'REPORT  ',         
                  page,
                  date,
                  time),

   HEADER2=(/,                                                * insert new line
            10:C' Number Name E-no Id',                * your heading
           /,
            80C'=')



For the second report change the sort condition.

Hope this solves your problem.
Back to top
View user's profile Send private message
youayshu
Currently Banned

New User


Joined: 07 Nov 2006
Posts: 13
Location: Thiruvanathapuram

PostPosted: Wed Mar 14, 2007 5:03 pm
Reply with quote

Thank you

I'll try this out& let u know the result
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 Mar 14, 2007 8:50 pm
Reply with quote

youayshu,

Here's a DFSORT/ICETOOL job that will do what you asked for in one step. If you don't want ANSI control characters (e.g. '1' for eject) in your reports, add REMOVECC to the OUTFIL statements. Note that you can change the form of the PAGE number, DATE and TIME if you need to.

Code:

//S1    EXEC  PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG  DD SYSOUT=*
//IN DD *
003ding 067 12
001dong 123 14
002dish 123 13
/*
//RPT1 DD SYSOUT=*
//RPT2 DD SYSOUT=*
//TOOLIN   DD    *
SORT FROM(IN) TO(RPT1) USING(CTL1)
SORT FROM(IN) TO(RPT2) USING(CTL2)
/*
//CTL1CNTL DD *
  SORT FIELDS=(1,3,ZD,A)
  OUTFIL FNAMES=RPT1,
    HEADER2=(1:'REPORT',10:PAGE=(M10,LENGTH=3),
      19:DATE,28:TIME,/,X,/,
      1:'Number',13:'Name',23:'E-no',31:'Id',/,
      1:9'-',13:7'-',23:6'-',31:4'-'),
    BUILD=(1:1,3,13:4,4,23:9,3,31:13,2,5X)
/*
//CTL2CNTL DD *
  SORT FIELDS=(13,2,ZD,A)
  OUTFIL FNAMES=RPT2,
    HEADER2=(1:'REPORT',10:PAGE=(M10,LENGTH=3),
      19:DATE,28:TIME,/,X,/,
      1:'Number',13:'Name',23:'E-no',31:'Id',/,
      1:9'-',13:7'-',23:6'-',31:4'-'),
    BUILD=(1:1,3,13:4,4,23:9,3,31:13,2,5X)
/*
Back to top
View user's profile Send private message
youayshu
Currently Banned

New User


Joined: 07 Nov 2006
Posts: 13
Location: Thiruvanathapuram

PostPosted: Thu Mar 15, 2007 1:59 pm
Reply with quote

Thank you for ur suggestion. It worked ou correctly.....
Can you please suggest the keyword using which we can filter only the required FIELDS(not records) from the input files? I think INCLUDE is for filtering the records only, right?
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 Mar 15, 2007 8:26 pm
Reply with quote

Quote:
Can you please suggest the keyword using which we can filter only the required FIELDS(not records) from the input files? I think INCLUDE is for filtering the records only, right?


I don't understand what you're asking. This question doesn't seem to relate to your original example. INCLUDE "filters" records based on a test of values in the fields of the records (e.g. if field1 = 5). What do you mean by "filter only the required fields"? It would help if you gave an example of what you want to do (input records and expected output records).
Back to top
View user's profile Send private message
rammraju

New User


Joined: 05 Mar 2005
Posts: 65
Location: Hyderabad

PostPosted: Wed Mar 28, 2007 4:08 pm
Reply with quote

I guess youayshu is referring to a column of a record when he is referring a "Field". If my guess is right SPLICE of ICETOOL should help him.

Please correct me if anything is wrong
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 INCLUDE OMIT COND for Multiple values... DFSORT/ICETOOL 5
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 How to create a list of SAR jobs with... CA Products 3
Search our Forums:

Back to Top