Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ 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
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    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

ajay_diaz
Warnings : 1

New User


Joined: 12 Sep 2005
Posts: 28

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

New User


Joined: 12 Sep 2005
Posts: 46
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: 28

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

New User


Joined: 12 Sep 2005
Posts: 46
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
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Match two files using multiple keys a... santoshks1987 SYNCSORT 10 Fri Aug 18, 2017 10:50 am
This topic is locked: you cannot edit posts or make replies. how to code for GDG in Rexx cvnlynn CLIST & REXX 13 Wed Aug 09, 2017 9:13 pm
No new posts Multiple VSAM files single output fil... Mohan Kothakota DFSORT/ICETOOL 11 Wed Aug 09, 2017 7:57 pm
This topic is locked: you cannot edit posts or make replies. rexx to create a tso command Bharath Vikraman CLIST & REXX 1 Tue Aug 08, 2017 3:32 pm
This topic is locked: you cannot edit posts or make replies. rexx code to create a ps file Bharath Vikraman CLIST & REXX 4 Mon Aug 07, 2017 10:30 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us