View previous topic :: View next topic |
Author |
Message |
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Fri Mar 04, 2005 3:43 pm Post subject: Column number |
|
|
Is is possible to automatically show the column numbers when invoking ISPF EDIT or VIEW? I try to avoid typing the line command "COL" whenver I edit a data file. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Sun Mar 06, 2005 9:33 pm Post subject: |
|
|
Danm,
Are you planning to use this rexx exec for any type of dataset? or just for a pds? If you are planning to edit a pds member with 80 bytes then I have an exec which does that for you.
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
danm Intermediate
Joined: 29 Jun 2004 Posts: 170 Topics: 73
|
Posted: Mon Mar 07, 2005 8:45 am Post subject: |
|
|
Kolusu,
I want to use it for a 80 bytes PS dataset which contains only Y or N. I want to be able to confirm a particular column is set correctly when I view the file in ISPF without typing in the COL line command every time. |
|
Back to top |
|
|
kolusu Site Admin
Joined: 26 Nov 2002 Posts: 12375 Topics: 75 Location: San Jose
|
Posted: Mon Mar 07, 2005 10:22 am Post subject: |
|
|
danm,
Try this. I hard coded the lrecl as 80. This will work of both the line command C and CC.
Code: |
/* REXX */
ADDRESS ISPEXEC
"ISREDIT MACRO NOPROCESS"
"ISPEXEC CONTROL ERRORS CANCEL"
"ISREDIT PROCESS RANGE C"
IF RC >= 16 THEN CALL 40000_DISP_ERROR
"ISREDIT (LINECMD) = RANGE_CMD"
CALL 1000_CHECK_LINE_CMD
MAX_LRECL = 80
CALL 2000_SET_COLS
DO WHILE FIRSTLIN <= LASTLIN
CALL 3000_DISP_COLS
END
STOPIT:
EXIT
1000_CHECK_LINE_CMD:
SELECT
WHEN LINECMD = 'C' THEN
DO
"ISREDIT (FIRSTLIN) = LINENUM .ZFRANGE"
"ISREDIT (LASTLIN) = LINENUM .ZLRANGE"
END
WHEN LINECMD = ' ' THEN
DO
"ISREDIT (FIRSTLIN) = LINENUM .ZFIRST"
"ISREDIT (LASTLIN) = LINENUM .ZFIRST"
END
OTHERWISE
CALL 40000_DISP_ERROR
END
RETURN
2000_SET_COLS:
COLSLINE = ''
DO I = 1 TO MAX_LRECL
REMAINDER = I // 10
SELECT
WHEN REMAINDER = 0 THEN
DO
QUOTIENT = I / 10
IF QUOTIENT < 10 THEN
COLS_CHAR = QUOTIENT
ELSE
DO
CURRPOS_LENGTH = LENGTH(I)
CHAR_WANTED = CURRPOS_LENGTH - 1
COLS_CHAR = SUBSTR(I,CHAR_WANTED,1)
END
END
WHEN REMAINDER = 5 THEN
COLS_CHAR = '+'
OTHERWISE
COLS_CHAR = '-'
END
COLSLINE = COLSLINE | | COLS_CHAR
END
RETURN
/**/
3000_DISP_COLS:
'ISREDIT LINE_BEFORE &FIRSTLIN = INFOLINE "&COLSLINE"'
ADVANCE_TO_NEXT_LINE:
FIRSTLIN = FIRSTLIN + 1
RETURN
/**/
40000_DISP_ERROR:
ADDRESS ISPEXEC
ZEDSMSG = 'PF1 FOR ERROR'
ZEDLMSG = 'ERROR PLACING THE COMMAND'
ZEDLMSG = ZEDLMSG | | ' FOR COLS TO BE DISPLAYED.'
'SETMSG MSG(ISRZ001)'
SIGNAL STOPIT
/**/
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
|
|
|