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
 

 

Delete Coloumns in Dataset

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

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Mon Aug 07, 2006 8:52 am    Post subject: Delete Coloumns in Dataset
Reply with quote

Hi all,

I have a flat file, with the following cols

1.
S.No Tax-Jan, Tax-Feb.................................Tax-Dec

I need to delete Tax-March to Tax- May cols through JCL. Is it possible ?

Do i need to do two copy of this flat file (i.e 1. Copy Tax-Jan to Tax-feb and 2. Tax-June to Tax-Dec) ?

2. I have other file which has followig cols.

S.No Tax-Jan Tax-feb Tax-Mar

Now i need to compare the above file with this above one based on the first three tax rates only. Is it possible thru JCL. Or do i have to write a cobol prog for this ?

Thanks in advance.

Regards,
Diwakar.D

--------------------------------------------------------
Nobody is perfect. I am Nobody
Back to top
View user's profile Send private message

priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Aug 07, 2006 9:19 am    Post subject: Re: Delete Coloumns in Dataset
Reply with quote

What is char length of each column?
What is RECFM?
What is LRECL?
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Mon Aug 07, 2006 9:49 am    Post subject:
Reply with quote

Piyush,
They are FB records and type is numeric. I think we can do it using File-Aid but i am not sure about givin options to the tool.

Regards,
Diwakar.D
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Aug 07, 2006 10:07 am    Post subject: Re: Delete Coloumns in Dataset
Reply with quote

I asked you what is the char length of each column ???

Well, lets assume it is 5 each. So LRECL for ur I/p file is 65.
Quote:
1.
S.No Tax-Jan, Tax-Feb.................................Tax-Dec

I need to delete Tax-March to Tax- May cols through JCL. Is it possible ?

Do i need to do two copy of this flat file (i.e 1. Copy Tax-Jan to Tax-feb and 2. Tax-June to Tax-Dec) ?

Code:
//SORTIN  DD DSN=<INPUT_DSN>,
//          DISP=SHR                           
//SORTOUT DD DSN=<OUTPUT_DSN>,           
//          DISP=(NEW,CATLG,DELETE)
//SYSIN DD *                                   
    SORT FIELDS=COPY                           
    OUTREC FIELDS=(1:1,15,16:31,35)               
