Portal | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Forum Index
 
Register
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Profile Log in to check your private messages Log in
 
Fetch the Dataset names from inside members of PDS

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
View previous topic :: :: View next topic  
Author Message
kalyan94

New User


Joined: 17 Jun 2020
Posts: 3
Location: India

PostPosted: Wed Jun 17, 2020 2:06 pm    Post subject: Fetch the Dataset names from inside members of PDS
Reply with quote

Hi!


I wanted to fetch the filenames from inside the members of the pds in a seperate Dataset how can i do that plz suggest me a solution
Back to top
View user's profile Send private message

sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Wed Jun 17, 2020 4:57 pm    Post subject: Re: Fetch the Dataset names from inside members of PDS
Reply with quote

kalyan94 wrote:
Hi!


I wanted to fetch the filenames from inside the members of the pds in a seperate Dataset how can i do that plz suggest me a solution


1) There are no such things as files

2) There are no "inside the members", and "outside the members" locations

3) How many filename(s) do you expect to find "inside" of how many "member(s) of pds"?

- Many filenames in a single member of pds?
- Single filename in each member of pds?
- Many filenames in each member of pds?

4) How do you expect the "filenames" are stored inside of "members of pds"?

5) What do you plan to do with the extracted "filenames" while no such thing as "file" does exist?


The suggestion is classical: RTFM, RTFM, and RTFM
Back to top
View user's profile Send private message
kalyan94

New User


Joined: 17 Jun 2020
Posts: 3
Location: India

PostPosted: Wed Jun 17, 2020 6:06 pm    Post subject:
Reply with quote

many data set names in each member of the PDS to be listed in seperate PS file to create an inventory for migration of the legacy code
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1220
Location: Vilnius, Lithuania

PostPosted: Wed Jun 17, 2020 7:26 pm    Post subject:
Reply with quote

And your organisation put you in charge of a migration process?

What a bunch of idiot PHB's!
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Wed Jun 17, 2020 8:40 pm    Post subject:
Reply with quote

kalyan94 wrote:
many data set names in each member of the PDS to be listed in seperate PS file to create an inventory for migration of the legacy code


Who would allow any migration of any non-toy product to any person who has not a minor idea about any mainframe’s entity???!! 12.gif
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


Joined: 10 May 2007
Posts: 2406
Location: Hampshire, UK

PostPosted: Wed Jun 17, 2020 9:15 pm    Post subject: Reply to: Fetch the Dataset names from inside members of PDS
Reply with quote

How are you to identify what is a dataset name? For members containing JCL it is reasonably simple to use SRCHFOR to search members for the string 'DSN=' or 'DSNAME=' but what about other members - holding program control statements e.g. VSAM dataset definitions/manipulations? Until you know what you have to look for you cannot think about how to do it.
Back to top
View user's profile Send private message
Willy Jensen

Active User


Joined: 01 Sep 2015
Posts: 386
Location: Denmark

PostPosted: Thu Jun 18, 2020 2:13 pm    Post subject:
Reply with quote

I think that I would offload the members to a sequential dataset and then use a program to search for datasetnames. For offloading, see the OFFLOAD program at cbttape.org file 093.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Thu Jun 18, 2020 5:24 pm    Post subject:
Reply with quote

Willy Jensen wrote:
I think that I would offload the members to a sequential dataset and then use a program to search for datasetnames. For offloading, see the OFFLOAD program at cbttape.org file 093.

A simple combination of standard IEBPTPCH/SORT, or SUPERC/SORT would easily do it.

Still the intentions of TS remain unclear. As well as his understanding of the involved entities.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Thu Jun 18, 2020 5:44 pm    Post subject:
Reply with quote

kalyan94 wrote:
many data set names in each member of the PDS to be listed in seperate PS file to create an inventory for migration of the legacy code

Concat them in SORTIN and run thru SORT and get them in output DAtaset of your choice. What’s seems to be a problem ?

This is definitely not a TSO/ISPF question.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Thu Jun 18, 2020 5:48 pm    Post subject:
Reply with quote

