Quantcast
Channel: IBM Mainframe Computers Forums
Viewing all 8500 articles
Browse latest View live

PL/I & Assembler :: RE: PL/I code tuning/Performance improvement

$
0
0
Author: Nic Clouston
Posted: Tue Dec 06, 2016 4:06 pm (GMT 5.5)

Some other bits:

Use LOCATE mode when reading/writing data sets
Use the TOTAL option when declaring files
Use as many buffers as you can for your data sets - avoiding disk access
Use FIXED BIN for counters
There is an entire chapter in the programming guide re performance.
Use PLIXOPT to find correct ISA size and then code it
Remove internal routines that are used only once
Remove repetetive, i.e. duplicate, tests
Limit data movement
Hard-code values - in particular parameters to BUILTIN functions
Call user exits directly
_________________
Regards
Nic


TSO/ISPF :: RE: Is the 'prompt' data for the DSLIST panel stored anywhere?

$
0
0
Author: Willy Jensen
Posted: Tue Dec 06, 2016 4:22 pm (GMT 5.5)

Hi steve-myers, yes, I am aware of the standard use for the prompt field. My challenge is that I must pass data to a REXX command run from the member list line command field. I have managed to do so by parsing the ZSCREENI variable, but that is clumsy and relies on the screen format not changing.
_________________
WJ

PL/I & Assembler :: RE: I can not compile my program PL1 V3.R7.M0

$
0
0
Author: Miguel Fernandez
Posted: Wed Dec 07, 2016 6:19 pm (GMT 5.5)

Hi

Nic Clouston

I would like to use the BBcode format.

Can you tell me which are the tags HTML that you use to leave it as 3270 green screen.

kind regards

PL/I & Assembler :: RE: I can not compile my program PL1 V3.R7.M0

$
0
0
Author: Miguel Fernandez
Posted: Wed Dec 07, 2016 7:18 pm (GMT 5.5)

Code:
Look at me ... this is a BBcode test ...

PL/I & Assembler :: RE: I can not compile my program PL1 V3.R7.M0

$
0
0
Author: Robert Sample
Posted: Wed Dec 07, 2016 7:22 pm (GMT 5.5)

Have you done an IPL with CLPA specified in your IEASYSxx PARMLIB member? That might resolve your issue.
_________________
TANSTAAFL

The first rule of code reuse is that the code needs to be worth re-using.

"We should forget about small efficiencies, say about 97% of the time: premature optimization is the root of all evil." -- Donald Knuth

PL/I & Assembler :: RE: I can not compile my program PL1 V3.R7.M0

$
0
0
Author: Garry Carroll
Posted: Wed Dec 07, 2016 7:23 pm (GMT 5.5)

Miguel,

If you look above the area where you're keying. you'll see a "code" button. Click this before pasting your 3270 screenshot and again after. This will put the tags in the correct place.

Garry.
_________________
Everyone's entitled to ONE fatal mistake.....

PL/I & Assembler :: RE: I can not compile my program PL1 V3.R7.M0

$
0
0
Author: Miguel Fernandez
Posted: Wed Dec 07, 2016 7:40 pm (GMT 5.5)

Definitely

My problem is solved with more memory, I have executed the PLICPLG job in another z / OS with PL1 V4.R5.M0 and runs very well. The problem I have when execute PL1 version V3.R7.M0 is that I have no initiators to run in REGION greater than 39M.

Thanks all by your technical support

Code:

********************************* TOP OF DATA **********************************
                   J E S 2  J O B  L O G  --  S Y S T E M  S 0 W 1  --  N O D E
                                                                               
