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

Allocate sequential file in REXX


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

New User


Joined: 12 Sep 2005
Posts: 28

PostPosted: Wed Jan 18, 2006 10:58 am
Reply with quote

Hello,

I want to allocate a sequential file in my program having same DCB parametrs as that of input file.
(Record length , block size, rec format etc.)

The input file name is entered by the user in my REXX program.
So these parameters are not fixed.

I have to allocate the file based on the DCB parameters of the file entered by the user.

Please reply.
Back to top
View user's profile Send private message
ajay_diaz
Warnings : 1

New User


Joined: 12 Sep 2005
Posts: 28

PostPosted: Wed Jan 18, 2006 12:49 pm
Reply with quote

Hi,
I am using LISTDSI function to get the data for the PS entered by the user.
It is returning values also.(I tested it by displaying)

But the program is giving error, when i am using the values retrieved in the variables (e.g. say SYSRECFM, SYSLRECL and moving them to the program variables)

"ALLOC FI (F2) DA('"DATASET"') NEW
LRECL (REC_LEN) RECFM (REC_FORMAT) UNIT (UNIT_VALUE)
TRACKS SPACE (5,5) CATALOG"

IKJ56702I INVALID LOGICAL RECORD LENGTH, REC_LEN
IKJ56701I MISSING LOGICAL RECORD LENGTH+
IKJ56712I INVALID KEYWORD, REC_FORMAT
IKJ56701I MISSING A DECIMAL NUMBER FROM 0 TO 32760, A CHARACTER X, OR A NUMBER FROM 1 TO 16384 WITH K MULTIPLIER .

Regards,
Ajay
Back to top
View user's profile Send private message
Paddy

New User


Joined: 12 Sep 2005
Posts: 46
Location: Paris France

PostPosted: Wed Jan 18, 2006 12:49 pm
Reply with quote

Hi Ajay,

Try this code :

Code:

******,***************************** Top of Data ******************************
000001,/* REXX */
000002,TRACE r
000003,say 'Enter DS name : '
000004,pull dataset
000005,X = LISTDSI("'"dataset"'" directory)
000006,recf = insert(',',sysrecfm,1,1)
000007,address tso 'alloc dataset('your dsname will be create')',
000008,            'volume(your volid)',
000009,            'space('sysprimary','sysseconds') 'sysunits'',
000010,            'LRECL('syslrecl') blksize('sysblksize')',
000011,            'dsorg('sysdsorg') recfm('recf') dir('sysadirblk')'
000012,EXIT
******,**************************** Bottom of Data ****************************


You need report to documentation to know all variables exploitable with LISTDSI.

I hope that this response will really help you.

Regards.

Paddy
Back to top
View user's profile Send private message
ajay_diaz
Warnings : 1

New User


Joined: 12 Sep 2005
Posts: 28

PostPosted: Wed Jan 18, 2006 1:24 pm
Reply with quote

Thanks Paddy !! icon_smile.gif
Back to top
View user's profile Send private message
Paddy

New User


Joined: 12 Sep 2005
Posts: 46
Location: Paris France

PostPosted: Wed Jan 18, 2006 1:49 pm
Reply with quote

Hi Ajay,

I tried a code exclusively for PS dataset :

Code:

******,***************************** Top of Data ******************************
000001,/* REXX */
000002,TRACE r
000003,say 'Enter DS name : '
000004,pull dataset
000005,X = LISTDSI("'"dataset"'" directory)
000006,recf = insert(',',sysrecfm,1,1)
000007,'allocate dataset(your dataset that will be create)',
000008,            'space('sysprimary','sysseconds')',
000009,            'LRECL('syslrecl') blksize('sysblksize')',
000010,            'dsorg('sysdsorg') recfm('recf')'
000011,EXIT
******,**************************** Bottom of Data ****************************


This code works fine in my shop. Caution you must insert a comma in sysrecfm variable. Look at the code on line 6 it's needed or else you will get an error as the one you describe in your message.

I hope in this help.

Regards.

Paddy icon_smile.gif
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