View previous topic :: View next topic
|
Author |
Message |
nithivenkat
New User
Joined: 15 Sep 2008 Posts: 22 Location: Mumbai
|
|
|
|
I want to write a sort parm for which the input file is a flat file.If the input file has record as '00', the output file should be created as 00 00 00 00 .... till the end . if the input file has '11' , then output must be 11 11 11 11 .... till the end.
I/P1 : 00
O/P1 : 00 00 00 00 00 ..... til the end
I/P2 : 11
O/P2 : 11 11 11 11 11 ..... til the end |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
nithivenkat,
Does your input file have only these 2 possible values- '00' and '11' ? Or do you expect something else? What is the input/output LRECL? |
|
Back to top |
|
|
nithivenkat
New User
Joined: 15 Sep 2008 Posts: 22 Location: Mumbai
|
|
|
|
Hi Arun,
LRECL of both the file is 100 bytes.
the input file can have any value. the logic is i want the value repeated with a space in between in the output file.
Thanks |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
nithivenkat,
What business requirement is served by merely repeating the values n number of times? I have seen efforts being made to reduce reduntant information. You're trying to do the reverse.
I dont see anything other than this.
Code: |
//STEP1 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN= Input file
//SORTOUT DD DSN= Output file
//SYSIN DD *
OPTION COPY
INREC BUILD=(1,2,X,1,2,X,1,2,X,.......)
|
|
|
Back to top |
|
|
umasankarmf
New User
Joined: 08 Sep 2008 Posts: 43 Location: india
|
|
|
|
Hi,
If I/P and O/P files have save LRECL, what about the spaces in the O/P file? Some data will be truncated...........! |
|
Back to top |
|
|
nithivenkat
New User
Joined: 15 Sep 2008 Posts: 22 Location: Mumbai
|
|
|
|
Hi,
Instead of giving 1,2,x many times in the sort, I want to know if there is any single command to be given in the sort to get the values repeated with a space in between in the output file...
Thanks, |
|
Back to top |
|
|
dick scherrer
Moderator Emeritus
Joined: 23 Nov 2006 Posts: 19244 Location: Inside the Matrix
|
|
|
|
Hi Arun,
Quote: |
What business requirement is served by merely repeating the values n number of times? I have seen efforts being made to reduce reduntant information. You're trying to do the reverse. |
Not only a questionable request, but
Quote: |
Instead of giving 1,2,x many times in the sort, I want to know if there is any single command to be given in the sort to get the values repeated with a space in between in the output file... |
a lazy request as well. . .
I wonder what should happen if the input is other than 2 characters? Should 111 become 111 111 111 or something else?
People would get useful replies so much quicker if they explained what they really needed to accomplish rather than technical tidbit. If we understand the business requirement, we can provide far better replies. . .[sigh] |
|
Back to top |
|
|
|