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

SORT VSAM file with each field one by one into output file


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 108
Location: india

PostPosted: Tue Mar 14, 2017 1:07 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1565
Location: Andromeda Galaxy

PostPosted: Tue Mar 14, 2017 1:34 pm
Reply with quote

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
View user's profile Send private message
enrico-sorichetti

Senior Moderator


Joined: 14 Mar 2007
Posts: 10712
Location: italy

PostPosted: Tue Mar 14, 2017 1:41 pm
Reply with quote

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
View user's profile Send private message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 108
Location: india

PostPosted: Tue Mar 14, 2017 2:57 pm
Reply with quote

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
View user's profile Send private message
Pandora-Box

Moderator


Joined: 07 Sep 2006
Posts: 1565
Location: Andromeda Galaxy

PostPosted: Tue Mar 14, 2017 6:25 pm
Reply with quote

Can you post what you have tried?

Thanks Enrico icon_smile.gif
Back to top
View user's profile Send private message
maxsubrat

Active User


Joined: 27 Feb 2008
Posts: 108
Location: india

PostPosted: Tue Mar 14, 2017 8:10 pm
Reply with quote

I tried with OUTFIELD BUILD with using / for each field to come to next line. It's working fine...

Thanks
Back to top
View user's profile Send private message
Arun Raj

Moderator


Joined: 17 Oct 2006
Posts: 2481
Location: @my desk

PostPosted: Tue Mar 14, 2017 8:21 pm
Reply with quote

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
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 Date conversion using SORT SYNCSORT 4
No new posts Converting a file from PD to display ... SYNCSORT 4
No new posts Record count of RECFM=U tape file DFSORT/ICETOOL 17
No new posts Which SORT utility can improve the Pe... DFSORT/ICETOOL 16
This topic is locked: you cannot edit posts or make replies. Write Character to Hexadecimal file w... COBOL Programming 8
Search our Forums:

Back to Top