View previous topic :: View next topic
|
Author |
Message |
rajkumarprajapati
New User
Joined: 20 Nov 2008 Posts: 9 Location: Delhi
|
|
|
|
I have a flat file with record lenght 1200. I want to extract records based on column numbers. out put records should contains data as
col 3-6 blank space col 26-74 blank splace col 77-end of records.
Thanks! |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
What is the Sort product you are using?
What have you tried, where does it go wrong?
Can you provide same input/expected output (in Code tags, please)?
Indicate what you mean by "column".
What is the Recfm? |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
what happened when You searched the forums with the include/omit keywords...
I am certain that before asking You tried something Yourself, didn' t You ? |
|
Back to top |
|
|
rajkumarprajapati
New User
Joined: 20 Nov 2008 Posts: 9 Location: Delhi
|
|
|
|
I am using DFSORT to extarct output records in desire format.
RECFB- FB
Code: |
INPUT rec:
CND001 071602 <#DBCD788V01-CONTRACT IDENTIFICATION .....V01-CONTRACT IDENTIFICATION
OUTPUT rec:
COL
3 6 26 74 77
D001 V01-CONTRACT IDENTIFICATION...... v01-TILL END OF RECORDS |
|
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
|
|
what happened when you tried something yourself
apart sitting doing nothing, waiting for somebody to do the job You are getting paid for ???
the issue is not that difficult that You could not solve it Yourself with a bit of searching ... and lurking in the jcl and dfsort forums |
|
Back to top |
|
|
Bill Woodger
Moderator Emeritus
Joined: 09 Mar 2011 Posts: 7309 Location: Inside the Matrix
|
|
|
|
There is a forum here for DFSORT topics. Next time post in there.
Your requirement is really simple. Have a search for BUILD, for instance. |
|
Back to top |
|
|
sqlcode1
Active Member
Joined: 08 Apr 2010 Posts: 577 Location: USA
|
|
|
|
rajkumarprajapati,
What is the LRECL for the input file?
Quote: |
out put records should contains data as
col 3-6 blank space col 26-74 blank splace col 77-end of records. |
Did you mean to extract data from 26th position through 74th position and then 77th position through end of record?
If that is the case, your sample input doesn't match expected output shown. 26th through 74th position has below data but that is not what you are showing in the expected output.
Code: |
V01-CONTRACT IDENTIFICATION .....V01-CONTRACT IDE |
Thanks, |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10873 Location: italy
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
rajkumar,
Here's a DFSORT job that will do what I think you're asking for:
Code: |
//S1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file (FB/1200)
//SORTOUT DD DSN=... output file (FB/1179)
//SYSIN DD *
OPTION COPY
INREC BUILD=(3,4,X,26,49,X,77,1124)
/*
|
|
|
Back to top |
|
|
rajkumarprajapati
New User
Joined: 20 Nov 2008 Posts: 9 Location: Delhi
|
|
|
|
Thank you for help. I got exact solution with following SORT card.
Code: |
//SYSIN DD *
SORT FIELDS=COPY
OUTREC BUILD=(1:3,4,6:26,49,56:77,1260)
/*
|
|
|
Back to top |
|
|
|