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
 

 

Need to write 3 output files
Goto page 1, 2  Next
 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Sun Dec 31, 2006 2:59 pm    Post subject: Need to write 3 output files
Reply with quote

Hi All,

Iam having 2 sequential Files. Both files are having common Records and uncommon Records.

My Requirement is I wanted to write common Records into one file and Uncommon records which is having in the first file needs to write into one file and in the same way i need to write uncommon records which is having in the second file, i need to write into a seperate file.

So finally 3 output files will come.

1. Common Records in 2 files.

2. Uncommon Records in First file

3. Uncommon Records in 3rd file.

Could you please help me out how to write a JCL for this requirement.

It will be a great help to me.

Thanks in advance to all of you.

Thanks and Regards,
Samba.
Back to top
View user's profile Send private message

William Thompson

Global Moderator


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

PostPosted: Sun Dec 31, 2006 4:58 pm    Post subject:
Reply with quote

Hi Samba,

What sort do you have?

Did you scan some of the posts in the DFSORT/ICETOOL forun? Your solution is probably already there.
Quote:
1. Common Records in 2 files.

2. Uncommon Records in First file

3. Uncommon Records in 3rd file.
Did you mean the 2nd file?

Could you provide sample input for both files and what you want the input to look like in your 3 output files? Use the "CODE" button for your sample data and "preview" to see how it looks.

Include recform and lrecl and anything special, like the "commen" key and the presense of duplicates on one or the other inputs.

Information leads to knowledge and knoledge is power.

Looking forward to your next post,

Bill
Back to top
View user's profile Send private message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Sun Dec 31, 2006 5:18 pm    Post subject:
Reply with quote

Hi Bill,

Thanks for your quick response.

Yes i mean that 2nd File only.

The two files are already sorted by DFSORT.

Files are having Client Numbers(PIC 9(9) COMP) and Policy Numbers(PIC S9(9) COMP).

In these two files some of the Policy Numbers are common and some of the policiy numbers are not common in both the files.

My requirement is which ic common in both files i need to keep in first output file

Which is not common(Policies) in both files i need to put in seperate files.


Suppose if policy numbers are there in first file and not in second file i need to keep in one file and viceversa.


Cheers,
Samba.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Sun Dec 31, 2006 5:59 pm    Post subject:
Reply with quote

Samba,

Go look at this thread http://ibmmainframes.com/viewtopic.php?t=16747, the dark boxes are created with the "CODE" button. make examples of your input. Show example of what you want.

Bill
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Sun Dec 31, 2006 9:22 pm    Post subject:
Reply with quote

Samba,

You can do what you want using the technique discussed in the "Create files with matching and non-matching records" Smart DFSORT Trick at:

http://.ibm.com/servers/storage/support/software/sort/mvs/tricks/
Back to top
View user's profile Send private message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Sun Dec 31, 2006 10:16 pm    Post subject:
Reply with quote

Hi Frank and Bill,

Thanks for your prompt answers.

Hi Frank,

Here i don't understand onething. I opened the link whichever you have given and read the topic Create files with matching and non-matching records.

Using the SPLICE parameter 11, 12 and 22 adding as identifiers.

Why we are doing this one. Iam not clear about this.

Could you please clarify me regarding th

Thanks for your help and patience.

Cheers,
Samba.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Sun Dec 31, 2006 10:29 pm    Post subject:
Reply with quote

sambasivarao wrote:
Using the SPLICE parameter 11, 12 and 22 adding as identifiers.
Why we are doing this one. Iam not clear about this.

The two digits show which file the record was in to start while splicing the second digit on a match leaves the output of the matches altered. 11 or 22 were no match and 12 was a match making it easy for the outfil include to split the combined data to the three required outputs.
Back to top
View user's profile Send private message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Sun Dec 31, 2006 10:39 pm    Post subject:
Reply with quote

Hi Bill,

Thanks for quik response and your valuable clarifications.

Thanks a lot.

Cheers,
Samba.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Jan 01, 2007 9:44 pm    Post subject:
Reply with quote

Quote:
Using the SPLICE parameter 11, 12 and 22 adding as identifiers.

Why we are doing this one.


Samba,

I actually explained that in the discussion of that Topic:

