DFSORT MOVE FIELDS EDIT RECORD



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

DFSORT MOVE FIELDS EDIT RECORD

Postby tsdjim » Tue Dec 15, 2015 7:38 pm

Hi,

I have the following record, I need to move the BB6666 to the beginning of the record. I have given the positions. Also I need to edit all X'00' to a space.
How do I do this in ICETOL.

Before

Pos 5
00001000521 34567890047 BB6666 ...... rest of record....
After
Pos 5
BB6666 00001000521 34567890047 ....rest of record.....


Thanks
tsdjim
 
Posts: 18
Joined: Mon Nov 03, 2008 1:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT MOVE FIELDS EDIT RECORD

Postby BillyBoyo » Tue Dec 15, 2015 7:47 pm

To change the binary-zeros to spaces, either look at ALTSEQ with TRAN=ALTSEQ or look at FINDREP.

A simple BUILD will allow you to rearrange your data. BUILD=(1,4,21,6,5,16,27) (I've not counted, so fix the positions, and I'm assuming variable-length records).
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: DFSORT MOVE FIELDS EDIT RECORD

Postby tsdjim » Tue Dec 15, 2015 10:28 pm

Thanks. I managed to build the following parameters (still need to try) ,but I have another question:

I edit only records that do not have a blank in position 10. However how do I write the other unmatching records unchanged. How can I do that.

OPTION COPY
ALTSEQ CODE=(0040)
OUTREC IFTHEN=(WHEN=(10,1,CH,NE,' '), -
BUILD=(1,4,31,5,6,30,32,100,TRAN=ALTSEQ))
tsdjim
 
Posts: 18
Joined: Mon Nov 03, 2008 1:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT MOVE FIELDS EDIT RECORD

Postby BillyBoyo » Tue Dec 15, 2015 10:33 pm

With that code, any records which don't match the WHEN condition will be left unchanged.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: DFSORT MOVE FIELDS EDIT RECORD

Postby tsdjim » Tue Dec 15, 2015 11:04 pm

In the BUILD the positions 32,100 are actually the rest of the record. Is there a way to specify the rest of the record till the end, without explicitly specifying the positions

OPTION COPY
ALTSEQ CODE=(0040)
OUTREC IFTHEN=(WHEN=(10,1,CH,NE,' '), -
BUILD=(1,4,31,5,6,30,rest unchanged,TRAN=ALTSEQ))
tsdjim
 
Posts: 18
Joined: Mon Nov 03, 2008 1:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT MOVE FIELDS EDIT RECORD

Postby BillyBoyo » Wed Dec 16, 2015 1:46 am

For a variable-length record, yes, like my example (where the last start-position is "unpaired" by a length).

For a fixed-length record, no.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: DFSORT MOVE FIELDS EDIT RECORD WITH ALTSET

Postby tsdjim » Wed Dec 16, 2015 7:08 pm

I created the following statements and they work fine except for the ALTSEQ which is not taking effect, the X'00' is not translated to X'40' in the file. Any ideas
why it might not work.

OPTION COPY
OUTFILE FNAMES=(OUT)
ALTSEQ CODE=(0040)
OUTREC IFTHEN=(WHEN=(8,2,CH,EQ,C'00',AND,35,3,CH,NE,C' '),
BUILD=(1,4,5,1,35,4,3X,8,28,41,93,TRAN=ALTSEQ)),
IFTHEN=(WHEN=(8,2,CH,EQ,C'00',AND,35,3,CH,EQ,C' '),
BUILD=(1,4,5,1,1X,39,5,1X,8,28,3X,44,90,TRAN=ALTSEQ))
tsdjim
 
Posts: 18
Joined: Mon Nov 03, 2008 1:38 am
Has thanked: 0 time
Been thanked: 0 time

Re: DFSORT MOVE FIELDS EDIT RECORD

Postby BillyBoyo » Wed Dec 16, 2015 8:09 pm

TRAN=ALTSEQ is a field-level thing, it operates on the immediately previous field-definition (in your case, 41,93 and 44,90).

You either specify it for any fields you have defined (as in start,length) or you can use FINDREP to find X'00' and replace it with C' '.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 265 times

Re: DFSORT MOVE FIELDS EDIT RECORD

Postby Terry Heinze » Wed Dec 16, 2015 8:10 pm

tsdjim,
In the future please use Code tags (available in POSTREPLY) to retain accurate spacing.
.... Terry
Terry Heinze
 
Posts: 239
Joined: Wed Dec 04, 2013 11:08 pm
Location: Richfield, MN, USA
Has thanked: 12 times
Been thanked: 11 times

Re: DFSORT MOVE FIELDS EDIT RECORD

Postby tsdjim » Fri Dec 18, 2015 11:39 am

It worked fine now after changing the ALTSEQ at the field level. Thanks for all who helped.

Ron
tsdjim
 
Posts: 18
Joined: Mon Nov 03, 2008 1:38 am
Has thanked: 0 time
Been thanked: 0 time


Return to DFSORT/ICETOOL/ICEGENER

 


  • Related topics
    Replies
    Views
    Last post