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

Sort to extract lines


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
markzasz

New User


Joined: 04 Apr 2017
Posts: 8
Location: USA

PostPosted: Fri Jun 11, 2021 4:51 pm
Reply with quote

Hello,

I have a datasets that contains 22 millions lines and 450,000 IDCMAS Define statements along with many other commands. I would like to scan the dataset and create multiple output files that contain the Define statements based on the usercatalog.

my defines look like this in the dataset.

Code:
/* DEFINE -
NONVSAM( -
NAME(PCMSS.MS3AT.EXTRACT.INDX.BASE.G0001V00) -
RECATALOG -
VOLUMES(MG4W12) -
DEVICETYPES(3390) -
) -
CATALOG(CATALOG.DZOSPLX.PROD05);


So when you find "/* DEFINE"
- save DEFINE and the next 7 lines
- and write the saved info to one of five output files.

the reason for five output files is we have 5 User Catalogs that these defines are going to and we would like to break the defines up by User Cataloag.

Thank you,

Mark...
Code'd for you
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 518
Location: Bamberg, Germany

PostPosted: Fri Jun 11, 2021 5:07 pm
Reply with quote

In general you should have some DEFINEs with more than one volume. With SORT you can IFTHEN GROUP with BEGIN and END.

Please post what you have tried and make use of code tags for data/code.
Back to top
View user's profile Send private message
sergeyken
Warnings : 2

Senior Member


Joined: 29 Apr 2008
Posts: 1084

PostPosted: Fri Jun 11, 2021 6:40 pm
Reply with quote

The post includes only the description of the task without any question…


I consider this as one more story like “One day in the life of a software developer”

Thank you very much for sharing your feelings about your IT life. 2014.gif 358.gif
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2678
Location: NYC,USA

PostPosted: Fri Jun 11, 2021 7:22 pm
Reply with quote

looks like REXX/COBOL stuff would be easier and flexible.
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 518
Location: Bamberg, Germany

PostPosted: Fri Jun 11, 2021 8:44 pm
Reply with quote

Rohit Umarjikar wrote:
looks like REXX/COBOL stuff would be easier and flexible.

This is simple SORT stuff and does not need any additional programming IMHO. The DEFINE misses the closing comment, I am confident it's there. Use IFTHEN WHEN=GROUP BEGIN and END to filter for the individual sections. Do NOT rely on the fact that each section has 7 lines, if it looks too good to be true - it wont be.
Back to top
View user's profile Send private message
markzasz

New User


Joined: 04 Apr 2017
Posts: 8
Location: USA

PostPosted: Fri Jun 11, 2021 8:46 pm
Reply with quote

thank you all for your input.... i will be seeking another alternative......
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2678
Location: NYC,USA

PostPosted: Fri Jun 11, 2021 9:44 pm
Reply with quote

Joerg.Findeisen wrote:
Rohit Umarjikar wrote:
looks like REXX/COBOL stuff would be easier and flexible.

This is simple SORT stuff and does not need any additional programming IMHO. The DEFINE misses the closing comment, I am confident it's there. Use IFTHEN WHEN=GROUP BEGIN and END to filter for the individual sections. Do NOT rely on the fact that each section has 7 lines, if it looks too good to be true - it wont be.
Wasnt a ask to create dynamic data sets per each /* DEFINE break? or I misunderstood the ask ?
Back to top
View user's profile Send private message
Joerg.Findeisen

Active Member


Joined: 15 Aug 2015
Posts: 518
Location: Bamberg, Germany

PostPosted: Fri Jun 11, 2021 9:58 pm
Reply with quote

Rohit Umarjikar wrote:
Wasn't a ask to create dynamic data sets per each /* DEFINE break? or I misunderstood the ask ?

Five Catalogs to split the data for. Sorry when I have my picture of what (I would have) to do here. The task itself seems simple.
Back to top
View user's profile Send private message
Rohit Umarjikar

Global Moderator


Joined: 21 Sep 2010
Posts: 2678
Location: NYC,USA

PostPosted: Fri Jun 11, 2021 10:36 pm
Reply with quote

I get it now and I agree DFSORT would be simple to split 5 DEFINEs +7 lines into 5 catalogs.
Earlier, I thought of more hence suggested programmatic approach.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
This topic is locked: you cannot edit posts or make replies. REXX to find /* Define and write the ... CLIST & REXX 5
No new posts SORT - Multiple Conditions DFSORT/ICETOOL 4
No new posts SYNCSORT/ICETOOL JOINKEYS SORT Statem... DFSORT/ICETOOL 13
No new posts Installing sort utilities on hercules... DFSORT/ICETOOL 4
No new posts Extract 2 more lines below line that ... DFSORT/ICETOOL 2
Search our Forums:

Back to Top