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
 

 

Move unique files to another file

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

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Sat Apr 21, 2007 7:00 pm    Post subject: Move unique files to another file
Reply with quote

I have two input files of the same length. I want to check if a record in FILE2 exist in FILE1 and if it deosnot i want to write this record into a new file.

BTW i have only SYNCSORT. icon_sad.gif


EG:

FILE1 FILE2 OUTPUT
------ ------ ---------
CAT AND AND
LOT CAT RAT
BAT RAT NOT
PAT PAT MET
SIT NOT
SIT
MET
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Sat Apr 21, 2007 7:32 pm    Post subject:
Reply with quote

Syncsort has the capability you need:
Quote:
Retaining Unpaired Records
When joining files, a record from one file may or may not have a match in the other file. A match occurs when the contents of the join keys in the record from the first file equal the contents of the join keys in the record from the second file.
By specifying the JOIN statement you can discard unpaired records from one or both files, or retain unpaired records from both files.
Have you looked into your manual?
Back to top
View user's profile Send private message
vkphani

New User


Joined: 29 Oct 2003
Posts: 29

PostPosted: Mon Apr 23, 2007 3:33 pm    Post subject:
Reply with quote

Try this:

Code:
//S1       EXEC PGM=ICETOOL
//OUT1     DD SYSOUT=*
//OUT2     DD SYSOUT=*
//TOOLMSG  DD SYSOUT=*
//DFSMSG   DD SYSOUT=*
//CON      DD DSN=FILE1,DISP=SHR
//             DD DSN=FILE2,DISP=SHR
//TOOLIN   DD *
  SELECT FROM(CON) TO(OUT1) ON(1,4,CH) ALLDUPS USING(CTL3)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=(OUT1,OUT2),SPLIT
