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

Filename Edit from 3.4 console


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

New User


Joined: 29 Oct 2014
Posts: 7
Location: India

PostPosted: Thu Oct 30, 2014 5:04 pm
Reply with quote

In ISPF 3.4 panel after pressing enter, I want to execute a command by the side of the file name which would change the first qualifier of the file and replace it with my User ID.

I have got the file name from the console window and I need to manipulate the file name and create the output file as below. Is this possible.

For example : XXX.CCC.FFF is the file

(MYID).CCC.FFF should be the output file.


Thank you
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Oct 30, 2014 5:28 pm
Reply with quote

Yes, it is possible. Something I have done before but don't have access to the MF for this contract so can't test anything.

BEWARE - Only if you are absolutely certain that the same user catalog is related to both aliases should you use the RENAME command.
OTHERWISE perform a copy to the new dataset name and only when that has completed perform the DELETE of the original dataset.
Back to top
View user's profile Send private message
rookie 1987

New User


Joined: 29 Oct 2014
Posts: 7
Location: India

PostPosted: Thu Oct 30, 2014 5:52 pm
Reply with quote

Will you please throw some light on how to identify and delete the first qualifier of the file . I believe we can achieve it by WORD function in REXX. Any similar function that can be used here to achieve it ?

Thank you
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Thu Oct 30, 2014 6:07 pm
Reply with quote

Code:
hlq = word(translate(dsname, '.', ' '), 1)
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Thu Oct 30, 2014 6:09 pm
Reply with quote

Look at the ALTER command entered on the DSN line from 3.4

However, as stated earlier check the "alias relates" to avoid potential catalog mismatch problems.
Back to top
View user's profile Send private message
rookie 1987

New User


Joined: 29 Oct 2014
Posts: 7
Location: India

PostPosted: Thu Oct 30, 2014 6:54 pm
Reply with quote

Robert ,

I believe your code works in REXX.
I am getting the filename dynamically from 3.4 panel

PROC 1 DSN
SET hlq = word(translate(&DSN, '.', ' '), 1) - this doesn't work

Hence this doesn't work. Any other ways to accomplish my requirement.

Thank you
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Thu Oct 30, 2014 7:05 pm
Reply with quote

I am not sure what a 'console window' is but why not use the Rename command available in 3.4 (paying heed to the caveats written about by Expat).

You never mentioned actually writing a program to do this but as you are - why are you using CLIST and not Rexx?
Back to top
View user's profile Send private message
rookie 1987

New User


Joined: 29 Oct 2014
Posts: 7
Location: India

PostPosted: Thu Oct 30, 2014 7:41 pm
Reply with quote

By Console window , I meant after 3.4, giving the dataset and pressing enter, the window that I get

I'm trying to get the file name from 3.4 , rather than executing a REXX(say TSO rexx command). I prefer getting the file name and use it for manipulation downstream.

Suppose somebody gets to 3.4 and type this command, he should perform the operation seamlessly rather than give a TSO command.

Thank you
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Thu Oct 30, 2014 7:45 pm
Reply with quote

Ever thought about pressing PF1 when on the 3.4 screen, and then selecting option 2?

Code:
 TUTORIAL--------- DISPLAYED LIST - TSO COMMANDS/CLISTS/EXECS ----------TUTORIAL
 COMMAND ===>

   You can use TSO commands and CLISTs as data set list line commands.

   For example, if you specify the TSO command LIST to the left of data
   set USER.TEST.DATA, the effect will be the same as if you had entered
   TSO LIST 'USER.TEST.DATA' on the COMMAND line.

   The quoted fully-qualified data set name will be appended to the line
   command during command expansion unless either the '/' character is used
   or the unquoted fully-qualified data set name is the first argument of
   the command.

   If a TSO command, CLIST, or REXX exec issues a return code greater
   than or equal to 8, processing will stop and an error message will be
   displayed.

                           (continued on next page)
Back to top
View user's profile Send private message
rookie 1987

New User


Joined: 29 Oct 2014
Posts: 7
Location: India

PostPosted: Thu Oct 30, 2014 7:58 pm
Reply with quote

Very much

I know the rename works either ways but my requirement is to delete the first qualifier and then replace with my Userid.

Thank you
Back to top
View user's profile Send private message
Marso

REXX Moderator