Code:
//*====================================================================
//* JOIN ALL MEMBERS INTO SINGLE STREAM                               
//*====================================================================
//LIST     EXEC PGM=IEBPTPCH                                           
//*                                                                   
//SYSPRINT DD  SYSOUT=*                                               
//SYSUT1   DD  DISP=SHR,DSN=&SYSUID..JCL                   
//SYSUT2   DD  DISP=(NEW,PASS),                                       
//             UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE),                   
//             DSN=&&LISTLIB                                           
//SYSIN    DD  *                                                       
 PRINT TYPORG=PO,MAXFLDS=1                                             
 RECORD FIELD=(80)                                                     
//*                                                                   
//*====================================================================
//* EXTRACT DSNAMES                                                   
//*====================================================================
//EXTRACT  EXEC PGM=SORT,COND=(0,NE)                                   
//*                                                                   
//SYSOUT   DD  SYSOUT=*                                               
//SORTIN   DD  DISP=(OLD,DELETE),DSN=&&LISTLIB                         
//SORTOUT  DD  SYSOUT=*,RECFM=FB                                       
//SYSIN    DD  *                                                       
 INCLUDE COND=(2,80,SS,EQ,C'DSN=',                                     
            OR,2,80,SS,EQ,C'DSNAME=')                                 
 INREC IFTHEN=(WHEN=(2,80,SS,EQ,C'DSN='),                             
               PARSE=(%1=(STARTAFT=C'DSN=',                           
                          ENDBEFR=C',',                               
                          ENDBEFR=C'(',                               
                          ENDBEFR=C' ',                               
                          FIXLEN=44)),                                 
               BUILD=(%1)),                                           
       IFTHEN=(WHEN=(2,80,SS,EQ,C'DSNAME='),                           
               PARSE=(%2=(STARTAFT=C'DSNAME=',                         
                          ENDBEFR=C',',                               
                          ENDBEFR=C'(',                               
                          ENDBEFR=C' ',                               
                          FIXLEN=44)),                                 
               BUILD=(%2))                                             
 SORT FIELDS=(1,44,CH,A)                                               
 SUM FIELDS=NONE                                                       
 END                                                                   
//*                                                                   
//*====================================================================
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Thu Jun 18, 2020 5:56 pm    Post subject:
Reply with quote

Rohit Umarjikar wrote:
This is definitely not a TSO/ISPF question.

It can be done also as ISPF macro, or TSO CLIST, or other 100 tools...
But all those would be almost useless in practical work
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Thu Jun 18, 2020 8:13 pm    Post subject:
Reply with quote

sergeyken wrote:
Code:
//*====================================================================
//* JOIN ALL MEMBERS INTO SINGLE STREAM                               
//*====================================================================
//LIST     EXEC PGM=IEBPTPCH                                           
//*                                                                   
//SYSPRINT DD  SYSOUT=*                                               
//SYSUT1   DD  DISP=SHR,DSN=&SYSUID..JCL                   
//SYSUT2   DD  DISP=(NEW,PASS),                                       
//             UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE),                   
//             DSN=&&LISTLIB                                           
//SYSIN    DD  *                                                       
 PRINT TYPORG=PO,MAXFLDS=1                                             
 RECORD FIELD=(80)                                                     
//*                                                                   
//*====================================================================
//* EXTRACT DSNAMES                                                   
//*====================================================================
//EXTRACT  EXEC PGM=SORT,COND=(0,NE)                                   
//*                                                                   
//SYSOUT   DD  SYSOUT=*                                               
//SORTIN   DD  DISP=(OLD,DELETE),DSN=&&LISTLIB                         
//SORTOUT  DD  SYSOUT=*,RECFM=FB                                       
//SYSIN    DD  *                                                       
 INCLUDE COND=(2,80,SS,EQ,C'DSN=',                                     
            OR,2,80,SS,EQ,C'DSNAME=')                                 
 INREC IFTHEN=(WHEN=(2,80,SS,EQ,C'DSN='),                             
               PARSE=(%1=(STARTAFT=C'DSN=',                           
                          ENDBEFR=C',',                               
                          ENDBEFR=C'(',                               
                          ENDBEFR=C' ',                               
                          FIXLEN=44)),                                 
               BUILD=(%1)),                                           
       IFTHEN=(WHEN=(2,80,SS,EQ,C'DSNAME='),                           
               PARSE=(%2=(STARTAFT=C'DSNAME=',                         
                          ENDBEFR=C',',                               
                          ENDBEFR=C'(',                               
                          ENDBEFR=C' ',                               
                          FIXLEN=44)),                                 
               BUILD=(%2))                                             
 SORT FIELDS=(1,44,CH,A)                                               
 SUM FIELDS=NONE                                                       
 END                                                                   