/*
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Mon Apr 23, 2007 4:21 pm    Post subject: Re: Move unique files to another file
Reply with quote

The code dint work for me.

I want to get the list of records that are present only in SECOND file and is not present in FIRST record.

Thanks anyways
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Mon Apr 23, 2007 7:45 pm    Post subject:
Reply with quote

hey,

Use this code..

Code:
//STEP1    EXEC PGM=ICETOOL                   
//IN1      DD DSN=XXXXXX.YYYY,DISP=SHR         
//IN2      DD DSN=AAAAAA.BBBB,DISP=SHR         
//TEMP1    DD DSN=TEMP1,DISP=(MOD,PASS)       
//TEMP2    DD DSN=TEMP2,DISP=(MOD,PASS)       
//OUT1     DD SYSOUT=*                         
//*                                           
//TOOLIN   DD *                               
 COPY FROM(IN1) TO(TEMP1) USING(CTL1)         
 COPY FROM(IN2) TO(TEMP1) USING(CTL2)         
 SELECT FROM(TEMP1) TO(TEMP2) ON(1,4,CH) NODUPS
 COPY FROM(TEMP2) TO(OUT1) USING(CTL3)         
/*                                             
//CTL1CNTL DD *                               
 INREC OVERLAY=(81:C'1')                       
/*                                             
//CTL2CNTL DD *                               
 INREC OVERLAY=(81:C'2')                       
/*                                             
//CTL3CNTL DD *                                           
 OUTFIL FNAMES=OUT1,INCLUDE=(81,1,CH,EQ,C'2'),BUILD=(1,80)
/*                                                       
//TOOLMSG  DD SYSOUT=*                                   
//SSMSG    DD SYSOUT=*       



This wil give ur desired output.. assumed that i/p files are Lrecl 80.

tel me if u have any probs... icon_biggrin.gif
Back to top
View user's profile Send private message
raak

Active User


Joined: 23 May 2006
Posts: 166
Location: chennai

PostPosted: Mon Apr 23, 2007 7:48 pm    Post subject:
Reply with quote

And one more thing..

In ur first post ur output is shown as

Quote:
AND
RAT
NOT
MET


In the last post u said..

Quote:
I want to get the list of records that are present only in SECOND file and is not present in FIRST record.


But i couldn't see the value MET in the second file.

was that a typo?? icon_lol.gif
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Mon Apr 23, 2007 8:30 pm    Post subject: Re: Move unique files to another file
Reply with quote

Yea tat was a typo icon_redface.gif
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Mon Apr 23, 2007 9:41 pm    Post subject: Re: Move unique files to another file
Reply with quote

William,
I got JOIN as invalid SORT keyword icon_cry.gif
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Mon Apr 23, 2007 10:03 pm    Post subject: Re: Move unique files to another file
Reply with quote

Hey,
Is
INREC OVERLAY a feature of SYNCSORT. Have never used this before
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Mon Apr 23, 2007 10:06 pm    Post subject: Re: Move unique files to another file
Reply with quote

antonyjoseph wrote:
I got JOIN as invalid SORT keyword icon_cry.gif
It is a statement all by itself, have you checked your manual?
Post your jcl and sysout.
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Apr 24, 2007 1:33 am    Post subject:
Reply with quote

Hello,

If Syncsort is your sort product, i'd suggest that you be wary of solutions that use ICETOOL. They are most likely DFSORT solutions and may not work with Syncsort. Not all of the options from one product are available in the other.

Some sites also are setup to execute Syncsort if ICETOOL is specified in the jcl.

If you don't have the Syncsort manuals, i'd suggest you get them from the vendor. If your site is a licensed user, they are available for free - Syncsort support will tell you how to "download" them.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Tue Apr 24, 2007 1:42 am    Post subject:
Reply with quote

Heck, just emailing their tech-support from your (licensed) shop will get you a copy........
Back to top
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Tue Apr 24, 2007 3:48 am    Post subject:
Reply with quote

Hello antonyjoseph,

Do you have this working now?

If not, please post the jcl for this step including the sort control statements and all of the output messages from the sort step.

From that we can offer suggestions to correct the problem(s).
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Tue Apr 24, 2007 9:57 am    Post subject: Re: Move unique files to another file
Reply with quote

Well i dont think i will get JOIN to work for me. i have SYNCSORT 1.1 and i read JOIN is a feature of 1.2 for Zos.
I eventually had to write a COBOL pgm for it icon_sad.gif
Back to top
View user's profile Send private message
antonyjoseph

New User


Joined: 11 Apr 2007
Posts: 28
Location: India

PostPosted: Tue Apr 24, 2007 10:04 am    Post subject:
Reply with quote

Code:

//TEST    EXEC  PGM=SORT             
//TOOLMSG  DD SYSOUT=*                 
//DFSMSG   DD SYSOUT=*                 
//SYSOUT   DD SYSOUT=*                 
//SORTJNF1 DD *                       
AA                             
BB
CC
AB
//SORTJNF2 DD *                       
BB
AD
DD
EE
//SORTOUT  DD DSN=TEST.SORT,     
//             DISP=(,CATLG,DELETE),   
//             UNIT=TESTDA,           
//             SPACE=(CYL,(5,5),RLSE)
//SYSIN    DD *                       
 JOINKEYS FILES=F1,FIELDS=(1,3,A)     
 JOINKEYS FILES=F2,FIELDS=(1,3,A)   
 JOIN UNPAIRED,F1,ONLY             
 REFORMAT FIELDS=(F1:1,3)           
 SORT FIELDS=COPY                   
//*                                 
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 Converting Variable block file to Fix... bhavana yalavarthi DFSORT/ICETOOL 10 Tue May 16, 2017 2:20 pm
No new posts Unable to create multiple files using... mbattu COBOL Programming 3 Fri May 05, 2017 5:35 pm
No new posts Getting error while opening a variabl... apandey1 COBOL Programming 5 Fri May 05, 2017 12:22 pm
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Issue with NDM process to transmit ES... chetanambi All Other Mainframe Topics 6 Wed May 03, 2017 10:52 am


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