|
View previous topic :: View next topic
|
| Author |
Message |
subramanianup Warnings : 1 New User
Joined: 18 May 2005 Posts: 46 Location: Bangalore, INDIA
|
|
|
|
You have a output file like format as below
<Header>field1 field2?????<Trailer>
I need to sort on filed1, I don?t want to disturb header and trailer, and the sorted file should appear format as like INPUT file? |
|
| Back to top |
|
 |
Alain Benveniste
New User
Joined: 14 Feb 2005 Posts: 88
|
|
| Back to top |
|
 |
subramanianup Warnings : 1 New User
Joined: 18 May 2005 Posts: 46 Location: Bangalore, INDIA
|
|
|
|
alain i am not able understand that,
for examplet the input is
<Header>000050 000000????<Trailer>
<Header>000045 000000????<Trailer>
<Header>000055 000000????<Trailer>
<Header>000002 000000????<Trailer>
<Header>000025 000000????<Trailer>
The output should be like as follows , i dont want to distrub tha Header and Trailer
<Header>000050 000000????<Trailer>
<Header>000045 000000????<Trailer>
<Header>000055 000000????<Trailer>
<Header>000002 000000????<Trailer>
<Header>000025 000000????<Trailer>
,
Can you explain how it will works? |
|
| Back to top |
|
 |
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
The input and output records you are showing are same.
if you want some thing like
<Header>000002 000000????<Trailer>
<Header>000025 000000????<Trailer>
<Header>000045 000000????<Trailer>
<Header>000050 000000????<Trailer>
<Header>000055 000000????<Trailer>
in the out put you can easily give a sort field with your second field as the
base key for sort
SORT FIELD(STARTING POSN AND LENGTH OF THE FIELD)
This will sort the file with your header and trailer and on the first field in the record after the header
Regards, |
|
| Back to top |
|
 |
subramanianup Warnings : 1 New User
Joined: 18 May 2005 Posts: 46 Location: Bangalore, INDIA
|
|
|
|
i am not able understand that,
for examplet the input is
<Header>000050 000000????<Trailer>
<Header>000045 000000????<Trailer>
<Header>000055 000000????<Trailer>
<Header>000002 000000????<Trailer>
<Header>000025 000000????<Trailer>
The output should be like as follows , i dont want to distrub tha Header and Trailer
Header>000002 000000????<Trailer>
<Header>000025 000000????<Trailer>
<Header>000045 000000????<Trailer>
<Header>000050 000000????<Trailer>
<Header>000055 000000????<Trailer>
,
Can you explain how it will works? Pls mind the header and Trailer |
|
| Back to top |
|
 |
priyesh.agrawal
Senior Member

Joined: 28 Mar 2005 Posts: 1448 Location: Chicago, IL
|
|
|
|
Is Header & Trailer same for all recs... If Not...Do you like this way.. means Do Not Disturb to Header means below...????????
| Code: |
<Header1>FLD1 ... <TRAIL1>
<Header2>FLD2 ... <TRAIL2>
:
:
<HeaderX>FLDX ... TRAILX> |
| Code: |
<Header1>FLD2 ... <TRAIL1>
<Header2>FLDX ... <TRAIL2>
:
:
<HeaderX>FLD1 ... TRAILX> |
Regards,
Priyesh. |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
| Quote: |
| i am not able understand that, |
Well, we're trying but we're not able to understand what you want. You show records that look like they all have the same header and trailer and a second field that you want to sort on. That's a simple case of sorting on that field. But you say you don't understand that.
Are the headers and trailers actually different in each record as Priyesh suggests? If so, please say so. Better yet, show us a better example of what the input records look like and what you want the output records to look like (with actual values). Also, what is the RECFM and LRECL of the input file, and what is the position, length and format of the header, sort field and trailer? |
|
| Back to top |
|
 |
Alain Benveniste
New User
Joined: 14 Feb 2005 Posts: 88
|
|
|
|
...worked on Priyesh suggestion...
| Code: |
//STEP0001 EXEC PGM=ICETOOL
//DFSMSG DD SYSOUT=*
//TOOLMSG DD SYSOUT=*
//IN DD *
<HEADER1>000050 000000<TRAILER1>
<HEADER2>000045 000000<TRAILER2>
<HEADER3>000055 000000<TRAILER3>
<HEADER4>000002 000000<TRAILER4>
<HEADER5>000025 000000<TRAILER5>
/*
//TOOLIN DD *
SORT FROM(IN) USING(ICE0)
SPLICE FROM(MERGE) TO(OUTX) ON(81,5,ZD) WITH(10,21) USING(ICE1)
/*
//OUT1 DD DSN=&&OUT1,
// DISP=(NEW,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1,0),RLSE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=85)
//OUT2 DD DSN=&&OUT2,
// DISP=(NEW,DELETE,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(1,1,0),RLSE),
// DCB=(DSORG=PS,RECFM=FB,LRECL=85)
//MERGE DD DSN=*.OUT1,VOL=REF=*.OUT1,DISP=(SHR,DELETE,DELETE)
// DD DSN=*.OUT2,VOL=REF=*.OUT2,DISP=(SHR,DELETE,DELETE)
//OUTX DD SYSOUT=*
//ICE0CNTL DD *
INREC OVERLAY=(81:SEQNUM,5,ZD)
SORT FIELDS=(10,21,CH,A)
OUTFIL FNAMES=OUT1
OUTFIL FNAMES=OUT2,
OVERLAY=(81:SEQNUM,5,ZD)
/*
//ICE1CNTL DD *
OUTFIL FNAMES=OUTX,
BUILD=(1,80)
/*
|
OUTX gives
| Code: |
<HEADER1>000002 000000<TRAILER1>
<HEADER2>000025 000000<TRAILER2>
<HEADER3>000045 000000<TRAILER3>
<HEADER4>000050 000000<TRAILER4>
<HEADER5>000055 000000<TRAILER5>
|
Is that what you want ?
If not, better respond to Frank's post
Alain |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|