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

REXX File handling


IBM Mainframe Forums -> CLIST & REXX
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Thu Jan 29, 2009 1:17 pm
Reply with quote

Can i get a simple code to extract line by line records from a flat file using REXX?
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Thu Jan 29, 2009 1:20 pm
Reply with quote

Search the forum and you'll find working examples here.
Back to top
View user's profile Send private message
mpawan
Warnings : 2

New User


Joined: 03 Nov 2008
Posts: 42
Location: Pune

PostPosted: Thu Jan 29, 2009 1:42 pm
Reply with quote

But I want to do that without using JCL
Back to top
View user's profile Send private message
dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6966
Location: porcelain throne

PostPosted: Thu Jan 29, 2009 1:50 pm
Reply with quote

look at execio in the rexx manual. or search for execio in the forums.
Back to top
View user's profile Send private message
lohithegde

New User


Joined: 18 May 2008
Posts: 31
Location: Chennai

PostPosted: Thu Jan 29, 2009 3:14 pm
Reply with quote

Hi Following code may help you
Code:
/* REXX */
"ALLOC DA('ASR.NVV.RUN.PROCLIB("MEMBER1")') F(INPUT) SHR REUSE"
 "EXECIO * DISKR INPUT (STEM LINES. FINIS"
   Do i = 1 To lines.0
      Say lines.i
      End
      Exit
"FREE F(INPUT)"


Also you can see www.ibmmainframes.com/about36121.html
Back to top
View user's profile Send private message
ofer71

Global Moderator


Joined: 27 Dec 2005
Posts: 2358
Location: Israel

PostPosted: Thu Jan 29, 2009 4:10 pm
Reply with quote

lohithegde -

Your EXIT instruction is misplaced.

O.
Back to top
View user's profile Send private message
lohithegde

New User


Joined: 18 May 2008
Posts: 31
Location: Chennai

PostPosted: Thu Jan 29, 2009 4:30 pm
Reply with quote

Hi

thanks for correcting me
Code:
/* REXX */
"ALLOC DA('ASR.NVV.RUN.PROCLIB("MEMBER1")') F(INPUT) SHR REUSE"
 "EXECIO * DISKR INPUT (STEM LINES. FINIS"
   Do i = 1 To lines.0
      Say lines.i
      End
      "FREE F(INPUT)"
   Exit
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Jan 29, 2009 9:40 pm
Reply with quote

Hello,

There is probably something i am misunderstanding. . . icon_confused.gif

Quote:
But I want to do that without using JCL
How does this relate to the suggestion to search the forum sor rexx examples?


Also, when posting code for a requirement, it is best to test the code or mention that it is untested when it is posted.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Thu Jan 29, 2009 10:01 pm
Reply with quote

Quote:
it is best to test the code or mention that it is untested when it is posted.

Agree!

lohithegde: you use an uninitialized variable.

and your indentation does not look right.
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 -> CLIST & REXX

 


Similar Topics
Topic Forum Replies
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Compile Several JCL JOB Through one r... CLIST & REXX 4
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top