MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
Rohit Sharma Beginner Joined: 30 Jan 2004 Posts: 5 Topics: 3
Posted: Fri Jan 30, 2004 4:34 am Post subject: Add string at end records of VB File
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
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
Posted: Fri Jan 30, 2004 6:40 am Post subject:
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
Rohit Sharma Beginner Joined: 30 Jan 2004 Posts: 5 Topics: 3
Posted: Mon Feb 02, 2004 11:37 pm Post subject:
Thanks for the reply.
Rohit.
Back to top
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