Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

Extract a COMP 3 field from an input file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Extract a COMP 3 field from an input file
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    Post subject:
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 Moderator


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

PostPosted: Tue Mar 14, 2006 9:51 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Changing of LRECL of a file abdulrafi DFSORT/ICETOOL 2 Fri Mar 24, 2017 3:25 pm
No new posts splitting a file abdulrafi DFSORT/ICETOOL 4 Fri Mar 24, 2017 11:51 am
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us