Joined: 13 Mar 2006
Posts: 1353
Location: Israel

PostPosted: Thu Oct 30, 2014 8:09 pm
Reply with quote

rookie 1987 wrote:
Will you please throw some light on how to identify and delete the first qualifier of the file.
PARSE will make it easier (supposing it's rexx):
Code:
parse var dsname oldhlq '.' whatsleftofthedsname
newdsname = userid()'.'whatsleftofthedsname


rookie 1987 wrote:
By Console window , I meant after 3.4, giving the dataset and pressing enter, the window that I get
Place "smiley tearing his hair off" here.
Back to top
View user's profile Send private message
rookie 1987

New User


Joined: 29 Oct 2014
Posts: 7
Location: India

PostPosted: Thu Oct 30, 2014 8:57 pm
Reply with quote

Thanks Marso, I have the rexx code with me that works but just wanted to accomplish this by combination of tso commands.

Thank you
Back to top
View user's profile Send private message
daveporcelan

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Thu Oct 30, 2014 11:27 pm
Reply with quote

From the American movie Cool Hand Luke:
What we've got here is a failure to communicate

I know there is a language barrier, but this is the most non-understandable statement ever:


Quote:
By Console window , I meant after 3.4, giving the dataset and pressing enter, the window that I get

I'm trying to get the file name from 3.4 , rather than executing a REXX(say TSO rexx command). I prefer getting the file name and use it for manipulation downstream.

Suppose somebody gets to 3.4 and type this command, he should perform the operation seamlessly rather than give a TSO command


What dataset are you giving? They are all listed on the screen
Manipulating downstream where?
Type what command?

You need to hit the books and understand how Rexx and TSO commands work.



Quote:
Thanks Marso, I have the rexx code with me that works but just wanted to accomplish this by combination of tso commands.


If you have a Rexx that works, then what do you want that is different?

icon_cry.gif
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Oct 31, 2014 8:47 pm
Reply with quote

Quote:
I know the rename works either ways but my requirement is to delete the first qualifier and then replace with my Userid.


Can you clarify your requirement? 'Replacing the the HLQ with your userid' sound very much like you want to rename the data set. If you do not want to rename the data set, where do you want the replacing to occur?
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Fri Oct 31, 2014 8:51 pm
Reply with quote

Quote:
I believe your code works in REXX.
I am getting the filename dynamically from 3.4 panel

PROC 1 DSN
SET hlq = word(translate(&DSN, '.', ' '), 1) - this doesn't work

Hence this doesn't work. Any other ways to accomplish my requirement.

It does not work because you are adding rexx syntax into a CLIST. The 'other way' you ask for is to actually use a rexx program instead of a clist.
Back to top
View user's profile Send private message
rookie 1987

New User


Joined: 29 Oct 2014
Posts: 7
Location: India

PostPosted: Sun Nov 02, 2014 10:43 am
Reply with quote

Thank you and that worked
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Nov 03, 2014 12:54 am
Reply with quote

Quote:
BEWARE - Only if you are absolutely certain that the same user catalog is related to both aliases should you use the RENAME command.


Hello, Could you please explain why this should not be done?
I have done a lot of renames in my career without knowing the above precaution. And I have not run into any problems doing so. Or atleast I was not noticing that I was messing up the catalog.
Any layman explanation is welcome.

Thank you,
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Mon Nov 03, 2014 3:11 pm
Reply with quote

I believe that this may have been fixed in later releases, but when you did a rename in 3.4 the original dataset was catalog'd in a user catalog and upon rename was left in the original catalog, which may not have the alias from the master catalog pointing to that catalog.

Caused quite a few problems many years ago
Back to top
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Mon Nov 03, 2014 4:25 pm
Reply with quote

Hello Expat,
I renamed one of my user dataset and changed it to some other HLQ.
The dataset usercat automatically switched to the new HLQ's usercat.

Guess the issue has been fixed.

Regards,
Vasanth.S
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 Query on edit primary command CLIST & REXX 5
No new posts Query on edit primary command CLIST & REXX 1
No new posts Need help to resolve a hard edit COBOL Programming 8
This topic is locked: you cannot edit posts or make replies. Need help to resolve a hard edit COBOL Programming 4
No new posts create rexx edit Macro that edits the... CLIST & REXX 3
Search our Forums:

Back to Top