MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Update total no:of records on every record using Sort

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
6930
Beginner


Joined: 06 Dec 2005
Posts: 3
Topics: 1

PostPosted: Tue Dec 06, 2005 7:44 am    Post subject: Update total no:of records on every record using Sort Reply with quote

Hi All,

I have two file and am comparing both of them.If the a/c no matches I am calculating the amount fields.

Eg

File 1

111 04
222 06

file 2

111 02
222 05
222 05

and i am getting

111 06
222 16

using


INCLUDE COND=(1,2,CH,EQ,C'DT')
SORT FIELDS=(29,15,A),FORMAT=CH
SUM FIELDS=(53,9,ZD)

My question is

Is there any way to get the record count
displayed here

Eq o/p as


111 06 1
222 16 2

from the records in file2.


Thanks in advance
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Dec 06, 2005 8:20 am    Post subject: Reply with quote

6930,

Please Use meaningful topics, do not use the Forum name for the topic, also Post detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.

You haven't provided the lrecl , recfm and how you are matching the records.

Assuming that both files are of the same lrecl(80) and file1 has unique records and file2 has duplicate records the following JCL will give you the desired results. Also I assumed

Code:

//STEP0100 EXEC PGM=SORT                           
//SYSOUT   DD  SYSOUT=*                             
//SORTIN   DD  DSN=YOUR DUPLICATE FILE2,
//             DISP=SHR
//         DD  DSN=YOUR UNIQUE RECORD FILE1,
//             DISP=SHR
//SORTOUT  DD  SYSOUT=*                             
//SYSIN    DD  *
  OPTION EQUALS                                   
  INREC FIELDS=(1,80,7C'0',C'1')
  INCLUDE COND=(1,2,CH,EQ,C'DT')
  SORT FIELDS=(29,15,A),FORMAT=CH
  SUM FIELDS=(53,9,ZD,81,8,ZD)
  OUTREC FIELDS=(1,80,81,8,ZD,SUB,+1,LENGTH=8)
  OUTFIL OMIT=(81,8,ZD,EQ,0)
/*


hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
6930
Beginner


Joined: 06 Dec 2005
Posts: 3
Topics: 1

PostPosted: Tue Dec 06, 2005 8:35 am    Post subject: Reply with quote

Hi,

Sorry for not providing the complete information.

The LRCEL of file1 is 525 and that of file2 is 90.

File 1 does not contain duplicates and file 2 has duplicates.

We want the total (amount) to be added in the file 2 ,if a match is found for the key in file1 and also no of such occurances in file2.


Let me know if I am not clear.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12375
Topics: 75
Location: San Jose

PostPosted: Tue Dec 06, 2005 9:09 am    Post subject: Reply with quote

6930,

Run the following Job and post the contents from the sysout here and we will suggest a solution based on the version of sort your shop has

Code:

//STEP0100 EXEC PGM=SORT         
//SYSOUT   DD SYSOUT=*           
//SORTIN   DD *
ABC
//SORTOUT  DD SYSOUT=*           
//SYSIN    DD *                   
 SORT FIELDS=COPY                 
/*


Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
6930
Beginner


Joined: 06 Dec 2005
Posts: 3
Topics: 1

PostPosted: Wed Dec 07, 2005 8:39 am    Post subject: Reply with quote

Kosulu,

Here is the SYSOUT from the Job

SYNCSORT FOR Z/OS 1.1CN TPF2A U.S. PATENTS: 4210961, 5117495 (C) 2002 SYNC
z/OS 1.4.0
PRODUCT LICENSED FOR CPU SERIAL NUMBER 30366, MODEL 9672 LICEN
SYSIN :
SORT FIELDS=COPY
WER164B 6,896K BYTES OF VIRTUAL STORAGE AVAILABLE, MAX REQUESTED,
WER164B 0 BYTES RESERVE REQUESTED, 173K 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
WER416B BSAM WAS USED FOR SORTIN
WER416B BSAM WAS USED FOR SORTOUT
WER054I RCD IN 1, OUT 1
WER169I RELEASE 1.1C BATCH 0401 TPF LEVEL 2A
WER052I END SYNCSORT -
DIAG=CA00,4802,E204,ECEE,82EA,6C8A,A
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group