Reformat data by using DFSORT

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

Moderators: Frank Yaeger, Moderator Group

Post Reply
sanjana24
Member
Posts: 2
Joined: Wed Feb 03, 2010 12:17 am

Reformat data by using DFSORT

Post by sanjana24 » Fri Mar 05, 2010 11:31 pm

Hi,

I have to convert data mentioned in section 1 to section 2 using DFSORT technique.I should remove first five lines, last dotted line and dotted columns.

Code: Select all

Section1:
**********
Table: CCCC
Displayed Fields: 2 of 2 Fixed Columns: 2 List Width 0250
-------------------------------------------------
| |xxxxx. Channel|Name                          |
-------------------------------------------------
| |00                   |xxx Generic                 |
| |01                   |oooooooooooooo          |
| |02                   |xxxxxxxxxxxxxxxxxxxx |
| |Q                    |yyyyyyyyyyyyyyyy        |
| |Z                    |zzzzzzzzzzzz                  |
| |ZZ                  |kkkkkkkkkkk                 |
---------------------------------------

Section2:
**************
00 xxx Generic
01 oooooooooooooo
02 xxxxxxxxxxxxxxxxxxxx
Q yyyyyyyyyyyyyyyy
Z zzzzzzzzzzzz
ZZ kkkkkkkkkkk
Please advise.

Thanks,
Sanjana

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

Post by Frank Yaeger » Sat Mar 06, 2010 12:04 am

Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes.

Code: Select all

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD *
Table:          CCCC
Displayed Fields:   2 of   2  Fixed Columns: ...
---------------------------------------
| |xxxxx. Channel|Name                |
---------------------------------------
| |00            |xxx Generic         |
| |01            |oooooooooooooo      |
| |02            |xxxxxxxxxxxxxxxxxxxx|
| |Q             |yyyyyyyyyyyyyyyy    |
| |Z             |zzzzzzzzzzzz        |
| |ZZ            |kkkkkkkkkkk         |
---------------------------------------
//SORTOUT DD SYSOUT=*
//SYSIN DD *
  OPTION COPY,SKIPREC=5
  OMIT COND=(1,5,CH,EQ,C'-----')
  OUTREC BUILD=(4,14,19,20,80:X)
/*
Alternatively, you could use this DFSORT/ICETOOL job:

Code: Select all

//S2    EXEC  PGM=ICETOOL            
//TOOLMSG DD SYSOUT=*                
//DFSMSG  DD SYSOUT=*                
//IN DD * 
Table:          CCCC
Displayed Fields:   2 of   2  Fixed Columns: ...
---------------------------------------
| |xxxxx. Channel|Name                |
---------------------------------------
| |00            |xxx Generic         |
| |01            |oooooooooooooo      |
| |02            |xxxxxxxxxxxxxxxxxxxx|
| |Q             |yyyyyyyyyyyyyyyy    |
| |Z             |zzzzzzzzzzzz        |
| |ZZ            |kkkkkkkkkkk         |
---------------------------------------
//OUT DD SYSOUT=*                                                 
//TOOLIN DD *                                                     
SUBSET FROM(IN) TO(OUT) INPUT REMOVE FIRST(5) LAST USING(CTL1)    
/*
//CTL1CNTL DD *                                                   
  OUTFIL BUILD=(4,14,19,20,80:X)                                  
/*                           
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

sanjana24
Member
Posts: 2
Joined: Wed Feb 03, 2010 12:17 am

Post by sanjana24 » Sat Mar 06, 2010 1:30 pm

Hi Frank,

Thanks for the DFSORT & ICETOOL sort cards. I used DFSORT card,it is working fine. Thanks for your time. :)

Thanks,
Sanjana

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