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

How to ignore HEADER & TRAILER from SORTing?


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

New User


Joined: 01 Feb 2006
Posts: 15

PostPosted: Wed Jun 21, 2006 5:11 am
Reply with quote

I've a file below

HEADER
003
001
004
002
TRAILER

I need the output as below. I'm using SORT for this. How can I do this without losing header and trailer records in the output file? Plz could you help.

HEADER
001
002
003
004
TRAILER
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 21, 2006 5:14 am
Reply with quote

You can use the technique shown in the Smart DFSORT Trick at:

www.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmtrck.html#a02
Back to top
View user's profile Send private message
punith007
Warnings : 1

New User


Joined: 16 May 2006
Posts: 11
Location: INDIA

PostPosted: Wed Jun 21, 2006 10:45 am
Reply with quote

Hi Frank,

This is Punith. I went thru the example. This technique can be done if we know what the header and trailor records are. But in case we dont know what it is, i mean say as like dates takes place header and number of records take trailer position, how we can go about it ?


Thanks
Punith
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 21, 2006 8:13 pm
Reply with quote

Please show a better example of what your input records look like and what you want for output. What is the RECFM and LRECL of the input file? What is the starting position, length and format of the key you want to sort on?
Back to top
View user's profile Send private message
SIVAMAIN

New User


Joined: 24 Jun 2006
Posts: 12

PostPosted: Mon Jun 26, 2006 5:00 pm
Reply with quote

Hi Subra,
This is Siva. I suggest this process.Check it out.I tried and got the result.
if any doubts, reply back.
1. split the input file into 3 files using sort.
2. sort the second file and put into fourth file.
3. concatenate the first,fourth and third files using IEBGENER.
Regards
Siva.
Back to top
View user's profile Send private message
SIVAMAIN

New User


Joined: 24 Jun 2006
Posts: 12

PostPosted: Mon Jun 26, 2006 5:10 pm
Reply with quote

hi subra
this siva
sending the code
//SIVAMAIN JOB 65038,SAIN,MSGCLASS=H,MSGLEVEL=(1,1),NOTIFY=&SYSUID
//SORTSTEP EXEC PGM=SORT
//SORTIN DD DSN=SSS036.SIVAMAIN.JCL(IN),DISP=SHR
//SORTOF01 DD DSN=SSS036.SIVAMAIN.GDG(-4 ,DISP=SHR
//SORTOF02 DD DSN=SSS036.SIVAMAIN.GDG(-3),DISP=SHR
//SORTOF03 DD DSN=SSS036.SIVAMAIN.GDG(-2),DISP=SHR
//SYSOUT DD SYSOUT=*
//SYSUDUMP DD SYSOUT=*
//CEEDUMP DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL FILES=01,INCLUDE=(1,6,CH,EQ,C'HEADER')
OUTFIL FILES=02,INCLUDE=(1,2,CH,EQ,C'00')
OUTFIL FILES=03,INCLUDE=(1,7,CH,EQ,C'TRAILER')
/*
//STEP1 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SORTIN DD DSN=SSS036.SIVAMAIN.GDG(-3),DISP=SHR
//SORTOUT DD DSN=SSS036.SIVAMAIN.GDG(-1),DISP=SHR
//SORTWK01 DD DSN=&&SIVA,SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA
//SYSIN DD *
SORT FIELDS=(1,3,CH,A)
/*
//STEP1 EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUT1 DD DSN=SSS036.SIVAMAIN.GDG(-4),DISP=SHR
// DD DSN=SSS036.SIVAMAIN.GDG(-1),DISP=SHR
// DD DSN=SSS036.SIVAMAIN.GDG(-2),DISP=SHR
//SYSUT2 DD DSN=SSS036.SIVAMAIN.GDG(0),DISP=SHR
//SORTWK01 DD DSN=&&SIVA,SPACE=(TRK,(1,1),RLSE),UNIT=SYSDA
//SYSIN DD DUMMY
//
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 Jun 26, 2006 8:13 pm
Reply with quote

Sivamain,

If you had bothered to look at the Smart DFSORT Trick I gave the link to before you posted, you would have seen that it shows a much more efficient way to do what you're doing - one pass rather than three passes! Or if you had bothered to read Punith's response to my post, you would have seen that he says he doesn't have "identifiers" for the header and trailer, so methods that depend on identifiers won't work. That's why I asked him for more information. I would suggest you spend a little more time reading through earlier posts before posting yourself.
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
This topic is locked: you cannot edit posts or make replies. Automation need help in sorting the data DFSORT/ICETOOL 38
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Comparing Header and Trailer. DFSORT/ICETOOL 7
No new posts Adding a trailer with record count an... JCL & VSAM 4
Search our Forums:

Back to Top