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
 

 

When an employee with two difference write first record

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

New User


Joined: 05 Dec 2006
Posts: 89
Location: chennai

PostPosted: Wed May 07, 2008 6:24 pm    Post subject: When an employee with two difference write first record
Reply with quote

Hi all,
consider a below input record (REF = 80 FB) contains employee and indicator
Input

Code:

Employee  Indicator
1                y
1                N
2                Y
3                Y
3                N


Output

Code:

Employee  Indicator
1                y
3                y


Req : same Employee with different indicator.When an employee with two different we need to write first record into output.
In our case employee 1 and 3 contains record with two different indicator so we need to write first occurance of record into output. Employee 2 doesn contains two type of indicator.so no need to write into output.

please help me out to sort this
Back to top
View user's profile Send private message

HappySrinu

Active User


Joined: 22 Jan 2008
Posts: 195
Location: India

PostPosted: Wed May 07, 2008 6:57 pm    Post subject: Reply to: Solve this
Reply with quote

first gather only the values who are repeating in to file.
then duplicate using first column. guess it works.
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 07, 2008 7:18 pm    Post subject:
Reply with quote

could there be 3 records for an employee?

is the input file sorted? if so, what are the keys?
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Wed May 07, 2008 8:08 pm    Post subject:
Reply with quote

also, I would like to commend you for such a useful title/subject. I am sure that others searching will find a wealth of info.
Back to top
View user's profile Send private message
Skolusu

Senior Member


Joined: 07 Dec 2007
Posts: 2205
Location: San Jose

PostPosted: Wed May 07, 2008 10:26 pm    Post subject:
Reply with quote

The following DFSORT JCL will give you the desired results. I assumed that your employee is 10 bytes length key and the indicator starts at pos 15. I also assumed that the indicator must be Y or N.

Code:

//STEP0100 EXEC PGM=ICEMAN                                 
//SYSOUT   DD SYSOUT=*                                     
//SORTIN   DD *                                           
1             Y                                           
1             N                                           
2             Y                                           
3             Y                                           
3             N                                           
4             N 
//SORTOUT  DD SYSOUT=*
//SYSIN    DD *                                           
  OPTION EQUALS                                           
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:C'00')),             
        IFTHEN=(WHEN=(15,1,CH,EQ,C'Y'),OVERLAY=(81:C'1')),
        IFTHEN=(WHEN=(15,1,CH,EQ,C'N'),OVERLAY=(82:C'1')) 
                                                           
  SORT FIELDS=(01,10,CH,A)                                 
  SUM FIELDS=(81,1,ZD,82,1,ZD)
  OUTFIL OMIT=((81,1,ZD,EQ,0,AND,82,1,ZD,GT,0),OR,
          (81,1,ZD,GT,0,AND,82,1,ZD,EQ,0)), 
      BUILD=(01,80)   
/*


Hope this helps...

Cheers

Kolusu
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 Difference between TWALENG and TWASIZE Arunkumar Chandrasekaran CICS 3 Tue Jan 03, 2017 12:57 pm
No new posts How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Sticky: difference between ... DUMMY ... and ... enrico-sorichetti JCL & VSAM 0 Mon Oct 17, 2016 4:31 pm
No new posts Error IEC161I 052(009,XXXRS00)-084 wh... amitc23 JCL & VSAM 10 Wed Oct 12, 2016 5:00 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am


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