View previous topic :: View next topic
|
Author |
Message |
marvs13th
New User
Joined: 22 Jun 2007 Posts: 5 Location: philippines
|
|
|
|
Hi;
I had an input file(i.e. INFILE1) which have a record length of 87. My specs requires that the last 7 characters of INFILE1 to be strip using a JCL code WITHOUT SORTING the file.
In summary:
INFILE1 (LRECL=87) ===> OUTFILE1 (LRECL=80)
I tried the PGM=IEBGENER but I have problem in truncating the record.....
Need your asist here thanks |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/87)
//SORTOUT DD DSN=... output file (FB/80)
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,80)
/*
|
|
|
Back to top |
|
|
marvs13th
New User
Joined: 22 Jun 2007 Posts: 5 Location: philippines
|
|
|
|
Thank you.....the code works |
|
Back to top |
|
|
0d311
Guest
|
|
|
|
Or using IEBGENER,
Code: |
//IEBGENER EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SYSUT1 DD DSN=input.dsn.fb87,DISP=SHR
//SYSUT2 DD DSN=output.dsn.fb80,DISP=(NEW,CATLG,DELETE),
// DCB=(LRECL=80,RECFM=FB)
//SYSIN DD *
GENERATE MAXFLDS=1
RECORD FIELD=(80,1,,1)
/*
|
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Frank,
A small question here: In your JCL if one don't code
then also the code should suffice.
Please let me know if it changes the processing speed of JOB. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
krisprems wrote: |
then o/p file would have the LRECL of 87 not 80, and hence wont suffice! |
Hi,
When you code the LRECL=80 in the DCB of outout file, then even if you don't code INREC BUILD=(1,80) output will shrink to LRECL 80. What I thought is, INREC will make SORT to work on only 80-characters of input file instead of taking all 87-characters during COPY process.
P.S.: I think, I've mixed the DCB (of output files) of IEBGENER JCL to SORT. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Anuj,
Yes, it's true that if you use LRECL=80 on the //SORTOUT DD, DFSORT will truncate the output records to 80, and doing it that way would probably be more efficient than using INREC or OUTREC to truncate the records. However, in terms of "documentation" and avoiding pitfalls, there's something to be said for using INREC or OUTREC to set the record length explicitly rather than depending on the LRECL of the DD statement. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Thanks for the clarification Frank.
Frank Yaeger wrote: |
Yes, it's true that if you use LRECL=80 on the //SORTOUT DD, DFSORT will truncate the output records to 80, and doing it that way would probably be more efficient than using INREC |
But if you have a larger file of say, LRECL=400 or more & some million-records, & you code INREC BUILD=(1,80) to get LRECL of 80 in output instead of codeing LRECL=80 in DCB of SORTOUT, don't you think INREC will sigificantly reduce the processing speed of that JOB, as INREC will mask only first 80-characters of input for the COPY process of SORT, whilst without INREC system will process the whole chunk of data?
Please advise. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
I tried this and the INREC step was actually slower. INREC requires extra processing to reformat every record. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Frank Yaeger wrote: |
I tried this and the INREC step was actually slower. INREC requires extra processing to reformat every record. |
Thanks Frank, for enganging your valuable time for my rather stupid query. |
|
Back to top |
|
|
krisprems
Active Member
Joined: 27 Nov 2006 Posts: 649 Location: India
|
|
|
|
Quote: |
I tried this and the INREC step was actually slower. INREC requires extra processing to reformat every record.
|
Okay, this is the reason the documentation says
Quote: |
INREC and OUTREC should not be used unless they are actually needed to reformat your records.
|
|
|
Back to top |
|
|
|