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
 

 

Empty a flat file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
View previous topic :: :: View next topic  
Author Message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Apr 18, 2007 1:50 pm    Post subject: Empty a flat file
Reply with quote

i am havin an input file as a PDS menber with lrecl=80 and blksize=80
i converted it to a flat file using FILEAID utility(by JCL) havin lrecl=133 and blksize=27930

the problem is that in output file area from 80 to 133 are not spaces but some junk characters and i want them to be spaces

so how can i create a flat file which is empty(spaces) ??
Back to top
View user's profile Send private message

William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 1:55 pm    Post subject:
Reply with quote

Sort is handy for this, either to overlay the trailing junk or to do the initial convert (correctly).
Back to top
View user's profile Send private message
guptae

Moderator


Joined: 14 Oct 2005
Posts: 1187
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 2:08 pm    Post subject:
Reply with quote

Hi There,

U can use the following sort card for this to make ur file empty one
Code:

//SYSIN   DD * 
  OPTION COPY   
  OMIT COND=ALL
/*       
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Apr 18, 2007 2:24 pm    Post subject: Re: Empty a flat file
Reply with quote

thnx guys for quick reply

@guptae..... do i have to use this control statement in IEBGENER
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Apr 18, 2007 2:33 pm    Post subject:
Reply with quote

use SORT and OUTREC OVERLAY,

Ekta's job will empty your file, no records at all. I don't thing you want that.
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Apr 18, 2007 2:37 pm    Post subject:
Reply with quote

Quote:
use SORT and OUTREC OVERLAY,

Ekta's job will empty your file, no records at all. I don't thing you want that.


yes ur r right i tried it ...it is creatin an empty file
actually i dont want to sort the input file, i want the data in input file to be copied as it is in output file with spaces instead of junk
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 2:51 pm    Post subject:
Reply with quote

Paul,

Use this -

Code:
//SORTSTEP  EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT   DD SYSOUT=*
//SORTIN DD DSN=YOUR.IPFILE,DISP=SHR
//SORTOUT DD DSN=YOUR.OPFILE,DISP=....
//SYSIN DD *
  SORT FIELDS=COPY
  OUTREC OVERLAY=(80:53C' ')
/*
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 2:55 pm    Post subject:
Reply with quote

paul_007 wrote:
actually i dont want to sort the input file, i want the data in input file to be copied as it is in output file with spaces instead of junk
Have you looked at a sort manual, sort can copy without sorting and reformat your output changing the record length and filling the longer record with the characters of your choice.
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Apr 18, 2007 2:56 pm    Post subject:
Reply with quote

OR YOU CAN USE-
Code:
//SYSIN DD *
  SORT FIELDS=COPY
  OUTREC BUILD=(1,80,53X)
/*
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Apr 18, 2007 3:06 pm    Post subject:
Reply with quote

jcl is abending with code S000

following error is generated

SYSIN :
SORT FIELDS=COPY
OUTREC BUILD=(1,80,53X)
*
WER161B ALTERNATE PARM USED
WER268A OUTREC STATEMENT : SYNTAX ERROR
WER211B SYNCSMF CALLED BY SYNCSORT; RC=0000
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 3:25 pm    Post subject:
Reply with quote

Paul,

Try the one which I had provided.
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Apr 18, 2007 3:28 pm    Post subject:
Reply with quote

Quote:
Paul,

Try the one which I had provided.


Murali,

i tried ur method also getting same error
here is my jcl:

//Togt65s1 JOB (00020,TSTT2KN,10E4),TEST,CLASS=V,
// NOTIFY=T0SPAXD,MSGCLASS=L
//SORTSTEP EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=CDS.TEST.UTILLIB(B7754TST),DISP=SHR
//SORTOUT DD DSN=T2T65S8.TSTMAIL.FILE.TEST,
// DISP=(NEW,CATLG,DELETE),
// UNIT=TST1,
// SPACE=(15476,(150,15),RLSE),
// DCB=(RECFM=FBA,LRECL=133,BLKSIZE=27930,DSORG=PS)
//SYSIN DD *
SORT FIELDS=COPY
OUTREC OVERLAY=(80:53C' ')
/*
//
Back to top
View user's profile Send private message
murmohk1

Senior Member


Joined: 29 Jun 2006
Posts: 1439
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 3:33 pm    Post subject:
Reply with quote

Paul,

Your shop is using SYNCSORT. But the commands we had provided was DFSORT ones.


Sorry I dint check your error messages before I did my post earlier icon_redface.gif
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Apr 18, 2007 3:36 pm    Post subject:
Reply with quote

The thing is you are using SYNCSORT and we have given control cards for DFSORT.( happens quite frequently on this forum icon_smile.gif )

If it is just a PDS member then-
Code:
C ALL 81 133 P'=' ' '

This should work for you.

I will recite a dialog from 'Entrapment' (One of my fav movies)
"DONT USE A SWORD TO KILL A MOSQUITO'
Thats what we were doing here. icon_lol.gif
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 3:40 pm    Post subject:
Reply with quote

paul_007 wrote:
jcl is abending with code S000
Have you looked at you sort manual for the proper format of the OUTREC?
OUTREC FIELDS=(1,80,53X)
Back to top
View user's profile Send private message
William Thompson

Global Moderator


Joined: 18 Nov 2006
Posts: 3158
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 3:44 pm    Post subject:
Reply with quote

agkshirsagar wrote:
If it is just a PDS member then-
Code:
C ALL 81 133 P'=' ' '

This should work for you.
Isn't that a bit difficult to do when the PDS member has an lrecl of 80?
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Apr 18, 2007 3:53 pm    Post subject:
Reply with quote

//SYSIN DD *
SORT FIELDS=COPY
C ALL 81 133 P'=' ' '
/*


so this is how i shud put control card
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Apr 18, 2007 4:02 pm    Post subject:
Reply with quote

William Thompson wrote:
agkshirsagar wrote:
If it is just a PDS member then-
Code:
C ALL 81 133 P'=' ' '

This should work for you.
Isn't that a bit difficult to do when the PDS member has an lrecl of 80?

Did I sound like I want to edit PDS member itself..?
We were giving solution considering it a FLAT file with LRECL=133
What I meant is, content of this flat file will be of a PDS member.
Genarally PDS members are relatively small in size.. agree?, we can open it in edit mode easily.
so open flat file in edit mode and give that command.
Hope I made it clear this time.
Back to top
View user's profile Send private message
paul_007

New User


Joined: 03 Aug 2006
Posts: 33
Location: earth

PostPosted: Wed Apr 18, 2007 4:13 pm    Post subject:
Reply with quote

thr is some confusion it seems:
i will tell u my complete requirements:

there is an i/p file(pds mem) lrecl 80 blksize 80

i want to convert to flat file of lrecl 133 and blksize 27930

and this output file have to be used immediately in next step after this conversion so i cant do it manually

so i have 2 methods in my mind
1) create the output file and somehow remove junk in area between 80 to 133

2)first create an empty file having spaces completely of lrecl 133 and then copy into it


i guess first method is not workin for me

so cud u pls tell me how can i create an empty file of lrecl 133 and blksize 27930
Back to top
View user's profile Send private message
agkshirsagar

Active Member


Joined: 27 Feb 2007
Posts: 685
Location: Earth

PostPosted: Wed Apr 18, 2007 6:32 pm    Post subject:
Reply with quote

Code:
//SORTSTEP  EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*                                         
//SYSOUT   DD SYSOUT=*                                         
//SORTIN DD DSN=DPDS.my(member),DISP=SHR               
//SORTOUT DD DSN=Dflat.OPFILE,DISP=(NEW,CATLG,DELETE),     
// LRECL=133,BLKSIZE=27930                                     
//SYSIN DD *                                                   
  SORT FIELDS=COPY                                             
  OUTREC FIELDS=(1,80,53X)   
                             

This works in SYNCSORT too, just change BUILD TO FIELDS as suggested by Bill. Did you give this a try? icon_confused.gif
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 -> JCL & VSAM All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Add PD field from 2nd file to PD in 1st Sushant Garje DFSORT/ICETOOL 6 Thu Dec 01, 2016 4:32 pm
No new posts File Aid to File Manager conversion murali3955 IBM Tools 4 Thu Nov 24, 2016 3:41 pm
No new posts How to convert the VBM file to VB or... Sulabh Agrawal JCL & VSAM 4 Fri Nov 18, 2016 1:04 pm
No new posts CICS Roll back partially - Need to re... dwijadas CICS 4 Wed Nov 16, 2016 4:30 pm
No new posts Problem in writing Output file vickey_dw COBOL Programming 5 Mon Nov 14, 2016 11:14 pm


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