Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

SYNCSORT No matched records

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
bamohan

New User


Joined: 29 Jan 2007
Posts: 33
Location: chennai

PostPosted: Tue Mar 10, 2009 6:41 pm    Post subject: No matched records
Reply with quote

Hi I'm just comparing two files using join keys. If the records are matched I'm writing into o/p file1, if not matched i'm writing into o/p file2.

There is a case, if there are no matched records found at all, then I need to write into the o/p file1 as " No records are matched ".. How can i do this ? Please help !!
Back to top
View user's profile Send private message

Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Tue Mar 10, 2009 8:10 pm    Post subject:
Reply with quote

Hi,

Please show the sort card you are using along with some sample input records, rules & expected output - someone will be around with a suggestion.
Back to top
View user's profile Send private message
bamohan

New User


Joined: 29 Jan 2007
Posts: 33
Location: chennai

PostPosted: Tue Mar 10, 2009 8:42 pm    Post subject:
Reply with quote

Code:
//SYSIN    DD  *                                                 
  JOINKEYS FILES=F1,FIELDS=(1,9,A)                               
  JOINKEYS FILES=F2,FIELDS=(1,9,A)                               
  REFORMAT FIELDS=(F1:1,54,F2:10,8)                               
  JOIN UNPAIRED,F1                                               
  OUTFIL FILES=1,INCLUDE=(55,7,CH,NE,C' '), 
         OUTREC=(1:1,9,10:2X,12:55,7,19:44X),REMOVECC,           
         HEADER1=(1:'DATE';2X,&DATE=(DMY/);17:14X;               
         31:'DEL OPTION CUSIPS HAVING HOLDERS',/,                 
         1:'CUSIP';6X;12:'ACCTNO';45X,/,                         
         1:18'-')                                                                       
  OUTFIL FILES=2,INCLUDE=(55,7,CH,EQ,C' '),                       
                 OUTREC=(1:C'P',2:1,9,11:191X)                   
  SORT FIELDS=COPY                   


My question is -- If the include condition in OUTFIL FILES 1 is not at all matched then I need to write "No Records " in the o/p file1
Back to top
View user's profile Send private message
Alissa Margulies

SYNCSORT Support


Joined: 25 Jul 2007
Posts: 500
Location: USA

PostPosted: Wed Mar 11, 2009 2:09 am    Post subject:
Reply with quote

bamohan,

Give this untested SORT application a try and let me know if you get the desired results:
Code:

//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTJNF1 DD DSN=...
//SORTJNF2 DD DSN=...
//SORTOF1 DD DSN=&&TEMP1,DISP=(NEW,PASS),...
//SORTOF2 DD DSN=UNPAIRED.REPORT,DISP=(NEW,CATLG),...
//SYSIN    DD  *                                                 
  JOINKEYS FILES=F1,FIELDS=(1,9,A)                               
  JOINKEYS FILES=F2,FIELDS=(1,9,A)                               
  REFORMAT FIELDS=(F1:1,54,F2:10,8)                               
  JOIN UNPAIRED,F1                                               
  OUTFIL FILES=1,INCLUDE=(55,7,CH,NE,C' '), 
     OUTREC=(1:1,9,10:2X,12:55,7,19:44X),NULLOFL=RC4                                     
  OUTFIL FILES=2,INCLUDE=(55,7,CH,EQ,C' '),                       
     OUTREC=(1:C'P',2:1,9,11:191X)                   
  SORT FIELDS=COPY   
//************************************************
//* STEP2 WILL EXECUTE WHEN SORTOF01 CONTAINS DATA
//************************************************
//STEP2 EXEC PGM=SORT,COND=(4,EQ,STEP1)
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=&&TEMP1,DISP=SHR
//SORTOUT DD DSN=MATCHED.RECORDS.REPORT,DISP=(NEW,CATLG),...
//SYSIN DD *
   SORT FIELDS=COPY
   OUTFIL REMOVECC,           
      HEADER1=(1:'DATE';2X,&DATE=(DMY/);17:14X;               
      31:'DEL OPTION CUSIPS HAVING HOLDERS',/,                 
      1:'CUSIP';6X;12:'ACCTNO';45X,/,                         
      1:18'-'),OUTREC=(1,62)
//***************************************************
//* STEP3 WILL EXECUTE WHEN SORTOF01 CONTAINS NO DATA
//***************************************************
//STEP3 EXEC PGM=SORT,COND=(0,EQ,STEP1)
//SYSOUT DD SYSOUT=*
//SORTIN DD *
NO MATCHES
//SORTOUT DD DSN=MATCHED.RECORDS.REPORT,DISP=(NEW,CATLG),...
//SYSIN DD *
   SORT FIELDS=COPY 
   OUTFIL REMOVECC,           
      HEADER1=(1:'DATE';2X,&DATE=(DMY/);17:14X;               
      31:'DEL OPTION CUSIPS HAVING HOLDERS',/,                 
      1:'CUSIP';6X;12:'ACCTNO';45X,/,                         
      1:18'-'),OUTREC=(1,62)
/*                         
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Check if any Detail records and extra... V S Amarendra Reddy SYNCSORT 19 Mon May 08, 2017 8:54 pm
No new posts Join giving more records than expected Danielle.Filteau SYNCSORT 2 Thu Mar 09, 2017 3:28 am
No new posts TSO or command line utility to genera... kishpra JCL & VSAM 3 Thu Mar 09, 2017 1:11 am
No new posts Extract set of records matching on ac... bhaskar_kanteti DFSORT/ICETOOL 3 Mon Mar 06, 2017 7:19 am
No new posts Inserting records based on conditions vickey_dw DFSORT/ICETOOL 9 Wed Feb 22, 2017 1:33 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us