DFSORT/Next Record



IBM's flagship sort product DFSORT for sorting, merging, copying, data manipulation and reporting. Includes ICETOOL and ICEGENER

DFSORT/Next Record

Postby KarenM » Tue Oct 19, 2010 5:32 am

Z/OS DFSORT V1R10 Record Type F

Hi

Is there a way to use DFSORT to take an action on the next record based on the value of the current record?

INPUT IS FB LRECL 80

AAAAAAAAAAAA,

BBBBBBBBBBBB,

CCCCCCCCCCCC,

DDDDDDDDDDDD,

EEEEEEEEEEEE,

FFFFFFFFFFFF,

GGGGGGGGGGGG,

HHHHHHHHHHHH,



Expected output is FB LRECL 80

When i/p record = EEEEEEEEEEE make the next record spaces 1 - 12



AAAAAAAAAAAA,

BBBBBBBBBBBB,

CCCCCCCCCCCC,

DDDDDDDDDDDD,

EEEEEEEEEEEE,

,

GGGGGGGGGGGG,

HHHHHHHHHHHH,



Thanks for your help
KarenM
 
Posts: 4
Joined: Thu Oct 14, 2010 9:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT/Next Record

Postby dick scherrer » Tue Oct 19, 2010 8:17 am

Hello and welcome to the forum,

I don't have dfsort available so this i've not tested this.

You want something like:
 SORT FIELDS=COPY 
 OUTFIL IFTHEN=(WHEN=(1,12,CH,EQ,C'EEEEEEEEEEEE'),
               BUILD=(1,80,/,',',79X)),
       IFTHEN=(WHEN=NONE,
               BUILD=(1,80))


Hopefully, i've provided no typos. . . :)
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: DFSORT/Next Record

Postby KarenM » Tue Oct 19, 2010 8:55 am

Thank you for the welcome and I appreciate your help. I will be trying this out first thing in the morning. :)
KarenM
 
Posts: 4
Joined: Thu Oct 14, 2010 9:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT/Next Record

Postby dick scherrer » Tue Oct 19, 2010 9:22 am

You're welcome - good luck :)

d
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: DFSORT/Next Record

Postby KarenM » Tue Oct 19, 2010 9:17 pm

This did work for me. Thank you.
Is there a way to skip or omit the next record after it processes this statement?
OUTFIL IFTHEN=(WHEN=(1,12,CH,EQ,C'EEEEEEEEEEEE'),
BUILD=(1,80,/,C',',79X)),
TIA! K
KarenM
 
Posts: 4
Joined: Thu Oct 14, 2010 9:32 pm
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT/Next Record

Postby skolusu » Tue Oct 19, 2010 9:42 pm

karenM,

The following DFSORT/ICETOOL JCL will give you the desired results.

//STEP0100 EXEC PGM=ICETOOL                               
//TOOLMSG  DD SYSOUT=*                                     
//DFSMSG   DD SYSOUT=*                                     
//IN       DD *                                           
AAAAAAAAAAAA,                                             
BBBBBBBBBBBB,                                             
CCCCCCCCCCCC,                                             
DDDDDDDDDDDD,                                             
EEEEEEEEEEEE,                                             
FFFFFFFFFFFF,                                             
GGGGGGGGGGGG,                                             
HHHHHHHHHHHH,                                             
//OUT      DD SYSOUT=*                                     
//TOOLIN   DD *                                           
  SELECT FROM(IN) TO(OUT) ON(81,8,CH) FIRST USING(CTL1)   
//CTL1CNTL DD *                                           
  SORT FIELDS=COPY                                         
  INREC IFTHEN=(WHEN=INIT,OVERLAY=(81:SEQNUM,8,ZD)),       
  IFTHEN=(WHEN=(1,12,CH,EQ,C'EEEEEEEEEEEE'),               
  OVERLAY=(81:81,8,ZD,ADD,+1,M11,LENGTH=8))               
  OUTFIL FNAMES=OUT,BUILD=(1,80)                           
//*
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
skolusu
 
Posts: 586
Joined: Wed Apr 02, 2008 10:38 pm
Has thanked: 0 time
Been thanked: 39 times

Re: DFSORT/Next Record

Postby KarenM » Wed Oct 20, 2010 12:01 am

Thank you
I ran your step first and the step provided by Dick Scherrer step 2nd and got what I needed. :)
KarenM
 
Posts: 4
Joined: Thu Oct 14, 2010 9:32 pm
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post