Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Mon Jan 12, 2004 5:48 pm Post subject: How To Disintegrate A File thru JCL
Hi All !
I need to know which Utilities can help achieve the following and some specifics as how to in a JCL .
I have a Input File of Fixed Record Length of 480. Need to create a New Output File where the Record Length would now be 80 bytes ! Basically each 480 byte Input Record to result in 6 Output Recds of 80 bytes each.
I am aware this can be achieved thru a Program ..however ...if there is an alternate method available I would prefer not to code a Program for it.
Thanks a ton !
Vini
Last edited by vini on Mon Jan 12, 2004 6:16 pm; edited 1 time in total
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Mon Jan 12, 2004 6:28 pm Post subject:
Kolusu,
I did not understand the following steps as all I have is ONE FILE as Input and of Length 480. How do I make these FIRST to SIXTH files from this ONE File OR are you sayin the SORTIN File would be same as all these ??? Pls. explain and bear with me as I am not very familiar with JCLs.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Mon Jan 12, 2004 6:40 pm Post subject:
vini,
As you already noticed that we just have one input file and sort utility reads this file and splits the record into 6 different files. Look at the sysin statements
Code:
OUTFIL FNAMES=FIRST,OUTREC=(1,80)
Which means that copy the input file to output file with ddname FIRST and the outrec tells to copy bytes starting from 1 for a length of 80 bytes. simlarly the second ,third...
/ tells DFSORT to start a new line. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Mon Jan 12, 2004 7:19 pm Post subject:
kolusu ,
I executed the following JCL .
However ..where would the OUTPUT File get created .. .. what steps am I missing to complete this JCL to get the actual output in a DS i.e ? .. If all this sounds DUMB pls. bear with me as am a beginner. Also my input file will potentially have multiple records of length 480.
Joined: 12 Jan 2004 Posts: 240 Topics: 48 Location: Maryland
Posted: Mon Jan 12, 2004 7:40 pm Post subject:
Frank ,
Thanks ...the DFSORT did work !
How can I achieve the Reverse now ...meaning to ask ...my Input now is of 80 and need Output of 480 ...i.e 6 records of Input clubbed into ONE Output record . Is this also possible using DFSORT in some way ??? Pls. let me know.
Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Mon Jan 12, 2004 8:32 pm Post subject:
Vini,
DFSORT does NOT have any built-in function to go from six 80 byte records to one 480 byte record. I'm on my way out, so I can't post more at the moment. Maybe Kolusu or somebody else knows a trick for this (playing around with the BLKSIZE, maybe?). Of course, you could always do it with an E15 exit. _________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Tue Jan 13, 2004 7:17 am Post subject:
Vini,
I sincerely apolozise for mis-intrepreting your question. As shown by frank you can use the "/" to split 1 record into 'n' number of records. Now for reversing i.e combining 6 records into 1 single record involves a trick. Usually with sort products you don't have to specify the DCB Parameters. sort automatically calculates it from the sortin or inrec or outrec fields.
Now the trick to create the split file with a BLKSIZE which is a EVEN multiple of the LRECL.In this case I used 480. Now in the second step we override the LRECL to 480 even though the file lrecl is only 80 bytes. The LRECL=480 on the DD statement overrides the LRECL=80 in the DSCB, so the data set is treated as if it has LRECL=480 and adjacent 80 bytes records are read as one record.
Personally I do not like the idea of messing around with the LRECL/BLKSIZE this way. The following JCl will give you the desired results.
Code:
//********************************************************************
//* THIS STEP WILL SPLIT THE INPUT RECORD INTO 6 RECORDS EACH WITH *
//* 80 BYTES IN LENGTH. *
//********************************************************************
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR 480 BYTES INPUT FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR OUTPUT FILE SPLIT INTO 6 RECORDS,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE),
// DCB=(LRECL=80,RECFM=FB,BLKSIZE=480)
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL OUTREC=(1,80,/,81,80,/,161,80,/,241,80,/,321,80,/,401,80)
//*
//********************************************************************
//* THIS STEP WILL COMBINE 6 RECORDS INTO A SINGLE RECORD BY OVER- *
//* RIDING THE LRECL ON THE SORTIN DATASET. *
//********************************************************************
//STEP0200 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE WHICH IS SPLIT INTO 6 RECORDS,
// DISP=SHR,LRECL=480
//SORTOUT DD DSN=YOUR OUTPUT FILE WHICH COMBINES 6 RECORDS INTO ONE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
//*
Note to kolusu: I was writing the following before I saw your post.
When you state 'an even multiple of the blocksize' do you mean this or do you actually mean 'an exact multiple'. I don't understand why the mutiple shouldn't be odd (e.g. 57 * 480 as opposed to 58 * 480)
You can do this with IEBGENER, DFSORT, FILEAID, etc..
All you need to do is:
1/ When you create it, make sure the blocksize of your '80 character' dataset is a multiple of 480 (do not use system determined blocksize) e.g. BLKSIZE=27840 for 3390 is OK.
2/ Simply put an LRECL=480 override on your input dataset and copy it to the 480 character output dataset.
e.g.
SYSUT1 is the dataset with the groups of 6 80 character records and SYSUT2 is the resulting output dataset with them joined back into 480 character records.
DFSORT can do the same with 'MERGE FIELDS=COPY' or FILEAID with its COPY function.
Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Tue Jan 13, 2004 7:36 am Post subject:
Mike,
I remember getting an S013 abend when the BLKSIZE is an ODD mulitple of the LRECL.in this case the odd multiple of blksize will result in a abend as we are combining an even number(6) records into a single record. I cannot test it right now but may be some one can test with an odd multiple of the blksize.
Kolusu,
I have tested with:
1500 x 80 char records
blocksize=27360 (= 57 * 480)
with IEBGENER, DFSORT and FILEAID
and in each case it works fine, with 250 correctly joined records created.
I have never come across the problem you are describing; as per above I understood that the only requirement is that the overiding LRECL is an exact (odd or even) multiple of the blocksize. Perhaps this was a problem a number of years ago which does not apply now?
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum