HEADER
CUSTOMER1....................................
MAILING.............a.........................
a
b
c
CUSTOMER2....................................
MAILING........................................
a
b
c
CUSTOMER3....................................
MAILING.......................b...............
a
b
c
CUSTOMER4
MAILING.................................c.....
a
b
c
CUSTOMER5
MAILING.......................................
a
b
c
RQSTCNTL999999999....................
CUSTOMER6
MAILING.......................................
a
b
c
CUSTOMER7
MAILING....................a.................
a
b
c
RQSTCNTL888888888....................
TRAILER
Please see the description of above input file
1. after the header till RQSTCNTL is one group for a request
2. within a group of request, starting from CUSTOMER record till next CUSTOMER is a group for each customer
3. each customer has mailing record which may have value at fixed opsition let's say 35, 40 & 45
Now the requirement is -
1. I need to keep the header and trailer as it is.
2. I need to SORT it by RQSTCNTL (in this case goup of second RQSTCNT should come first since it has RQSTCNTL as 888888888).
3. Once it's sorted by RQSTCNTL (as a group) I need to SORT the customers based on the mailing record (position 35, 40 & 45)
Please see the sorted output -
Code:
HEADER
CUSTOMER6
MAILING.......................................
a
b
c
CUSTOMER7
MAILING....................a.................
a
b
c
RQSTCNTL888888888....................
CUSTOMER2....................................
MAILING........................................
a
b
c
CUSTOMER5
MAILING.......................................
a
b
c
CUSTOMER1....................................
MAILING.............a.........................
a
b
c
CUSTOMER3....................................
MAILING.......................b...............
a
b
c
CUSTOMER4
MAILING.................................c.....
a
b
c
RQSTCNTL999999999....................
TRAILER
Please note that Customer records have CUSTOMER (it's not unique, I just made it to avoid any confusion).
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
trilokdewangan,
The following DFSORT JCL will give you the desired results.
I assumed the following
1. Your input lrecl is 80 and recfm is FB
2. Every group has one RQSTCNTL in pos 1
3. Sorting of the customer data is identified by 'customer' in pos 1 and the sorting filed starts at pos 35 to 45 for a length of 11 bytes
I tried to run this in my shop but stuck with JCL error with :
"NO SORTIN DD STATMENT PROVIDED."
Is that possible to display following information at the same time into another file -
REQUEST# - (the list - starting from 9, length 9 of RQSTCNTL record)
NUMBER OF RECORDS : total records
NUMBER OF CUSTOMERS = count of CUSTOMER records
NUMBER OF REQUESTS = Number of RQSTCNTL records.
(Input file has LRECL = 2000, FB, Mailing records ("MAILING") sorting records start:343, length 32)
Joined: 07 Dec 2007 Posts: 2205 Location: San Jose
trilokdewangan wrote:
Thanks Kolusu.
I tried to run this in my shop but stuck with JCL error with :
"NO SORTIN DD STATMENT PROVIDED."
You need to show me the complete SYSOUT messages so that I can determine the error
Quote:
Is that possible to display following information at the same time into another file -
REQUEST# - (the list - starting from 9, length 9 of RQSTCNTL record)
NUMBER OF RECORDS : total records
NUMBER OF CUSTOMERS = count of CUSTOMER records
NUMBER OF REQUESTS = Number of RQSTCNTL records.
(Input file has LRECL = 2000, FB, Mailing records ("MAILING") sorting records start:343, length 32)
Yes it is possible but I need to see the level of DFSORT you are running.
Run the following sample job and show me the complete SYSOUT listing
OUTREC BUILD=(1,2000)
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER268A JOINKEYS STATEMENT: SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
SYSOUT of ICEMAN -
Code:
SYNCSORT FOR Z/OS 1.3.2.1R U.S. PATENTS: 4210961, 5117495 (C) 2007 SYNCSO
Prudential Financial z/OS 1.11.0
SYNCSORT LICENSED FOR CPU SERIAL NUMBER 1AD35, MODEL 2097 606 LICEN
SYSIN :
OPTION COPY
WER276B SYSDIAG= 103744, 2261881, 2261881, 4496025
WER415I DSM FACILITY ACTIVE: STORAGE ADJUSTED BY 0 BYTES
WER164B 9,052K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 272K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER108I SORTIN : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER110I SORTOUT : RECFM=FB ; LRECL= 80; BLKSIZE= 80
WER410B 7,848K BYTES OF VIRTUAL STORAGE AVAILABLE ABOVE THE 16MEG LINE,
WER410B 0 BYTES RESERVE REQUESTED, 156K BYTES USED
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
WER416B BSAM WAS USED FOR SORTIN
WER416B BSAM WAS USED FOR SORTOUT
WER054I RCD IN 1, OUT 1
WER169I RELEASE 1.3 BATCH 0506 TPF LEVEL 2.1
WER052I END SYNCSORT - TESTSORT,S1,,DIAG=C200,40CE,EAAE,00E6,8A52,6CC3,AAA8,0C
Synsort and DFSORT are competitive products
Kolusu is a DFSORT Developer...
He will be glad to answer and solve issues on DFSORT!
You cannot expect Him to provide assistance on a competitor's product
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
trilokdewangan,
Here's a SYNCTOOL (untested) equivalent of Kolusu's above solution.
I have modified it as per the file attributes and field positions mentioned in your latest post.
WER276B SYSDIAG= 356230, 1304350, 1304350, 2362575
WER415I DSM FACILITY ACTIVE: STORAGE ADJUSTED BY 14M BYTES
WER164B 1,204K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 1,176K BYTES USED
WER146B 20K BYTES OF EMERGENCY SPACE ALLOCATED
WER267A SORT STATEMENT : STATEMENT NOT FOUND
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
WER449I SYNCSORT GLOBAL DSM SUBSYSTEM ACTIVE
******************************* BOTTOM OF DATA ********************************
I see the mailing record's detail doesn't overlayed to customer record (Position from 2010 length = 32) this is why after sorting, CUSTOMER records are misplaced. Here is the screen of output file from position 2010 (from Position 2010, first 9 - RQSTCNTL, rest are MAILING records Length 32) without the final sort (above) {first record - HEADER, 2nd - CUSTOMER, 3rd -MAILING, rest are the records from group}
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
Hi Dick,
I got busy over the week and could not check the forums. AFAIK JOINKEYS do need a SORT rather than a COPY.
trilokdewangan,
The SYNCTOOL job provided earlier assumes that the CUSTOMER record has the field (343,32) by which you want to sort each CUSTOMER group within an RQST group. But it seems like this is not what you want here. You need to explain clearly the sorting rule to be followed here.
Does CUSTOMER record have the field with which the CUSTOMER groups have to be sorted?
If not, is it the 'MAILING' record which has this field?
Is there only a single 'MAILING' record per 'CUSTOMER' group?