XML formatting using SORT

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
Posts: 1
Joined: Tue Apr 24, 2012 12:47 pm

XML formatting using SORT

Post by MDP » Thu Apr 26, 2012 12:42 pm

I have a VB (variable block) file which has some data fields and some xml fields.
My requirement is to sort the data fields to 1 file and the xml fields to a separate file which will be attached to a identifier. Later on, again merge the data file and xml file back into 1 file and use this file for loading data to table.
We are using BMC Unload and BMC Load utility

When I run the BMC Unload query, it unloads data to a VB file. The structure looks like below -

FBC ¿N Raven HolleyRAVEN HOLLEY nkä< í à AS2 S Y <?xm
BQC ¿N Emily BudneyEMILY BUDNEY ën î ` AP02 S Y ª<?xm
BOC ¿N Derek GossDEREK GOSS oÁ ÍÌâ AS0 S Y <?xml
BBL zY b° bÅø ZB9E S YYN <?xml version="

Now, I am not able to sort the fields as some columns are NULL and hence, the data after the null column gets shifted forward. So, I do not have any fixed position for a column and hence, I am finding it very difficult to SORT.

Any inputs on this would be of great help.

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

Post by Frank Yaeger » Thu Apr 26, 2012 10:00 pm

Are you asking how to use DFSORT to do the sorting? (If not, you can ignore the rest of this note.)

If so, you need to show your sample records in hex so we can see what they actually look like. Identify the sort fields you want to use. Identify the null fields (are they X'00' fields or something else?). Show the output you expect.

DFSORT has a PARSE function for dealing with delimited fields, but you haven't given enough information for me to tell if PARSE would be relevant. If you want to read about PARSE, you can find the DFSORT books at:

http://www.ibm.com/support/docview.wss? ... g3T7000080
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 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