Finding Comp fields in a PS ISPF



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

Finding Comp fields in a PS ISPF

Postby naresh_ceg » Tue Mar 24, 2009 11:17 pm

What would be the syntax to find a field stored as COMP binary in a PS?

For ex. if the field is declared as PIC 9(9) USAGE IS COMP. If the value stored is say 123, how do i find that in ISPF Editor.

In the ex if the usage is comp-3 hex, then my i would use F X'000000123C'. Please tell me the equivalent command for COMP usage.
naresh_ceg
 
Posts: 2
Joined: Sun Mar 22, 2009 6:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Finding Comp fields in a PS ISPF

Postby dick scherrer » Wed Mar 25, 2009 12:10 am

Hello and welcome to the forum,

Decimal 123 is x'7B' in binary. F X'7B' should find it.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times

Re: Finding Comp fields in a PS ISPF

Postby naresh_ceg » Wed Mar 25, 2009 12:36 am

Thanks Dick Scherrer for your reply. My elaborated need is to find out the first occurence of this binary field 123 in the PS file, and insert a line next to the current cursor position incrementing by 1 ie 124.

For ex. If the file has these records,
ABCD123XYZ
BCDE456MOP
CDEF678ZYX

Only this number field is defined as binary, the row has many other fields in hex, char formats apart from the field i need to increment.
Then my expected output is

ABCD123XYZ
ABCD124XYZ
BCDE456MOP
CDEF678ZYX

So if i'm accomplishing this with ISPF edit macros and Rexx. I should basically convert this 123 into binary (D2X followed by X2B) and find the first occurence of it in the file. Use Getline command to copy the data of the entire row. Use Parse Arg to split and then update the incremented no. in the correct position in binary format. And then finally insert using Line_After command from the .ZCSR position.

Please let me know if there are better ways to do this and this seems mundane. Thanks for your help!
naresh_ceg
 
Posts: 2
Joined: Sun Mar 22, 2009 6:57 pm
Has thanked: 0 time
Been thanked: 0 time

Re: Finding Comp fields in a PS ISPF

Postby dick scherrer » Wed Mar 25, 2009 1:44 am

Hello,

I should basically convert this 123 into binary (D2X followed by X2B)
Quite confusing. . . If the value is 123 and the field is binary, it will already be x'7b'. . .

Also, if you scan the "input" for some x'..' value anywhere in the record, you will get "hits" in places you will not want. . . For example, the x'7b' is the #. . . x'c1' (193) is the letter A.

You might want to consider writing this in cobol and using the actual record layout in the code. I believe it will be easier to implement and far easier to maintain.
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6268
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 93 times


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post