//*                                                                   
//*====================================================================

I am not sure if this is needed to be coded as this far as TS did not even share how each PDS member looks like which makes the solution unpredictable a this point. If there are only Data sets names in those member then simply copy to a PS (TS can google that) and Jobs is well done.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Thu Jun 18, 2020 8:15 pm    Post subject:
Reply with quote

sergeyken wrote:
Rohit Umarjikar wrote:
This is definitely not a TSO/ISPF question.

It can be done also as ISPF macro, or TSO CLIST, or other 100 tools...
But all those would be almost useless in practical work

Then it needs to go to a CLIST/REXX section but that ain't the intention either of the TS.

This is a moot point until we get sample input data and expected output data form TS otherwise we would just be guessing.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Thu Jun 18, 2020 9:23 pm    Post subject:
Reply with quote

Rohit Umarjikar wrote:
I am not sure if this is needed to be coded as this far as TS did not even share how each PDS member looks like which makes the solution unpredictable a this point. If there are only Data sets names in those member then simply copy to a PS (TS can google that) and Jobs is well done.


Only to demonstrate that neither cbttape, nor any third-party OFFLOAD program is needed.

The TS does hardly understand at all, what other people do ask him, or recommend to him... icon_axe.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2467
Location: NY,USA

PostPosted: Thu Jun 18, 2020 9:28 pm    Post subject:
Reply with quote

sergeyken wrote:
Rohit Umarjikar wrote:
I am not sure if this is needed to be coded as this far as TS did not even share how each PDS member looks like which makes the solution unpredictable a this point. If there are only Data sets names in those member then simply copy to a PS (TS can google that) and Jobs is well done.


Only to demonstrate that neither cbttape, nor any third-party OFFLOAD program is needed.

The TS does hardly understand at all, what other people do ask him, or recommend to him... icon_axe.gif

Agree. Just a suggestion then to keep it simple assuming it has datasets only. (without DSN/DSNMAE in the beginning).
Step-1 :IEBPTPCH
If we use this instead then all we go to do exclude is VMEMBER
Code:
//SYSIN    DD  *     
 PUNCH TYPORG=PO     

Step-2 DFSORT will exclude unwanted records.
Code:
OPTION COPY
OMIT CONDITION=(1,8,CH,EQ,C'VMEMBER')
BUILD=(2,80)
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Thu Jun 18, 2020 10:53 pm    Post subject:
Reply with quote

Rohit Umarjikar wrote:
Agree. Just a suggestion then to keep it simple assuming it has datasets only. (without DSN/DSNMAE in the beginning).
Step-1 :IEBPTPCH
If we use this instead then all we go to do exclude is VMEMBER
Code:
//SYSIN    DD  *     
 PUNCH TYPORG=PO     

Step-2 DFSORT will exclude unwanted records.
Code:
OPTION COPY
OMIT CONDITION=(1,8,CH,EQ,C'VMEMBER')
BUILD=(2,80)

In 99.99% of real situations simple copying of IEBPTPCH results is not enough. If so, no difference between PRINT and PUNCH.

Long time ago I’ve got a problem, I don’t remember, when PUNCH did not give what I wanted; maybe, LRECL was not 80, or something else...

The mentioned PDS might be a library of listings, with RECFM=VBA,LRECL=133, or whatever...
Back to top
View user's profile Send private message
kalyan94

New User


Joined: 17 Jun 2020
Posts: 3
Location: India

PostPosted: Fri Jun 19, 2020 6:17 am    Post subject: This is will help thanks man
Reply with quote

