View previous topic :: View next topic
|
Author |
Message |
dilipan
New User
Joined: 09 Mar 2011 Posts: 5 Location: india
|
|
|
|
i have thousands of record in a ps.i want to read only the particular records where labels have been set. |
|
Back to top |
|
|
prino
Senior Member
Joined: 07 Feb 2009 Posts: 1315 Location: Vilnius, Lithuania
|
|
|
|
Records in a PS do not have labels, problem solved. |
|
Back to top |
|
|
dilipan
New User
Joined: 09 Mar 2011 Posts: 5 Location: india
|
|
|
|
thank you... |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
dilipan
New User
Joined: 09 Mar 2011 Posts: 5 Location: india
|
|
|
|
.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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
> 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 |
|
|
dilipan
New User
Joined: 09 Mar 2011 Posts: 5 Location: india
|
|
|
|
hi
i have attached the input what i am given and also attached output what i need. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
Kjeld
Active User
Joined: 15 Dec 2009 Posts: 365 Location: Denmark
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
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 |
|
|
daveporcelan
Active Member
Joined: 01 Dec 2006 Posts: 792 Location: Pennsylvania
|
|
|
|
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 |
|
|
Pedro
Global Moderator
Joined: 01 Sep 2006 Posts: 2593 Location: Silicon Valley
|
|
|
|
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 |
|
|
Nic Clouston
Global Moderator
Joined: 10 May 2007 Posts: 2454 Location: Hampshire, UK
|
|
|
|
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 |
|
|
|