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 

eliminate selected record in two files

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


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Tue May 31, 2005 7:16 am    Post subject: eliminate selected record in two files Reply with quote

Hi all
I have a requirement like this

I have two input files check file and autopay file. I have to concatenate both these files and sort on contract number (it's location is 15 length is 9 in ascending order) and write it back to check file.

Case 1:-
Check file contains contracts and Autopay file contains record as "NO PAYMENTS FOUND." (may be one or more than one records) in this case I need only contract numbers not "NO PAYMENTS FOUND." message in output.

Case 2:-

Check file contains record as "NO PAYMENTS FOUND." (may be one or more than one records) and Autopay file contains contract records in this case I need only contract numbers not "NO PAYMENTS FOUND." message in output.

Case 3:-

Check file contains "NO PAYMENTS FOUND." (may be one or more than one records) and Autopay file contains record as "NO PAYMENTS FOUND." (may be one or more than one records) in this case I need only one "NO PAYMENTS FOUND." record in my output

Case 4:-

Check file contains contracts and Autopay file contains contracts in this
case I need all contract numbers in my output

In my shop I have Syncsort. DCB parameters for both file are LRECL=315,RECFM=FB.
_________________
Regards,
Chandra
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


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

PostPosted: Tue May 31, 2005 7:33 am    Post subject: Reply with quote

Chandra,

How do we know what you meant by contract and autoplay ? Please post a sample input and desired output.

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


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Wed Jun 01, 2005 2:11 am    Post subject: Reply with quote

The input and Required output

Case 1:-Check file records

R050518003101 A0004282 AB55403ASM000011111+CHANDRA' NEW DELHI NURSING HOM
R050222001101 A0289120 CD88201ASM000030000+DIBAKAR BISWAS
R050518001101 A0292448 AA61115ASM000077700+SRILATHA' HOLLYWOOD NURSING
R050518001101 A0392448 BB61115ASM000077700+PRAKASH' NOIDA NURSING

Autopay File records

NO PAYMENTS FOUND.

output

R050518003101 A0004282 AB55403ASM000011111+CHANDRA' NEW DELHI NURSING HOM
R050222001101 A0289120 CD88201ASM000030000+DIBAKAR BISWAS
R050518001101 A0292448 AA61115ASM000077700+SRILATHA' HOLLYWOOD NURSING
R050518001101 A0392448 BB61115ASM000077700+PRAKASH' NOIDA NURSING


Case 2:-

check File records

NO PAYMENTS FOUND.


Autopay file records

R050518003101 A0001234 AB55403ASM000011111+venu' NEW DELHI NURSING HOM
R050222001101 A0001235 CD88201ASM000030000+RAVI
R050518001101 A0001236 AA61115ASM000077700+HARI' HOLLYWOOD NURSING
R050518001101 A0001237 BB61115ASM000077700+RAM' NOIDA NURSING
R050518003101 A0001238 NM55403ASM000011111+NAYANA' SARITHA VIHAR NURSING HOM

output

R050518003101 A0001234 AB55403ASM000011111+venu' NEW DELHI NURSING HOM
R050222001101 A0001235 CD88201ASM000030000+RAVI
R050518001101 A0001236 AA61115ASM000077700+HARI' HOLLYWOOD NURSING
R050518001101 A0001237 BB61115ASM000077700+RAM' NOIDA NURSING
R050518003101 A0001238 NM55403ASM000011111+NAYANA' SARITHA VIHAR NURSING HOM


Case 3:-
Check file records

NO PAYMENTS FOUND.
NO PAYMENTS FOUND.

Autopay File records

NO PAYMENTS FOUND.

output

NO PAYMENTS FOUND.


Case 4:-

Check file file records

R050518003101 A0004282 AB55403ASM000011111+CHANDRA' NEW DELHI NURSING HOM
R050222001101 A0289120 CD88201ASM000030000+DIBAKAR BISWAS
R050518001101 A0292448 AA61115ASM000077700+SRILATHA' HOLLYWOOD NURSING
R050518001101 A0392448 BB61115ASM000077700+PRAKASH' NOIDA NURSING
R050518003101 A0004282 NM55403ASM000011111+SAMPATH' SARITHA VIHAR NURSING HOM

Autopay File records

R050518003101 A0001234 AB55403ASM000011111+venu' NEW DELHI NURSING HOM
R050222001101 A0001235 CD88201ASM000030000+RAVI
R050518001101 A0001236 AA61115ASM000077700+HARI' HOLLYWOOD NURSING
R050518001101 A0001237 BB61115ASM000077700+RAM' NOIDA NURSING
R050518003101 A0001238 NM55403ASM000011111+NAYANA' SARITHA VIHAR NURSING HOM

output

R050518003101 A0001234 AB55403ASM000011111+venu' NEW DELHI NURSING HOM
R050222001101 A0001235 CD88201ASM000030000+RAVI
R050518001101 A0001236 AA61115ASM000077700+HARI' HOLLYWOOD NURSING
R050518001101 A0001237 BB61115ASM000077700+RAM' NOIDA NURSING
R050518003101 A0001238 NM55403ASM000011111+NAYANA' SARITHA VIHAR NURSING HOM
R050518003101 A0004282 AB55403ASM000011111+CHANDRA' NEW DELHI NURSING HOM
R050222001101 A0289120 CD88201ASM000030000+DIBAKAR BISWAS
R050518001101 A0292448 AA61115ASM000077700+SRILATHA' HOLLYWOOD NURSING
R050518001101 A0392448 BB61115ASM000077700+PRAKASH' NOIDA NURSING
_________________
Regards,
Chandra
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Fri Jun 17, 2005 10:38 am    Post subject: Reply with quote

Chandru,

I Apologize for the late reply. I am not sure whether you got a solution already.

The following Syncsort (Synctool) job will solve your requirement.

Code:

//R010    EXEC  PGM=SYNCTOOL                                           
//TOOLMSG   DD  SYSOUT=*                                               
//DFSMSG    DD  SYSOUT=*                                               
//*
//INPUT     DD  DSN=MY.AUTOPAY.FILE,
//              DISP=SHR                                                       
//          DD  DSN=MY.CHECK.FILE,
//              DISP=SHR                                                     
//*
//CTL2CNTL  DD  DSN=&&T1,DISP=(,PASS)                                   
//          DD  *                                                       
  OUTFIL ENDREC=1,                                                     
  OUTREC=(C'NO PAYMENTS FOUND.',80:X)                                   
  END                                                               
/*                                                                   
//OUTPUT    DD  SYSOUT=*                                             
//TOOLIN    DD  *                                                   
  COPY FROM(INPUT) TO(CTL2CNTL) USING(CTL1)                         
  COPY FROM(INPUT) TO(OUTPUT)   USING(CTL2)                         
/*                                                                   
//CTL1CNTL  DD  *                                                   
  INCLUDE COND=(1,8,CH,NE,C'NO PAYMENTS FOUND.')                     
  OUTFIL FNAMES=CTL2CNTL,                                           
         ENDREC=1,                                                   
  OUTREC=(3X,C'INCLUDE COND=(1,18,CH,NE,C''NO PAYMENTS FOUND.'')',/,
          3X,C'END',80:X)                                           
/*                                                                   


Brief Explanation of the job
1. Concatenate both the input files in the order - Autopay -> Check File.
2. Create a dynamic sort card CTL2CNTL in Step 1.
a. Reject all "No Payments Found" record from the concatenated files (no matter in which file/how many occurences are there).
b. Just process 1 record (OUTFIL ENDREC=1). If there is a DATA record left in the input, a dynamic sort card will be created as shown below. See the OUTREC parameter in OUTFIL.

Code:

   INCLUDE COND=(1,18,CH,NE,C'NO PAYMENTS FOUND.')   
   END                                               


c. If no DATA records are available (Case 3) then no records will be written to the dynamic control card CTL2CNTL. In this case, sort will pickup the Hardcoded instream control card concatenated to CTL2CNTL.

For Case 1, 2 & 4, the CNTL2CNTL will actually be
Code:

  INCLUDE COND=(1,18,CH,NE,C'NO PAYMENTS FOUND.')   
  END                                               
  OUTFIL ENDREC=1,                     
  OUTREC=(C'NO PAYMENTS FOUND.',80:X) 
  END                   


The END statement makes sure that the second half of the control card is not taken for processing.

Hope this helps,

Let us know if you face any problems,

Regards,
Phantom
Back to top
View user's profile Send private message
chandra
Beginner


Joined: 26 Sep 2003
Posts: 130
Topics: 36

PostPosted: Sat Jun 18, 2005 1:46 am    Post subject: Reply with quote

Hi Phantom,

Thanks for your reply.

Your solution is not working for case 2 and the length field in INCLUDE COND in CTL1 is not correct. I have corrected but still I am not getting can you please help me out.

Quote:

INCLUDE COND=(1,8,CH,NE,C'NO PAYMENTS FOUND.')

_________________
Regards,
Chandra
Back to top
View user's profile Send private message
Phantom
Data Mgmt Moderator
Data Mgmt Moderator


Joined: 07 Jan 2003
Posts: 1056
Topics: 91
Location: The Blue Planet

PostPosted: Tue Jun 21, 2005 4:21 am    Post subject: Reply with quote

Chandra,

Thanks for pointing out the typo with the INCLUDE Length. I ran the job for Case 2 and it works fine for me.

Can you Please post your JCL & Sysout (TOOLMSG & DFSMSG) so that we can see what might have gone wrong.

Thanks,
Phantom
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