Quote:
The trick here is to add an identifier of '11' to the File1 records, add an identifier of '22' to the File2 records, and splice the second id byte for matching records so we get '12' for names in both files, '11' for names only in File1 and '22' for names only in File2.
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Tue Jan 02, 2007 10:45 am    Post subject:
Reply with quote

Hi There,

Code:
//STEP0100 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                   
//DFSMSG   DD SYSOUT=*                                   
//IN1      DD *                                           
AAA123BBBBBB                                             
AAA222BBBBBB                                             
AAA333CCCCCCC                                             
/*                                                       
//IN2      DD *                                           
AAA111BBBBBB                                             
AAA222BBBBBB                                             
AAA333CCCCCCC                                             
/*                                                       
//T1        DD DSN=&&T1,SPACE=(CYL,(5,5),RLSE),DISP=(MOD,PASS)
//FILEA     DD SYSOUT=*                                   
//FILEB     DD SYSOUT=*   
//FILEC     DD SYSOUT=*                                   
//TOOLIN    DD   *                                         
  COPY FROM(IN1) USING(CTL1)                               
  COPY FROM(IN2) USING(CTL2)                               
  SORT FROM(T1) USING(CTL3)                               
/*                                                         
//CTL1CNTL  DD *                                           
  OUTFIL FNAMES=T1,OUTREC=(1,80,C'1')                     
/*                                                         
//CTL2CNTL  DD   *                                         
  OUTFIL FNAMES=T1,OUTREC=(1,80,C'2')                     
/*                                                         
//CTL3CNTL  DD   *                                           
  OPTION EQUALS                                               
  SORT FIELDS=(1,13,CH,A)                                     
  SUM FIELDS=(81,1,ZD)                                       
  OUTFIL FNAMES=FILEA,INCLUDE=(81,1,ZD,EQ,3),OUTREC=(1,80)     
  OUTFIL FNAMES=FILEB,INCLUDE=(81,1,CH,EQ,C'1'),OUTREC=(1,80)
  OUTFIL FNAMES=FILEC,INCLUDE=(81,1,CH,EQ,C'2'),OUTREC=(1,80)
/*



Hope it will helpful
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jan 02, 2007 10:03 pm    Post subject:
Reply with quote

Ekta,

I'm not sure why you're showing this "alternative" to the Smart DFSORT Trick for the same thing, but if you're going to continue to show it, would you please, please stop using concatenation as it can cause problems due to the system restriction discussed in the second bullet at:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/1.8.3.1?SHELF=&DT=20060615185603&CASE=

Use one T1 MOD data set instead of T1 and T2 and concatenation.

I've fixed your job above to use a T1 MOD data set. If you feel the need to post this example again, please post the T1 MOD version, not the concatenation version.
Back to top
View user's profile Send private message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Tue Jan 02, 2007 10:58 pm    Post subject:
Reply with quote

Is it possible to resolve this issue with out DFSORT.

Could you Please let me know if any one is having idea.

Cheers,
Samba.
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 Jan 02, 2007 11:23 pm    Post subject:
Reply with quote

Hello,

A COBOL program should work nicely. . . .
Back to top
View user's profile Send private message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Wed Jan 03, 2007 8:12 pm    Post subject:
Reply with quote

Hi Frank,

I gone thru the below PDF provided by you.

http://ibm.com/servers/storage/support/software/sort/mvs/tricks/

Topic is "Create files with matching and non-matching records"

SPLICE FROM(T1) TO(OUT12) ON(1,10,CH) WITH(13,1) -

In the above statement could you please explain what is meant by

WITH(13,1).

Here iam unable to understand the number 13.

Could you please help me regarding the same.

Thanks in advance for your help.

Cheers,
Samba.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Wed Jan 03, 2007 10:04 pm    Post subject:
Reply with quote

We put a '11' in positions 12-13 for each file1 record and a '22' in positions 12-13 for each file2 record. When file1 and file2 have a "match", WITH(13,1) splices position 13 from the file2 record (the "overlay" record) into position 13 of the file1 record (the "base" record) giving a '12'. So matching records will have a '12' in positions 12-13, whereas file1 only records will have a '11' in position 12-13 and file2 only records will have a '22' in positions 12-13.

For complete information on the SPLICE operator of DFSORT's ICETOOL, see:

http://publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ICE1CA20/6.13?DT=20060615185603
Back to top
View user's profile Send private message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Fri Jan 05, 2007 5:11 pm    Post subject: Re: Need to write 3 output files
Reply with quote

Hi Frank,

Thanks for the response.

Here iam having one more doubt.... Could you please let me clarify.....

After putting the DFSORT coding in JCL....where i need to mention output files in JCL and how it will recognize that.....matching records will go to the particular Sequential file and unmatched the records will go to particular Sequential file.....


Could you please help me out regarding this.

Thanks in advance for your help.

Cheers,
Samba.
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Fri Jan 05, 2007 5:18 pm    Post subject:
Reply with quote

If you followed the example in Frank's Smart DFSORT Tricks,

Code:

* Write matching records to OUT12 file. Remove id.
  OUTFIL FNAMES=OUT12,INCLUDE=(12,2,CH,EQ,C'12'),BUILD=(1,10)
* Write FILE1 only records to OUT1 file. Remove id.
  OUTFIL FNAMES=OUT1,INCLUDE=(12,2,CH,EQ,C'11'),BUILD=(1,10)
* Write FILE2 only records to OUT2 file. Remove id.
  OUTFIL FNAMES=OUT2,INCLUDE=(12,2,CH,EQ,C'22'),BUILD=(1,10)


The FNAMES keyword points to the DD.
Did that help?
Back to top
View user's profile Send private message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Fri Jan 05, 2007 6:34 pm    Post subject: Re: Need to write 3 output files
Reply with quote

Hi William,

Thanks for the quick response.

I can mention like this for this.
[* Write matching records to OUT12 file. Remove id.
OUTFIL FNAMES=SAMBA.SRTOT.OUT12.DEL365,INCLUDE=(12,2,CH,EQ,C'12'),BUILD=(1,10)
* Write FILE1 only records to OUT1 file. Remove id.
OUTFIL FNAMES=SAMBA.SRTOT.OUT1.DEL365,INCLUDE=(12,2,CH,EQ,C'11'),BUILD=(1,10)
* Write FILE2 only records to OUT2 file. Remove id.
OUTFIL FNAMES=SAMBA.SRTOT.OUT2.DEL365,INCLUDE=(12,2,CH,EQ,C'22'),BUILD=(1,10)]

Could you please clarify me reegarding the same.

Thanks in advance for your help.

Cheers,
Samba.

[/quote][/code]
Back to top
View user's profile Send private message
William Thompson

Global Moderator


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

PostPosted: Fri Jan 05, 2007 6:40 pm    Post subject:
Reply with quote

I don't think so, the FNAMES are for the DD name, you have listed the dataset name....like:
FNAMES=OUT12
//OUT12 DD DSN=SAMBA.SRTOT.OUT12.DEL365,...
Back to top
View user's profile Send private message
sambasivarao

New User


Joined: 10 Jul 2006
Posts: 47
Location: Bangalore

PostPosted: Fri Jan 05, 2007 6:51 pm    Post subject:
Reply with quote

Hi,

Thanks for the quick response...

I mentioned the First Input file like below.

IN1 DD DSN=SAMBA.RA186.SORTOUT.SQLA6.Y120619,
DISP=(NEW,CATLG,CATLG),
UNIT=DEVPOOL,
SPACE=(CYL,(10,15),RLSE),
DCB=(LRECL=91,BLKSIZE=0,RECFM=FB)

IN2 DD DSN=SAMBA.RA186.SRTOUT.NOVBARC.Y120629,
DISP=(NEW,CATLG,CATLG),
UNIT=DEVPOOL,
SPACE=(CYL,(10,15),RLSE),
DCB=(LRECL=91,BLKSIZE=0,RECFM=FB)

Can i mention in the same way output files like above.

Because i need to store this data in Sequential file...

Could you please help me out.

Thanks a lot...

Cheers,
Samba.
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 -> DFSORT/ICETOOL All times are GMT + 6 Hours
Goto page 1, 2  Next
Page 1 of 2

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts High CPU consumption Job using IAM fi... aswinir JCL & VSAM 8 Thu Dec 01, 2016 8:28 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts Syncsort - Hard coded Value in output PORYES SYNCSORT 1 Thu Nov 03, 2016 9:23 am
No new posts output data in CSV Format janmejay COBOL Programming 8 Sat Oct 15, 2016 2:20 pm


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