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
REXX- Query..... Allocate?
- MrSpock
- Global moderator
- Posts: 809
- Joined: Wed Jun 06, 2007 9:37 pm
- Skillset: REXX, JCL, DFSORT, Syncsort, Axway MFT, Connect:Direct, FTP, SFTP
- Referer: ibmmainframes.com
- Location: Raleigh NC USA
- Contact:
Re: REXX- Query..... Pease answer
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.
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.
Re: REXX- Query..... Pease answer
The environment is TSO/ISPF
Re: REXX- Query..... Pease answer
Hey Bondhi,
I think you want to allocate the dataset in TSO environment! So please refer the following sample -
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
I think you want to allocate the dataset in TSO environment! So please refer the following sample -
Code: Select all
"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
Re: REXX- Query..... Pease answer
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
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
- MrSpock
- Global moderator
- Posts: 809
- Joined: Wed Jun 06, 2007 9:37 pm
- Skillset: REXX, JCL, DFSORT, Syncsort, Axway MFT, Connect:Direct, FTP, SFTP
- Referer: ibmmainframes.com
- Location: Raleigh NC USA
- Contact:
Re: REXX- Query..... Pease answer
"alloc da('"DATA_SET"') f(indd) shr reuse"
Re: REXX- Query..... Pease answer
Thank you very much MrSpock.
Re: REXX- Query..... Pease answer
Nice Mr Spock.... 

Re: REXX- Query..... Allocate?
To read from a file
To write to a file:
Code: Select all
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:
Code: Select all
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)"