Write to same line using EXECIO



IBM's Command List programming language & Restructured Extended Executor

Write to same line using EXECIO

Postby smirkhan » Wed Jul 09, 2008 10:59 pm

Hi Everyone,

I was wondering if anyone knew how to read all lines of a dataset and output the lines concatanated on one line in a new dataset.

For example if the input dataset contains:

ABC
DEF
GHI
JKL

The output dataset would look like this:

ABCDEFGHIJKL
smirkhan
 
Posts: 3
Joined: Wed Jul 09, 2008 10:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Write to same line using EXECIO

 

Re: Write to same line using EXECIO

Postby smirkhan » Thu Jul 10, 2008 1:55 am

I actually figured out how to fix this. You can read using a STEM variable. Then use a loop with a temp variable to store each line like so:

"EXECIO * DISKR DATAIN (STEM ST. FINIS"   
IF RC = 0 THEN                           
DO                                       
   TEMP = ST.1                           
   DO I = 2 TO ST.0                                             
      TEMP = STRIP(TEMP) || ST.I         
   END                                   
END                                       
PUSH TEMP                                 
"EXECIO * DISKW DATAOUT"
smirkhan
 
Posts: 3
Joined: Wed Jul 09, 2008 10:29 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Write to same line using EXECIO

Postby dick scherrer » Thu Jul 10, 2008 2:04 am

Hello smirkhan and welcome to the forums,

Good to hear you have it working :)

Please notice your second post - it is now posted with a fixed-font and aligned (which makes it much more readable). To accomplish this, i "Code"ed your post (usng the Code tag on the top of the reply panel). You can also Preview to see what your post will look like to the forum, rather than only being able to see it in the reply editor. When you are satisfied with your post, then click Submit (remember to Submit because if you don't, the post is lost ;) ).

Enjoy the forums,
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times

Re: Write to same line using EXECIO

Postby smirkhan » Thu Jul 10, 2008 6:20 pm

Hey Dick,

It's good to be on the forums. I've recently gotten into the field and had a course last year at university on mainframe basics which made me very interested in the systems. I'm hoping to gain as much knowledge as I can in the next couple of months before I go back to University for one more year.

I will make sure to follow your instructions on my next post.
smirkhan
 
Posts: 3
Joined: Wed Jul 09, 2008 10:29 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post