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 copying data without knowing location arunsoods DFSORT/ICETOOL 6 Thu Jul 20, 2017 1:03 pm
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts Loading data to table gives wrong for... Raghu navaikulam DB2 18 Thu Jul 13, 2017 2:11 pm
No new posts SQL - select data available in index Nileshkul DB2 3 Mon Jun 26, 2017 1:30 am
No new posts NDM syntax checking without actually ... GAPX1 All Other Mainframe Topics 0 Wed Jun 07, 2017 2:36 am


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