IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

Extract a COMP 3 field from an input file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
prarthana

New User


Joined: 12 Mar 2006
Posts: 21

PostPosted: Tue Mar 14, 2006 5:56 am
Reply with quote

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
View user's profile Send private message
fixdoubts

New User


Joined: 21 Oct 2005
Posts: 54

PostPosted: Tue Mar 14, 2006 11:23 am
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Mar 14, 2006 9:51 pm
Reply with quote

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
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top