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: 10873
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: 7309
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 Compare 2 files and retrive records f... DFSORT/ICETOOL 3
No new posts TRIM everything from input, output co... DFSORT/ICETOOL 1
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 8
No new posts Extract the file name from another fi... DFSORT/ICETOOL 6
No new posts How to split large record length file... DFSORT/ICETOOL 10
Search our Forums:

Back to Top