Portal | Manuals | References | Downloads | Info | Programs | JCLs | Mainframe wiki | Quick Ref
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist 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 Compare yesterday's date to the one o... migusd SYNCSORT 8 Fri Sep 22, 2017 11:35 pm
No new posts Split 1 file into 10 output Files - S... Prasanth Kumar SYNCSORT 5 Sat Sep 16, 2017 12:02 am
No new posts BUILD OUTFIL based on condition other... balaji81_k DFSORT/ICETOOL 13 Fri Sep 08, 2017 11:06 pm
This topic is locked: you cannot edit posts or make replies. Extract all "IF" Statements... Adarsh Damodaran CLIST & REXX 1 Wed Sep 06, 2017 9:28 am
No new posts Remove leading spaces from numeric field rexx77 SYNCSORT 6 Wed Sep 06, 2017 2:15 am

Facebook
Back to Top
 
Job Vacancies | Forum Rules | Bookmarks | Subscriptions | FAQ | Polls | Contact Us