IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Fetch the Dataset names from inside members of PDS


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
kalyan94

New User


Joined: 17 Jun 2020
Posts: 4
Location: India

PostPosted: Wed Jun 17, 2020 2:06 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Wed Jun 17, 2020 4:57 pm
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: 4
Location: India

PostPosted: Wed Jun 17, 2020 6:06 pm
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: 1312
Location: Vilnius, Lithuania

PostPosted: Wed Jun 17, 2020 7:26 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Wed Jun 17, 2020 8:40 pm
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: 2454
Location: Hampshire, UK

PostPosted: Wed Jun 17, 2020 9:15 pm
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 Member


Joined: 01 Sep 2015
Posts: 725
Location: Denmark

PostPosted: Thu Jun 18, 2020 2:13 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Thu Jun 18, 2020 5:24 pm
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: 3075
Location: NYC,USA

PostPosted: Thu Jun 18, 2020 5:44 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Thu Jun 18, 2020 5:48 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Thu Jun 18, 2020 5:56 pm
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: 3075
Location: NYC,USA

PostPosted: Thu Jun 18, 2020 8:13 pm
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: 3075
Location: NYC,USA

PostPosted: Thu Jun 18, 2020 8:15 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Thu Jun 18, 2020 9:23 pm
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: 3075
Location: NYC,USA

PostPosted: Thu Jun 18, 2020 9:28 pm
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

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Thu Jun 18, 2020 10:53 pm
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: 4
Location: India

PostPosted: Fri Jun 19, 2020 6:17 am
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: 917
Location: The Universe

PostPosted: Fri Jun 19, 2020 9:52 am
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

Senior Member


Joined: 29 Apr 2008
Posts: 2120
Location: USA

PostPosted: Fri Jun 19, 2020 4:58 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts batch SFTP job using AOPBATCH unable ... All Other Mainframe Topics 7
No new posts Reading Empty Dataset DFSORT/ICETOOL 5
No new posts Mainframe Dataset Binary or ASCII Mainframe Interview Questions 4
No new posts SPOOL to Mainframe dataset in batch mode JCL & VSAM 7
No new posts To fetch records that has Ttamp value... DFSORT/ICETOOL 5
Search our Forums:

Back to Top