My reqt is to change the production naming qualifiers to test naming qualifiers. Eg: "PRD" to "TST.R2.TEST" in the PROC.
The problem here is that when doing this conversion, the truncation occurs (mainly to symbolic parameters declared in the PROC) and I had solved it by the following logic.
1. Split the line to 3 parts. The first part will have 33 bytes.
2. From the 34th byte, see whether " ,' " is there. Then till that line, put it in part2 and remaining in part3.
3. Delete the part3 from the main line and write it in new line immediately after the main line puting //.
4. After this , do the conversion from PRD to TST.R2.TEST
But the above logic works for the PROC of Case 1 shown below.
But in some other PROCs, the "PRD" keyword comes as shown in Case-2 and since it comes as part of comment, how to handle that
We can't exclude that line as it is not fully commented
("INPUT GDG - PRD.INS.OSTMONTH.EXPAND"). The same in Case-3 wherein if we are converting PRD, the wordings "(KEEP DIFF THAN MSG" will truncate showing Error when we put JSCAN in the JCL.
Case-3
------
//TST1110A EXEC PGM=TSTABC,
// ACCT=('CREATE CSP RECORDS')
//SYSOUT DD SYSOUT=(P,,0010),HLQUA='PRD' (KEEP DIFF THAN MSG
//* SO AMOUNTS / COUNTS DO NOT GET IN JCL)
//SYSABEND DD SYSOUT=*
Code put forth for handling Case-1
-----------------------------------
CHNG_PROC:
PARSE ARG TEXT1
SAVERC = 0
"ISREDIT CURSOR = 1 1"
DO WHILE (SAVERC = 0)
"ISREDIT F &TEXT1 NX"
SAVERC = RC
IF SAVERC = 0 THEN
DO
"ISREDIT (LINE) = LINENUM .ZCSR"
"ISREDIT (LNE1) = LINE .ZCSR"
PARSE VAR LNE1 PART1 33 PART2 "'," PART3 /*dividing main line to 3 parts
IF SUBSTR(PART3,1,2) <> ' ' THEN /*check part3 has data
DO
PART3 = SLASHES||PART3 /*combine slashes to part3
PART = PART1||PART2||"',"
"ISREDIT LINE &LINE = (PART)"
"ISREDIT LINE_AFTER &LINE = (PART3)"
END
ELSE DO
"ISREDIT (LINE) = LINENUM .ZCSR"
END
END
ELSE DO
"ISREDIT (LINE) = LINENUM .ZCSR"
END
END
Plz help me how to handle Case-2 and Case-3 as shown above.
Joined: 01 Sep 2006 Posts: 2547 Location: Silicon Valley
I do not have a good answer for comments. I do not mind comments at the end of a line, but they have make sense and still fit. I suggest either of these approaches:
1. split the line, but put the entire comment ahead of the line that the comment is directed at.
I also thought of the first option that you had said.
But i am wondering how we can handle this in ISPF edit macros
since the ISREDIT code that i had mentioned is already handling case-1 scenario but had no clue about case-2 and case-3 scenarios.
The manual thing that we can do is pushing those comments to next line like that you had mentioned. Can u plz help me how we can handle that in ISPF macros
Thanks Pedro for the suggestion
Sorry..I meant puting comments before the line only.it was a typo error.
As for your suggestion of using fixed comments, actually this prod PROC is written years before and at that time nobody cared about that.
But the actual reqt for me is to convert PRD to TST.R2.TEST in this PROC.
In this scenario, unfortunately the PRD comes as part of comment. If it came as //* PRD, I could have excluded the line and then proceeded for naming standard conversion. But since this is an exceptional case, I am wondering how we can handle it using macros.
Here I need to change the PRD to TST.R2.TT only if it is not commented.
In my example, the ISPF macro will go ahead and change all the PRD to TST.R2.TT but since this is as part of comment but not written within //* I am not able to exclude this.