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 File Tailoring -- Temporary dataset i... samzee71 CLIST & REXX 3 Fri Dec 01, 2017 3:12 am
No new posts Rexx - File tailoring samzee71 CLIST & REXX 10 Thu Nov 30, 2017 10:47 pm
No new posts Extract record for change in combinat... Trinadh DFSORT/ICETOOL 6 Thu Nov 23, 2017 3:32 pm
No new posts Moving a PS file as body of a mail! Vignesh Sid JCL & VSAM 4 Tue Nov 21, 2017 9:23 pm
No new posts unable to set RC = 4 when empty file migusd SYNCSORT 1 Tue Nov 21, 2017 1:21 am

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