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 Record Not found in AlX but record re... mukun264 COBOL Programming 2 Fri Mar 24, 2017 9:28 am
No new posts Count the length of the record & ... sreekusr DFSORT/ICETOOL 4 Thu Mar 23, 2017 7:52 pm
No new posts IMS DB-How to update a record (a sing... Nic Clouston IMS DB/DC 9 Thu Mar 09, 2017 4:38 pm
No new posts Write R1 and R2 to OP1 and R1 to OP2 bhaskar_kanteti DFSORT/ICETOOL 10 Fri Mar 03, 2017 11:18 am
No new posts Can you write 2 recs on SORTOUT when ... Sysaron DFSORT/ICETOOL 6 Thu Feb 23, 2017 12:07 am


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