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

TRIM everything from input, output contains only DSN name.


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

New User


Joined: 06 Feb 2014
Posts: 7
Location: India

PostPosted: Fri Apr 19, 2024 6:12 pm
Reply with quote

Hi,

I have following input file which contains the dsn=<dsname> and information about it, I want to trim part after "dsn=" and trim everything after <dsname> as well and want to have only <dsname> in output file.

Can anyone please suggest, if this can be achieved using SORT, or should I better go for REXX ?

Input Looks like =

[dsn=AAA.BBB.LOAD is not catalogued or does not exist on volser=******
dsn=BBB.CCC.LIB is not catalogued or does not exist on volser=******
dsn=CCC.DDD.LOADLIB is not catalogued or does not exist on volser=****
dsn=DDD.EEEE.LOAD is not catalogued or does not exist on volser=*****
dsn=EEEE.DDDD.LINK is not catalogued or does not exist on volser=*****
dsn=FFFFF.GGGGG.HHHHH.LOADLIB is not catalogued or does not exist on volser=***** ]

Output should look a like =

[AAA.BBB.LOAD
BBB.CCC.LIB
CCC.DDD.LOADLIB
DDD.EEEE.LOAD
EEEE.DDDD.LINK
FFFFF.GGGGG.HHHHH.LOADLIB]

Please suggest. Thanks in Advance,
Back to top
View user's profile Send private message
Joerg.Findeisen

Senior Member


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

PostPosted: Fri Apr 19, 2024 9:31 pm
Reply with quote

For the sample data provided, this works:
Code:
OPTION COPY                                                     
INREC IFTHEN=(WHEN=INIT,                                         
  FINDREP=(IN=(C'dsn=',                                         
     C' is not catalogued or does not exist on volser=******'), 
           OUT=(C'')))                                           
END

Code:
****** ********************
000001 [AAA.BBB.LOAD       
000002 BBB.CCC.LIB         
000003 CCC.DDD.LOADLIB     
000004 DDD.EEEE.LOAD       
000005 EEEE.DDDD.LINK]     
****** ********************


To make it work for varying volser names and/or descriptions, use PARSE instead.

Remember to use code tags when providing code or data to the forum icon_exclaim.gif
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
No new posts COBOL sorting, with input GDG base COBOL Programming 7
No new posts REXX/CMS How to place command console... CLIST & REXX 4
No new posts Reroute print output via REXX/SDSF TSO/ISPF 6
No new posts Concatenate 2 input datasets and give... JCL & VSAM 2
No new posts How to turn off 'ACTION' SDSF output ... TSO/ISPF 2
Search our Forums:

Back to Top