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 

How do add a character at end of variable length record

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


Joined: 17 Nov 2006
Posts: 1
Topics: 1

PostPosted: Sat Mar 08, 2008 4:52 pm    Post subject: How do add a character at end of variable length record Reply with quote

Hi,

I have a VARIABLE length file and need to add a character at the end of reach record. I can easly do this FIXED length files but this needs to remain a variable length file:

Example Input Records

Code:
aaa,bbb,rqerqrr,rqwer,qereqw,rqewr
aaa,brqr,rqerqe,qrerqrqrr,qewrqwr,qer,rqew,rewqrq,qer
rrrq,tqr,tqr,qter,tqer,qer,tqer,tqer
qrqe,qr,er,rqe,rqew,rqwe,rqwetqwerrq
qrewrqr,qwer,qr,qr,r,rweq,qrq,rweq


I need it to get to look like this:

Code:

aaa,bbb,rqerqrr,rqwer,qereqw,rqewr:
aaa,brqr,rqerqe,qrerqrqrr,qewrqwr,qer,rqew,rewqrq,qer:
rrrq,tqr,tqr,qter,tqer,qer,tqer,tqer:
qrqe,qr,er,rqe,rqew,rqwe,rqwetqwerrq:
qrewrqr,qwer,qr,qr,r,rweq,qrq,rweq:


Is this even possible to do with sort?
Thanks
Back to top
View user's profile Send private message
Frank Yaeger
Sort Forum Moderator
Sort Forum Moderator


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

PostPosted: Sun Mar 09, 2008 3:25 pm    Post subject: Reply with quote

Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=VB and LRECL=80, but the job can be changed appropriately for other attributes.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD DSN=...   input file (VB/80)
//SORTOUT DD DSN=...  output file (VB/80)
//SYSIN    DD    *
  OPTION COPY
  OUTFIL IFTHEN=(WHEN=INIT,
    BUILD=(1,4,5,76,JFY=(SHIFT=LEFT,TRAIL=C':'))),
    VLTRIM=C' '
/*

_________________
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
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