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

Can we skip headings while sorting a report using DFSORT?


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

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Mon Nov 13, 2006 5:31 pm
Reply with quote

I have a requirement that I need to skip headings(first 3 lines) while sorting a report.

Can we do like that using DFSORT control statements.
Back to top
View user's profile Send private message
rkprasanth_m

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Mon Nov 13, 2006 5:37 pm
Reply with quote

I mean those headings should be added to sortout file at the begining. Those heading lins should be excluded from sorting.
Back to top
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Mon Nov 13, 2006 6:20 pm
Reply with quote

Martin,
You can use part of the logic explained at

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/

by looking 'Sort records between a header and trailer'

Alain
Back to top
View user's profile Send private message
rkprasanth_m

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Mon Nov 13, 2006 7:40 pm
Reply with quote

Thanks Martin

I have checked given link. But I can't reformt my input file. I just wanted to skip header records from processing. Can't we copy first n records to output file by bypass sort processing..so the remaining records will go through sort processing?
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: Mon Nov 13, 2006 11:48 pm
Reply with quote

That trick does what you want. It only reformats the records temporarily. The output file will not have the temporary fields.

If you need more help with this, show an example of your input records and what you want for output. And tell us the RECFM and LRECL of your input file.
Back to top
View user's profile Send private message
rkprasanth_m

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Tue Nov 14, 2006 9:20 pm
Reply with quote

Frank Yaeger,

Here a sample report file that I wanted to sort..

User-Id Voilation Sign Sent-Date Due-Date Final Revoke Revoke
Date Off EFlag Date EFlag
-----------------------------------------------------------------------------------
KPTMDFLT 10/19/2006 y 11/10/2006 11/24/2006 N N
ZKUEC2 10/19/2006 y 11/10/2006 11/24/2006 N N
ZKUEW2 10/19/2006 y 11/10/2006 11/24/2006 N N
ZKUJ52 10/19/2006 y 11/10/2006 11/24/2006 N N
ZKUMG7 10/19/2006 y 11/10/2006 11/24/2006 N N
ZKURL1 10/19/2006 N 11/10/2006 11/24/2006 N y
ZKUYN6 10/19/2006 N 11/10/2006 11/24/2006 N y


The requirement is the output file should contain headings as first 3 records then sorted records.

One more question, can I use same file name in sortin and sortout?


[/img]
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 Nov 14, 2006 9:29 pm
Reply with quote

A variation of the trick will work for that.

Again, what is the RECFM and LRECL of your input file?

What is the position, length and format of the field or fields you want to sort on?

Quote:
can I use same file name in sortin and sortout?


No. And that's usually not a good idea anyway since you could lose the file if something goes wrong.
Back to top
View user's profile Send private message
rkprasanth_m

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Thu Nov 16, 2006 8:00 pm
Reply with quote

Frank Yaeger

LRECL=133,RECFM=FB and input file has 3 heading lines. headings apper more then once. I don't have alter access to input file. What I really wanted is hide heading lines from sorting process, and output file should only have one set of headings at the begining.
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 Nov 16, 2006 9:42 pm
Reply with quote

Given what you've said, the easiest way to do this is to omit the header lines, sort the data and rebuild the first header lines, with a DFSORT job something like this:

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (FB/133)
//SORTOUT DD DSN=...  output file (FB/133)
//SYSIN    DD    *
  OMIT COND=(1,7,CH,EQ,C'User-Id',OR,1,7,CH,EQ,C' ',
         OR,1,7,CH,EQ,C'-------')
  SORT FIELDS=(...)
  OUTFIL HEADER1=(1:'User-Id',13:'Voilation',
     29:'Sign',...,/,
     13:'Date',29:'Off',...,/,
     1:83'-')
/*

Back to top
View user's profile Send private message
rkprasanth_m

New User


Joined: 22 Jun 2006
Posts: 44

PostPosted: Thu Nov 16, 2006 10:12 pm
Reply with quote

Thanks.. Frank
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 DFsort help with SUM() DFSORT/ICETOOL 12
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
Search our Forums:

Back to Top