View previous topic :: View next topic
|
Author |
Message |
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi,
To Access the normal dataset we are using like
Code: |
"ALLOC DD(****) DA("*****") SHR REUSE"
"EXECIO * DISKR **** (STEM OUDATA. FINIS)"
"FREE F(KART)" |
but to use the GDG if I use
Code: |
ALLOCSTR="ALLOC DD(****) DA("****") SHR REUSE"
QUEUE " DEF GDG (NAME(****) EMP NSCR LIM(255))"
"EXECIO "QUEUED()" DISKW (STEM INDATA. FINIS)"
CALL BPXWDYN(ALLOCSTR)
|
am getting DD positional parameter missing error . Can anyone please help me for the same .
Can anyone please help me for the same,, In the Queue What exactly I shld give,, |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10889 Location: italy
|
|
|
|
You are mixing up things...
the ALLOC and the DEFine
and You are also mixing up the EXECIO parameters
what has the QUEUED() have to do with the STEM construct
the two things are normally used separately !
start over and do one thing at the time |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Might help if you explained what you are trying to achieve |
|
Back to top |
|
|
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi,
I want to read the data from the dataset which is a GDG ..
Can you please help me for the same
Regards,
Gayathiri Ravi |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
Can you please help me for the same |
Not until you post the code you tried and explain where you are stuck.
Running a trace would probably help as well. |
|
Back to top |
|
|
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi,
To get the currrent version of the GDG I have tried this step ...
GDGDA = "****************************"
/*-- LIST ALL GDG ENTRIES FOR THIS DATASET. --*/
RECS= OUTTRAP(DATA.)
"LISTC ENT('"||GDGDA||"')"
RECS= OUTTRAP(OFF)
/*-- DETERMINE THE CURRENT GDG DATASET NAME --*/
TOT = DATA.0 -1
PARSE VAR DATA.TOT . . NAME
SAY 'DATASET==>' NAME
But to read the Datas from the current version of the GDG .. nomal read statement is not working,,, i.e ,,
"EXECIO * DISKR **** (STEM OUDATA. FINIS)"
So while serching thru some sites,, I get to know that I shld use QUEUE () parameter,,, As I am not having enough idea of the same,, Can anyone pls me for the same |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Gay251319 wrote: |
I want to read the data from the dataset which is a GDG ..
To get the currrent version of the GDG I have tried this step ...
|
As there is only ever ONE VERSION of a GDS perhaps you mean generations.
The whole GDG base, the 0 gen, the -1 gen, or what.
As I'm in a good mood so far, here's a snippet
Code: |
GDG = "TEST.GDG"
DSN = STRIP(GDG||".G0000V00") /* DEFAULT IF NOT EXIST */
X=OUTTRAP(LST.) /* LISTCAT GDG BASE */
" LISTC ENT('"GDG"')"
X=OUTTRAP(OFF)
DO A = LST.0 TO 1 BY -1 /* FIRST FIND = 0 GEN */
IF POS('NONVSAM',LST.A) > 0 THEN DO
DSN = SUBSTR(LST.A,POS('NONVSAM',LST.A)+13,44)
A = 0
END
END |
|
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Gayathiri, why aren't you just allocating the GDG as you normally would in your job that's using this REXX exec? Also, as an additional comment, reading the entire contents of a dataset into a stem variable is never a good idea unless you have some control over how much data is actually present. |
|
Back to top |
|
|
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi,
Thanks all for ur valuable help..
Hi Superk,
" why aren't you just allocating the GDG as you normally would in your job that's using this REXX exec"
Can you tell this more clearly as I couldnt get exactly what you are meaning..
I always want to read the contents the current version of the GDG and do some process,, How it is possible ?????????? |
|
Back to top |
|
|
superk
Global Moderator
Joined: 26 Apr 2004 Posts: 4652 Location: Raleigh, NC, USA
|
|
|
|
Gayathiri, since I've been involved with this forum, there's been certain assumptions and standards applied here, which I know I've stated before. This forum is about REXX, not TSO or ISPF (there's a seperate forum for those). The assumption here is that the code is standard REXX and that it's running in batch or an environment outside of foreground TSO. If it's not, that fact needs to be clearly stated.
The REXX langauge, like most others, doesn't allocate the datasets. That function is left up to the operating system to manage. In that case, based on the basic assumptions of this forum, since you haven't stated otherwise, I have to presume that there is a job running your exec. In that job, you would use DD statements to refer to the Generation Data Set. That can be accomplished either by a relative definition:
//DDNAME DD DSN=TEST.GDG(0),DISP=SHR or something similar, which will give you the most current generation at that moment in time, or by using the explicit definition:
//DDNAME DD DSN=TEST.GDG.G0001V00,DISP=SHR or something similar.
For a process running outside of the batch environment, dealing with GDG's gets to be trickier. The TSO/E ALLOCATE command can only work with an explicit definition of a GDG. For these environments, if relative allocation of a GDG is required, then I've found that the BPXWDYN dynamic allocation routine can mamage these allocations. I created a topic on this:
www.ibmmainframes.com/viewtopic.php?t=24474
to describe my experience with this function. |
|
Back to top |
|
|
Gay251319
New User
Joined: 17 Jun 2009 Posts: 57 Location: Kochi
|
|
|
|
Hi All,
Thanks a Lot for ur valuable solution |
|
Back to top |
|
|
rohanthengal
Active User
Joined: 19 Mar 2009 Posts: 206 Location: Globe, India
|
|
|
|
i have a similar problem:
i want to check the list of datasets if they are existing through REXX EXEC.
I am able to do this task for NON GDG datsets using below code:
Code: |
/* REXX */
"ALLOC DA('"MFID.REXX.INPUT"') F(ENTRIES) SHR REUSE"
"ALLOC DA('"MFID.REXX.OUTPUT"') F(OUTPUT) SHR REUSE"
"EXECIO * DISKR ENTRIES (STEM LIST. FINIS"
DO I=1 TO LIST.0
PARSE VAR LIST.I INLIST ' '
CHK=SYSDSN("'"INLIST"'")
FOUND.I=INLIST||' = '||CHK
END
"EXECIO * DISKW OUTPUT (STEM FOUND. FINIS"
|
But whenever i pass GDG latest generation / current generation in the input file, it says invalid dataset name:(just like shown below)
Code: |
MFID.PJKS.BBG002I.ACCT.UNLOAD(0) - invalid dataset name
|
i guess my function
Code: |
CHK=SYSDSN("'"INLIST"'") |
is not able to identify GDG generation.
Please let me know if any other mechanism to be used to do this job of checking if the gdg generation is cataloged. |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
So you should have started a new, similar, tiopic, with a link to this one if you felt the content is relevant (that's with the URL button). |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
There is my code in the above post, Kevin has given a link to his code, and here you are asking how it's done |
|
Back to top |
|
|
|