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
 
Logical Thinking about sort?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Logical Thinking about sort?
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    Post subject:
Reply with quote

That link could help you

http://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    Post subject:
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    Post subject:
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    Post subject:
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: 1452
Location: Chicago, IL

PostPosted: Fri Feb 10, 2006 3:55 pm    Post subject: Re: Logical Thinking about sort?
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 Moderator


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

PostPosted: Fri Feb 10, 2006 9:08 pm    Post subject:
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    Post subject:
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    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 Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts JOINKEYS Paired and Unpaired Sort on ... MFwhiz DFSORT/ICETOOL 7 Tue Nov 07, 2017 2:46 am
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts JOINKEYS Paired and Unpaired Sort MFwhiz DFSORT/ICETOOL 4 Fri Sep 29, 2017 1:48 am
No new posts Difference in SORT & ICETOOL Mohan Kothakota DFSORT/ICETOOL 5 Fri Sep 22, 2017 4:56 pm

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