Portal | IBM Manuals | Downloads | Products | Refer | Info | Programs | JCLs | Forum Rules*| Site Map | Mainframe CD 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index
 
Register
 
IBMMAINFRAMES.com - IBM Mainframe Support Forums Index FAQ Search Memberlist Usergroups Profile Log in to check your private messages Log in
 
Allocate sequential file in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
Author Message
ajay_diaz
Warnings : 1

New User


Joined: 12 Sep 2005
Posts: 22

PostPosted: Wed Jan 18, 2006 10:58 am    Post subject: Allocate sequential file in REXX
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
References
PostPosted: Wed Jan 18, 2006 10:58 am    Post subject: Re: Allocate sequential file in REXX Reply with quote

ajay_diaz
Warnings : 1

New User


Joined: 12 Sep 2005
Posts: 22

PostPosted: Wed Jan 18, 2006 12:49 pm    Post subject: Re: Allocate sequential file in REXX
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

Active User


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

PostPosted: Wed Jan 18, 2006 12:49 pm    Post subject:
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: 22

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

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

Active User


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

PostPosted: Wed Jan 18, 2006 1:49 pm    Post subject:
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
Display posts from previous:   
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1