Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Why Count operator changes dataset LRECL?

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
vasanthz

Global Moderator


Joined: 28 Aug 2007
Posts: 1456
Location: Azeroth

PostPosted: Wed Oct 28, 2009 10:46 pm    Post subject: Why Count operator changes dataset LRECL?
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 Moderator


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

PostPosted: Thu Oct 29, 2009 1:21 am    Post subject:
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: 1456
Location: Azeroth

PostPosted: Thu Oct 29, 2009 3:36 pm    Post subject:
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

Site Director


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

PostPosted: Thu Oct 29, 2009 8:26 pm    Post subject:
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: 1456
Location: Azeroth

PostPosted: Thu Oct 29, 2009 8:40 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP - JCL failed while passing FTP co... Suneetha1612 JCL & VSAM 12 Wed Nov 16, 2016 7:33 pm
No new posts abend sort based on count records in ... anatol DFSORT/ICETOOL 5 Mon Oct 17, 2016 10:10 pm
No new posts To trim spaces in a pipe delimited da... Nish84 COBOL Programming 16 Mon Oct 10, 2016 1:54 pm
No new posts Get Record count in summary record fo... Atul Banke DFSORT/ICETOOL 21 Fri Sep 23, 2016 4:17 pm
No new posts Allocate dataset withour BLKSIZE Susanta CLIST & REXX 2 Thu Sep 22, 2016 11:51 am


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us