|
View previous topic :: View next topic
|
| Author |
Message |
zh_lad
Active User
Joined: 06 Jun 2009 Posts: 115 Location: UK
|
|
|
|
Hi,
I have never SORT to produce a report so far. However, I have used it for sorting, OUTREC, SPLICE etc.
LRECL=62, RECFM=FB, all the columns are definded as alphanumeric.
| Code: |
N6337957215295476N6337957215295476V203020100622201007227020300
N6340814358152612N6340814358152612V203020100622201007227020300
N6153057215295476N6153057215295476V203020100622201007227020300
N6259957215295470N6259957215295470V203020100622201007227020300
N6259957215295470N6259957215295470V203120100622201007227020300
N7026528643866904N7026528643866904V203120100622201007227020300
N7028957215295470N7028957215295470V203120100622201007227020300
N7030814358152618N7030814358152618V203120100622201007227020300
N7033814358152612N7033814358152612V203120100622201007227020300
N7041385786724045N7041385786724045V203120100622201007227020300
N7044671501009751N7044671501009751V203120100622201007227020300
N6280081433729847N6280081433729847V203020100622201007227020301
N6288591433729841N6288591433729841V203020100622201007227020301
Y6093724290872702Y6093724290872702V203020100622201007227020301
N6303581433729841N6303581433729841V203020100622201007227020301
|
Field Position Length
Entity 56 4
Subprod 60 3
MKTIND 35 5
Output Report format:
Entity Subproduct MKTIND Count
7020 300 V2030 4
7020 300 V2031 7
7020 301 V2030 4
Many thanks,
Zurich Lad |
|
| Back to top |
|
 |
anshul_gugnani
New User

Joined: 02 Nov 2009 Posts: 73 Location: Mumbai
|
|
|
|
Hello zh_lad,
Below sort card will give you desired result -
| Code: |
INREC OVERLAY=(63:56,04,60,3,35,5,75:C'01')
SORT FIELDS=(56,04,CH,A,60,3,CH,A,35,5,CH,A)
OUTFIL REMOVECC,NODETAIL,
HEADER2=(01:C'ENTITY ',09:C'SUBPRODUCT ',21:C'MKTIND ',
29:'COUNT ',/,
01:C'======',09:C'==========',21:C'======',29:'====='),
BUILD=(1,62),
SECTIONS=(63,12,
TRAILER3=(01:56,04,09:60,3,21:35,5,28:TOT=(75,02,ZD,EDIT=(IIIIIT)))) |
Hope this Helps,
Anshul. |
|
| Back to top |
|
 |
zh_lad
Active User
Joined: 06 Jun 2009 Posts: 115 Location: UK
|
|
|
|
It worked!
ENTITY SUBPRODUCT MKTIND COUNT
================== ===== =====
7020 300 V2030 187
7020 300 V2031 158
7020 301 V2030 80
7020 301 V2031 73
Thank you very much! Right now I am busy with work. However, I will quickly come back to understand SECTIONS and TRAILER3.
Cheers! |
|
| Back to top |
|
 |
Frank Yaeger
DFSORT Developer

Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Alternatively, you can use a DFSORT/ICETOOL job like the following to do what you asked for:
| Code: |
//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN DD DSN=... input file
//OUT DD DSN=... output file
//TOOLIN DD *
OCCUR FROM(IN) LIST(OUT) NOCC BETWEEN(10) -
HEADER('Entity') ON(56,4,CH) -
HEADER('Subproduct') ON(60,3,CH) -
HEADER('MKTIND') ON(35,5,CH) -
HEADER('Count') ON(VALCNT,U05)
/*
|
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:
www.ibm.com/support/docview.wss?rs=114&uid=isg3T7000080 |
|
| Back to top |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|