View previous topic :: View next topic
|
Author |
Message |
maxsubrat
Active User
Joined: 27 Feb 2008 Posts: 110 Location: india
|
|
|
|
Hi,
I have a input vsam file and The record length are 3616
01 PA-RECORD.
05 LT-TEXT-KEY PIC X(04).
05 LT-FORM-1 PIC X(06).
05 LT-FORM-2 PIC X(06).
05 LT-TEXT-LINE PIC X(90) OCCURS 40.
My output file will be:
I need to omit LT-FORM-1 and LT-FORM-2, only want to keep LT-TEXT-KEY and LT-TEXT-LINE.
For LT-TEXT-KEY, I just wnat to keep only for SS01 , HH01 & ZZ01.
the output wil be be as below top to bottom:
SS01
line1
line2
-
-
line40
************
HH01
line1
line2
-
-
line40
************
ZZ01
line1
line2
-
-
line40
************
I have tried to get it in a line for each key, not sure how to put vertically as above.
Thanks
Maxs |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Maxs,
Your requirement is not clear at all..
Post your input and expected output with code tags and also the code what you have tried |
|
Back to top |
|
|
enrico-sorichetti
Superior Member
Joined: 14 Mar 2007 Posts: 10872 Location: italy
|
|
|
|
seems pretty clear to me ...
just forget about the field lengths ...
given a set of records like
Code: |
key1<some fields to be ignored>A1A2A3...Ann
key2<some fields to be ignored>B1B2B3...Bnn
|
the ts wants
Code: |
Key1
A1
A2
A3
...
Ann
key2
B1
B2
B3
...
Bnn |
|
|
Back to top |
|
|
maxsubrat
Active User
Joined: 27 Feb 2008 Posts: 110 Location: india
|
|
|
|
I have mentioned my input file structure very clearly..
4 fields .. the 4th field has occurs 40 times.
my output should be 1st and 4th field only...
We can do SORT to fetch all the records based on the key...
But each record will come in a line.. Instead of, I want to put each field in a separate line.
Just want to know whether this is possible in SORT ? |
|
Back to top |
|
|
Pandora-Box
Global Moderator
Joined: 07 Sep 2006 Posts: 1592 Location: Andromeda Galaxy
|
|
|
|
Can you post what you have tried?
Thanks Enrico |
|
Back to top |
|
|
maxsubrat
Active User
Joined: 27 Feb 2008 Posts: 110 Location: india
|
|
|
|
I tried with OUTFIELD BUILD with using / for each field to come to next line. It's working fine...
Thanks |
|
Back to top |
|
|
Arun Raj
Moderator
Joined: 17 Oct 2006 Posts: 2481 Location: @my desk
|
|
|
|
maxsubrat,
If your input VSAM data set is of fixed-length, you could use the ICETOOL RESIZE operator to achieve this, to avoid repeating code for each line.
Code: |
//STEP01 EXEC PGM=ICETOOL
//IN DD DISP=SHR,DSN= (VSAM Input AvgLen/Maxlen=3616)
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//OUT DD DISP=(,CATLG),DSN= (FB Output LRECL=90)
//TOOLIN DD *
RESIZE FROM(IN) TO(OUT) TOLEN(90) USING(CTL1)
//CTL1CNTL DD *
INCLUDE COND=(1,4,SS,EQ,C'SS01,HH01,ZZ01')
INREC BUILD=(1,4,91:17,3600)
OUTFIL OMIT=(1,1,CH,EQ,C' ') |
|
|
Back to top |
|
|
|