View previous topic :: View next topic
|
Author |
Message |
ajay_diaz Warnings : 1 New User
Joined: 12 Sep 2005 Posts: 28
|
|
|
|
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 |
|
 |
ajay_diaz Warnings : 1 New User
Joined: 12 Sep 2005 Posts: 28
|
|
|
|
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 |
|
 |
Paddy
New User

Joined: 12 Sep 2005 Posts: 46 Location: Paris France
|
|
|
|
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 |
|
 |
ajay_diaz Warnings : 1 New User
Joined: 12 Sep 2005 Posts: 28
|
|
|
|
Thanks Paddy !!  |
|
Back to top |
|
 |
Paddy
New User

Joined: 12 Sep 2005 Posts: 46 Location: Paris France
|
|
|
|
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  |
|
Back to top |
|
 |
|
|