Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Insert strings thru' ISPF commands

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> TSO/ISPF
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    Post subject: Insert strings thru' ISPF commands
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

Moderator


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

PostPosted: Mon Jun 24, 2013 6:20 pm    Post subject:
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    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 24, 2013 6:33 pm    Post subject:
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: 656
Location: Whitby, ON, Canada

PostPosted: Mon Jun 24, 2013 7:41 pm    Post subject:
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: 8593
Location: Back in jolly old England

PostPosted: Mon Jun 24, 2013 7:47 pm    Post subject:
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

Moderator


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

PostPosted: Mon Jun 24, 2013 8:01 pm    Post subject:
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    Post subject: Reply to: Insert strings thru' ISPF commands
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

Senior Member


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

PostPosted: Mon Jun 24, 2013 9:20 pm    Post subject: Reply to: Insert strings thru' ISPF commands
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: 686
Location: Earth

PostPosted: Mon Jun 24, 2013 9:37 pm    Post subject:
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    Post subject:
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    Post subject:
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: 686
Location: Earth

PostPosted: Wed Jun 26, 2013 9:52 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> TSO/ISPF All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts saving your settings in ISPF. VintageReceiver TSO/ISPF 9 Wed Jul 26, 2017 6:42 pm
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts Occurrence of various strings within ... TS70363 JCL & VSAM 1 Thu Apr 27, 2017 8:18 pm
No new posts Strings with double quotes having pro... raja Arumugam All Other Mainframe Topics 11 Thu Mar 30, 2017 10:34 am
No new posts Customizing the ISPF HILITE Command Pedro TSO/ISPF 3 Fri Mar 03, 2017 11:49 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us