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

Why Count operator changes dataset LRECL?


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Wed Oct 28, 2009 10:46 pm
Reply with quote

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? icon_eek.gif

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Thu Oct 29, 2009 1:21 am
Reply with quote

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Oct 29, 2009 3:36 pm
Reply with quote

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. icon_biggrin.gif

Regards,
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Thu Oct 29, 2009 8:26 pm
Reply with quote

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. . . icon_confused.gif

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
View user's profile Send private message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1742
Location: Tirupur, India

PostPosted: Thu Oct 29, 2009 8:40 pm
Reply with quote

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
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts To get the count of rows for every 1 ... DB2 3
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts VB to FB - Finding LRECL SYNCSORT 4
No new posts To find whether record count are true... DFSORT/ICETOOL 6
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
Search our Forums:

Back to Top