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

Insert strings thru' ISPF commands


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

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Mon Jun 24, 2013 6:14 pm
Reply with quote

Consider my file has this data -

0092138C
8393293C
3923933C

With this data, I need to build queries as given below -

DELETE FROM TABLENAME WHERE FIELD_ONE='009213' and FIELD_TWO='8C';
DELETE FROM TABLENAME WHERE FIELD_ONE='839329' and FIELD_TWO='3C';
DELETE FROM TABLENAME WHERE FIELD_ONE='392393' and FIELD_TWO='3C';

I usually write a SORT or download it to textpad to build queries. Is it possible to do this with ISPF commands?
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Jun 24, 2013 6:20 pm
Reply with quote

Through Rexx it should be achievable
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Mon Jun 24, 2013 6:21 pm
Reply with quote

With ISPF commands? icon_smile.gif
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Jun 24, 2013 6:33 pm
Reply with quote

Yes, but why would you want to use ISPF commands when native REXX will do the same thing.

You have the input record layout defined, so just parse that and insert it into the command syntax.
Back to top
View user's profile Send private message
don.leahy

Active Member


Joined: 06 Jul 2010
Posts: 765
Location: Whitby, ON, Canada

PostPosted: Mon Jun 24, 2013 7:41 pm
Reply with quote

I have used Rexx programs to do this sort of thing, but lately I have been using SORT. IMO it is by far the easiest way to do it, and I am a lazy programmer who always tries to find the easiest way to do anything.
Back to top
View user's profile Send private message
expat

Global Moderator


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

PostPosted: Mon Jun 24, 2013 7:47 pm
Reply with quote

don.leahy wrote:
I have used Rexx programs to do this sort of thing, but lately I have been using SORT. IMO it is by far the easiest way to do it, and I am a lazy programmer who always tries to find the easiest way to do anything.
I'd call that being efficiency concious icon_biggrin.gif
Back to top
View user's profile Send private message
Pandora-Box

Global Moderator


Joined: 07 Sep 2006
Posts: 1592
Location: Andromeda Galaxy

PostPosted: Mon Jun 24, 2013 8:01 pm
Reply with quote

why not generate the file as

Code:
DELETE FROM TABLENAME WHERE FIELD_ONE='009213' and FIELD_TWO='8C';
DELETE FROM TABLENAME WHERE FIELD_ONE='839329' and FIELD_TWO='3C';
DELETE FROM TABLENAME WHERE FIELD_ONE='392393' and FIELD_TWO='3C';


Rather than

Code:
0092138C
8393293C
3923933C
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Mon Jun 24, 2013 8:14 pm
Reply with quote

Yes.. I can generate the file with the necessary queries instead of the values only..

And ofcourse, there is always DFSORT which makes these sort of things to be easily done...

I came across few ispf commands like P'.', P'=', p'>' , TS (text split), TF80(to change the record length) etc.. So, I was just curious to know if it was possible thru' ispf commands..
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Mon Jun 24, 2013 9:20 pm
Reply with quote

Your examples are editor commands, not ISPF commands.

To answer your question, yes, most of it can be done with editor commands:
bounds
shift
overlay
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Mon Jun 24, 2013 9:37 pm
Reply with quote

Hi Richy,
If I understand correctly, you don't want a macro.. just a series of ISPF editor commands. In one word, answer is yes.
Try this -
BNDS 7 72
BLOCK SHIFT 55 (This should take the last two chars to desired column)
(This is not editor command. You will have to select the lines and use )) to shift the block)
BNDS 1 60
BLOCK SHIFT 39

C ALL P'===============' 1 'DELETE FROM '
C ALL P'===============' 13 'TABLENAME WHERE'
C ALL P'=' 29 "FIELD_ONE='"
You get the idea..
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Mon Jun 24, 2013 10:19 pm
Reply with quote

thank you all for the responses...
agkshirsagar.. i would try this tomorrow.. icon_smile.gif
Back to top
View user's profile Send private message
Richy12

New User


Joined: 29 May 2013
Posts: 22
Location: India

PostPosted: Wed Jun 26, 2013 9:26 am
Reply with quote

It worked. Thank you once again:)
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 691
Location: Earth

PostPosted: Wed Jun 26, 2013 9:52 pm
Reply with quote

Glad to know it helped!
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 Preserve changes to ISPF Panel Variables TSO/ISPF 5
No new posts can an ISPF appl save user changes in... TSO/ISPF 14
No new posts Unload and Load ISPF Table TSO/ISPF 4
No new posts ISPF Table to add a new column TSO/ISPF 1
No new posts Looking for a little history of ISPF ... TSO/ISPF 5
Search our Forums:

Back to Top