IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

OUTREC - Insert Blanks


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Arun Prasad R

New User


Joined: 13 Feb 2008
Posts: 7
Location: India

PostPosted: Thu Mar 26, 2009 11:22 am
Reply with quote

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
View user's profile Send private message
bipinpeter

Active User


Joined: 18 Jun 2007
Posts: 213
Location: Cochin/Kerala/India

PostPosted: Thu Mar 26, 2009 1:03 pm
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Mar 26, 2009 1:10 pm
Reply with quote

Are your records FB or VB ?
Back to top
View user's profile Send private message
Arun Prasad R

New User


Joined: 13 Feb 2008
Posts: 7
Location: India

PostPosted: Thu Mar 26, 2009 1:11 pm
Reply with quote

Thanks Bipin.
It has solved the issue.
Back to top
View user's profile Send private message
Arun Prasad R

New User


Joined: 13 Feb 2008
Posts: 7
Location: India

PostPosted: Thu Mar 26, 2009 1:14 pm
Reply with quote

expat wrote:
Are your records FB or VB ?

It's an FB file
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Mar 26, 2009 9:20 pm
Reply with quote

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
View user's profile Send private message
Arun Prasad R

New User


Joined: 13 Feb 2008
Posts: 7
Location: India

PostPosted: Fri Mar 27, 2009 10:48 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Fri Mar 27, 2009 8:58 pm
Reply with quote

Also:

Code:

   OUTREC BUILD=(1,16,64X'40') 
 
   OUTREC BUILD=(1,16,80:C' ')     

   OUTREC BUILD=(1,16,80:X'40')
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Insert header record with record coun... DFSORT/ICETOOL 14
No new posts Insert system time/date (timestamp) u... DFSORT/ICETOOL 5
No new posts Identify Program Insert DB2 7
No new posts Insert trailer for non empty file only DFSORT/ICETOOL 6
No new posts Merge files with a key and insert a b... DFSORT/ICETOOL 6
Search our Forums:

Back to Top