MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

FTOV with VLTRIM option

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities
View previous topic :: View next topic  
Author Message
hasan
Beginner


Joined: 02 Sep 2004
Posts: 9
Topics: 3

PostPosted: Tue Mar 06, 2012 2:39 pm    Post subject: FTOV with VLTRIM option Reply with quote

Hi,

I am trying to convert a fixed length file to a variable length file, and while doing so I would like the trailing spaces to be removed.

Sample input data -
Code:

    ****** ***************************** Top of Data ******************************
    000001 0000000000000001                                                       
           FFFFFFFFFFFFFFFF44444444444444444444444444444444444444444444444444444444
           000000000000000100000000000000000000000000000000000000000000000000000000
    ------------------------------------------------------------------------------
    000002 0000000000000002AAAAA                                                   
           FFFFFFFFFFFFFFFFCCCCC444444444444444444444444444444444444444444444444444
           000000000000000211111000000000000000000000000000000000000000000000000000
    ------------------------------------------------------------------------------
    000003 0000000000000003BB                                                     
           FFFFFFFFFFFFFFFFCC444444444444444444444444444444444444444444444444444444
           000000000000000322000000000000000000000000000000000000000000000000000000
    ------------------------------------------------------------------------------
    000004 0000000000000004CCCCCCCCCCCC                                           
           FFFFFFFFFFFFFFFFCCCCCCCCCCCC44444444444444444444444444444444444444444444
           000000000000000433333333333300000000000000000000000000000000000000000000
    ------------------------------------------------------------------------------
    000005 0000000000005                                                           
           FFFFFFFFFFFFF44444444444444444444444444444444444444444444444444444444444
           000000000000500000000000000000000000000000000000000000000000000000000000

Expected output result -
Code:

    ****** ***************************** Top of Data ******************************
    000001 0000000000000001                                                       
           FFFFFFFFFFFFFFFF
           0000000000000001
    ------------------------------------------------------------------------------
    000002 0000000000000002AAAAA                                                   
           FFFFFFFFFFFFFFFFCCCCC
           000000000000000211111
    ------------------------------------------------------------------------------
    000003 0000000000000003BB
           FFFFFFFFFFFFFFFFCC
           000000000000000322
    ------------------------------------------------------------------------------
    000004 0000000000000004CCCCCCCCCCCC                                           
           FFFFFFFFFFFFFFFFCCCCCCCCCCCC
           0000000000000004333333333333
    ------------------------------------------------------------------------------
    000005 0000000000005                                                           
           FFFFFFFFFFFFF
           0000000000005


The SORT JCL I am using -
Code:

    //STEP0001 EXEC PGM=SORT,COND=(0,NE)
    //SORTIN   DD   DSN=&HLQ..TEST.FB,                                 
    //             DISP=SHR                                                 
    //OUTPUTFI DD   DSN=&HLQ..TEST.FBTOVB,                               
    //             DISP=(NEW,CATLG,DELETE),                                 
    //             SPACE=(CYL,(15,15),RLSE),                               
    //             RECFM=VB,                                               
    //             LRECL=27994,                                             
    //             DSORG=PS                                                 
    //SYSIN  DD *                                                           
      SORT FIELDS=COPY                                                     
      OUTFIL FNAMES=OUTPUTFI,FTOV,VLTRIM=X'40'                             
    /*                                                                     
    //SYSOUT   DD SYSOUT=*                                                 


But I keep getting the trailing spaces even though the file gets converted to variable length format. I thought VLTRIM would strip them off. When I replace the spaces in input file with '*' and use VLTRIM=C'*', the '*' are removed and are replaced with spaces. I am confused as to why trailing blanks keep coming in both cases. Shouldn't VLTRIM remove them and adjust the RDW accordingly. Or may be I am missing something.

Please help.

Thanks.
Back to top
View user's profile Send private message
kolusu
Site Admin
Site Admin


Joined: 26 Nov 2002
Posts: 12368
Topics: 75
Location: San Jose

PostPosted: Tue Mar 06, 2012 2:57 pm    Post subject: Reply with quote

hasan,

I don't think there is any problem. I believe that it is your ISPF display that makes you think that there are trailing blanks. If you want to double check you can run the following job which displays the length in the RDW:

Code:

//STEP0100 EXEC PGM=SORT                 
//SYSOUT   DD SYSOUT=*                   
//SORTIN   DD DSN=your input vb file created with vltrim,DISP=SHR         
//SORTOUT  DD SYSOUT=*                   
//SYSIN    DD *                           
  SORT FIELDS=COPY                       
  OUTFIL VTOF,BUILD=(1,2,BI,M11,LENGTH=6)
//*

_________________
Kolusu - DFSORT Development Team (IBM)
DFSORT is on the Web at:
www.ibm.com/storage/dfsort

www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


Joined: 02 Dec 2002
Posts: 1618
Topics: 31
Location: San Jose

PostPosted: Tue Mar 06, 2012 3:46 pm    Post subject: Reply with quote

hasan,

I agree with Kolusu. I ran your job and then used this DFSORT job to see the output in hex:

Code:

//SHOWV EXEC  PGM=SORT                         
//SYSOUT    DD  SYSOUT=*                       
//SORTIN  DD DSN=Y897797.MFR1.OUT,DISP=SHR     
//SORTOUT DD SYSOUT=*                           
//SYSIN    DD    *                             
 OPTION COPY                                   
 OUTFIL BUILD=(1,4,1,4,HEX,5,HEX)               


The output for the first record was:

Code:

00140000F0F0F0F0F0F0F0F0F0F0F0F0F0F0F0F1               


X'0014' = 20 is the length of the record (4 bytes for RDW + 16 data bytes).

If I look at the output with ISPF EDIT in hex, I see:

Code:

000000 0000000000000001                                                       
       FFFFFFFFFFFFFFFF44444444444444444444444444444444444444444444444444444444
       000000000000000100000000000000000000000000000000000000000000000000000000


So it appears that ISPF EDIT does not show VB records as they actually look.
_________________
Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
View user's profile Send private message Send e-mail Visit poster's website
hasan
Beginner


Joined: 02 Sep 2004
Posts: 9
Topics: 3

PostPosted: Tue Mar 06, 2012 11:19 pm    Post subject: Reply with quote

Hi Kolusu and Frank,

You are right. It is the ISPF display that was making me feel that I have the trailing blanks.

When I just browse the file (as against to viewing it), this is what I see.

Code:

----+----1----+----2----+----3----+----4
----+----F----+----F----+----F----+----F
----+----1----+----2----+----3----+----4
 ---------------------------------------
0000000000000001                       
FFFFFFFFFFFFFFFF                       
0000000000000001                       
 ---------------------------------------
0000000000000002AAAAA                   
FFFFFFFFFFFFFFFFCCCCC                   
000000000000000211111                   
 ---------------------------------------
0000000000000003BB                     
FFFFFFFFFFFFFFFFCC                     
000000000000000322                     
 ---------------------------------------
0000000000000004CCCCCCCCCCCC           
FFFFFFFFFFFFFFFFCCCCCCCCCCCC           
0000000000000004333333333333           
 ---------------------------------------


I should have checked the RDWs by displaying them, I instead spent lot of time going thru the manuals, forums etc ... Smile

Thanks a lot for your help.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Utilities All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group