/*             



Quote:
2. I have other file which has followig cols.

S.No Tax-Jan Tax-feb Tax-Mar

Now i need to compare the above file with this above one based on the first three tax rates only

What you want to do after comparison....
Check out this DFSORT trick for the complete code....
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Mon Aug 07, 2006 10:16 am    Post subject:
Reply with quote

Hi,
I need to write the records in seperate dataset which have changes in Tax-Jan to Tax-Mar in File2 when compared to File-1.

Thanks,
Diwakar.D
Back to top
View user's profile Send private message
priyesh.agrawal

Senior Member


Joined: 28 Mar 2005
Posts: 1452
Location: Chicago, IL

PostPosted: Mon Aug 07, 2006 10:18 am    Post subject: Re: Delete Coloumns in Dataset
Reply with quote

Check out the link posted in my earlier reply.
It'll tell you what exactly you are looking for.
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Mon Aug 07, 2006 8:40 pm    Post subject:
Reply with quote

Diwakar.D,

You can do this kind of thing with DFSORT. But if you want a detailed solution, you have to supply complete details of what you want to do. Show an example of the records in your input file(s) and what you want for output. Give the starting position, length and format of each relevant field. Give the RECFM and LRECL of the input file(s). Explain clearly what you want.
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Tue Aug 08, 2006 4:40 pm    Post subject:
Reply with quote

HI,

Two Flat Files need to be compared.

File - 1.

S.No Tax-JAN ........................................TAX-DEC

All are 9(5) and the type is FB.

File - 2.

S.No TAX-JAN TAX-MAR.

there will be changes for TAX in file-2.

I need to get the records which are modified in the second file.

Regards,
Diwakar
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Aug 08, 2006 8:13 pm    Post subject:
Reply with quote

If you can't do a better job of describing what you want (including an example of the input records and the output records as I requested), then I can't help you.
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Tue Oct 03, 2006 5:19 pm    Post subject:
Reply with quote

Frank,

File -1
SNO TX-01 TX-02 TX-03
00001 00245 00345 00890
00002 00345 00890 00678

File - 2

00001 00345 00345 00567 00989 .................... 00123 For 12 months.
00002 00345 00890 00678 00567 ---------------- 00777

Note that the tax for Tx01 in file 1 and file 2 is different. I need to extract the records from File-02 and i need to put the same in file03.

Record Formats:
File 01:
LRECL : 20
RECFM : FB

File 02:
LRECL : 65
RECFM : FB

Hope this information is enough.
Thanks,
Diwakar



[/b]
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Tue Oct 03, 2006 8:47 pm    Post subject:
Reply with quote

If I understand what you want (and I'm not sure I do), this DFSORT/ICETOOL job will do it:

Code:

//S1 EXEC PGM=ICETOOL
//TOOLMSG DD SYSOUT=*
//DFSMSG DD SYSOUT=*
//IN1 DD DSN=...  input file1 (FB/20)
//IN2 DD DSN=...  input file2 (FB/65)
//T1 DD DSN=&&T1,UNIT=SYSDA,SPACE=(CYL,(5,5)),DISP=(MOD,PASS)
//OUT DD DSN=...  output file (FB/65)
//TOOLIN DD *
* IN1->T1:  reformat records to:
* |key|blanks...|IN1 data|
COPY FROM(IN1) TO(T1) USING(CTL1)
* IN2->T1:  reformat records to:
* |key|IN2 data|blanks...|
COPY FROM(IN2) TO(T1) USING(CTL2)
* T1->OUT:  Splice records to get:
* |key|IN2 data|IN1 data|
* If IN2 data is not equal to IN1 data, keep
* |key|IN2 data|
SPLICE FROM(T1) TO(OUT) ON(1,5,CH) WITH(1,65) USING(CTL3)
/*
//CTL1CNTL DD *
  INREC BUILD=(1,5,66:6,15)
/*
//CTL2CNTL DD *
  INREC OVERLAY=(80:X)
/*
//CTL3CNTL DD *
  OUTFIL FNAMES=OUT,INCLUDE=(6,15,CH,NE,66,15,CH),
    BUILD=(1,65)
/*
Back to top
View user's profile Send private message
diwa_thilak

Active User


Joined: 13 Jul 2006
Posts: 205
Location: At my desk

PostPosted: Wed Oct 04, 2006 2:16 pm    Post subject:
Reply with quote

Thanks Frank ,

Can you explain the significance of these steps..
Quote:

//CTL1CNTL DD *
INREC BUILD=(1,5,66:6,15)
/*
//CTL2CNTL DD *
INREC OVERLAY=(80:X)
/*
//CTL3CNTL DD *
OUTFIL FNAMES=OUT,INCLUDE=(6,15,CH,NE,66,15,CH),
BUILD=(1,65)


i could not understand the significance of specifying 80:X and the INREC in CTL.

Thanks in advance.

Regards,
Diwakar.D

Nobody is Perfect. I am Nobody[/quote]
Back to top
View user's profile Send private message
Frank Yaeger

DFSORT Moderator


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

PostPosted: Wed Oct 04, 2006 8:31 pm    Post subject:
Reply with quote

I added comments to my job to explain what I'm doing.

Quote:
INREC BUILD=(1,5,66:6,15)


Builds an output record with IN1 input positions 1-5 in ouput positions 1-5 and IN1 input positions 6-20 in output positions 66-80.

Quote:
INREC OVERLAY=(80:X)


Since the T1 records created from IN1 are 80 bytes, the T1 records created from IN2 must also be 80 bytes. OVERLAY with 80:X just pads the 65 byte IN2 records with blanks up to and including position 80.

Quote:
OUTFIL FNAMES=OUT,INCLUDE=(6,15,CH,NE,66,15,CH),
BUILD=(1,65)


Includes records where positions 6-20 (from the IN2 record) are not equal to position 66-80 (from the IN1 record) and just keeps positions 1-65 (from the IN2 record).
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 Extra character appears in file when ... Balu5491 All Other Mainframe Topics 1 Wed Jul 26, 2017 2:39 pm
No new posts Browse dataset cvnlynn CLIST & REXX 4 Tue Jul 18, 2017 3:52 am
No new posts Fileaid 2 commands instream work. In ... descann Compuware & Other Tools 2 Tue May 16, 2017 3:31 pm
No new posts To find out size allocated to a seque... ashek15 JCL & VSAM 15 Thu Apr 27, 2017 9:42 am
No new posts LISTCAT on a dataset with symbolic pa... shreya19 JCL & VSAM 5 Fri Apr 07, 2017 5:43 pm


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