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 

Diff b/w splittng flds and havng it as a single fld in sort.

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


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Fri Apr 29, 2005 1:47 pm    Post subject: Diff b/w splittng flds and havng it as a single fld in sort. Reply with quote

HI, I am wondering if there is a difference between the following sort cards in terms of performance. I am using SYNCSORT.
SORT FIELDS=(1,18,CH,A)
and
SORT FIELDS=( 1,13,CH,A,14,5,PD,A)
As far as the ouput is concerned, both the outputs matched as I had expected. I am trying to find out the CPU time by running the jobs with these 2 different control cards on the same CPU. But the jobs are not running in the same CPU nor do I know how to force to run th jobs in the same CPU.
Thanks,
Meg
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Apr 29, 2005 2:27 pm    Post subject: Reply with quote

Meg,

Quote:

As far as the ouput is concerned, both the outputs matched as I had expected.


Nope ! You just got lucky with the outputs as your data might had only positive values in the Packed decimal field.

You cannot sort packed decimal fields treating them as character field because of the signs of the field(positive and negative)

ex: try this job and see it for your self. Look at the outputs from step0200 and step0300

Code:

//STEP0100 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                           
123456789012300000005   -REC 1                           
123456789012300000000   -REC 2                           
123456789012300000002   -REC 3                           
123456789012300000015   -REC 4                           
123456789012300000001   -REC 5                           
123456789012300000003   -REC 6                           
123456789012200000009   -REC 7                           
//SORTOUT  DD DSN=&T1,DISP=(,PASS),SPACE=(TRK,(1,1),RLSE)
//SYSIN    DD    *                                       
  INREC FIELDS=(1,13,14,8,ZD,PD,LENGTH=5,22,15)           
  SORT FIELDS=COPY                                       
  OUTREC FIELDS=(1,13,+6,SUB,14,5,PD,PD,LENGTH=5,19,15)   
/*                                                       
//STEP0200 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=&T1,DISP=SHR                           
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD    *                                       
  OPTION EQUALS                                           
  SORT FIELDS=(1,18,CH,A)                                 
/*                                                       
//STEP0300 EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD DSN=&T1,DISP=SHR                           
//SORTOUT  DD SYSOUT=*                                   
//SYSIN    DD    *                                       
  OPTION EQUALS                                           
  SORT FIELDS=(1,13,CH,A,14,5,PD,A)                       
/*


Oh btw step0300 ran faster than step0200



Hope this helps...

Cheers

kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Fri Apr 29, 2005 4:49 pm    Post subject: Thanks Kolusu, but one more qn. Reply with quote

Thanks Kolusu.
But can you let me know why the performace is better when we split the fields and sort.

Also I have a question on the same lines.
We have a file out of which 10 records are having packed decimal values from 14th position to 18th. Also in the same file, there is a record which has a numeric field and another record which has alpha numeric values in the same postion. But if we sort the file using the SORT card SORT FIELDS=(1,13,CH,A,14,5,PD,A) the job does not end S0C7. How is sort able to handle numeric and spaces as PD?

Meg
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Fri Apr 29, 2005 5:30 pm    Post subject: Reply with quote

Quote:

But can you let me know why the performace is better when we split the fields and sort.


Meg,

Here is an educated guess. Sort treates a character field as is represented by its 8-bit EBCDIC code where as each digit of the packed decimal number is converted into its 4-bit binary equivalent.

Quote:

We have a file out of which 10 records are having packed decimal values from 14th position to 18th. Also in the same file, there is a record which has a numeric field and another record which has alpha numeric values in the same postion. But if we sort the file using the SORT card SORT FIELDS=(1,13,CH,A,14,5,PD,A) the job does not end S0C7. How is sort able to handle numeric and spaces as PD?


Check this link which explains in detail about various data Formats. I hope frank wouldn't mind me linking a DFSORT manual link

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA10/C.1?DT=20050222160456

Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Meg
Beginner


Joined: 08 Jul 2003
Posts: 44
Topics: 16

PostPosted: Fri Apr 29, 2005 6:45 pm    Post subject: Reply with quote

Thanks Kolusu. From the link I was able to understand and test it out that since we were not doing any calculations using SUM or any other command and we were just sorting the input file, we did not receive any S0C7 errors.
Thanks,
Meg
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