Quantcast
Viewing all articles
Browse latest Browse all 8500

DFSORT/ICETOOL :: RE: SQZ pipe delimited file with 1 column varying length

Author: sergeyken
Subject: Re: SQZ pipe delimited file with 1 column varying length
Posted: Wed Mar 15, 2017 10:52 pm (GMT 5.5)

Rick Silvers wrote:
Code:
9999999 |9999999 |MEX.111 Description1 Description2 Description3 |11/06/2016 |11062016 | |record count |Y
I need to SQZ the whole data set but in 3rd field I need to leave the spaces between the ctrlid and descriptions and spaces between the descriptions words. The 3rd column will always start with the pipe at position 18 for a length of 400, but the descriptions can vary in length. So I need to SQZ the next field delimiter to end of Description3 and then SQZ last 5 fields to that


SORT solution works as well
Code:
 INREC PARSE=(%=(ABSPOS=5,ENDAT=C'|'),                           
              %=(ENDAT=C'|'),                                     
              %1=(ENDBEFR=C'|',FIXLEN=400),                       
              %2=(SUBPOS=1,ENDBEFR=X'00',FIXLEN=400)),           
       BUILD=(1,4,                  RDW                           
              5,18,                 two fixed fields             
              %1,SQZ=(VL,MID=C' '), squeezed field               
              %2,JFY=(VL))          last fields shifted left     
 SORT FIELDS=COPY                                                 
 END       

_________________
Tyrannosaurus-REXX


Viewing all articles
Browse latest Browse all 8500

Trending Articles