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

Multiple processing in a file


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

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Mon Oct 20, 2008 11:37 pm
Reply with quote

this is my input, csv since it will be transferred from pc to mainframe
record 1 is the one with text "Doorbelasting voor ALLE loketten"


Doorbelasting voor ALLE loketten

Totaal aantal loketten : 377713;
bankcode;banknaam;aantal loketten;%;
1049;Cooperatieve Rabobank Stein en Beek U.A;1992;0,53;
1050;Coöperatieve Rabobank Laarbeek U.A.;1072;0,28;
1062;Cooperatieve Rabobank Valkenburg aan de Geul U.A.;223;0,06;
1066;Cooperatieve Rabobank 3B Hoek U.A.;3335;0,88;
1083;Rabobank Swentibold;680;0,18;
totaal;377713;100;


This is what should happen

see attachment output file
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 Oct 20, 2008 11:53 pm
Reply with quote

Your description of what you want is NOT clear.

For the input records you showed in your example, please show the expected output records.

What do you mean by "Null"? Do you mean binary zeros (X'00's)? Or do you mean something else (show in hex if appropriate)?

What is "CGW"?

It appears we can delete any record that does not start with a '1' - right?

Are the N(x) types character numeric values like '1234' or something else?

Quote:
CCYY This is the year of the month the data are related to.

MM The number of the month the data are related to.


I don't know what you mean by this. Do you mean the current year and month (e.g. 200810)? If not, you need to explain exactly what you mean by this.
Back to top
View user's profile Send private message
revdpoel

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Tue Oct 21, 2008 12:49 am
Reply with quote

Frank I will give you the answers

