SORT Help



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

SORT Help

Postby SpadoBeans » Fri Apr 29, 2011 3:00 am

I posted a while back to parse out characters in between 'DOC' and 'INDEX' for a fixed 80 byte record and this is what I received:

SORT FIELDS=COPY
INCLUDE COND=(1,3,CH,EQ,C'DOC')
INREC PARSE=(%01=(STARTAFT=C'DOC',ENDBEFR=C'INDEX',FIXLEN=80)),
BUILD=(%01,JFY=(SHIFT=LEFT))

I now need to accomplish a similar task but am using a variable length record instead of fixed. This time I'd like to take what's in between 'DocumentId</EventAttributeName> <EventAttributeValue>' and '</EventAttributeValue>' and I'm not sure how it changes the above control card for a variable length file.

Here is what the input looks like and what I want to strip out of it and sort:

Input:
DocumentId</EventAttributeName> <EventAttributeValue>RENEW70D</EventAttributeValue>

Output:
RENEW70D

Any help is greatly appreciated.
SpadoBeans
 
Posts: 4
Joined: Fri Feb 11, 2011 1:25 am
Has thanked: 0 time
Been thanked: 0 time

Re: SORT Help

Postby Frank Yaeger » Fri Apr 29, 2011 5:38 am

What is the RECFM and LRECL of your input file?

What do you want for the RECFM and LRECL of your output file?

Does the INCLUDE need the entire string of 'DocumentId</EventAttributeName> <EventAttributeValue>' or can it just use something shorter like 'DocumentId'?

What is the maximum length of the field you want to extract?
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
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times

Re: SORT Help

Postby SpadoBeans » Mon May 02, 2011 7:32 pm

Input file - RECFM = VB, and LRECL - 32746.

I want the output file to be RECFM = FB and LRECL - 80 bytes.

The field that I want to take out of this file will always be in between 'DocumentId</EventAttributeName> <EventAttributeValue>' and '</EventAttributeValue>'.

The max length of the field that I want to extract can be 20 bytes.
SpadoBeans
 
Posts: 4
Joined: Fri Feb 11, 2011 1:25 am
Has thanked: 0 time
Been thanked: 0 time

Re: SORT Help

Postby Frank Yaeger » Tue May 03, 2011 12:19 am

Here's a DFSORT job that will do what you asked for:

//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=...  input file (VB/32746)
//SORTOUT DD DSN=...  output file (FB/80)
//SYSIN DD *
  OPTION COPY,VLSCMP
  INCLUDE COND=(5,32700,SS,EQ,
   C'DocumentId</EventAttributeName> <EventAttributeValue>')
  INREC PARSE=(%01=(FIXLEN=20,
  STARTAFT=C'DocumentId</EventAttributeName> <EventAttributeValue>',
  ENDBEFR=C'</EventAttributeValue>')),
  BUILD=(1,4,%01)
  OUTFIL VTOF,BUILD=(5,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
User avatar
Frank Yaeger
Global moderator
 
Posts: 1079
Joined: Sat Jun 09, 2007 8:44 pm
Has thanked: 0 time
Been thanked: 15 times


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post