MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

SORT FIELDS - Picks which columns? Quick question

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Feb 06, 2014 10:39 am    Post subject: SORT FIELDS - Picks which columns? Quick question Reply with quote

I have the below sort where the output record layout is changed using INREC.

Now, with sort card= (1,13,CH,A,14,3,CH,A,17,4,BI,A,22,5,CH,D)
This the sort that I want to apply for the output file layout. will this work? or do I need to specify once the output file is created?

I tested with this and it worked as expected - output file is sorted, but what I thought is that the sort card applies to the input file but here the output file is getting sorted, how is this, I missing something?.
please advise pros.

Code:

//SORTF01   EXEC PGM=SORT                                             
//SYSOUT    DD SYSOUT=*                                               
//SORTIN    DD DSN=DATA.INPUT,     
//             DISP=SHR                                               
//SORTOUT   DD DSN=DATA.OUTPUT,DISP=OLD         
//SYSPRINT  DD SYSOUT=*                                               
//SYSIN     DD DSN=SSRC.PROD.PARMLIB(SAARFTN1),DISP=SHR             



SSRC.PROD.PARMLIB(SAARFTN1)

   SORT FIELDS=(1,13,CH,A,14,3,CH,A,17,4,BI,A,22,5,CH,D)                         
   INCLUDE COND=((178,01,CH,EQ,C'Y'),           
            AND,((7,02,CH,EQ,C'02'),               
              OR,(7,02,CH,EQ,C'04'),                 
              OR,(7,01,CH,EQ,C'2'),               
              OR,(7,07,CH,EQ,C'0000000')))                 
   INREC BUILD=(01:7,12,                                       
                13:C'0',                                       
                14:27,3,                                       
                17:46,9,ZD,BI,LENGTH=4,                       
                21:125,1,                                     
                22:180,5,                       
                27:C'L',                                       
                28:C'0',                                       
                29:33,5,                                       
                29:33,5,                                   
                34:85,40,                                 
                74:C'00000',                               
                79:133,2,                                 
                81:66,8,                                   
                89:126,7,ZD,PD,LENGTH=4,                   
                93:133,2,                                 
                95:66,8,                                   
                103:126,7,ZD,PD,LENGTH=4,                 
                107:62,4,                                 
                111:179,1,                                       
                112:C'0000')                               
/*                   
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Feb 06, 2014 12:24 pm    Post subject: Reply with quote

The INREC control statement allows you to reformat the input records before they are sorted, merged, or copied.

so the SORT is performed after the INREC conditions are applied?
So 1,13,CH,A will be applied to 7,12 and 13:C'0' on the reformatted input file ?
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Thu Feb 06, 2014 1:29 pm    Post subject: Reply with quote

vak255 wrote:
The INREC control statement allows you to reformat the input records before they are sorted, merged, or copied.

so the SORT is performed after the INREC conditions are applied?
So 1,13,CH,A will be applied to 7,12 and 13:C'0' on the reformatted input file ?


Vak255,

Yes. Check this link which explains the processing order for record handling, exits, statements, and options. Use this diagram with the text following it to understand the order DFSORT uses to run your job.

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA60/1.5.4?
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Feb 06, 2014 2:05 pm    Post subject: Reply with quote

Thanks Kolusu.
Back to top
View user's profile Send private message
vak255
Intermediate


Joined: 10 Sep 2004
Posts: 384
Topics: 79

PostPosted: Thu Feb 06, 2014 2:18 pm    Post subject: Reply with quote

bonk Wow...this is informative. Now I know why the sort was working for me.
I will move the sort card after the inrec build to make it as per this diagram.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group