View previous topic :: View next topic
|
Author |
Message |
prabhucs01 Warnings : 1 New User
Joined: 07 Mar 2005 Posts: 43
|
|
|
|
//SYSIN DD *
SORT FIELDS=(start, length, type, sequence,….)
INCLUDE COND=(start, length, type,{EQ/NE/GT/GE/LT/LE},constant)
END
/*
What is the difference between both the Start and length fields. Are they denoting same start position and end position.
in an example i came across the have given.
//sysin DD *
SORT FIELDS=(1,20,CH,A)
INCLUDE COND=(28,4,CH,EQ,C'CANE')
END
/*
Both the SORT FIELDS and INCLUDE COND have different Start and Length parameters. |
|
Back to top |
|
|
technut
New User
Joined: 27 Dec 2007 Posts: 73 Location: India
|
|
|
|
Here the programmer wants to include only character 'CANE' starting from column '28' with length 4 characters.
While you have 100 such records in the output file.. the programmer wants those records to be sorted in the ascending order for characters starting from column '1' with length 20. |
|
Back to top |
|
|
guptae
Moderator
Joined: 14 Oct 2005 Posts: 1208 Location: Bangalore,India
|
|
|
|
Hi ramprabhu,
I suggest you to read Manual. Links are available on the top of this page.
Let us know if anything is not clear |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
prabhucs01 wrote: |
What is the difference between both the Start and length fields. Are they denoting same start position and end position.
in an example i came across the have given.
Code: |
//sysin DD *
SORT FIELDS=(1,20,CH,A)
INCLUDE COND=(28,4,CH,EQ,C'CANE')
END
/* |
Both the SORT FIELDS and INCLUDE COND have different Start and Length parameters. |
Above sort-card sorts the input file on first 20 fields (bytes) of input and it includes only those records which have "CANE", of length 4-bytes, starting at position 28 in the input file.
If you are intrested to learn details of Sort-products, Please run the following job and check the //SYSOUT messages
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
RECORD
//SORTOUT DD DUMMY
//SYSIN DD *
OPTION COPY
/* |
If the messages are of type ICExxx you are using DFSort - so picking up "z/OS DFSORT: Getting Started" can be good choice; if you got messages of type WERxxxx contact Alissa to get the manuals. |
|
Back to top |
|
|
|