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
 

 

GDG file Access in REXX

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> CLIST & REXX
View previous topic :: :: View next topic  
Author Message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Fri Nov 25, 2011 6:32 pm    Post subject: GDG file Access in REXX
Reply with quote

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
View user's profile Send private message

enrico-sorichetti

Global Moderator


Joined: 14 Mar 2007
Posts: 10201
Location: italy

PostPosted: Fri Nov 25, 2011 6:34 pm    Post subject: Reply to: GDG file Access in REXX
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Fri Nov 25, 2011 6:37 pm    Post subject:
Reply with quote

Might help if you explained what you are trying to achieve
Back to top
View user's profile Send private message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Mon Nov 28, 2011 8:18 am    Post subject:
Reply with quote

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
View user's profile Send private message
dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Mon Nov 28, 2011 11:24 am    Post subject:
Reply with quote

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
View user's profile Send private message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Mon Nov 28, 2011 11:38 am    Post subject:
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Mon Nov 28, 2011 1:12 pm    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Mon Nov 28, 2011 7:32 pm    Post subject: Reply to: GDG file Access in REXX
Reply with quote

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
View user's profile Send private message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Wed Nov 30, 2011 8:45 am    Post subject:
Reply with quote

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
View user's profile Send private message
superk

Moderator Team Head


Joined: 26 Apr 2004
Posts: 4648
Location: Raleigh, NC, USA

PostPosted: Wed Nov 30, 2011 10:16 am    Post subject: Reply to: GDG file Access in REXX
Reply with quote

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:

http://www.ibmmainframes.com/viewtopic.php?t=24474

to describe my experience with this function.
Back to top
View user's profile Send private message
Gay251319

New User


Joined: 17 Jun 2009
Posts: 57
Location: Kochi

PostPosted: Thu Dec 01, 2011 4:41 pm    Post subject:
Reply with quote

Hi All,

Thanks a Lot for ur valuable solution
Back to top
View user's profile Send private message
rohanthengal

Active User


Joined: 19 Mar 2009
Posts: 176
Location: Pune, Maharashtra, India

PostPosted: Thu Dec 08, 2011 10:30 am    Post subject:
Reply with quote

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
View user's profile Send private message
Bill Woodger

DFSORT Moderator


Joined: 09 Mar 2011
Posts: 7223

PostPosted: Thu Dec 08, 2011 1:25 pm    Post subject: Reply to: GDG file Access in REXX
Reply with quote

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
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8593
Location: Back in jolly old England

PostPosted: Thu Dec 08, 2011 1:30 pm    Post subject:
Reply with quote

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 icon_rolleyes.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 Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts IMS DC screen Access sivasaras IMS DB/DC 3 Fri Nov 18, 2016 6:38 pm
No new posts What is the command to check MODE of ... rohanthengal CLIST & REXX 6 Fri Nov 18, 2016 1:48 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm


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