If Then & When in DFSORT / ICETOOL

In this Mainframe Forum - You can post your queries on DFSORT, ICETOOL , SyncSort & JCL Utilities

Moderators: Frank Yaeger, Moderator Group

Post Reply
raulravi
Member
Posts: 47
Joined: Mon Apr 18, 2011 9:51 am
Location: India

If Then & When in DFSORT / ICETOOL

Post by raulravi » Mon Nov 17, 2014 1:31 pm

Find and replace records in file 2 from file1

FILE1

Code: Select all

----+----1----+----2----+----3----+----4----+----5
***************************** Top of Data ********
NAME                                    AAAAA     
ROLL NUMBER                             12345     
CLASS                                   SEVEN     
SUBJECT                                 MATHS     
FILE2

Code: Select all

----+----1----+----2----+
*************************
MY NAME IS XXXXX         
XXXXX IS MY ROLL NUMBER  
MY CLASS IS XXXXX        
I LOVE SUBJECT 'XXXXX'   



OUTPUT -
FILE3

Code: Select all

----+----1----+----2----+
*************************
MY NAME IS AAAAA         
12345 IS MY ROLL NUMBER  
MY CLASS IS SEVEN        
I LOVE SUBJECT 'MATHS'   
Is it possible to get this done in DFSORT or icetool?

Regards,
Raul

William Collins
Active Member
Posts: 732
Joined: Thu May 24, 2012 4:07 am

Post by William Collins » Mon Nov 17, 2014 5:03 pm

Yes. DFSORT can do it (which means ICETOOL can do it as well, but you don't need it for this).

raulravi
Member
Posts: 47
Joined: Mon Apr 18, 2011 9:51 am
Location: India

Post by raulravi » Wed Dec 03, 2014 5:56 pm

Hi William Collins,

What if the file three is a data card member?
is it still possible?

FILE1 = INPUT 1
FILE2 = INPUT2
SORTOUT DD DSN=AAAA.BBBB.CCCC(DATACARD),DISP=OLD

?

raulravi
Member
Posts: 47
Joined: Mon Apr 18, 2011 9:51 am
Location: India

Post by raulravi » Wed Dec 03, 2014 6:22 pm

Find and replace text in a PDS member: I think this is the right question.

File1

----+----1----+----2----+----3----+----4----+----5
***************************** Top of Data ********
NUMBER 99999

OUTPUT IS A PDS MEMBER WHICH IS EXPECTED TO LOOK LIKE:
----+----1----+
***************
NAME -- ABD
DEPT -- XYZ
TYPE -- 123
NUMBER --XXXXX THIS XXXXX MUST BE REPLACED BY 99999

Post Reply

FREE TUTORIALS

Tutorials
Free tutorials from mainframegurukul
  • JCL Tutorial
    Covers all important JCL concepts.
  • Cobol Tutorial
    This tutorials covers all Cobol Topics from STRING to COMP-3.
  • DB2 Tutorial
    DB2 Tutorial focuses on DB2 COBOL Programming.
  • SORT Tutorial
    This Tutorial covers all important aspects of DFSORT with examples
  • CICS Tutorial
    This CICS tutorial covers CICS concepts and CICS Basics, CICS COBOL Programming.
Interview
Mainframe Interview questions



Other References
Mainframe Tools and others