View previous topic :: View next topic
|
Author |
Message |
prarthana
New User
Joined: 12 Mar 2006 Posts: 21
|
|
|
|
Hi,
I have a input file(record format is FB and record lenght is 756).
I have a field in input file which is declared as S9(11) COMP-3 (it stores 11 bytes),
How do I extract this field alone from the input file?
Thanks. |
|
Back to top |
|
|
fixdoubts
New User
Joined: 21 Oct 2005 Posts: 54
|
|
|
|
Hi,
If the i dont think the field S9(11) COMP-3 will occupy 11 bytes of memory it will occupy n/2 + 1 which is 6 bytes for s9(11) comp-3.
Now lets assume that the field starts from 11th byte then it will ocupy 6 bytes till 16
In the sort step
Code: |
//stepsort exec pgm=icetool
//dfsmsg dd sysout=*
//toolmsg dd sysout=*
//infile dd dsn=file dsn
//outfile dd dsn=file dsn
//toolin dd *
copy from(infile) to(outfile) using(cnt1)
/*
//cnt1cntl dd *
outrec fields=(11,6,to=zd,length=11)
/*
//
this will do i hope
Regards,
|
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
If you want to extract just the 6-byte PD field as is, you can use this DFSORT job:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTREC FIELDS=(11,6)
/*
|
|
|
Back to top |
|
|
|