06.23.44 JOB07532 ---- WEDNESDAY, 07 DEC 2016 ----                             
06.23.44 JOB07532  IRR010I  USERID IMCS     IS ASSIGNED TO THIS JOB.           
06.23.45 JOB07532  ICH70001I IMCS     LAST ACCESS AT 05:45:20 ON WEDNESDAY, DECE
06.23.45 JOB07532  $HASP373 PLICPLG  STARTED - INIT 1    - CLASS A        - SYS
06.23.46 JOB07532  -                                      -----TIMINGS (MINS.)--
06.23.46 JOB07532  -STEPNAME PROCSTEP    RC   EXCP   CONN       TCB       SRB  C
06.23.46 JOB07532  -PLI                  00  10176    122       .00       .00   
06.23.46 JOB07532  -PLKED                04     72     19       .00       .00   
06.23.47 JOB07532  -LKED                 00    346     53       .00       .00   
06.23.47 JOB07532  -GO                   00     21      7       .00       .00   
06.23.47 JOB07532  -PLICPLG  ENDED.  NAME-                     TOTAL TCB CPU TIM
06.23.47 JOB07532  $HASP395 PLICPLG  ENDED - RC=0004                           
------ JES2 JOB STATISTICS ------                                               
  07 DEC 2016 JOB EXECUTION DATE                                               
           81 CARDS READ                                                       
          782 SYSOUT PRINT RECORDS                                             
********************************* TOP OF DATA **********************************
 SDSF OUTPUT DISPLAY PLICPLG  JOB07532  DSID     3 LINE 0       COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
********************************* TOP OF DATA **********************************
        1 //PLICPLG  JOB 'EXECUTE PLI',                                         
          //         CLASS=A,MSGCLASS=X,REGION=80M                             
          //*                                                                   
          //********************************************************************
          //* Licensed Materials - Property of IBM                             
          //* 5655-W67                                                         
          //* Copyright IBM Corp. 1999, 2015 All Rights Reserved               
          //*                                                                   
          //* US Government Users Restricted Rights - Use, duplication or       
          //* disclosure restricted by GSA ADP Schedule Contract with IBM Corp.
          //*                                                                   
          //********************************************************************
          //*                                                                   
          //*       IBM Enterprise PL/I for z/OS                               
          //*       Version 4 Release 5 Modification 0                         
          //*                                                                   
          //*  COMPILE, PRELINK, LINK-EDIT AND RUN A PL/I PROGRAM               
          //*                                                                   
5655-W67  IBM(R) Enterprise PL/I for z/OS       V4.R5.M0 (Built:20160829)       
                     Options Specified                                         
  Install:                                                                     
  Command: OBJECT,OPTIONS,SOURCE,COMPILE,LIST,MAP                               
  Install:                                                                     
                     Options Used                                               
     NOAGGREGATE                                                               
       ARCH(7)                                                                 
5655-W67  IBM(R) Enterprise PL/I for z/OS       TEST: PROCEDURE OPTIONS(MAIN); 
 Compiler Source                                                               
    Line.File                                                                   
       1.0      TEST: PROCEDURE OPTIONS(MAIN);                                 
       2.0        DCL MUNDO CHAR(36);                                           
       3.0        MUNDO='HI,.... IF YOU READ YOU CAN EAT ....';                 
       4.0        PUT SKIP LIST(MUNDO);                                         
       5.0      END TEST;                                                       
5655-W67  IBM(R) Enterprise PL/I for z/OS       TEST: PROCEDURE OPTIONS(MAIN); 
                     Block Name List                                           
    Number  Name                                                               
         1  TEST                                                               
5655-W67  IBM(R) Enterprise PL/I for z/OS       TEST: PROCEDURE OPTIONS(MAIN); 
                                                                               
OFFSET OBJECT CODE        LINEÑ  FILEÑ    P S E U D O   A S S E M B L Y   L I S
                               * * * * *   E N D     O F     A U T O M A T I C 
5655-W67  IBM(R) Enterprise PL/I for z/OS       TEST: PROCEDURE OPTIONS(MAIN); 
 No Compiler Messages                                                           
 File Reference Table                                                           
   File    Included From  Name                                                 
      0                   IMCS.IMG.JCLS(PGMPLI)                                 
 Component    Return Code    Messages (Total/Suppressed)    Time               
 Compiler         0                1  /  1                   0 secs             
 End of compilation of TEST                                                     
******************************** BOTTOM OF DATA ********************************
========================================================================       
|                  ESD Map of Defined and Long Names                   |       
========================================================================       
                                                                               
                   OUTPUT                                                       
*REASON  FILE ID  ESD NAME   INPUT NAME                                         
                                                                               
          00001   CEESTART   CEESTART                                           
          00001   CEEMAIN    CEEMAIN                                           
          00001   ***TEST1   ***TEST1                                           
          00001   ***TEST2   ***TEST2                                           
          00001   TEST       TEST                                               
                                                                               
*REASON: P=Ñpragma or reserved    S=matches short name    R=RENAME card         
         L=C Library              U=UPCASE option         D=Default             
                                                                               
                                                                               
============  E N D   O F   P R E - L I N K A G E   M A P  =============       
******************************** BOTTOM OF DATA ********************************
z/OS V2 R2 BINDER     06:23:46 WEDNESDAY DECEMBER  7, 2016                     
BATCH EMULATOR  JOB(PLICPLG ) STEP(LKED    ) PGM= IEWL                         
IEW2008I 0F03 PROCESSING COMPLETED.  RETURN CODE =  0.                         
                                                                               
                                                                               
                                                                               
----------------------                                                         
MESSAGE SUMMARY REPORT                                                         
----------------------                                                         
 TERMINAL MESSAGES      (SEVERITY = 16)                                         
 NONE                                                                           
                                                                               
 SEVERE MESSAGES        (SEVERITY = 12)                                         
 NONE                                                                           
                                                                               
 ERROR MESSAGES         (SEVERITY = 08)                                         
 NONE                                                                           
 SDSF OUTPUT DISPLAY PLICPLG  JOB07532  DSID   106 LINE 0       COLUMNS 02- 81 
 COMMAND INPUT ===>                                            SCROLL ===> CSR 
********************************* TOP OF DATA **********************************
HI,.... IF YOU READ YOU CAN EAT ....                                           
******************************** BOTTOM OF DATA ********************************
                                                                               

PL/I & Assembler :: RE: I can not compile my program PL1 V3.R7.M0

$
0
0
Author: Miguel Fernandez
Posted: Wed Dec 07, 2016 7:57 pm (GMT 5.5)

Difference between run with REGION = 39M (Here I lack memory)
and REGION = 80M


Code:


EDIT       MIGUEL.JCLS(PLICPLG) - 01.16                   Member PLICPLG saved
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //PLICPLG  JOB 'EXECUTE PLI',                                           
000002 //         CLASS=A,MSGCLASS=X,REGION=39M                               
000003 //*********************************************************************
000004 //*                                                                     
000005 //*       IBM Enterprise PL/I for z/OS                                 
000006 //*       Version 3 Release 7 Modification 0         

                   
VIEW       IMCS.IMG.JCLS(PLICPLG) - 01.04                  Columns 00001 00072
Command ===>                                                  Scroll ===> CSR 
****** ***************************** Top of Data ******************************
000001 //PLICPLG  JOB 'EXECUTE PLI',                                           
000002 //         CLASS=A,MSGCLASS=X,REGION=80M                               
000003 //*********************************************************************
000004 //*                                                                     
000005 //*       IBM Enterprise PL/I for z/OS                                 
000006 //*       Version 4 Release 5 Modification 0                           
000007 //*                                                                     
000008 //*  COMPILE, PRELINK, LINK-EDIT AND RUN A PL/I PROGRAM                 
000009 //*                   


DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: Rohit Umarjikar
Posted: Wed Dec 07, 2016 8:31 pm (GMT 5.5)

Code:
OPTION COPY                             
INREC BUILD=(1,1,ZD,MUL,+1,EDIT(T),     
               2,1,ZD,MUL,+2,EDIT(IT),
               3,1,ZD,MUL,+1,EDIT(T),   
               4,1,ZD,MUL,+2,EDIT(IT)) 
OUTREC FINDREP=(INOUT=(C' ',C''))

_________________
Regards,
Rohit Umarjikar
"Knowledge is knowing that a tomato is a fruit, but Wisdom is knowing not to put it in a fruit salad."icon_razz.gif

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: Bill Woodger
Subject: Reply to: Performing arithmetic on input field
Posted: Wed Dec 07, 2016 8:38 pm (GMT 5.5)

If you don't specify a length (with LENGTH or an explicit EDIT mask) you get a default length. If you don't provide an explicit EDIT, you get a default mask.

"I" in an EDIT means "a blank if there is no significant digit encountered yet", so leading zeros you ask to be blank.

You need a + (or -) because that is how DFSORT will tell if you are specifying a numeric literal, or the (incomplete) start of a field definition.

I'm pretty sure the examples for 2.1 are the same as for 2.2, for instance, p136 in both documents:

Quote:
arexp,edit or (arexp),edit
specifies that the edited result of an arithmetic expression is to appear in the reformatted input record. The arithmetic expression can consist of input fields, decimal constants, operators and parentheses. An arithmetic expression produces a signed, 31-digit zoned decimal (ZD) result to be edited as specified.
See arexp,edit under OUTFIL OUTREC for details.

Code:
Sample Syntax:
INREC FIELDS=(C’**’,27,2,FI,MIN,
83,4,PD,EDIT=(STTTTTTT),SIGNS=(+,-),
15:(((15,5,ZD,ADD,+1),MUL,+100),DIV,62,2,PD),M25,LENGTH=10)


Note the use of FIELDS instead of BUILD, which likely indicates that this example has been around for more than 10 years.

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: Arun Raj
Posted: Wed Dec 07, 2016 8:44 pm (GMT 5.5)

zh_lad,

I would suggest keeping all the intermediate multiplication results in 2 bytes, so you don't have to figure out later which result has 2 digits and which one has 1 digit. Because you need to sum all of them later. It might add more work and confusion if you get rid of the blanks, and then try to figure out where each intermediate result starts.

So you can use TT...edits and read them as ZD in further computations or keep the IT...edits and read them as UFF, whichever works for you.
_________________
Arun
----------------------------------------------------------------------------------------------------
Love is like an hourglass, with the heart filling up as the brain empties. -Jules Renard

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: Bill Woodger
Subject: Reply to: Performing arithmetic on input field
Posted: Wed Dec 07, 2016 9:26 pm (GMT 5.5)

And multiple arithmetic operations can be carried out without having to define anything for intermediate results. The next operation is on "the current result" for as long as necessary without having to be concerned about it.

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: zh_lad
Posted: Wed Dec 07, 2016 10:06 pm (GMT 5.5)

Thanks Rohit, it worked.

Rohit Umarjikar wrote:
Code:
OPTION COPY                             
INREC BUILD=(1,1,ZD,MUL,+1,EDIT(T),     
               2,1,ZD,MUL,+2,EDIT(IT),
               3,1,ZD,MUL,+1,EDIT(T),   
               4,1,ZD,MUL,+2,EDIT(IT)) 
OUTREC FINDREP=(INOUT=(C' ',C''))

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: zh_lad
Subject: Re: Reply to: Performing arithmetic on input field
Posted: Wed Dec 07, 2016 10:18 pm (GMT 5.5)

Thanks Bill.

1. I learnt it later when I read about Mask.
2. I am aware of use of 'I' in EDIT
3. I didn't know, I was using arithmetic first the first in SORT - Thanks
4. Yes PDF has examples but always problem is discussed on different page. Ideally it should have link to go directly to the problem description by one click. It difficult to absorb example (sample) if problem is discussed on a different page.

Thanks for your comments. They helped to use PDF better.

Bill Woodger wrote:
If you don't specify a length (with LENGTH or an explicit EDIT mask) you get a default length. If you don't provide an explicit EDIT, you get a default mask.

"I" in an EDIT means "a blank if there is no significant digit encountered yet", so leading zeros you ask to be blank.

You need a + (or -) because that is how DFSORT will tell if you are specifying a numeric literal, or the (incomplete) start of a field definition.

I'm pretty sure the examples for 2.1 are the same as for 2.2, for instance, p136 in both documents:

Quote:
arexp,edit or (arexp),edit
specifies that the edited result of an arithmetic expression is to appear in the reformatted input record. The arithmetic expression can consist of input fields, decimal constants, operators and parentheses. An arithmetic expression produces a signed, 31-digit zoned decimal (ZD) result to be edited as specified.
See arexp,edit under OUTFIL OUTREC for details.