NULL might just be spaces (i putted in 'xxxxxxxx'
CGW is our systemcode, just a alphanumeric field
It appears we can delete any record that does not start with a '1' - right? No, that's not right. The first 4 records should be deleted as well as the last one
N(x) types are charachter numeric, as in your example
Let's say the input file consists of the first 7 records (so including the 1049 en 1050 and 1062) as well as the last one the the output must look like this
for date I took 20081020 (20 Octobre 2008), for time 211632
the version-number was 0005, so becomes 0006

0SAA000620081020211632xxxxxxxxCGW
120081010491992
120081010501072
120081010620023
900000005
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 Oct 21, 2008 1:18 am
Reply with quote

Quote:
It appears we can delete any record that does not start with a '1' - right? No, that's not right. The first 4 records should be deleted as well as the last one


I don't understand. In your input example, these are the first four records you show:

Code:

Doorbelasting voor ALLE loketten

Totaal aantal loketten : 377713;
bankcode;banknaam;aantal loketten;%;


and this is the last record you show:

Code:

totaal;377713;100;


Those are the ones you say you want deleted. They also happen to be the only ones in your example that do NOT have '1' in position 1. So how is deleting the first 4 records and the last record different from deleting the records that don't have a '1' in position 1?

Can any of the first 4 records have a '1' in position 1? Can the last record have a '1' in position '1'? Can any of the other records NOT have a '1' in position 1?

I'm just looking for a way to use an OMIT condition to delete the records you want to delete since that's easier then deleting the last record. If the not '1' test won't work, then is there another test that will work such as a test for a non-numeric in position 1?

Maybe you need to show a better example of the input records?

This input record has 223:

1062;Cooperatieve Rabobank Valkenburg aan de Geul U.A.;223;0,06;

But for output, you show 0023:

120081010620023

Where did the 0023 come from? That's supposed to be an N(7) output field - how does that fit with the 4-character input field, for example, '1992' or '0223' -> N(7) field with leading zeros or N(4) field with leading zeros or what?

Other inconsistencies/questions:

In your description of the header, you show the CCYYMMDD value twice. In your output header, you show it once. Which is it?

You didn't answer my question about the year and month the data are related to. In your output records you show '200810' so is it just the current year and month?

What is the RECFM and LRECL of the input file?

What is the RECFM and LRECL of the output file?

What is the RECFM and LRECL of the separate file with the version number? Does the value in this file have 5 digits or 4 digits? That is:

00005

or

0005
Back to top
View user's profile Send private message
revdpoel

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Tue Oct 21, 2008 1:32 am
Reply with quote

Can any of the first 4 records have a '1' in position 1? No
Can the last record have a '1' in position '1'? No
Can any of the other records NOT have a '1' in position 1? Yes
The records I need will always start with 4 positions numeric before the first delimiter

I was indeed wrong about the header record. it should contain two times the date, which are just current year and month and day

0SAA00062008102021163220081020xxxxxxxxCGW
120081010491992
120081010501072
120081010620023
900000005

Both files are FB. Input LRECL is 80, ouput LRECL is 41.
Input is an excel-file which is been uploaded to mainframe, so it contains delimiters (;)
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 Oct 21, 2008 1:56 am
Reply with quote

Another question:

This input record has 223:

1062;Cooperatieve Rabobank Valkenburg aan de Geul U.A.;223;0,06;

But for output, you show 0023:

120081010620023

Where did the 0023 come from? That's supposed to be an N(7) output field - how does that fit with the 4-character input field, for example, '1992' or '0223' -> N(7) field with leading zeros or N(4) field with leading zeros or what?

Assuming that you just want that field copied as is, here's my guess at a DFSORT job that will do what I think you want. If it doesn't give you what you want, then explain where the output it produces is different from the output you want.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *    version number file
0005
/*
//SORTOUT DD DSN=&&S1,UNIT=SYSDA,SPACE=(TRK,(1,1)),DISP=(,PASS)
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(C'VERNUM,''',1,4,ZD,ADD,+1,EDIT=(TTTT),C'''',80:X)
/*
//S2    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SYMNAMES DD DSN=&&S1,DISP=(OLD,PASS)
//SORTIN DD *    input file
Doorbelasting voor ALLE loketten

Totaal aantal loketten : 377713;
bankcode;banknaam;aantal loketten;%;
1049;Cooperatieve Rabobank Stein en Beek U.A;1992;0,53;
1050;Coöperatieve Rabobank Laarbeek U.A.;1072;0,28;
1062;Cooperatieve Rabobank Valkenburg aan de Geul U.A.;223;0,06;
1066;Cooperatieve Rabobank 3B Hoek U.A.;3335;0,88;
1083;Rabobank Swentibold;680;0,18;
totaal;377713;100;
/*
//SORTOUT DD DSN=...  output file (FB/41)
//SYSIN    DD    *
  OPTION COPY                                                 
  OMIT COND=(1,4,FS,NE,NUM)                                   
  OUTFIL REMOVECC,                                             
    HEADER1=('0SAA',VERNUM,DATENS=(4MD),TIMENS=(24),           
       DATENS=(4MD),8X,'CGW'),                                 
    IFOUTLEN=41,                                               
    IFTHEN=(WHEN=INIT,PARSE=(%01=(ENDBEFR=C';',FIXLEN=4),     
      %=(ENDBEFR=C';'),                                       
      %02=(ENDBEFR=C';',FIXLEN=7)),                           
     BUILD=(C'1',DATE2,%01,%02)),                             
    TRAILER1=('9',COUNT+2=(M11,LENGTH=8))                     
/*
Back to top
View user's profile Send private message
revdpoel

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Tue Oct 21, 2008 2:56 am
Reply with quote

sorry Frank you are right

120081010620023 should be
120081010620000223
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 Oct 21, 2008 3:18 am
Reply with quote

If you want those last 7 digits with leading zeros, just change the S2 BUILD line to:

Code:

     BUILD=(C'1',DATE2,%01,%02,UFF,EDIT=(TTTTTTT))),     
Back to top
View user's profile Send private message
revdpoel

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Tue Oct 21, 2008 8:24 pm
Reply with quote

Frank, thanks
one of these coming days I will try it out and let you know
thanks again
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 Oct 21, 2008 9:12 pm
Reply with quote

Quote:
one of these coming days I will try it out and let you know


Glad to know I spent time on this so you could maybe try it out some day ... sheesh. icon_rolleyes.gif
Back to top
View user's profile Send private message
revdpoel

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Tue Oct 21, 2008 10:04 pm
Reply with quote

Frank, don't misunderstand me
I know this works and we will certainly take it into production
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 Oct 21, 2008 10:09 pm
Reply with quote

Ok. It sounded like this was something you really didn't care about. Glad to know you do.
Back to top
View user's profile Send private message
revdpoel

New User


Joined: 01 Nov 2006
Posts: 56

PostPosted: Tue Oct 21, 2008 10:14 pm
Reply with quote

Be sure I am very happy with your help
There is so much information in the Programming Guide that sometimes it is hard to find the right way
I look up your suggestions in the guide and so hope to learn something
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 Binary File format getting change whi... All Other Mainframe Topics 7
No new posts Compare 2 files and retrive records f... DFSORT/ICETOOL 3
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