View previous topic :: View next topic |
Author |
Message |
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Mon Oct 27, 2014 7:51 am Post subject: Problem with CHANGE command |
|
|
This seems really stupid, but I'm obviously missing something somewhere.
I have a simple sequential file with 81 characters in it. The first 4 are garbage that I want to remove. I've tried everything (?) but keep on failing on the actual change command. The data looks like this
Code: |
` X1002.00S21+00040CRE-WIRATG-IPDK-001 00+0000M23+00029SHBGG507 0
0500EFFFF4FFEFF4FFFFFCDC6ECDCEC6CDCD6FFF44444FF4FFFFDFF4FFFFFECCCCFFF44F
013071002B00221E0004039506991370974200010000000E0000423E0002928277507000
|
and scrolling to the right I have
Code: |
300000018
FFFFFFFFF
300000018
|
I have set the bounds to 1 81, but when I try the change command (either as cha p'====' '' or cha '00510300'x '') I suddenly see the 4 bytes I want removed being inserted as extra blanks after the IPDK-001 as shown here
Code: |
X1002.00S21+00040CRE-WIRATG-IPDK-001 00+0000M23+00029SHBGG507 0
EFFFF4FFEFF4FFFFFCDC6ECDCEC6CDCD6FFF444444444FF4FFFFDFF4FFFFFECCCCFFF44F
71002B00221E00040395069913709742000100000000000E0000423E0002928277507000
|
Can anyone point me in the right direction as to what I'm doing wrong ? _________________ Michael |
|
Back to top |
|
 |
Terry_Heinze Supermod
Joined: 31 May 2004 Posts: 391 Topics: 4 Location: Richfield, MN, USA
|
Posted: Mon Oct 27, 2014 8:22 am Post subject: |
|
|
Those 1st 4 bytes look like the RDW of a variable length record. X'0051' = decimal 81 and X'0300' = decimal 768. I don't think the RDW of a varible length record is available for editing. If you want to remove it, I think you'll need to copy this VB file to an FB one. It would help if you had done a "col" in your editing session to make it easier for us to see the exact columns. _________________ ....Terry |
|
Back to top |
|
 |
William Collins Supermod
Joined: 03 Jun 2012 Posts: 437 Topics: 0
|
Posted: Mon Oct 27, 2014 9:23 am Post subject: |
|
|
That first lump of characters are being treated as a "word" contiguous with what you want to remove. The "word" will be shifted left/right if the replacement is shorter/longer and will leave the next "word" alone, unless the change makes the first word long enough such that it would otherwise "crash" into the second word, when the second word will be shifted right with one space between the two words.
If you just want to chop off the first four bytes of a line/block try (4/((4 in the line command area. You will receive the four blanks at finishing at the end of the bounds. |
|
Back to top |
|
 |
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Tue Oct 28, 2014 6:30 am Post subject: |
|
|
Terry - they're actually the outgoing result from an IMS transaction, so the length would be the length of the trans. The file is already FB (91 bytes). Sorry that I can't seem to upload an attachment showing the layout, but the first X is in column 5
William - I should have mentioned that I'm trying to remove those 4 bytes via an edit macro (which is when I started seeing the "problem"). To my knowledge, you can't (?) do a (4 as a prefix command in a macro _________________ Michael |
|
Back to top |
|
 |
misi01 Advanced
Joined: 02 Dec 2002 Posts: 629 Topics: 176 Location: Stockholm, Sweden
|
Posted: Tue Oct 28, 2014 6:45 am Post subject: |
|
|
Quick append to the previous one. After googling, I found the following command (no idea it existed)
Code: |
"SHIFT ( .zcsr "i - 1
|
where i was (in this case) 5.
That did the trick _________________ Michael |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12378 Topics: 75 Location: San Jose
|
Posted: Tue Oct 28, 2014 10:38 am Post subject: |
|
|
misi01 wrote: | William - I should have mentioned that I'm trying to remove those 4 bytes via an edit macro (which is when I started seeing the "problem"). To my knowledge, you can't (?) do a (4 as a prefix command in a macro |
ADDRESS ISREDIT "MACRO PROCESS". PROCESS (the default) says that the Editor should process line commands, such as A and C, before executing your macro.
With z/OS 1.13 you can issue Line command macro. Check this link
http://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/ispzem90/1.1.5.2? _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
|
|