MVSFORUMS.com A Community of and for MVS Professionals
View previous topic :: View next topic
Author
Message
somuk Beginner Joined: 04 Feb 2003 Posts: 113 Topics: 37
Posted: Thu Feb 19, 2004 9:15 am Post subject: Stacking the fields one by one
Hi,
I have an input file in the following format.
Code:
misc1 line-1 line-2 line-3 line-4 line-5 line-6 line-7 line-8 line-9
1111 It's 1 It's 2 It's 3 It's 4 It's 5 It's 6 It's 7 It's 8 It's 9
3333 It's 1 It's 2 It's 3 It's 4 It's 5 It's 6 It's 7 It's 8 It's 9
I would like to reformat this as follows.
Code:
misc1 All-lines
1111 It's 1
It's 2
It's 3
It's 4
It's 5
It's 6
It's 7
It's 8
It's 9
Is this possible using any utilities.
Here is my file details.
Code:
File LRECL- 986 . Below the field position and length.(position,length)
Misc1 1,362
line-1 363,100
line-2 464,100
line-3 565,100
line-4 666,100
line-5 767,100
line-6 868,30
line-7 899,30
line-8 930,15
line-9 946,40
_________________ Regds,
Somu Last edited by somuk on Thu Feb 19, 2004 11:48 am; edited 1 time in total
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Feb 19, 2004 10:58 am Post subject:
Somu,
where is MISC2 (2222) coming from ? Is it a hard coded value?
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
somuk Beginner Joined: 04 Feb 2003 Posts: 113 Topics: 37
Posted: Thu Feb 19, 2004 11:47 am Post subject:
Sorry Kolusu. It was a typo. I corrected the original message. _________________ Regds,
Somu
Back to top
kolusu Site Admin Joined: 26 Nov 2002 Posts: 12376 Topics: 75 Location: San Jose
Posted: Thu Feb 19, 2004 12:53 pm Post subject:
Somu,
The following JCL will give you desired results. As I busy packing , I really did not test it. Here is something which will give you the desired results. It will copy the first 362 bytes as is from input file and in 363 pos you will have the line info
Code:
//STEP0100 EXEC PGM=SORT
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=YOUR INPUT FILE,
// DISP=SHR
//SORTOUT DD SYSOUT=*
//SYSIN DD *
SORT FIELDS=COPY
OUTFIL REMOVECC,
HEADER1=(001:C'MISC1',
363:C'ALL-LINES'),
OUTREC=(1,362,363,100,/,
362X,464,100,/,
362X,565,100,/,
362X,666,100,/,
362X,767,100,/,
362X,868,30,/,
362X,899,30,/,
362X,930,15,/,
362X,946,40)
/*
Hope this helps...
Cheers
Kolusu _________________ Kolusu
www.linkedin.com/in/kolusu
Back to top
Frank Yaeger Sort Forum Moderator Joined: 02 Dec 2002 Posts: 1618 Topics: 31 Location: San Jose
Posted: Thu Feb 19, 2004 12:57 pm Post subject:
Somu,
Here's another way to do it with DFSORT. I assumed you really didn't want the header fields:
Code:
//S1 EXEC PGM=ICEMAN
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=... input file
//SORTOUT DD DSN=... output file
//SYSIN DD *
OPTION COPY
OUTFIL OUTREC=(1,362,363:363,100,/,363:464,100,/,363:565,100,/,
363:666,100,/,363:767,100,/,363:868,30,/,363:899,30,/,
363:930,15,/,363:946,40)
/*
_________________ Frank Yaeger - DFSORT Development Team (IBM)
Specialties: JOINKEYS, FINDREP, WHEN=GROUP, ICETOOL, Symbols, Migration
DFSORT is on the Web at:
www.ibm.com/storage/dfsort
Back to top
somuk Beginner Joined: 04 Feb 2003 Posts: 113 Topics: 37
Posted: Thu Feb 19, 2004 2:51 pm Post subject:
Thanks Kolusu and Frank. It did the trick..!!! _________________ Regds,
Somu
Back to top
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum