View previous topic :: View next topic
|
Author |
Message |
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi,
I allocate a dataset XK89.BORED.PROGRAMR with LRECL 80 FB.
But when we run a count ICETOOL step as shown below it changes the LRECL to 6.
Why?
This query can be considered as a question and maybe an awareness to new programmars when using COUNT.
Code: |
//XK89JOB2 JOB ,'GREEN DAY',CLASS=4,MSGCLASS=P,NOTIFY=&SYSUID
//STEP2 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=XK89.SORTIN,DISP=SHR
//IN2 DD DSN=XK89.BORED.PROGRAMR,DISP=OLD
//TOOLIN DD *
COUNT FROM(IN1) WRITE(IN2) DIGITS(6)
/* |
Few days back I had a problem while concatenating datasets. And it was because of COUNT operator and I did not knew that count operator changes LRECL at that time.
Thanks & Regards, |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Yes, the LRECL will be set to 6 as documented in "z/OS DFSORT Application Programming Guide" where it says the following in the description of the WRITE(countdd) operand of COUNT:
o LRECL is set to one of the following:
- If WIDTH(n) is specified, LRECL is set to n. Use WIDTH(n) if your count record length and LRECL must be set to a particular value (for example, 80), or if you want to ensure that the count record does not exceed a specific maximum (for example, 20 bytes)
- If WIDTH(n) is not specified, LRECL is set to the calculated required record length. If your LRECL does not need to be set to a particular value, you can let ICETOOL determine and set the appropriate LRECL by not specifying WIDTH(n).
If you want LRECL=80, specify WIDTH(80). Since you didn't specify WIDTH(n), the LRECL was set to the calculated value of 6 as expected. |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi Frank,
Thanks for your time. WIDTH operator is quite handy.
This worked,
Code: |
COUNT FROM(IN1) WRITE(IN2) WIDTH(80) DIGITS(6) |
I will use ICETOOL to change LRECL of datasets without creating them again.
Regards, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
I will use ICETOOL to change LRECL of datasets without creating them again. |
Why in the world would you go about changing lrecls here and there. . .
If a file is created with 110-byte records, changing the lrecl to anything else will most likely create a mess.
If you go around changing "stuff", how will anyone else be aware of it?
Just because something can be done, does not mean one should do it. . . |
|
Back to top |
|
|
vasanthz
Global Moderator
Joined: 28 Aug 2007 Posts: 1742 Location: Tirupur, India
|
|
|
|
Hi D,
Quote: |
If you go around changing "stuff", how will anyone else be aware of it? |
I have some automation programs which no one except me use. Moreover they are no where near to production programs.
Example, daily health checks of systems. Periodic reporting of transmissions and CPU consumption analysis of jobs..
Also allocation of dataset is a problem at our shop, where in a user is not allowed to use more than 300 CYLS in a single dataset on DASD. Also it gets worse before the end of the period, maybe thats when the defragmentation & Tape backup is done. Dont know.
So I thought reusing the same WORK dataset by changing the LRECL will suit for many purposes.
Although I have not yet tried it out.
I understand your point that changing LRECL could cause data corruption and S0C7 abend. Which is genuinely a valid concern.
Regards, |
|
Back to top |
|
|
|