Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SORT only detail records, leave Header and Trailer as such

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
muralialla

New User


Joined: 03 Jan 2007
Posts: 11
Location: Chennai

PostPosted: Tue Nov 06, 2007 10:02 am    Post subject: SORT only detail records, leave Header and Trailer as such
Reply with quote

HI...

I have a requirement, i need to SORT the input file...but only the detail records...my file format is like this...

Hxxxxxxx
Dxxxxxxxxxxxxxxxxxxxxxxxxx
Dxxxxxxxxxxxxxxxxxxxxxxxxx
Dxxxxxxxxxxxxxxxxxxxxxxxxx
Txxxxx

The output file should have Header first, followed by all sorted detail records and then Trailer.....

any suggestions pls....
Back to top
View user's profile Send private message

Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Nov 06, 2007 10:46 am    Post subject: Reply to: SORT only detail records, leave Header and Trailer
Reply with quote

murali,

check this link

http://ibmmainframes.com/viewtopic.php?t=23773&highlight=header+trailor
Back to top
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Tue Nov 06, 2007 10:53 am    Post subject: Reply to: SORT only detail records, leave Header and Trailer
Reply with quote

murali,


Also give us the details of the key fields and all if you need a working JCl for your requirement.
Back to top
View user's profile Send private message
muralialla

New User


Joined: 03 Jan 2007
Posts: 11
Location: Chennai

PostPosted: Tue Nov 06, 2007 5:31 pm    Post subject: Reply to: SORT only detail records, leave Header and Trailer
Reply with quote

Aaru....

Thanks for your reply....

my input file is a VB, LRECL=2082

Sort field for detail record (16,14,CH,A)

I tried with the this, i am getting error saying "OUTREC - SHORT RECORD"

output should be a VB of length 2082.

can you help me...
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Nov 06, 2007 5:38 pm    Post subject:
Reply with quote

Hi murali,

Can u provide ur sort card?
Back to top
View user's profile Send private message
muralialla

New User


Joined: 03 Jan 2007
Posts: 11
Location: Chennai

PostPosted: Tue Nov 06, 2007 5:42 pm    Post subject: Reply to: SORT only detail records, leave Header and Trailer
Reply with quote

INREC IFTHEN=(WHEN=(01,01,CH,EQ,C'H'),OVERLAY=(2083:C'1')),
IFTHEN=(WHEN=(01,01,CH,EQ,C'D'),OVERLAY=(2083:C'5')),
IFTHEN=(WHEN=(01,01,CH,EQ,C'T'),OVERLAY=(2083:C'9'))
SORT FIELDS=(2083,01,CH,A,
16,14,CH,A)
OUTREC FIELDS=(1,2082)
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Nov 06, 2007 7:45 pm    Post subject:
Reply with quote

muralialla

What is the i/p and o/p RECFM and LRECL?
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Tue Nov 06, 2007 7:56 pm    Post subject:
Reply with quote

Sorry i missed your previous post which says the i/p & o/p details
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: Tue Nov 06, 2007 9:59 pm    Post subject:
Reply with quote

Murali,

Here's a DFSORT job that will do what you asked for. I assumed when you said the key started in position 16, you were not counting the RDW, so it really starts in position 20 (16+4).

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...  input file (VB)
//SORTOUT DD DSN=...  output file (VB)
//SYSIN    DD    *
  INREC IFTHEN=(WHEN=INIT,BUILD=(1,4,5:C'1',6:5)),
    IFTHEN=(WHEN=(6,1,CH,EQ,C'H'),OVERLAY=(5:C'0')),
    IFTHEN=(WHEN=(6,1,CH,EQ,C'T'),OVERLAY=(5:C'9'))
  SORT FIELDS=(5,1,CH,A,21,14,CH,A)
  OUTREC BUILD=(1,4,5:6)
/*
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: Tue Aug 19, 2008 4:31 am    Post subject:
Reply with quote

With the new DATASORT operator of DFSORT's ICETOOL, available with z/OS DFSORT V1R5 PTF UK90013 (July, 2008), you can do this kind of thing quite easily like this:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file (VB)
//OUT DD DSN=...  output file (VB)
//TOOLIN DD *
DATASORT FROM(IN) TO(OUT) HEADER TRAILER USING(CTL1)
/*
//CTL1CNTL DD    *
  SORT FIELDS=(20,14,CH,A)
/*



For complete details on the new DATASORT function and the other new functions available with PTF UK90013, see:

www.ibm.com/systems/support/storage/software/sort/mvs/ugpf/
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 Innovations in Your Mainframe Sort Arun Raj PC Guides & IT News 4 Wed Mar 15, 2017 10:38 pm
No new posts SORT VSAM file with each field one by... maxsubrat DFSORT/ICETOOL 6 Tue Mar 14, 2017 1:07 pm
No new posts SORT requirement sjiraga COBOL Programming 6 Thu Mar 09, 2017 9:11 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us