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

Logical Thinking about sort?


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

New User


Joined: 18 May 2005
Posts: 46
Location: Bangalore, INDIA

PostPosted: Fri Feb 10, 2006 1:42 pm
Reply with quote

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
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Fri Feb 10, 2006 2:00 pm
Reply with quote

That link could help you

www-03.ibm.com/servers/storage/support/software/sort/mvs/tricks/srtmtrck.html#a02

If it's not, be more clear in your requirement

alain
Back to top
View user's profile Send private message
subramanianup
Warnings : 1

New User


Joined: 18 May 2005
Posts: 46
Location: Bangalore, INDIA

PostPosted: Fri Feb 10, 2006 2:24 pm
Reply with quote

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
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Fri Feb 10, 2006 2:51 pm
Reply with quote

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
View user's profile Send private message
subramanianup
Warnings : 1

New User


Joined: 18 May 2005
Posts: 46
Location: Bangalore, INDIA

PostPosted: Fri Feb 10, 2006 3:37 pm
Reply with quote

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
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1448
Location: Chicago, IL

PostPosted: Fri Feb 10, 2006 3:55 pm
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


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

PostPosted: Fri Feb 10, 2006 9:08 pm
Reply with quote

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
View user's profile Send private message
Alain Benveniste

New User


Joined: 14 Feb 2005
Posts: 88

PostPosted: Fri Feb 10, 2006 9:19 pm
Reply with quote

...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
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 Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts JCL sort card - get first day and las... JCL & VSAM 9
No new posts Rotate partition-logical & physic... DB2 0
No new posts Sort First/last record of a subset th... DFSORT/ICETOOL 7
Search our Forums:

Back to Top