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

Need to get only the Data Part.


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

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Mon Feb 23, 2009 9:49 am
Reply with quote

Hi all,

I am having an input file which contains Header, trailer, Title an Data Part.

Could you guys please help me to get only the Data portion of the file into one file. For e.g:

Code:

The Report
Dated : 23/02/2008
SL No;Report Numeber;values
1;123456;2000
2;256488;2330
3;598654;1254
Total No - 3


So my o/p Should be like below,

Code:

1;123456;2000
2;256488;2330
3;598654;1254


Simillarly i just need another Sort card which will do the Vice versa,

Input File- 1

Code:

a;aaaaaa;1234
b;vvvvvv;2330
C;zzzzzz;1254


Input File 2

Code:

The Report
Dated : 23/02/2008
SL No;Report Numeber;values
1;123456;2000
2;256488;2330
3;598654;1254
Total No - 3


So my output should be like below,

Code:

The Report
Dated : 23/02/2008
SL No;Report Numeber;values
a;aaaaaa;1234
b;vvvvvv;2330
C;zzzzzz;1254
Total No - 3


That is it will copy the Data from File 2 and the header and trailer stuffs from File 1 and put in the O/P File.

Let all the files are Of FB and having LRECL=80.

If somebody is having sample sort cards please help me.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Mon Feb 23, 2009 9:51 pm
Reply with quote

How do we identify the "header and trailer stuffs" programmatically?

Is it the first three records and last record, or the records that don't have a semicolon in position 2, or what?
Back to top
View user's profile Send private message
Niki

Active User


Joined: 20 Sep 2008
Posts: 106
Location: Bangalore

PostPosted: Tue Feb 24, 2009 10:01 am
Reply with quote

Hi Frank,

Thanks for ur reply.

yes, It is the First three and the last record itself.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Developer


Joined: 15 Feb 2005
Posts: 7129
Location: San Jose, CA

PostPosted: Tue Feb 24, 2009 10:02 pm
Reply with quote

You can use a DFSORT/ICETOOL job like the following for your first requirement:

Code:

//S1   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN DD DSN=...  input file
//OUT DD DSN=...  output file
//TOOLIN DD *
SUBSET FROM(IN) TO(OUT) REMOVE INPUT FIRST(3) LAST
/*


You can use a DFSORT/ICETOOL job like the following for your second requirement. Make sure OUT is a MOD data set.

Code:

//S2   EXEC  PGM=ICETOOL
//TOOLMSG   DD  SYSOUT=*
//DFSMSG    DD  SYSOUT=*
//IN1 DD DSN=... input file1 (has new data)
//IN2 DD DSN=... input file2 (has header/old data/trailer)
//*** OUT MUST BE A MOD DATA SET
//OUT DD DISP=MOD,DSN=...  output file (has header/new data/trailer)
//TOOLIN DD *
SUBSET FROM(IN2) TO(OUT) KEEP INPUT FIRST(3)
COPY FROM(IN1) TO(OUT)
SUBSET FROM(IN2) TO(OUT) KEEP INPUT LAST
/*
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 Store the data for fixed length COBOL Programming 1
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
No new posts SCOPE PENDING option -check data DB2 2
No new posts Check data with Exception Table DB2 0
No new posts JCL EXEC PARM data in C Java & MQSeries 2
Search our Forums:

Back to Top