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

to read particular files where labels have been set


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

New User


Joined: 09 Mar 2011
Posts: 5
Location: india

PostPosted: Mon Mar 14, 2011 12:10 pm
Reply with quote

i have thousands of record in a ps.i want to read only the particular records where labels have been set.
Back to top
View user's profile Send private message
prino

Senior Member


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

PostPosted: Mon Mar 14, 2011 2:47 pm
Reply with quote

Records in a PS do not have labels, problem solved.
Back to top
View user's profile Send private message
dilipan

New User


Joined: 09 Mar 2011
Posts: 5
Location: india

PostPosted: Mon Mar 14, 2011 2:50 pm
Reply with quote

thank you...
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Mon Mar 14, 2011 7:50 pm
Reply with quote

Hello,

Now, if you post a bit of sample input data and explain the output you want from this sample data, someone may have a suggestion. . .
Back to top
View user's profile Send private message
dilipan

New User


Joined: 09 Mar 2011
Posts: 5
Location: india

PostPosted: Tue Mar 15, 2011 9:24 am
Reply with quote

.A 001
000002 002
.B 003
000004 004
000005 005
.D 006
000007 007
000008 008
.C 009
000010 010

i want to retreive only the record which i have set label like .a,.b,.c,.d
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Mar 15, 2011 9:50 am
Reply with quote

Hello,

Read the file.

If the first position of the record is a period (.), do whatever otherwise read the next record.

If this does not answer what you want to do, show the sample output from this sample input.

Also, is there some reason rexx has been chosen?
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Mar 15, 2011 9:57 am
Reply with quote

> records where labels have been set.

It looks very much like the labels are only in the editor session... please clarify if that is the environment.

note: the labels do not actually exist in the dataset. That is, you cannot save the dataset with the labels.

To find editor labels, use an editor macro with:
Code:

Address ISREDIT
rc = 0
Do while (RC = 0)
  "LOCATE NEXT LABEL"
  If rc = 0 THen
     . . .
End
Back to top
View user's profile Send private message
dilipan

New User


Joined: 09 Mar 2011
Posts: 5
Location: india

PostPosted: Tue Mar 15, 2011 10:07 am
Reply with quote

hi
i have attached the input what i am given and also attached output what i need.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Tue Mar 15, 2011 8:01 pm
Reply with quote

Hello,

You need to re-post your data using copy/paste and the "Code" tag (as Pedro has done). There is no reason to post "screenshots" to show 3270-screen data. . .

Then explain how the "output" was determined. It is surely not obvious line 000002 was chosen/generated/whatever. . .
Back to top
View user's profile Send private message
Kjeld

Active User


Joined: 15 Dec 2009
Posts: 365
Location: Denmark

PostPosted: Tue Mar 15, 2011 11:06 pm
Reply with quote

The attached screenshots are in reverse order. Top one is the output, bottom one the input.

This presumes that you want all lines in your edit session which have no prefix labels deleted, isn't that so?

Pedro has already posted the logic to test if a label is set or not...

So the process is: Open the dataset for edit, mark the lines to be retained with labels (You might even define block labels). Run the macro. Save the dataset. You can repeat the labeling and macro execution until satisfied.
If you accidently delete records, you have to use the UNDO command, or possibly cancel edit and start over.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Tue Mar 15, 2011 11:15 pm
Reply with quote

I suggest the following:

1. add your labels
2. EXCLUDE ALL
3. run macro that locates all labels
4. DELETE ALL X

You can add 2 and 4 to the sample macro.

NOTE: the initial post only mentioned reading particular lines, but the sample output shows the deletion of many records. You need to re-evaluate whether you really want to delete records.
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19243
Location: Inside the Matrix

PostPosted: Wed Mar 16, 2011 12:46 am
Reply with quote

Thanks Kjeld,

Quote:
The attached screenshots are in reverse order. Top one is the output, bottom one the input.
Tough to break my mind from habit. . . Input first - then output - Aaargh. . .

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

Active Member


Joined: 01 Dec 2006
Posts: 792
Location: Pennsylvania

PostPosted: Wed Mar 16, 2011 1:18 am
Reply with quote

This is the typical thread lately.

Topic Starter gives a vauge and incomplete requirement.

The experts swoop in with thier crystal balls and take guesses as to the real requirement. They ask for more information in a effort to get a better understanding of the requirement.

Topic starter gives little tidbits of semi-useful information, usually ignoring the questions for useful information from the experts.

Topic starter looses interest while experts continue with questions and solutions.

Now to this case:

Why are you using labels to identify the lines you want to save?

It is my understanding that labels only stay for the current edit session.
With this being the case, you have one shot to identify your data out of thousands of lines.

It may work better to overlay the zero in position 1 with a K to mark the rows you want to keep.

You can then use commands like Pedro mentioned above.

You can then change all the Ks back to zero afterwards.

I think this is yet another case of the Topic starter, coming up with a ill fated solution, and trying to find a way to make it work.

The forum is much better when the real and complete requirement is clearly stated, so valuable suggestions can be given.
Back to top
View user's profile Send private message
Pedro

Global Moderator


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

PostPosted: Wed Mar 16, 2011 7:38 pm
Reply with quote

Quote:
Topic starter looses interest while ...


Another factor in this instance is that the topic was moved to a different forum. I think moving it during the discussion will confuse newcomers. I think it should be moved, but only after it becomes stale.
Back to top
View user's profile Send private message
Nic Clouston

Global Moderator


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

PostPosted: Thu Mar 17, 2011 12:21 am
Reply with quote

No - move it but pm the OP to say it has been moved and why. This could help them to post correctly next time they haven't googled, read the manuals, read their output messages etc.
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 3 files concatenated to 1 DFSORT/ICETOOL 2
No new posts JCL sort to compare dates in two file... DFSORT/ICETOOL 2
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts Compare 2 files and write Matched/Unm... JCL & VSAM 8
No new posts Error to read log with rexx CLIST & REXX 11
Search our Forums:

Back to Top