OnlineKnowledgeRepository
OnlineKnowledgeRepository
OnlineKnowledgeRepository
Would you like to react to this message? Create an account in a few clicks or log in to continue.


For Questions and Assistance please use the proper Category.. please..
 
HomeLatest imagesSearchRegisterLog in
Welcome guys!!.. In order for you guys to post your Questions and assistance requests,, please REGISTER first.. Only members can post.. If you have requests then feel free to email ADMIN neuron or SPAMMER onatzky.. thanks!
Search
 
 

Display results as :
 
Rechercher Advanced Search
Donation box
Latest topics
» Convert signed ZD to PD
Sort and Merge in JCL EmptyThu Sep 01, 2016 7:57 pm by neuron

» Abia State Polytechnic Admission form for 2013/2014 out!
Sort and Merge in JCL EmptyTue Oct 08, 2013 9:30 am by stevejoo

» Convert ZD to SIGNED PD
Sort and Merge in JCL EmptySun Sep 08, 2013 9:22 pm by neuron

» How to Speed Up My PC
Sort and Merge in JCL EmptyTue Feb 26, 2013 9:15 am by alphysudaria143

» Hi I'm alphysudaria143
Sort and Merge in JCL EmptySun Feb 17, 2013 12:25 am by alphysudaria143

» How to Copy all the Generations of a GDG
Sort and Merge in JCL EmptyThu Oct 11, 2012 8:30 am by neuron

» Remove Duplicates in a dataset though Sort
Sort and Merge in JCL EmptyThu Oct 11, 2012 8:23 am by neuron

» how to insert data into your access database vb.net
Sort and Merge in JCL EmptyTue Aug 14, 2012 9:56 am by neuron

» how to populate combobox in vb.net during form load
Sort and Merge in JCL EmptyTue Aug 14, 2012 9:53 am by neuron

Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search
Help
Please support me my registering to NEOBUX
advertisements
Sort and Merge in JCL Banner3
Affiliates
free forum
 



 

 Sort and Merge in JCL

Go down 
AuthorMessage
neuron
Administrator
Administrator
neuron


Posts : 38
Join date : 2009-08-06

Sort and Merge in JCL Empty
PostSubject: Sort and Merge in JCL   Sort and Merge in JCL EmptyThu Aug 06, 2009 11:00 am

SORT


The SORT program is used to sort data into a certain sequence or to merge from 2 to 100 previously sorted input data sets into 1 output data set.


//STEP10 EXEC PGM=SORT

//SYSOUT DD SYSOUT=*

//SYSPRINT DD SYSOUT=*

//SYSUDUMP DD SYSOUT=*

//SORTIN DD DISP=SHR,DSN=<<>>

//SORTOUT DD DISP=(MOD,CATLG,DELETE),SPACE=(CYL,(5,5),RLSE),

// UNIT=SYSDA,DCB=*.SORTIN,

// DSN=<<>>

//SYSIN DD *

//************** INCLUDE SORT STEPS HERE



<!--[if !supportLists]-->1) <!--[endif]-->TO SORT ON POSITIONS say for eg. 1 to 7


SORT FIELDS=(1,7,CH,A)


Where


Sort fields = (position ,length ,format ,sequence) or

Sort fields = (position ,length , sequence..),format = CH/BI/PD/ZD.d

PD=packed Decimal(COMP-3), ZD=zone decimal.


NOTE :-


Instead of using JCL to perform SORT operation , there's one simple alternative,

For eg:- Open a Flat file in edit mode. On the command line type (say) SORT 1,7 and press ENTER, the file will be sorted on positions 1 to 7 bytes.



2) TO COPY ALL THE RECORDS FROM INPUT FILE TO OUTPUT FILE


SORT FIELDS=COPY


3) TO COPY THOSE RECORDS WHICH SATISFY A PARTICULAR CONDITION.



INCLUDE COND=(38,10,CH,EQ,C'57071509',OR,36,10,CH,EQ,C' 57105779')


4) TO OMIT THOSE RECORDS WHICH SATISFY A PARTICULAR CONDITION.



OMIT COND=(19,1,CH,EQ,C'S',OR,19,1,CH,EQ,C'S')


5) TO SKIP CERTAIN NO OF RECORDS



SORT FIELDS=COPY,SKIPREC=1000


6) TO STOP AFTER COPYING CERTAIN NO OF RECORDS



SORT FIELDS=COPY,STOPAFT=5000



7) SKIPREC AND STOPREC CAN BE USED IN COMBINATION



SORT FIELDS=COPY,SKIPREC=1000,STOPAFT=5000



<!--[if !supportLists]-->Cool <!--[endif]-->TO REMOVE DUPLICATES FROM THE FILE USING SORT



SORT FIELDS=(1,7,A),FORMAT=CH

SUM FIELDS=NONE


MERGE

The MERGE control statement defines the application as a MERGE application.


MERGE FIELDS=...

{,FILES=n}

{,EQUALS | NOEQUALS}

{,CKPT | CHKPT}

{,CENTWIN={0 | s | f}}


where

FIELDS=(pos1,len1,opt1,pos2,len2,opt2,...),FORMAT= type


Keyword explanations:


The FIELDS= keyword is used to identify the fields to use as merge keys. Each field is described using 4 values:


'pos', its position in the record, relative to 1;

'len', the field's length;

'type', the type of data stored in the field; and

'opt', the sort order for the field which can be

A for ascending, D for descending, or

E as modified by an E61 exit.

Up to 128 fields can be sorted or merged using one

MERGE control statement.
Back to top Go down
https://myonlinekr.forumotion.com
 
Sort and Merge in JCL
Back to top 
Page 1 of 1
 Similar topics
-
» Remove Duplicates in a dataset though Sort

Permissions in this forum:You cannot reply to topics in this forum
OnlineKnowledgeRepository :: All About PC :: Programming :: MAINFRAME :: JCL-
Jump to: