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 Need to write record of PS File in ex... Chandan1993 JCL & VSAM 1 Wed Jun 07, 2017 1:35 am
No new posts Adding big TEXT lines to each record ... bshkris SYNCSORT 4 Sat May 06, 2017 1:40 am
This topic is locked: you cannot edit posts or make replies. Merge two files and update Trailer re... Yashashri JCL & VSAM 1 Thu May 04, 2017 12:54 pm
No new posts Sort Large record length cmsmoon DFSORT/ICETOOL 14 Tue Apr 11, 2017 5:49 pm
No new posts Format record to remove Leading zeroes Learncoholic DFSORT/ICETOOL 14 Wed Apr 05, 2017 2:43 pm


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