IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

formatting records and writing to new dataset.


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
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
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: 6966
Location: porcelain throne

PostPosted: Fri Aug 10, 2007 12:57 am
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
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 Developer


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

PostPosted: Fri Aug 10, 2007 1:40 am
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
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 Developer


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

PostPosted: Sat Aug 11, 2007 8:49 pm
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:

Use [URL] BBCode for External Links
Back to top
View user's profile Send private message
Anuj Dhawan

Superior Member


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

PostPosted: Mon Aug 13, 2007 1:34 pm
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: 1287
Location: Chennai, India

PostPosted: Mon Aug 13, 2007 3:04 pm
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 Developer


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

PostPosted: Mon Aug 13, 2007 8:48 pm
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

Superior Member


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

PostPosted: Mon Aug 13, 2007 9:12 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts FINDREP - Only first record from give... DFSORT/ICETOOL 3
No new posts Compare only first records of the fil... SYNCSORT 7
No new posts Pulling a fixed number of records fro... DB2 2
No new posts Map Vols and Problem Dataset All Other Mainframe Topics 2
No new posts Allocated cylinders of a dataset DB2 12
Search our Forums:

Back to Top