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 

Add string at end records of VB File

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


Joined: 30 Jan 2004
Posts: 5
Topics: 3

PostPosted: Fri Jan 30, 2004 4:34 am    Post subject: Add string at end records of VB File Reply with quote

Hi,

I need to add four character bytes ( C'1111') at end of each record of a variable block file. How can I achieve this using Syncsort.

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


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

PostPosted: Fri Jan 30, 2004 6:40 am    Post subject: Reply with quote

Rohit sharma,

Adding a constant value of '1111' at the end of each record for each variable is not possible. VB records have a fixed part and a variable part.

ex:
Code:

RDW|aaaaaaaaaaa|bbbbbbbbbbbbbbbbbbbbbb
RDW|ccccccccccc|
RDW|fffffffffff|vvvvvvv


In this scenario you wanted to pad '1111' at the end of each record.

Code:

RDW|aaaaaaaaaaa|bbbbbbbbbbbbbbbbbbbbbb|1111
RDW|ccccccccccc|1111
RDW|fffffffffff|vvvvvvv1111


Syncsort does not have any provision for creating records as show above. There is a feature VLFILL which can be used to fil records with a value. VLFILL= f where f can be any single byte C'c' (character) or X'hh' (hex) byte you like such as C'1' or X'40' (blank).

By using that feature the output will be as follows

Code:

RDW|aaaaaaaaaaa|bbbbbbbbbbbbbbbbbbbbbb|1111
RDW|ccccccccccc|111111111111111111111111111
RDW|fffffffffff|vvvvvvv11111111111111111111


Since you have not provided the lrecl , here is a sample JCl which you can try for 80 byte LRECL.
Code:

//STEP0100 EXEC PGM=SORT                                   
//SYSOUT   DD  SYSOUT=*                                   
//SORTIN   DD  DSN=YOUR VB INPUT,                         
//             DISP=SHR                                   
//SORTOUT  DD  DSN=YOUR VB OUTPUT,                       
//             DISP=(NEW,CATLG,DELETE),                   
//             UNIT=SYSDA,                                 
//             SPACE=(CYL,(X,Y),RLSE)                   
//SYSIN    DD  *                                           
 SORT FIELDS=COPY                                         
 OUTFIL VLFILL=C'1',OUTREC=(1,4,5,76)                     
/*                                                         



Hope this helps...

Cheers

Kolusu
_________________
Kolusu
www.linkedin.com/in/kolusu
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Rohit Sharma
Beginner


Joined: 30 Jan 2004
Posts: 5
Topics: 3

PostPosted: Mon Feb 02, 2004 11:37 pm    Post subject: Reply with quote

Thanks for the reply.

Rohit.
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