concacenate strings

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

Moderators: Frank Yaeger, Moderator Group

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

concacenate strings

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

Hi,
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

OUTREC IFTHEN=(WHEN=INIT,
  FINDREP=(STARTPOS=71,ENDPOS=81,
   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
Moderator
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.
Regards,
Anuj

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

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?'),  
    OVERLAY=(71:C'?',59X,C'?'))                             
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?'),  
    OVERLAY=(71:C'?',9X,C'?'))                             
Frank Yaeger - DFSORT Development Team (IBM) - yaeger@us.ibm.com
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
=> DFSORT/MVS is on the Web at http://www.ibm.com/storage/dfsort

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