View previous topic :: View next topic
|
Author |
Message |
sdurvasu
New User
Joined: 14 Apr 2008 Posts: 15 Location: chennai
|
|
|
|
Help me to copy from a VB dataset to an FB dataset using IEBGENER or IDCAMS without using SORT. |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello surya and welcome to the forums,
Who comes up with these "requirements". . .? Surely this is no business requirement. . . . Please tell whoever came up with the "without using SORT" rule that they have excluded the best way to copy a file (if there is any concern for performance).
I don't recall being able to do this with IEBGENER (without writing an exit), but if it can be done, someone will reply.
Over the years, i've completely gotten away from IDCAMS for anything execpt catalog and vsam things. It performs poorly. |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi,
here is a piece of code using IEBGENER
Code: |
//COPY EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
GENERATE MAXFLDS=1
RECORD FIELD=(129,1,,1)
//SYSUT1 DD DSN=INPUT FILE VB=133 ,
// DISP=SHR
//SYSUT2 DD DSN=OUTPUT FILE,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(600,10),RLSE),
// DCB=(RECFM=FB,LRECL=129)
|
Short records will be padded out with binary zeroes.
Gerry |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
Well, I'm with Dick on this one. You just can not beat SORT !!! |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Expat,
I agree with you but they did say no SORT.
Gerry |
|
Back to top |
|
|
sdurvasu
New User
Joined: 14 Apr 2008 Posts: 15 Location: chennai
|
|
|
|
Can't we do that IEBCOPY also? i just want to know all the possibilities thats'it .. |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
No, IEBCOPY is a PDS utility.
So why is there a restriction on using the fastest and easiest tool available.
Just a thought though, if you can not use SORT why not try ICETOOL |
|
Back to top |
|
|
sdurvasu
New User
Joined: 14 Apr 2008 Posts: 15 Location: chennai
|
|
|
|
we are using one tool that will write jcl based on requirements ,now we have to add one more step at the bottom, |
|
Back to top |
|
|
expat
Global Moderator
Joined: 14 Mar 2007 Posts: 8796 Location: Welsh Wales
|
|
|
|
sdurvasu wrote: |
we are using one tool that will write jcl based on requirements ,now we have to add one more step at the bottom, |
Yes, but what has this to do with converting a VB dataset to FB ?
ICETOOL code - may need changing as this extracts from a 2044 VB record into an 80 FB record.
Code: |
//ICETOOL EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//INFILE DD DSN=INPUT DATASET,DISP=SHR
//OUFILE DD DSN=OUTPUT DATASET,
// DISP=(,CATLG,DELETE),
// SPACE=(CYL,(10,10),RLSE),RECFM=FB,LRECL=80
//TOOLIN DD *
COPY FROM(INFILE) TO(OUFILE) USING(COPY)
/*
//COPYCNTL DD *
* LRECL DEFAULTS TO LENGTH OF SELECTED FIELDS + SPACES
* 80:X SETS LRECL TO 80 WITH C' ' FILLER FROM DATA END TO POS 80
OPTION VLLONG
INCLUDE COND=(9,1,EQ,C'M'),FORMAT=CH
OUTFIL FNAMES=OUFILE,CONVERT,OUTREC=(29,44,80:X),VLFILL=C' '
/*
|
|
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Quote: |
we are using one tool that will write jcl based on requirements ,now we have to add one more step at the bottom,
|
I believe we all understand that a new step is being added. What we do not understand is why this new step should not be the sort product |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
Hi gcicchet,
Should not the statement RECORD FIELD=(129,1,,1) actually be:
RECORD FIELD=(129,5,,1) because data in input VB file actually starts from column 5?
//COPY EXEC PGM=IEBGENER
//SYSPRINT DD SYSOUT=*
//SYSIN DD *
GENERATE MAXFLDS=1
Quote: |
RECORD FIELD=(129,1,,1) |
//SYSUT1 DD DSN=INPUT FILE VB=133 ,
// DISP=SHR
//SYSUT2 DD DSN=OUTPUT FILE,
// DISP=(,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(TRK,(600,10),RLSE),
// DCB=(RECFM=FB,LRECL=129)
Thanks,
Ajay |
|
Back to top |
|
|
gcicchet
Senior Member
Joined: 28 Jul 2006 Posts: 1702 Location: Australia
|
|
|
|
Hi Ajay,
I tested my code, did you ?
Some programs work different to others, they allow for the 4 bytes.
Gerry |
|
Back to top |
|
|
Ajay Baghel
Active User
Joined: 25 Apr 2007 Posts: 206 Location: Bangalore
|
|
|
|
Hi gcicchet,
You are right . I tested it and it is working your way. But still:
RECORD FIELD=(Lengthofinputfield,position_in_input,,position_in_output)
I don't understand why IEBGENER is ignoring the fact that there is a RDW in the col1 instead of data in the input file.
-Ajay |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19243 Location: Inside the Matrix
|
|
|
|
Hello,
Different utilities - different "rules".
Maybe think of it as the difference between logical and physical position_in_input. |
|
Back to top |
|
|
|