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
 

 

Match a record and modify the positions

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Match a record and modify the positions
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    Post subject: Reply to: Match a record and modify the positions
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    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 How to update a portion of text in a ... Bill Woodger DFSORT/ICETOOL 25 Wed Nov 09, 2016 9:41 pm
No new posts Match or compare two files in VB Format anatol DFSORT/ICETOOL 14 Thu Nov 03, 2016 7:41 pm
No new posts sort with previous record anatol DFSORT/ICETOOL 9 Thu Oct 06, 2016 2:36 am
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Change date (DD/MM/YY) in 2nd record ... uday kiran DFSORT/ICETOOL 12 Wed Sep 07, 2016 10:57 pm


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