Code:
Sample Syntax:
INREC FIELDS=(C’**’,27,2,FI,MIN,
83,4,PD,EDIT=(STTTTTTT),SIGNS=(+,-),
15:(((15,5,ZD,ADD,+1),MUL,+100),DIV,62,2,PD),M25,LENGTH=10)


Note the use of FIELDS instead of BUILD, which likely indicates that this example has been around for more than 10 years.

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: Arun Raj
Posted: Wed Dec 07, 2016 10:25 pm (GMT 5.5)

Quote:
Thanks Rohit, it worked
But I am afraid that is not what you were trying to achieve. Like Bill mentioned above, you can have multiple computations, just use braces to have meaningful results and then edit the final result as needed.
_________________
Arun
----------------------------------------------------------------------------------------------------
Love is like an hourglass, with the heart filling up as the brain empties. -Jules Renard


DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: zh_lad
Posted: Wed Dec 07, 2016 10:37 pm (GMT 5.5)

Thanks Arun. Yes, I need to edit my original post to:

Code:
1+8 + 8 + 1+4 + 6 + 1+0 + 4 + 6 + 1
= 40 * 9
= 360

I want to sum the digits of all the results of multiplication. I think I would need intermediate result to find all the digits to do sum later.

Thanks

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: Arun Raj
Posted: Wed Dec 07, 2016 11:08 pm (GMT 5.5)

Quote:
Code:
987654321

My Input record

Code:
9 (2) + 8 + 7(2) + 6 + 5(2) + 4 + 3(2) + 1   
Multiplying every alternate digit with 2, starting from left.

From your original post, if it is every alternate digit, should it not be like this?

9 (2) + 8 + 7(2) + 6 + 5(2) + 4 + 3(2) + 2 + 1(2) = 70 * 9 = 630

You don't need to worry about the format of intermediate results because, as suggested you can do multiple computations one after the other, like this and edit only the final result.
Code:
//SORTIN  DD *                                     
987654321                                         
//SYSIN   DD *                                     
  OPTION COPY                                     
  OUTREC BUILD=((1,1,ZD,MUL,+2,ADD,               
                 2,1,ZD,ADD,                       
                 3,1,ZD,MUL,+2,ADD,               
                 4,1,ZD,ADD,                       
                 5,1,ZD,MUL,+2,ADD,               
                 6,1,ZD,ADD,                       
                 7,1,ZD,MUL,+2,ADD,               
                 8,1,ZD,ADD,                       
                 9,1,ZD,MUL,+2),MUL,+9,EDIT=(TTTT))
SORTOUT
Code:
 0630

_________________
Arun
----------------------------------------------------------------------------------------------------
Love is like an hourglass, with the heart filling up as the brain empties. -Jules Renard

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: zh_lad
Subject: Reply to: Performing arithmetic on input field
Posted: Wed Dec 07, 2016 11:22 pm (GMT 5.5)

Thanks Arun. Please check my previous post where I said I need to add up all the digits e.g.
9 (2) + 8 + 7 (2 ) + 6 + 5 (2) + 4 + 3 (2) + 1
18 + 8 + 14 + 6 + 10 + 4 + 6 + 1
1+8+8+1+4+6+1+0+4+6+1
= 40 × 9
= 360.

I couldn't edit my original post. Thanks

>>Still "2" is missing

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: Bill Woodger
Subject: Reply to: Performing arithmetic on input field
Posted: Thu Dec 08, 2016 12:29 am (GMT 5.5)

IFTHEN=(WHEN=INIT for an OVERLAY to give you the several multiply-by-two results (they are not "intermediate results" in the sense normally used), then another WHEN=INIT with the BUILD to ADD all the digits that you need (odd-number from original location, even-numbered from the location OVERLAYed to) and then multiply that by +9.

DFSORT/ICETOOL :: RE: Performing arithmetic on input field

$
0
0
Author: zh_lad
Posted: Thu Dec 08, 2016 4:21 am (GMT 5.5)

Thanks Bill. I will apply these suggestions. I was about to fix missing '2' but it was locked. Cheers
Viewing all 8500 articles
Browse latest View live