Page 1 of 1

DFSORT to reformat data

PostPosted: Fri Mar 05, 2010 11:51 pm
by sanjana6
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.

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

Re: DFSORT to reformat data

PostPosted: Sat Mar 06, 2010 12:22 am
by Frank Yaeger
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.

//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:

//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)                                 
/*