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

Change data with DFSORT/ICETOOL


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

New User


Joined: 26 Aug 2005
Posts: 8

PostPosted: Mon Apr 16, 2012 9:15 pm
Reply with quote

I need to change the value of the row that begins with CR columns 17-24 (20120413) by 19000101 only if the row (DE) below contains the value 000 columns 9-11

Input
Code:

----+----1----+----2----+----
*****************************
CR01YYYYYYYYYY0220120413ZZZZZ
DE01AAAA000BBBBBBBBBBBBBBBBBB
CR01YYYYYYYYYY0220120413ZZZZZ
DE01AAAA028BBBBBBBBBBBBBBBBBB

Output
Code:

----+----1----+----2----+----
*****************************
CR01YYYYYYYYYY0219000101ZZZZZ
DE01AAAA000BBBBBBBBBBBBBBBBBB
CR01YYYYYYYYYY0220120413ZZZZZ
DE01AAAA028BBBBBBBBBBBBBBBBBB


it can be done using DFSORT / ICETOOL?
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Mon Apr 16, 2012 10:05 pm
Reply with quote

carlmgu,

Assuming your input lrecl=30 and recfm=FB, the following DFSORT JCL will give you the desired results
Code:

//STEP0100 EXEC PGM=SORT                               
//SYSOUT   DD SYSOUT=*                                 
//SORTIN   DD *                                         
CR01YYYYYYYYYY0220120413ZZZZZ                           
DE01AAAA000BBBBBBBBBBBBBBBBBB                           
CR01YYYYYYYYYY0220120413ZZZZZ                           
DE01AAAA028BBBBBBBBBBBBBBBBBB                           
DD01AAAA028BBBBBBBBBBBBBBBBBB                           
//SORTOUT  DD SYSOUT=*                                 
//SYSIN    DD *                                         
  OPTION COPY                                           
  INREC IFTHEN=(WHEN=GROUP,BEGIN=(1,2,CH,EQ,C'CR'),     
        PUSH=(31:1,30),RECORDS=2),                     
  IFTHEN=(WHEN=(1,2,CH,EQ,C'DE',AND,9,3,CH,EQ,C'000'), 
        OVERLAY=(47:C'19000101'))                       
                                                       
  OUTFIL IFOUTLEN=30,OMIT=(1,2,CH,EQ,C'CR'),           
  IFTHEN=(WHEN=(1,2,CH,EQ,C'DE'),BUILD=(31,30,/,1,30)) 
//*
Back to top
View user's profile Send private message
carlmgu

New User


Joined: 26 Aug 2005
Posts: 8

PostPosted: Tue Apr 17, 2012 3:31 am
Reply with quote

Tnks Koluso, I have this case
Input
Code:

----+----1----+----2----+----3
CR01YYYYYYYYYY0220120413ZZZZZ
DE01AAAA000BBBBBBBBBBBBBBBBBB
CR01YYYYYYYYYY0220120413ZZZZZ
DE01AAAA028BBBBBBBBBBBBBBBBBB
DE01AAAA000BBBBBBBBBBBBBBBBBB


Output
Code:

---+----1----+----2----+----3
CR01YYYYYYYYYY0219000101ZZZZZ
DE01AAAA000BBBBBBBBBBBBBBBBBB
CR01YYYYYYYYYY0220120413ZZZZZ
DE01AAAA028BBBBBBBBBBBBBBBBBB
DE01AAAA000BBBBBBBBBBBBBBBBBB
Back to top
View user's profile Send private message
Skolusu

Senior Member


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

PostPosted: Tue Apr 17, 2012 4:33 am
Reply with quote

carlmgu wrote:
Tnks Koluso, I have this case
Input
Code:

----+----1----+----2----+----3
CR01YYYYYYYYYY0220120413ZZZZZ
DE01AAAA000BBBBBBBBBBBBBBBBBB
CR01YYYYYYYYYY0220120413ZZZZZ
DE01AAAA028BBBBBBBBBBBBBBBBBB
DE01AAAA000BBBBBBBBBBBBBBBBBB


Output
Code:

---+----1----+----2----+----3
CR01YYYYYYYYYY0219000101ZZZZZ
DE01AAAA000BBBBBBBBBBBBBBBBBB
CR01YYYYYYYYYY0220120413ZZZZZ
DE01AAAA028BBBBBBBBBBBBBBBBBB
DE01AAAA000BBBBBBBBBBBBBBBBBB


I have no idea if you are telling me that the provided job did work or did not work. And I would really appreciate if you can please spell my name correctly. Post detailed information on what you're trying to accomplish. Do not make people guess what you mean. This will give you a much better chance of getting a good answer to your question.

What is the LRECL and RECFM of the input file? Is 'CR' kinda of header record for each group of records? If any of the detail records 'DE' has '000' in position 9 you should the header date?
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 Store the data for fixed length COBOL Programming 1
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
Search our Forums:

Back to Top