MGIndaco
Active User
Joined: 10 Mar 2005 Posts: 432 Location: Milan, Italy
|
|
|
|
Hi to all.
Does DfSort support, directly or with a tool, a variable layout?
I mean, there's an opportunity to work with sort using a separator
to determine the field(like a syspunch)?
I know that my english(or my mind) is very hard and this is true to me too, so I post a sample of input and output to clarify my question:
Input:
Code: |
AAA;1;A2;00001
AAA;02;A;02
AAA;3;A3;0005
AAA;4;A999;006
|
Output:
Code: |
AAA; 1;A2 ;00001
AAA;02;A ; 02
AAA; 3;A3 ; 0005
AAA; 4;A999; 006
|
I know that this question presupposes various analysis about length and
datatype especially for the alignment(I'm still writing to a rexx to do this that will be necessary to an icetool) but I only want to know if this option already exist. |
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
DFSORT does not have any built-in features to do that. |
Well, it does now! With z/OS DFSORT V1R5 PTF UK90007 or DFSORT R14 PTF UK90006 (April, 2006), you can use the new PARSE, %nn and JFY functions to do this kind of thing quite easily. Here's the DFSORT job:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
AAA;1;A2;00001
AAA;02;A;02
AAA;3;A3;0005
AAA;4;A999;006
/*
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
* extract second variable field (starts at position 5, and
* ends before ';') into 2-byte %00 parsed field.
INREC PARSE=(%00=(ABSPOS=5,FIXLEN=2,ENDBEFR=C';'),
* extract third variable field (starts after ';' that ends first
* field, and ends before next ';') into 4-byte %01 parsed field.
%01=(FIXLEN=4,ENDBEFR=C';'),
* extract fourth variable field (starts after ';' that ends second
* field, and ends before next blank) into 5-byte %02 parsed field.
%02=(FIXLEN=5,ENDBEFR=C' ')),
* Create output record with first field and ';' (1-4),
* right-justified %00 field, ';', %01 field, ';', and
* right-justified %02 field.
BUILD=(1,4,%00,JFY=(SHIFT=RIGHT),C';',
%01,C';',%02,JFY=(SHIFT=RIGHT))
/*
|
For complete information on PARSE, %nn and JFY, see:
Use [URL] BBCode for External Links |
|