View previous topic :: View next topic
|
Author |
Message |
jose.jeyan
New User
Joined: 28 Jul 2006 Posts: 60 Location: Mumbai
|
|
|
|
Hi everyone,
Need help in reformating my input dataset and writing to output dataset
My requirement
Input dataset :
Code: |
123456789 aswasdfghjkkloiuj
123456789 wwwwwwwwddscc
123456788 tyghtrfdergtyhjuio
|
output data set :
Code: |
123456789 aswasdfghjkkloiuj
123456789 wwwwwwwwddscc
123456788 tyghtrfdergtyhjuio
|
just want to cut the space from the file and write as given above into the output dataset.
I think this can be done using the copy operator but could anyone please let me know the control cards..
Thanks in advance ..
Tony jose |
|
Back to top |
|
|
dbzTHEdinosauer
Global Moderator
Joined: 20 Oct 2006 Posts: 6966 Location: porcelain throne
|
|
|
|
you need to enclose your examples with code tags in order to maintain spacing.
As you can see, both input and output appear to be the same.
See BBCode FAQ. |
|
Back to top |
|
|
jose.jeyan
New User
Joined: 28 Jul 2006 Posts: 60 Location: Mumbai
|
|
|
|
sorry input data set
123456789 ------ aswasdfghjkkloiuj
123456789 ------ wwwwwwwwddscc
123456788 ------ tyghtrfdergtyhjuio
----- resembles space
As space is not coming here while posting |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Here's a DFSORT job that will do what you asked for. I assumed your input file has RECFM=FB and LRECL=80, but the job can be changed appropriately for other attributes:
Code: |
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD *
123456789 aswasdfghjkkloiuj
123456789 wwwwwwwwddscc
123456788 tyghtrfdergtyhjuio
//SORTOUT DD SYSOUT=*
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,10,11:25,56,80:X)
|
Use code tags to keep the spacing. I put them in for you in your first post. |
|
Back to top |
|
|
jose.jeyan
New User
Joined: 28 Jul 2006 Posts: 60 Location: Mumbai
|
|
|
|
hi frank ,
Thanks a lot
Its working fine but could you please explain me the control card
1,10 which is the data from 1-10 we write into sortout
11,25 which is the data from 11-25 we write into sortout
but could you please explain me wats that 56,80:x resembles
Thanks once again.
Tony jose. |
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Code: |
INREC BUILD=(1,10,11:25,56,80:X)
|
1,10 - puts input positions 1-10 in output positions 1-10
11:25,56 - puts input positions 25-80 in output positions 11-66. 11: means start at output position 11.
80:X - pads output records with blanks from the next position (67) to position 80. 80: means start at output position 80 and X is a blank. Blanks are filled in up to position 80.
If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:
Use [URL] BBCode for External Links |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Frank Yaeger wrote: |
Code: |
INREC BUILD=(1,10,11:25,56,80:X)
|
80:X - pads output records with blanks from the next position (67) to position 80. 80: means start at output position 80 and X is a blank. Blanks are filled in up to position 80. |
Frank,
From above got one thing to ask, regarding:
In this
Quote: |
80: means start at output position 80 |
what's meaning of 'start', does this mean, SPACES in output will start from 80 & will be paded back till 67 position? |
|
Back to top |
|
|
Aaru
Senior Member
Joined: 03 Jul 2007 Posts: 1287 Location: Chennai, India
|
|
|
|
Quote: |
what's meaning of 'start', does this mean, SPACES in output will start from 80 & will be paded back till 67 position |
No, it wont be padded back ! i Guess that was a TYPO.
Got this from the GETTING STARTED - DFSORT PDF
Quote: |
Specifying c:X as your last field is an easy way to increase the record length of
your output records to c bytes. For example, if you want to create 80- byte output
records containing the first 30 bytes of your input records padded with blanks, you
can use this OUTREC statement:
OUTREC BUILD=(1,30,80:X) |
|
|
Back to top |
|
|
Frank Yaeger
DFSORT Developer
Joined: 15 Feb 2005 Posts: 7129 Location: San Jose, CA
|
|
|
|
Quote: |
80:X - pads output records with blanks from the next position (67) to position 80. 80: means start at output position 80 and X is a blank. Blanks are filled in up to position 80. |
To clarify: 80:X - The X (1 blank) starts (and ends) at output position 80. Blanks are inserted from the current next position (67) to the position (79) before 80. So you get blanks padded from 67-79, and a blank in 80. Effectively, this pads with blanks up to and including position 80. |
|
Back to top |
|
|
Anuj Dhawan
Superior Member
Joined: 22 Apr 2006 Posts: 6250 Location: Mumbai, India
|
|
|
|
Thanks for the clarification Frank.
Quote: |
i Guess that was a TYPO. |
When Frank replies..I ususally forget about human mistakes. |
|
Back to top |
|
|
|