View previous topic :: View next topic |
Author |
Message |
subho Beginner
Joined: 19 Oct 2004 Posts: 13 Topics: 4 Location: Atlanta
|
Posted: Tue Nov 16, 2004 1:24 pm Post subject: How do we create a different record length file? |
|
|
I have searched in this forum but couldn't find it. How do we create a dataset from another dataset, which will have just one byte extra? For an example, I have a file with Record Length 105. I want to create a file with same information, but record length of 106. The last byte(106th byte) would be space.
I can use SYNCSORT in my system.
Thanks in advance,
Subho |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Tue Nov 16, 2004 1:43 pm Post subject: |
|
|
Subho,
Try this JCL
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR 105 LRECL FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR 106 LRECL FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,105, $ COPY FIRST 105 BYTES AS IS
X) $ PUT A SPACE IN 106TH BYTE
/*
|
_________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
subho Beginner
Joined: 19 Oct 2004 Posts: 13 Topics: 4 Location: Atlanta
|
Posted: Tue Nov 16, 2004 1:58 pm Post subject: |
|
|
It worked!!! woow.. Thanks a lot!!
Subho |
|
Back to top |
|
 |
subho Beginner
Joined: 19 Oct 2004 Posts: 13 Topics: 4 Location: Atlanta
|
Posted: Tue Nov 16, 2004 3:19 pm Post subject: |
|
|
In addition to this issue, how can we have a different length output file where additional field is in between? For an example record length of input file is 90. Output file will have record length of 91 with exact same data. But the column number 55 for all output records will have space.
Input file:
AAABBBCCC
AAACCCBBB
Output file:
AAAB BBCCC
AAAC CCBBB
Thanks,
Subho |
|
Back to top |
|
 |
kolusu Site Admin

Joined: 26 Nov 2002 Posts: 12377 Topics: 75 Location: San Jose
|
Posted: Tue Nov 16, 2004 3:30 pm Post subject: |
|
|
Subho,
Try this
Code: |
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR 90 LRECL FILE,
// DISP=SHR
//SORTOUT DD DSN=YOUR 91 LRECL FILE,
// DISP=(NEW,CATLG,DELETE),
// UNIT=SYSDA,
// SPACE=(CYL,(X,Y),RLSE)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC FIELDS=(1,54, $ COPY FIRST 54 BYTES AS IS
X, $ PUT A SPACE IN 55th BYTE
55,36) $ COPY 55 THRU 90 BYTES
/*
|
Hope this helps...
Cheers
kolusu _________________ Kolusu
www.linkedin.com/in/kolusu |
|
Back to top |
|
 |
subho Beginner
Joined: 19 Oct 2004 Posts: 13 Topics: 4 Location: Atlanta
|
Posted: Tue Nov 16, 2004 4:21 pm Post subject: |
|
|
Thanks a lot!! It's working PERFECT!!
Thanks again,
Subho |
|
Back to top |
|
 |
|
|