sergeyken wrote:
Code:
//*====================================================================
//* JOIN ALL MEMBERS INTO SINGLE STREAM                               
//*====================================================================
//LIST     EXEC PGM=IEBPTPCH                                           
//*                                                                   
//SYSPRINT DD  SYSOUT=*                                               
//SYSUT1   DD  DISP=SHR,DSN=&SYSUID..JCL                   
//SYSUT2   DD  DISP=(NEW,PASS),                                       
//             UNIT=SYSDA,SPACE=(TRK,(50,50),RLSE),                   
//             DSN=&&LISTLIB                                           
//SYSIN    DD  *                                                       
 PRINT TYPORG=PO,MAXFLDS=1                                             
 RECORD FIELD=(80)                                                     
//*                                                                   
//*====================================================================
//* EXTRACT DSNAMES                                                   
//*====================================================================
//EXTRACT  EXEC PGM=SORT,COND=(0,NE)                                   
//*                                                                   
//SYSOUT   DD  SYSOUT=*                                               
//SORTIN   DD  DISP=(OLD,DELETE),DSN=&&LISTLIB                         
//SORTOUT  DD  SYSOUT=*,RECFM=FB                                       
//SYSIN    DD  *                                                       
 INCLUDE COND=(2,80,SS,EQ,C'DSN=',                                     
            OR,2,80,SS,EQ,C'DSNAME=')                                 
 INREC IFTHEN=(WHEN=(2,80,SS,EQ,C'DSN='),                             
               PARSE=(%1=(STARTAFT=C'DSN=',                           
                          ENDBEFR=C',',                               
                          ENDBEFR=C'(',                               
                          ENDBEFR=C' ',                               
                          FIXLEN=44)),                                 
               BUILD=(%1)),                                           
       IFTHEN=(WHEN=(2,80,SS,EQ,C'DSNAME='),                           
               PARSE=(%2=(STARTAFT=C'DSNAME=',                         
                          ENDBEFR=C',',                               
                          ENDBEFR=C'(',                               
                          ENDBEFR=C' ',                               
                          FIXLEN=44)),                                 
               BUILD=(%2))                                             
 SORT FIELDS=(1,44,CH,A)                                               
 SUM FIELDS=NONE                                                       
 END                                                                   
//*                                                                   
//*====================================================================
Back to top
View user's profile Send private message
steve-myers

Active Member


Joined: 30 Nov 2013
Posts: 859
Location: The Universe

PostPosted: Fri Jun 19, 2020 9:52 am    Post subject:
Reply with quote

sergeyken wrote:
Long time ago I’ve got a problem, I don’t remember, when PUNCH did not give what I wanted; maybe, LRECL was not 80, or something else...

The DCB attributes of the data set specified by the DD statement with DD name SYSUT2 for IEBPTPCH is RECFM=FBA, LRECL=81. Yes, FBA. The "carriage control" for a card punch was a stacker select code for a real card punch. I think HASP/JES2 effectively discarded it and used its preferred stacker.
Back to top
View user's profile Send private message
sergeyken

Active Member


Joined: 29 Apr 2008
Posts: 825
Location: Maryland

PostPosted: Fri Jun 19, 2020 4:58 pm    Post subject:
Reply with quote

steve-myers wrote:
sergeyken wrote:
Long time ago I’ve got a problem, I don’t remember, when PUNCH did not give what I wanted; maybe, LRECL was not 80, or something else...

The DCB attributes of the data set specified by the DD statement with DD name SYSUT2 for IEBPTPCH is RECFM=FBA, LRECL=81. Yes, FBA. The "carriage control" for a card punch was a stacker select code for a real card punch. I think HASP/JES2 effectively discarded it and used its preferred stacker.

The problem was caused by the INPUT library, not by the output DCB...
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 -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Members search in PDS Dilipmg05 JCL & VSAM 9 Wed Sep 16, 2020 11:29 pm
No new posts How to fetch the latest record from a... Dinesh Mani DFSORT/ICETOOL 8 Tue Jun 02, 2020 5:34 pm
No new posts Finding Esoteric Unit Names Programma... schippsid All Other Mainframe Topics 2 Mon May 04, 2020 9:11 pm
No new posts what is the DSORG(Datset orgnisation)... sandeep prajapati JCL & VSAM 8 Mon Mar 30, 2020 9:09 pm
No new posts IEBGENER is not Creating Member in PD... sandeep prajapati JCL & VSAM 7 Mon Mar 23, 2020 11:50 pm

Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us