concacenate strings

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
Posts: 6
Joined: Fri Sep 02, 2011 10:06 am

concacenate strings

Post by hosti2011 » Wed Sep 14, 2011 11:13 am

i read a pli data file and want to replace values in null fields of db2 by '? 'depending on the indicator field.
For this purpose i use the findrep clause:

Code: Select all

   IN=C'         0?',
  OUT=C'?         ?')),
that should mark the input field as containing null, by writing '?' in the first column.
the first 10 bytes are the data field and the 11th is the according indicator field as in db2.

Now i have a char field with length 60.
is there a facility to write the in= and out= string in a shorter way?
i know there is the '9X' for nine blanks.
but i need '9X' !! C'0' !! C'?'.
Is there a way to concatenate char expressions?

thanks in forward

Anuj Dhawan
Posts: 1625
Joined: Sat Aug 09, 2008 9:02 am
Location: Mumbai, India

Post by Anuj Dhawan » Wed Sep 14, 2011 5:04 pm

I believe it can be done, however, I'm not very sure how your input looks like. It'd be nice if you show at least one example of sample records for us to have a better idea of input and the expected output from that.

User avatar
Frank Yaeger
Posts: 812
Joined: Sat Feb 18, 2006 5:45 am
Location: San Jose, CA

Post by Frank Yaeger » Wed Sep 14, 2011 10:44 pm

Here's a simpler way to do what you want with DFSORT for the 61 byte string:

Code: Select all

 OUTREC IFTHEN=(WHEN=(71,59,CH,EQ,C' ',AND,130,2,CH,EQ,C'0?'),  
For the 11 byte string, it would be:

Code: Select all

 OUTREC IFTHEN=(WHEN=(71,9,CH,EQ,C' ',AND,80,2,CH,EQ,C'0?'),  
Frank Yaeger - DFSORT Development Team (IBM) -
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at

Post Reply


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.
Mainframe Interview questions

Other References
Mainframe Tools and others