|
View previous topic :: View next topic
|
| Author |
Message |
kalyan94
New User
Joined: 17 Jun 2020 Posts: 4 Location: India
|
|
|
|
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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
kalyan94
New User
Joined: 17 Jun 2020 Posts: 4 Location: India
|
|
|
|
| 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 |
|
 |
prino
Senior Member

Joined: 07 Feb 2009 Posts: 1323 Location: Vilnius, Lithuania
|
|
|
|
And your organisation put you in charge of a migration process?
What a bunch of idiot PHB's! |
|
| Back to top |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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???!!  |
|
| Back to top |
|
 |
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
| 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 |
|
 |
Willy Jensen
Active Member

Joined: 01 Sep 2015 Posts: 772 Location: Denmark
|
|
|
|
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| 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 |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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...  |
|
| Back to top |
|
 |
Rohit Umarjikar
Global Moderator

Joined: 21 Sep 2010 Posts: 3109 Location: NYC,USA
|
|
|
|
| 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...  |
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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
kalyan94
New User
Joined: 17 Jun 2020 Posts: 4 Location: India
|
|
|
|
| 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 |
|
 |
steve-myers
Active Member
Joined: 30 Nov 2013 Posts: 917 Location: The Universe
|
|
|
|
| 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 |
|
 |
sergeyken
Senior Member

Joined: 29 Apr 2008 Posts: 2263 Location: USA
|
|
|
|
| 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 |
|
 |
|
|
 |
All times are GMT + 6 Hours |
|