Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

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

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
View previous topic :: :: View next topic  
Author Message
maxsubrat

New User


Joined: 27 Feb 2008
Posts: 78
Location: india

PostPosted: Tue Mar 14, 2017 1:07 pm    Post subject: SORT VSAM file with each field one by one into output file
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: 1535
Location: Andromeda Galaxy

PostPosted: Tue Mar 14, 2017 1:34 pm    Post subject:
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

Global Moderator


Joined: 14 Mar 2007
Posts: 10272
Location: italy

PostPosted: Tue Mar 14, 2017 1:41 pm    Post subject: Reply to: SORT VSAM file with each field one by one into output file
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

New User


Joined: 27 Feb 2008
Posts: 78
Location: india

PostPosted: Tue Mar 14, 2017 2:57 pm    Post subject: Reply to: SORT VSAM file with each field one by one into output file
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: 1535
Location: Andromeda Galaxy

PostPosted: Tue Mar 14, 2017 6:25 pm    Post subject:
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

New User


Joined: 27 Feb 2008
Posts: 78
Location: india

PostPosted: Tue Mar 14, 2017 8:10 pm    Post subject: Reply to: SORT VSAM file with each field one by one into output file
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: 2278
Location: @my desk

PostPosted: Tue Mar 14, 2017 8:21 pm    Post subject:
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts FTP xls file from Mainfrmae kumarsatheeshc1 TSO/ISPF 5 Tue Jun 20, 2017 6:56 pm
No new posts Validate if a Value from the file is ... balacsv2 COBOL Programming 8 Mon Jun 19, 2017 11:52 pm
No new posts Dynamic output file creation in cobol... smileheal COBOL Programming 7 Thu Jun 15, 2017 10:53 pm
No new posts compare 2 rows within the same file ram_vizag SYNCSORT 7 Wed Jun 14, 2017 12:34 am
No new posts XML Parse for large file muralikrishnan_new COBOL Programming 3 Mon Jun 12, 2017 12:50 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us