Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

DfSort Variable Layout

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: DfSort Variable Layout
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 Moderator


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

PostPosted: Thu Sep 01, 2005 8:48 pm    Post subject:
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 Moderator


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

PostPosted: Fri Apr 21, 2006 3:21 am    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/peug/
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts DFSORT MUL FIELDS tspr52 DFSORT/ICETOOL 16 Fri Mar 03, 2017 11:53 pm
No new posts Writing on to GSAM variable length rohanthengal JCL & VSAM 6 Fri Mar 03, 2017 7:46 pm
No new posts Count Trailing Spaces in variable str... Virendra Shambharkar SYNCSORT 10 Thu Feb 02, 2017 12:23 pm
No new posts How to get the remainder and quotient... vnktrrd DFSORT/ICETOOL 2 Mon Oct 31, 2016 10:59 am
No new posts Format to pipe delimited with variabl... pshongal SYNCSORT 6 Wed Sep 14, 2016 2:48 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us