IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

ISREDIT - Handling truncation issues


IBM Mainframe Forums -> TSO/ISPF
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
chidams78
Currently Banned

New User


Joined: 29 May 2006
Posts: 59
Location: India

PostPosted: Wed Sep 03, 2008 8:26 pm
Reply with quote

Hi all,

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-1
-------
//TST1111 PROC QSL='(0)',TBLDI='(0)',SUBCTL='64242T',HLQUA='PRD',
// PDLOSS='(+1)',OSLOSS='(+1)',DATEFILE='(-10)',

Case-2
------
//TGT1000 PROC ASVI1='PRD.',
// BDVI2='PRD.',
// OSTI='(0)', INPUT GDG - PRD.INS.OSTMONTH.EXPAND
// OCMI='(0)', INPUT GDG - PRD.INS.OCMMONTH.EXPAND
// QSL1='(+1)', OUTPUT GDG - PRD.STA.QSL
// STATMST='(0)' INPUT GDG - PRD.INS.STATMSTR
//TST8000A EXEC PGM=ICETOOL,PARM=EQUALS,
// ACCT='SORT TTL AND OSTMONTH'


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
-----------------------------------
Code:
SLASHES = '//             '       
CALL CHNG_PROC('PRD')
"ISREDIT C 'PRD' 'TST.R2.TEST' ALL"

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.

Thanls
Chidam
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu Sep 04, 2008 1:20 am
Reply with quote

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.
Code:
Case-2
------
//TGT1000 PROC ASVI1='PRD.',
// BDVI2='PRD.',
//* OSTI:  INPUT GDG - &ASVI1.INS.OSTMONTH.EXPAND
// OSTI='(0)',
//* OSMI: INPUT GDG - &ASVI1.INS.OCMMONTH.EXPAND
// OCMI='(0)',
//* QSL1:  OUTPUT GDG - &ASVI1.STA.QSL
// QSL1='(+1)',
//* STATMST:  INPUT GDG - &ASVI1.INS.STATMSTR
// STATMST='(0)'
//*
//TST8000A EXEC PGM=ICETOOL,PARM=EQUALS,
// ACCT='SORT TTL AND OSTMONTH'



2. Put all comments ahead of the proc call.
Code:
Case-2
------
//* -------------------------------------
//*  parms used:
//*    OSTI   : INPUT GDG - &ASVI1.INS.OSTMONTH.EXPAND
//*    OSMI   : INPUT GDG - &ASVI1.INS.OCMMONTH.EXPAND
//*    QSL1   : OUTPUT GDG - &ASVI1.STA.QSL
//*    STATMST: INPUT GDG - &ASVI1.INS.STATMSTR
//TGT1000 PROC ASVI1='PRD.',
// BDVI2='PRD.',
// OSTI='(0)',
// OCMI='(0)',
// QSL1='(+1)',
// STATMST='(0)'
//*
//TST8000A EXEC PGM=ICETOOL,PARM=EQUALS,
// ACCT='SORT TTL AND OSTMONTH'


Also, I disgree with using fixed values in the comments, when it is actually a variable value used when the proc is used.
Back to top
View user's profile Send private message
chidams78
Currently Banned

New User


Joined: 29 May 2006
Posts: 59
Location: India

PostPosted: Thu Sep 04, 2008 9:36 pm
Reply with quote

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
Back to top
View user's profile Send private message
Pedro

Global Moderator


Joined: 01 Sep 2006
Posts: 2547
Location: Silicon Valley

PostPosted: Thu Sep 04, 2008 9:57 pm
Reply with quote

Quote:
pushing those comments to next line like that you had mentioned

No, I recommended putting the comment in the line before it, NOT the next.

My recommendation is not to make your original code do three things, but to write new code to do the other things.

You did not comment on my suggestion:
Quote:
Also, I disgree with using fixed values in the comments, when it is actually a variable value used when the proc is used.

You may not have to handle case 2 or case 3.
Back to top
View user's profile Send private message
chidams78
Currently Banned

New User


Joined: 29 May 2006
Posts: 59
Location: India

PostPosted: Thu Sep 04, 2008 10:12 pm
Reply with quote

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.
Back to top
View user's profile Send private message
Adrian Stern

New User


Joined: 13 Feb 2008
Posts: 12
Location: Sweden

PostPosted: Mon Sep 08, 2008 5:21 pm
Reply with quote

Use variables!

// set env =tst
OR
// set env= prd

THEN

//TGT1000 PROC ASVI1='PRD.',
// BDVI2='PRD.',
// OSTI='(0)', INPUT GDG - env..INS.OSTMONTH.EXPAND
Back to top
View user's profile Send private message
chidams78
Currently Banned

New User


Joined: 29 May 2006
Posts: 59
Location: India

PostPosted: Fri Sep 12, 2008 8:33 pm
Reply with quote

Adrian,

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.

// OSTI='(0)', INPUT GDG - PRD.INS.OSTMONTH.EXPAND
// OCMI='(0)', INPUT GDG - PRD.INS.OCMMONTH.EXPAND

How to go ahead with this
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> TSO/ISPF

 


Similar Topics
Topic Forum Replies
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Issues with VIEW DATASET Command CLIST & REXX 2
No new posts Issues with executing a REXX MACRO th... TSO/ISPF 4
No new posts File Handling COBOL Programming 9
No new posts Handling the numeric data in unstring... COBOL Programming 18
Search our Forums:

Back to Top