Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

OUTREC - Insert Blanks

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: OUTREC - Insert Blanks
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Thu Mar 26, 2009 1:10 pm    Post subject:
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    Post subject:
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    Post subject:
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 Moderator


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

PostPosted: Thu Mar 26, 2009 9:20 pm    Post subject:
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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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    Post subject:
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 Moderator


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

PostPosted: Fri Mar 27, 2009 8:58 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts outrec field outside range Danielle.Filteau SYNCSORT 10 Sat Mar 04, 2017 2:37 am
No new posts SORT- outrec ram_vizag DFSORT/ICETOOL 10 Tue Sep 27, 2016 12:50 am
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm
No new posts OUTREC FILELDS FAILS WITH ICE126A 2 ... balaji81_k DFSORT/ICETOOL 8 Sat Jul 02, 2016 1:22 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us