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: 1529
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: 641
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: 1529
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: 2019
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: 685
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: 685
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 FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts ISPF program to set SCRNAME prino TSO/ISPF 5 Fri Sep 30, 2016 2:18 pm
No new posts I am unable to use SWAPBAR ON command... mrsidhu12 TSO/ISPF 3 Thu Sep 01, 2016 1:10 pm
No new posts Insert Lines in JCL with Rexx after a... Willy Jensen CLIST & REXX 3 Tue Aug 30, 2016 4:18 pm
No new posts How to insert a lengthy string havin... vidyaa DB2 7 Thu Aug 25, 2016 5:20 pm


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