Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm
No new posts Repeat part of record multiple times Learncoholic DFSORT/ICETOOL 4 Tue Aug 29, 2017 11:33 am
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 11 Fri Aug 18, 2017 10:50 am
No new posts Read two inputs and write into output... murali.andaluri DFSORT/ICETOOL 6 Wed Jul 26, 2017 7:35 pm

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us