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

Create output file from control card


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

New User


Joined: 29 Apr 2014
Posts: 2
Location: India

PostPosted: Thu Mar 12, 2015 3:14 pm
Reply with quote

Hi,

I have a requirement in which i have to read a control card and create output file based on the range(highlighted in yellow) present in control card.

Code:
Control card--012345001 029820000 9
                    100018369 102347359 9



output file should be like below:
Code:
SORT FIELDS=(6,6,BI,A,632,8,BI,A,20,17,BI,A,37,7,BI,D)
OUTFIL FILES=01,                                       
    INCLUDE=(0005,001,CH,EQ,C'0',       
             OR,                                       
             0005,001,CH,EQ,C'9',             
             OR,                                       
              (0100,008,BI,GE,0012345001,
               AND,                                   
               0100,008,BI,LE,0029820000),
             OR,                         
              (0100,008,BI,GE,0100018369,
              AND,                       
              0100,008,BI,LE,0102347359))

Based on control card range 100,8 position in o/p file has to written. remaining are all should be built as it is.


Please guide me to create this using sort/eazytrieve.

Code'd
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10765
Location: italy

PostPosted: Thu Mar 12, 2015 3:24 pm
Reply with quote

the yellow color makes the post unreadable icon_evil.gif
Back to top
View user's profile Send private message
Sureznicky

New User


Joined: 29 Apr 2014
Posts: 2
Location: India

PostPosted: Thu Mar 12, 2015 3:36 pm
Reply with quote

Sorry for making it unreadable.


I have a requirement in which i have to read a control card and create output file based on the range present in control card.

Code:
Control card--012345001 029820000 9
                    100018369 102347359 9



output file should be like below:
Code:
SORT FIELDS=(6,6,BI,A,632,8,BI,A,20,17,BI,A,37,7,BI,D)
OUTFIL FILES=01,
INCLUDE=(0005,001,CH,EQ,C'0',
OR,
0005,001,CH,EQ,C'9',
OR,
(0100,008,BI,GE,0012345001,
AND,
0100,008,BI,LE,0029820000),
OR,
(0100,008,BI,GE,0100018369,
AND,
0100,008,BI,LE,0102347359))


Based on control card range 100,8 position in o/p file has to written. remaining are all should be built as it is.


Please guide me to create this using sort/eazytrieve.

Code'd
Back to top
View user's profile Send private message
Devil_13

New User


Joined: 17 Mar 2015
Posts: 2
Location: India

PostPosted: Wed Mar 18, 2015 10:29 pm
Reply with quote

Hi Suresh
I think you can do it using a combination of OUTFIL HEADER1,,HEADER3 and TRAILER1.

you can refer to this sample code:
Code:

SORT FIELDS=COPY
OUTFIL FNAMES=SORTOUT,REMOVECC,NODETAIL,
SECTIONS=(1,8
HEADER3=(C'(0100,008,BI,GE,',1,8,,C',',/,
                 C'AND',',/,
                 C'0100,008,BI,LE,',9,8,,C'),',/,
                 C'OR,')),
HEADER1=(C'SORT FIELDS=(6,6,BI,A,632,8,BI,,A,,20,17,,BI,,A,
                 C'37,7,BI,D)',/,
                 C'OUTFIL FILES=01,',/,
                 C'INCLUDE=(005,001,CH,EQ,C''',C'0',C''',',/,
                 C'OR,'),
TRAILER1=(C'005,001,,CH,EQ,C''',C'9',''')')


I have assumed the key length in control card to be 8.

Thanks
Devil13
Back to top
View user's profile Send private message
Bill Woodger

Moderator Emeritus


Joined: 09 Mar 2011
Posts: 7310
Location: Inside the Matrix

PostPosted: Wed Mar 18, 2015 11:03 pm
Reply with quote

Devil_13,

Why would there be a key?
Back to top
View user's profile Send private message
Devil_13

New User


Joined: 17 Mar 2015
Posts: 2
Location: India

PostPosted: Thu Mar 19, 2015 1:59 am
Reply with quote

Hi Bill,
I meant the content of the control card:
Code:

012345001 029820000 9
100018369 102347359 9


Since these will be part of the include condition i mentioned them as keys. probably a range of account numbers or any unique identifiers i guess icon_smile.gif

Thanks
Devil13
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 Get two files from one file with diff... DFSORT/ICETOOL 10
No new posts View GDG data which is copied from a ... JCL & VSAM 2
No new posts How to read unpacked field created in... DFSORT/ICETOOL 11
No new posts How to add 2 digits to COMP-3 file? DFSORT/ICETOOL 11
This topic is locked: you cannot edit posts or make replies. Sort card help to prepare status report DFSORT/ICETOOL 13
Search our Forums:

Back to Top