Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
How to ignore HEADER & TRAILER from SORTing?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: How to ignore HEADER & TRAILER from SORTing?
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 Moderator


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

PostPosted: Wed Jun 21, 2006 5:14 am    Post subject:
Reply with quote

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

http://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    Post subject: Re: How to ignore HEADER & TRAILER from SORTing?
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 Moderator


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

PostPosted: Wed Jun 21, 2006 8:13 pm    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Mon Jun 26, 2006 8:13 pm    Post subject:
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    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 FTP Skip or ignore error and process ... AJAYREDDY All Other Mainframe Topics 3 Wed Sep 27, 2017 8:12 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts SORT Trailer Count - LRECL Output co... amorante DFSORT/ICETOOL 5 Tue Aug 29, 2017 8:57 pm
No new posts Sorting on text - but in non-alphabet... Roy Ware SYNCSORT 5 Wed Aug 23, 2017 9:15 pm
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us