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
 

 

Format Created Output file Using REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Anand Kumar

New User


Joined: 29 Aug 2007
Posts: 24
Location: chennai

PostPosted: Mon Oct 25, 2010 4:39 pm    Post subject: Format Created Output file Using REXX
Reply with quote

Hi,

Through REXX I am creating some insert queries. I store the data in an array and write into the output file.

The output dataset created looks like this:-

Code:
INSERT INTO GBX.OVST8801 (
  ID,                     
  DAT                     
) VALUES (               
'OM01',   --ID           
'2005-03-17'); --DAT     
INSERT INTO GBX.OVST8801 (
  ID,                     
  DAT                     
) VALUES (               
'OM02', --ID             
'2010-10-17');  --DAT     
INSERT INTO GBX.OVST8801 (
  ID,                     
  DAT                     
) VALUES (               
'OM03',  --ID             
'2010-10-24');  --DAT     


I would look nice if the data is alligned like below. i.e. data from "--" should move to 35th position. Data truncation after 72 is no problem because it is any way a comment.

Code:
INSERT INTO GBX.OVST8801 (             
  ID,                                 
  DAT                                 
) VALUES (                             
'OM01',                           --ID
'2005-03-17');                    --DAT
INSERT INTO GBX.OVST8801 (             
  ID,                                 
  DAT                                 
) VALUES (                             
'OM02',                           --ID
'2010-10-17');                    --DAT
INSERT INTO GBX.OVST8801 (             
  ID,                                 
  DAT                                 
) VALUES (                             
'OM03',                           --ID
'2010-10-24');                    --DAT


Please let me know if there is any way to do this alignment in REXX itself.

Thanks,
Anand[/code]
Back to top
View user's profile Send private message

superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4649
Location: Raleigh, NC, USA

PostPosted: Mon Oct 25, 2010 4:54 pm    Post subject: Reply to: Format Created Output file Using REXX
Reply with quote

Are you using the OVERLAY function?
Back to top
View user's profile Send private message
Akatsukami

Global Moderator


Joined: 03 Oct 2009
Posts: 1770
Location: Bloomington, IL

PostPosted: Mon Oct 25, 2010 5:00 pm    Post subject: Re: Format Created Output file Using REXX
Reply with quote

Anand Kumar wrote:
Please let me know if there is any way to do this alignment in REXX itself.

Yes, there is. Simply infix the desired number of spaces. I recommend the use of a recursive function to get that string; you'll find use for it in many other situations.
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: Mon Oct 25, 2010 5:03 pm    Post subject:
Reply with quote

I'd go for OVERLAY too
Back to top
View user's profile Send private message
Anand Kumar

New User


Joined: 29 Aug 2007
Posts: 24
Location: chennai

PostPosted: Mon Oct 25, 2010 5:58 pm    Post subject: Reply to: Format Created Output file Using REXX
Reply with quote

Okey, I will use Overlay itself. We are trying to make this dynamically created. Hence we never know how many spaces each line to suffix or rather it would go more complex.

Thank you.
Back to top
View user's profile Send private message
Pedro

Senior Member


Joined: 01 Sep 2006
Posts: 2050
Location: Silicon Valley

PostPosted: Mon Oct 25, 2010 8:25 pm    Post subject: Reply to: Format Created Output file Using REXX
Reply with quote

Quote:
Please let me know if there is any way to do this alignment in REXX itself.

Show us how you are doing it now. Show us your rexx.

Consider using the LEFT(stuff,35) function.
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 -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
This topic is locked: you cannot edit posts or make replies. Fetching data from BAI File arunsoods JCL & VSAM 1 Wed Jul 19, 2017 4:28 pm
No new posts REXX to get the all datasets name parasmalik20 CLIST & REXX 5 Tue Jul 18, 2017 9:10 pm
No new posts Write out NODUPS but just from one file Jay Villaverde DFSORT/ICETOOL 8 Fri Jul 14, 2017 12:44 am
No new posts How to add header with Date(YYMMDD) i... Rajan Moorthy DFSORT/ICETOOL 2 Thu Jul 06, 2017 11:44 pm
No new posts How system know which REXX to excute? jackzhang75 CLIST & REXX 14 Thu Jul 06, 2017 1:09 am


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