Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Can we skip headings while sorting a report using DFSORT?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Can we skip headings while sorting a report using DFSORT?
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    Post subject:
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    Post subject:
Reply with quote

Martin,
You can use part of the logic explained at

http://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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Nov 13, 2006 11:48 pm    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Nov 14, 2006 9:29 pm    Post subject:
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    Post subject:
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Thu Nov 16, 2006 9:42 pm    Post subject:
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    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFSORT - Overriding default option TU... Steve Ironmonger DFSORT/ICETOOL 3 Tue Apr 04, 2017 3:54 pm
No new posts Splitting of single report to seperat... abdulrafi TSO/ISPF 7 Mon Mar 27, 2017 3:59 pm
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Easytrieve report shalem CA Products 4 Sun Feb 26, 2017 9:08 am
No new posts Sorting group data rajella DFSORT/ICETOOL 4 Sun Jan 22, 2017 11:32 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us