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
 

 

Change data with DFSORT/ICETOOL

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Change data with DFSORT/ICETOOL
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    Post subject:
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    Post subject:
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    Post subject:
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    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 Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts SPUFI -- Joining 3 tables – data in... Sysaron DB2 2 Wed Mar 08, 2017 4:18 am
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Overriding PS data in rexx Shaheen Shaik CLIST & REXX 8 Fri Mar 03, 2017 5:08 pm


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