REXX- Query..... Allocate?



IBM's Command List programming language & Restructured Extended Executor

REXX- Query..... Allocate?

Postby bodhi » Mon Jul 30, 2007 5:41 pm

hi,

could anyone please tell me How to access a data set given by a user in the REXX Program.

i am asking you this because in the REXX program we need to allocate the Dataset before processing it with EXECIO.

so i would like to know how to allocate that dataset entered by a user?


thanks
Girish Mohnani
bodhi
 
Posts: 53
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- Query..... Allocate?

 

Re: REXX- Query..... Pease answer

Postby MrSpock » Mon Jul 30, 2007 5:55 pm

What type of environment (i.e. address space) is your exec running in? Batch (MVS), TSO, TSO/ISPF, Netview, USS or some other environment?

The methods used to allocate datasets/sysout to DD's vary depending on the active environment. The only common factor is that the allocation of data is an external event to the REXX exec.
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: REXX- Query..... Pease answer

Postby bodhi » Mon Jul 30, 2007 6:01 pm

The environment is TSO/ISPF
bodhi
 
Posts: 53
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- Query..... Pease answer

Postby amitava » Mon Jul 30, 2007 6:03 pm

Hey Bondhi,
I think you want to allocate the dataset in TSO environment! So please refer the following sample -
   "ALLOC F(LOGICAL) DA('[i]<Dataset Name>[/i]') NEW DIR(10)
   SPACE(10,10)DSORG(PO) RECFM(F,B) LRECL(80) BLKSIZE(800)"
   "FREE F(LOGICAL)"


Byu this you will be able to allocate a dataset. Here it is PO i.e it is a PDS. If you want to allocate a PS, change the DSORG from PO to PS and don't give the DIR() parameter.

Regards,

Amitava
Regards,

Amitava
amitava
 
Posts: 5
Joined: Mon Jul 30, 2007 5:34 pm
Location: India
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- Query..... Pease answer

Postby bodhi » Mon Jul 30, 2007 6:09 pm

Well i know this method of allocating but i want to access the data set which will be entered by the user after running the program


i am sending you the part of my coding as following:


SAY 'PLEASE ENTER DATA SET NAME'
PULL DATA_SET
"alloc da( ) f(indd) shr reuse"
"execio * diskr indd (stem var."


according to the coding part above what should i type in the DA( ) so that i can access the Dataset entered by the user after the execution of SAY and PULL statement.

thanks
Bodhi
bodhi
 
Posts: 53
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- Query..... Pease answer

Postby MrSpock » Mon Jul 30, 2007 6:23 pm

"alloc da('"DATA_SET"') f(indd) shr reuse"
User avatar
MrSpock
Global moderator
 
Posts: 810
Joined: Wed Jun 06, 2007 9:37 pm
Location: Raleigh NC USA
Has thanked: 0 time
Been thanked: 2 times

Re: REXX- Query..... Pease answer

Postby bodhi » Mon Jul 30, 2007 6:59 pm

Thank you very much MrSpock.
bodhi
 
Posts: 53
Joined: Mon Jul 30, 2007 5:01 pm
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- Query..... Pease answer

Postby CICS Guy » Tue Jul 31, 2007 2:47 am

Nice Mr Spock.... :o
CICS Guy
 
Posts: 255
Joined: Wed Jun 20, 2007 4:08 am
Has thanked: 0 time
Been thanked: 0 time

Re: REXX- Query..... Allocate?

Postby marso » Thu Aug 02, 2007 6:34 pm

To read from a file
InpFileName = "'prefix.input.file'"
If SYSDSN(InpFileName) <> "OK" Then Do
   Say "Input file not found"
   Return
End
"ALLOC F(INPF) DA("InpFileName") SHR"
"EXECIO * DISKR (FINIS STEM InpLines."
"FREE F(INPF)"


To write to a file:
OutFileName = "'prefix.output.file'"
If SYSDSN(OutFileName) = "OK" Then
   "ALLOC F(OUTF) DA("OutFileName") SHR"
Else
   "ALLOC F(OUTF) DA("OutFileName") NEW TRACKS SPACE(10,10) RECFM(FB) LRECL(80)"
"EXECIO * DISKW (FINIS STEM OutLines."
"FREE F(OUTF)"
User avatar
marso
 
Posts: 12
Joined: Mon Jul 30, 2007 5:04 pm
Has thanked: 0 time
Been thanked: 0 time


Return to CLIST & REXX

 


  • Related topics
    Replies
    Views
    Last post