IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

DfSort Variable Layout


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
MGIndaco

Active User


Joined: 10 Mar 2005
Posts: 432
Location: Milan, Italy

PostPosted: Thu Sep 01, 2005 6:36 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Sep 01, 2005 8:48 pm
Reply with quote

DFSORT does not have any built-in features to do that.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Apr 21, 2006 3:21 am
Reply with quote

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
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts Modifying Date Format Using DFSORT DFSORT/ICETOOL 9
No new posts Replace Multiple Field values to Othe... DFSORT/ICETOOL 12
No new posts Calling DFSORT from Cobol, using OUTF... DFSORT/ICETOOL 5
No new posts DFsort help with SUM() DFSORT/ICETOOL 12
Search our Forums:

Back to Top