IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Use Overlay for 2 different fields.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Atlanta, (USA)

PostPosted: Tue Jul 07, 2009 9:09 pm
Reply with quote

Hi,

I have the following file

Code:

----+----1----+----2----+----3-
*******************************
3040650901999-09-100001-01-01EE
7843304161999-08-020001-01-01EE
9586873901997-04-011998-07-15EE
3039913041998-12-030001-01-01EE
9302545841997-11-180001-01-01EE
0651718242001-06-010001-01-01EE
7009131401999-11-220001-01-01EE
9220380522000-05-012009-06-30RT
9220380522000-05-010001-01-01RT
9220380522000-05-010001-01-01RT


The o/p needs to be as follows

Code:

----+----1----+----2----+----3-
*******************************
3040650901999-09-10          N
7843304161999-08-02          N
9586873901997-04-011998-07-15N
3039913041998-12-03          N
9302545841997-11-18          N
0651718242001-06-01          N
7009131401999-11-22          N
9220380522000-05-012009-06-30Y
9220380522000-05-01          Y
9220380522000-05-01          Y



Basically need to change the '0001-01-01' to spaces and
'RT' to Y and anything other than RT to N.

Please can someone help me on this. I tried using overlay but seems that it doesn't work for two fields on the same record.

Thnx
M
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Jul 07, 2009 9:16 pm
Reply with quote

muffirulz,

The following DFSORT/ICETOOL JCl will give you the desired results

Code:

//STEP0100 EXEC PGM=SORT                                       
//SYSOUT   DD SYSOUT=*                                         
//SORTIN   DD *                                                 
3040650901999-09-100001-01-01EE                                 
7843304161999-08-020001-01-01EE                                 
9586873901997-04-011998-07-15EE                                 
3039913041998-12-030001-01-01EE                                 
9302545841997-11-180001-01-01EE                                 
0651718242001-06-010001-01-01EE                                 
7009131401999-11-220001-01-01EE                                 
9220380522000-05-012009-06-30RT                                 
9220380522000-05-010001-01-01RT                                 
9220380522000-05-010001-01-01RT                                 
//SORTOUT  DD SYSOUT=*                                         
//SYSIN    DD *                                                 
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=(20,10,CH,EQ,C'0001-01-01'),               
  OVERLAY=(20:10X),HIT=NEXT),                                   
  IFTHEN=(WHEN=(30,02,CH,NE,C'RT'),OVERLAY=(30:C'N '),HIT=NEXT),
  IFTHEN=(WHEN=(30,02,CH,EQ,C'RT'),OVERLAY=(30:C'Y '))         
/*
Back to top
View user's profile Send private message
muffirulz

New User


Joined: 14 Sep 2005
Posts: 74
Location: Atlanta, (USA)

PostPosted: Tue Jul 07, 2009 9:27 pm
Reply with quote

Thanks a lot Skolusu for quick reply..
HIT=NEXT is a new one for me.

thnx once again

regards
Muffazel
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Help, trying to use OVERLAY to get a ... DFSORT/ICETOOL 3
No new posts Concatenate 2 fields (usage national)... COBOL Programming 2
No new posts Cobol COMP-2 fields getting scrambled... Java & MQSeries 6
No new posts Converting unpacked fields to pack us... SYNCSORT 4
No new posts Data for newly added fields not displ... IMS DB/DC 6
Search our Forums:

Back to Top