View previous topic :: View next topic
|
Author |
Message |
Arun Prasad R
New User
Joined: 13 Feb 2008 Posts: 7 Location: India
|
|
|
|
Team,
How do I insert Blank characters to the records using OUTREC.
Suppose I have an FB Input file of LRECL 16 and I want it to make it to 80.
i.e, from positin 17 to 80 I want just C ' ' to be inserted.
Let me know the OUTREC syntax. |
|
Back to top |
|
|
bipinpeter
Active User
Joined: 18 Jun 2007 Posts: 213 Location: Cochin/Kerala/India
|
|
|
|
Hi Arun,
USe the DFSORT cards:
Code: |
SORT FIELDS=COPY
OUTREC FIELDS=(1,16,64X)
|
64X will insert 64 spaces.
if you want to insert other characters,suppose if you want to insert * in remaining positions you can use, 64C'*'.
Regards,
Bipin Peter |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8797 Location: Welsh Wales
|
|
|
|
Are your records FB or VB ? |
|
Back to top |
|
|
Arun Prasad R
New User
Joined: 13 Feb 2008 Posts: 7 Location: India
|
|
|
|
Thanks Bipin.
It has solved the issue. |
|
Back to top |
|
|
Arun Prasad R
New User
Joined: 13 Feb 2008 Posts: 7 Location: India
|
|
|
|
expat wrote: |
Are your records FB or VB ? |
It's an FB file |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Arun,
An easier way to do this is to use this DFSORT statement:
Code: |
OUTREC BUILD=(1,16,80:X)
|
That tells DFSORT to pad with blanks up to position 80. So you don't have to calculate the number of blanks needed.
Notice I used BUILD instead of FIELDS. Although BUILD and FIELDS are equivalent for the OUTREC statement, BUILD is preferred over FIELDS because it can be used in INREC, OUTREC, OUTFIL and IFTHEN.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Arun Prasad R
New User
Joined: 13 Feb 2008 Posts: 7 Location: India
|
|
|
|
Thanks Frank.
So we have now, three ways of adding blanks to records
Code: |
SORT FIELDS=COPY
OUTREC BUILD=(1,16,64X) or
OUTREC BUILD=(1,16,64C' ') or
OUTREC BUILD=(1,16,80:X) |
whichever is convinient, we can use.
Thanks Everybody. This Forum is Fantastic.
Edited: Please use BBcode when You post some code/error, that's rather readable, Thanks... Anuj |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Also:
Code: |
OUTREC BUILD=(1,16,64X'40')
OUTREC BUILD=(1,16,80:C' ')
OUTREC BUILD=(1,16,80:X'40')
|
|
|
Back to top |
|
|
|