I think reading recfm u returns the length in register 1. If he writes variable he will be responsible for the block and record prefixes. It should be simpler to write fixed with a little blank padding.
-----Original Message----- From: IBM Mainframe Discussion List [mailto:[EMAIL PROTECTED] On Behalf Of Chris Mason Sent: Thursday, August 07, 2008 10:28 AM To: IBM-MAIN@BAMA.UA.EDU Subject: Re: Converting / Copying a dataset from RECFM=UA to RECFM=FB Rahul Do remember I'm a bit rusty on these matters. It's possible that your BLKSIZE=0 caused JES2 - was it? - to come up with a rubbish BLKSIZE. I seem to remember that, if a parameter is missing - and 0 would be considered missing for BLKSIZE - the value set by the program opening and closing the data set for the equivalent parameter is going to set it. In addition the program can reset already specified parameters as shown by the change from FB to UA. This may also be a consequence of your having specified BLKSIZE=0. There are a lot of guess here. If JES2 - as I suppose - has specified "A" as one of the RECFM characters - mapped from bits internally if my memory is to be trusted - it probably did so for a reason and the printout is probably prepared with the "ASA" carriage control characters. Note also that your program which insists on FB or VB is very probably capable - although it's not guaranteed! - of dealing with FBA and VBA. In other words it is interested only in dealing with "fixed" or "variable" organisation and probably even doesn't care whether or not the records are blocked. My first idea was to suggest you try again using the following in your IEFBR14 job step: //STEP01 EXEC PGM=IEFBR14 //DD1 DD DSN=MY.DATASET, // DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(125,50),RLSE), // DCB=(RECFM=FBA,LRECL=133,BLKSIZE=133) But now I appreciate where the LRECL=133 came from in what you showed as the data set characteristics in your original post. This inclines me to think that the BLKSIZE=101 may be trusted as the largest block created and that other blocks are created which are equal to or smaller than 101 - and that when RECFM=U was specified it was meant to be just that: "undefined". Since you have written a little "read a record"/"write the record" program, perhaps you can adjust that to read the undefined blocks one at a time, note the length - someone who knows precisely how by heart please jump in - and write it out as a record with "variable" organisation, that is, with the correct length half-word and null half-word at the beginning. Note that you can specify any BLKSIZE value you like - greater than 105 for reasons I hope you understand - and the system will take care of when to write out your blocks with your variable length records. You do not even need to specify the DCB parameters in your JCL but rather you can specify them all in the DCB macros within your program. I'm pretty sure you need bother only with BLKSIZE and RECFM and that LRECL will be needed neither with "undefined" organisation nor with "variable" organisation. With any luck there remains now only the question of whether or not the recipient of the email can do anything with the carriage control character. If he/she complains about the useless extra character at the beginning of each line - printable at least since it's "ASA", you can use your little program just to throw it away - or - if you want to be really helpful, you could look up what the "ASA" control characters mean in terms of manoeuvering a printer carriage and adjust your output accordingly, even, for instance, going as far as simulating a new page using a full line of hyphens. Chris Mason On Thu, 7 Aug 2008 19:59:28 +0530, Rahul Karsija <[EMAIL PROTECTED]> wrote: >Hi >My original program sends out data to the spool and then the report is >printed. My task is to send the data to a dataset, and then email this >dataset. The email program (IKJEFT1A) doesn't support such datasets and >requires FB or VB as input > >I had also created the dataset using IEFBR14 - > >//STEP01 EXEC PGM=IEFBR14 >//DD1 DD DSN=MY.DATASET, >// DISP=(NEW,CATLG,DELETE),SPACE=(CYL,(125,50),RLSE), >// DCB=(RECFM=FB,LRECL=133,BLKSIZE=0) >//SYSPRINT DD SYSOUT=* >//SYSIN DD DUMMY >//SYSUDUMP DD SYSOUT=* > >Then, I used this dataset in my original program, with DISP=OLD. The >program converts it to RECFM=UA (undefined length record) while writing out >data to it. > >Regards >Rahul Karsija > > > >On Thu, Aug 7, 2008 at 6:38 PM, Chris Mason <[EMAIL PROTECTED]> wrote: > >> Rahul >> >> I'm a bit rusty on theses matters since I don't have systems to play with >> these days. However, if I wanted to set up an existing data set with DCB >> parameters other than those currently assigned, I'd try the following: >> >> First of all I'd be using IEBGENER as the program. >> >> Then I'd define the input data set with DCB parameters which "overrode" the >> stored DCB parameters with the DCB parameters I wanted the program to >> adopt and hence to try to use. >> >> Naturally I'd define the output data set with the same DCB parameters so >> that >> those became the stored DCB parameters for the new data set. >> >> I could guess that the records in the data set are 133 bytes long, that >> there >> is one record per block and that the records are print lines which have an >> ASA - if I remember correctly what "A" means - character as the first >> character, the carriage control character. I'm ignoring the defined stored >> block >> size of 101 which looks spurious. >> >> //... JOB ... >> //GENER EXEC PGM=IEBGENER >> //SYSUT1 DD DSN=input,DCB= >> (BLKSIZE=133,LRECL=133,RECFM=FBA),DISP=OLD >> //SYSUT2 DD DSN=output,DCB= (BLKSIZE=133,LRECL=133,RECFM=FBA),DISP= >> (NEW,KEEP) >> //SYSIN DD DUMMY >> >> Chris Mason ably assisted by John Austin >> >> On Thu, 7 Aug 2008 15:36:53 +0530, Rahul Karsija <[EMAIL PROTECTED]> >> wrote: >> >> >Hi >> >I need to convert a dataset from RECFM=UA to RECFM=FB. I tried to copy it >> >using IDCAMS but was unsuccessful. I also wrote a small program to read >> the >> >input records and then write them to output file but that did not work >> >either. Using SORT with OPTION COPY was also not helpful, got message - >> >ICE043A 3 INVALID DATA SET ATTRIBUTES SPECIFIED SORTIN RECFM >> > >> >Given below are the parameters of the input file - >> >Organization . . . : PS >> >Record format . . . : UA >> >Record length . . . : 133 >> >Block size . . . . : 101 >> >1st extent cylinders: 1 >> >Secondary cylinders : 50 >> > >> >Have also tried using IBM TRSMAIN (first PACK and then UNPACK) but that >> also >> >creates the final output file as UA. >> > >> >Please help me. >> > >> >Thanks & Regards >> >Rahul Karsija ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html ------------------------------------------------------------------------------ NOTICE: This electronic mail message and any attached files are confidential. The information is exclusively for the use of the individual or entity intended as the recipient. If you are not the intended recipient, any use, copying, printing, reviewing, retention, disclosure, distribution or forwarding of the message or any attached file is not authorized and is strictly prohibited. If you have received this electronic mail message in error, please advise the sender by reply electronic mail immediately and permanently delete the original transmission, any attachments and any copies of this message from your computer system. Thank you. ============================================================================== ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [EMAIL PROTECTED] with the message: GET IBM-MAIN INFO Search the archives at http://bama.ua.edu/archives/ibm-main.html