View previous topic :: View next topic
|
Author |
Message |
Supriya Das
New User
Joined: 18 Jul 2008 Posts: 5 Location: India
|
|
|
|
Where can I find 3 separate coding examples for Control Statements using SKIP; COUNT; SUM. Do I have to use INCLUDE control statement along with those control statements? If you can guide me toward the right URL/hyperlink I will appreciate it. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links
Your questions are rather vague so it's a bit difficult to answer them, but ...
DFSORT has a SKIP keyword on the OUTFIL statement, but I suspect what you're really asking about is the SKIPREC keyword on the OPTION statement. Here's a link to complete details of the OPTION statement:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.12?DT=20060615185603
Here's a link to an example with SKIPREC:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.12.2.1?SHELF=&DT=20060615185603
COUNT is a keyword on the TRAILERx (TRAILER1, TRAILER2, TRAILER3) operand of the OUTFIL statement. Here's a link to complete details on the OUTFIL statement:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.13?DT=20060615185603
Here's a link to an example with COUNT:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.13.2.4?SHELF=&DT=20060615185603&CASE=
SUM is a control statement. Here's a link to complete details on the SUM statement:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.17?DT=20060615185603
Here's a link to examples with SUM:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.17.2?DT=20060615185603
You would need INCLUDE if you want to include records based on a criteria. Here's a link to complete details on the INCLUDE statement:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.7?DT=20060615185603
Here's a link to some examples with INCLUDE:
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/3.7.3?DT=20060615185603
If you want something more specific, explain in detail what you want to do. |
|
Back to top |
|
|
Supriya Das
New User
Joined: 18 Jul 2008 Posts: 5 Location: India
|
|
|
|
Thanks Frank. I have a another question. I know that
Code: |
SORT FIELDS=(4,2,CH,A)
OPTION SKIPREC=20
|
is a valid control statement, but is it valid like:
Code: |
SORT FIELDS=null
OPTION SKIPREC=20
|
If not, what could be the right one? By the way, I do not want to sort the output dataset. |
|
Back to top |
|
|
Supriya Das
New User
Joined: 18 Jul 2008 Posts: 5 Location: India
|
|
|
|
I found the answer. It is:
|
|
Back to top |
|
|
Supriya Das
New User
Joined: 18 Jul 2008 Posts: 5 Location: India
|
|
|
|
I have 10 records in Input dataset. Forth byte is signed packed decimal. One of those 10 records is a duplicate record which should be eleminated.
The valid code is:
Code: |
SORT FIELDS=(4,1,PD,A)
SUM FIELDS=NONE
|
The invalid code is:
Code: |
SORT FIELDS=(4,1,PD,A)
SUM FIELDS=(4,1,PD)
|
The question is why? |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Because it violates the "rules". . .
You cannot SUM a field that is a SORT FIELD (to do so really makes no sense). SUM is to total values within the SORT FIELDs. For example, total sales by customer. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
SUM fields cannot overlap SORT fields. If you really need to SORT on a field and SUM it as well, you could do it like this (I'm assuming your input file has RECFM=FB and LRECL=80):
Code: |
INREC OVERLAY=(81:4,1)
SORT FIELDS=(81,1,PD,A)
SUM FIELDS=(4,1,PD)
OUTREC BUILD=(1,80)
|
|
|
Back to top |
|
|
Supriya Das
New User
Joined: 18 Jul 2008 Posts: 5 Location: India
|
|
|
|
Thanks to Frank & Dick. You guys are really helpful. Frank, you are great.
|
|
Back to top |
|
|
|