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
 
formatting records and writing to new dataset.

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Fri Aug 10, 2007 12:51 am    Post subject: formatting records and writing to new dataset.
Reply with quote

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
View user's profile Send private message

dbzTHEdinosauer

Global Moderator


Joined: 20 Oct 2006
Posts: 6968
Location: porcelain throne

PostPosted: Fri Aug 10, 2007 12:57 am    Post subject:
Reply with quote

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
View user's profile Send private message
jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Fri Aug 10, 2007 12:58 am    Post subject:
Reply with quote

sorry input data set

123456789 ------ aswasdfghjkkloiuj
123456789 ------ wwwwwwwwddscc
123456788 ------ tyghtrfdergtyhjuio

----- resembles space
As space is not coming here while posting
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: Fri Aug 10, 2007 1:40 am    Post subject:
Reply with quote

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
View user's profile Send private message
jose.jeyan

New User


Joined: 28 Jul 2006
Posts: 60
Location: Mumbai

PostPosted: Sat Aug 11, 2007 2:21 pm    Post subject: working but hav some doubts
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Sat Aug 11, 2007 8:49 pm    Post subject:
Reply with quote

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:

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
Back to top
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Aug 13, 2007 1:34 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Aaru

Senior Member


Joined: 03 Jul 2007
Posts: 1288
Location: Chennai, India

PostPosted: Mon Aug 13, 2007 3:04 pm    Post subject: Re: formatting records and writing to new dataset.
Reply with quote

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
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Aug 13, 2007 8:48 pm    Post subject:
Reply with quote

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
View user's profile Send private message
Anuj Dhawan

Senior Member


Joined: 22 Apr 2006
Posts: 6258
Location: Mumbai, India

PostPosted: Mon Aug 13, 2007 9:12 pm    Post subject:
Reply with quote

Thanks for the clarification Frank.

Quote:
i Guess that was a TYPO.

When Frank replies..I ususally forget about human mistakes. icon_cool.gif
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 Copy 4 byte of data from the last rec... arunsoods DFSORT/ICETOOL 9 Fri Oct 06, 2017 12:15 pm
No new posts sort records based on length exceeds ... maxsubrat DFSORT/ICETOOL 7 Wed Oct 04, 2017 4:48 pm
No new posts opening a dataset after reading it fr... arunsoods DFSORT/ICETOOL 5 Wed Oct 04, 2017 3:54 pm
No new posts Addition of two records on 2 fields amar143 SYNCSORT 8 Tue Oct 03, 2017 11:14 am
No new posts Updating the Trailer count in variabl... satheshbabur DFSORT/ICETOOL 6 Wed Aug 30, 2017 9:49 pm

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