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

Match a record and modify the positions


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

New User


Joined: 11 Sep 2008
Posts: 29
Location: USA

PostPosted: Mon Aug 15, 2011 11:29 pm
Reply with quote

Can some one please help me using the SORT to copy from INPUT file to an OUTPUT FILE.

Code:
I/P  FILE: FILE-1 ; 300 byte layout
O/P FILE: FILE-2 - 300 byte layout

should be copied FILE-1 to FILE-2.

IF the below matching condition in the I/P FILE-1 then the O/P FILE-2 pos 215-216 & 230-231 should be moved '09'

IF (POS 5-8 = 3442 or 6898) AND (POS 56 = '1')
  IF (POS 201-203 = 530)
     Move '09' to POS 215-26
  ELSE (POS 201-203 = 531)
     Move '09' to POS 230-231.


IF NOT MATCHING the above condition then COPY the record as it is from I/P FILE-1 to O/P FILE-2.


Thanks in Advance!
Subbu
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Aug 15, 2011 11:44 pm
Reply with quote

subbu1522,

use the following control cards


Code:

//SYSIN    DD *                                               
  SORT FIELDS=COPY                                             
  INREC IFTHEN=(WHEN=(005,4,SS,EQ,C'3442,6898',AND,           
                      056,1,CH,EQ,C'1',AND,                   
                      201,3,CH,EQ,C'530'),OVERLAY=(215:C'09')),
        IFTHEN=(WHEN=(005,4,SS,EQ,C'3442,6898',AND,           
                      056,1,CH,EQ,C'1',AND,                   
                      201,3,CH,EQ,C'531'),OVERLAY=(230:C'09'))
//*
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 How to split large record length file... DFSORT/ICETOOL 10
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Validating record count of a file is ... DFSORT/ICETOOL 13
Search our Forums:

Back to Top