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
 

 

OUTFIL valid operands to remove dups

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
rahul_jot

New User


Joined: 17 Aug 2005
Posts: 22
Location: Pune

PostPosted: Mon Mar 15, 2010 11:32 am    Post subject: OUTFIL valid operands to remove dups
Reply with quote

Hi,

I want to split a file into three files based as shown below:
1) All Enrolled students (10,1,ch,eq,c'E')
2) Enrolled studs with science(9,1,ch,eq,c'S',and,10,1,ch,eq,c'E')
3) Enrolled studs with maths (9,1,ch,eq,c,'X',and,10,1,ch,eq,c'E')
There can be duplicate stud number in files and studs can be enrolled to Science and Maths.
I want to remove duplicates in each files based on stud number.
I wrote following sort statement:

Code:

 SORT FIELDS=(1,8,CH,A)                             
 OUTFIL FNAMES=SORTFILA,INCLUDE=(10,1,CH,EQ,C'E')   
 OUTFIL FNAMES=SORTFILB,INCLUDE=(9,1,CH,EQ,C'S',AND,
                                 10,1,CH,EQ,C'E')   
 OUTFIL FNAMES=SORTFILE,INCLUDE=(9,1,CH,EQ,C'X',AND,
                                 10,1,CH,EQ,C'E')   
 SUM FIELDS=NONE                                   


But for some of the students who are enrolled to both science and maths are coming to only maths file. For these records the matchs records is before science record in file. As the student is enrolled in science as well I want to have this record in SORTFILB as well. If I give SUM FIELDS=NONE in outfil, it says invalid outfil operand. Is there any operand in outfil which can help to remove dups?
Back to top
View user's profile Send private message

Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Mar 15, 2010 12:23 pm    Post subject:
Reply with quote

Quote:
I want to remove duplicates in each files based on stud number.

No. I guess you want to remove duplicate based on stud number and enrollment.

Since you are using

Code:

  SORT FIELDS=(1,8,CH,A)
  SUM FIELDS=NONE


It is obvious that only one enrollment per student will be available.

If you want both enrollment to be available if there are then use

Code:

  SORT FIELDS=(1,8,CH,A,9,1,CH,A)
  SUM FIELDS=NONE


I think this will solve your problem if I have understood your problem currectly.
Back to top
View user's profile Send private message
rahul_jot

New User


Joined: 17 Aug 2005
Posts: 22
Location: Pune

PostPosted: Mon Mar 15, 2010 12:43 pm    Post subject: Reply to: OUTFIL valid operands to remove dups
Reply with quote

Thanks for your response!
Here when I sort on stud number and enrollement type, I am getting the student in both files for Science and Maths. So this is good.
But I am getting this student twice in only enrolled file (SORTFILA). I want one student only once in file.
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Mar 15, 2010 1:14 pm    Post subject:
Reply with quote

Below sort step will give you desired result.
Since include condition 10,1,CH,EQ,C'E' is common for all OUTFIL statements I have applied it before OUTFIL is applied.
Code:

//S1    EXEC  PGM=SORT         
//SYSOUT    DD  SYSOUT=*       
//SORTIN DD *                 
00010000SE                     
00010000XE                     
00020000SE                     
00020000SE                     
00030000XE                     
00040000XE                     
00050000SE                     
00060000SE                     
00070000XE                     
00080000XE                     
00090000SE                     
00010000SA                     
00010000XB                     
00020000SC
00020000SD
/*                                             
//SORTF3 DD SYSOUT=*                                                 
//SORTF1  DD SYSOUT=*                                               
//SORTF2  DD SYSOUT=*                                               
//SYSIN    DD    *   
  INCLUDE COND=(10,1,CH,EQ,C'E')                                     
  SORT FIELDS=(1,8,A,9,1,A),FORMAT=CH                               
  SUM FIELDS=NONE                                                   
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD,RESTART=(1,8)))   
  OUTFIL FNAMES=SORTF3,INCLUDE=(81,8,ZD,EQ,1),BUILD=(1,80)           
  OUTFIL FNAMES=SORTF1,INCLUDE=(9,1,CH,EQ,C'S'),BUILD=(1,80)         
  OUTFIL FNAMES=SORTF2,INCLUDE=(9,1,CH,EQ,C'X'),BUILD=(1,80)         
/*                                                                   


SORTF3: All enrolled students
Code:

00010000SE
00020000SE
00030000XE
00040000XE
00050000SE
00060000SE
00070000XE
00080000XE
00090000SE


SORTF1: Enrolled with SCI
Code:

00010000SE
00020000SE
00050000SE
00060000SE

SORTF2: Enrolled with maths
Code:

00010000XE
00030000XE
00040000XE
00070000XE
00080000XE
00090000SE
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Mar 15, 2010 1:38 pm    Post subject:
Reply with quote

In fact only one byte Sequence number is enough since only 2 subjects are there.....
you can modify sortcard like
Code:

//SYSIN    DD    *                                                   
  SORT FIELDS=(1,8,A,9,1,A),FORMAT=CH                               
  SUM FIELDS=NONE                                                   
  INCLUDE COND=(10,1,CH,EQ,C'E')                                     
  OUTREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,1,ZD,RESTART=(1,8)))   
  OUTFIL FNAMES=SORTF3,INCLUDE=(81,1,ZD,EQ,1),BUILD=(1,80)           
  OUTFIL FNAMES=SORTF1,INCLUDE=(9,1,CH,EQ,C'S'),BUILD=(1,80)         
  OUTFIL FNAMES=SORTF2,INCLUDE=(9,1,CH,EQ,C'X'),BUILD=(1,80)         
/*                           
Back to top
View user's profile Send private message
rahul_jot

New User


Joined: 17 Aug 2005
Posts: 22
Location: Pune

PostPosted: Mon Mar 15, 2010 2:24 pm    Post subject: Reply to: OUTFIL valid operands to remove dups
Reply with quote

Thank You Sambhaji
Back to top
View user's profile Send private message
Escapa

Senior Member


Joined: 16 Feb 2007
Posts: 1399
Location: IL, USA

PostPosted: Mon Mar 15, 2010 2:45 pm    Post subject: Re: Reply to: OUTFIL valid operands to remove dups
Reply with quote

rahul_jot wrote:
Thank You Sambhaji

Welcome. Good day.. .
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
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Remove Special Characters from Mainfr... Rodger Zhang All Other Mainframe Topics 6 Wed Jul 06, 2016 1:12 am
No new posts Remove header only knobi SYNCSORT 5 Mon Feb 15, 2016 10:42 pm
No new posts Append to file, but also remove old r... Garry Carroll JCL & VSAM 3 Mon Jan 25, 2016 8:05 pm
No new posts Remove intermediate spaces Pallavi Vishwanath SYNCSORT 1 Fri Jan 15, 2016 2:45 am
No new posts Syncsort to remove the leading spaces V S Amarendra Reddy SYNCSORT 5 Fri Jan 08, 2016 9:47 pm


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