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

Empty a flat file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
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
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: 3156
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 1:55 pm
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: 1208
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 2:08 pm
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
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: 691
Location: Earth

PostPosted: Wed Apr 18, 2007 2:33 pm
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
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: 1436
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 2:51 pm
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: 3156
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 2:55 pm
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: 691
Location: Earth

PostPosted: Wed Apr 18, 2007 2:56 pm
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
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: 1436
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 3:25 pm
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
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: 1436
Location: Bangalore,India

PostPosted: Wed Apr 18, 2007 3:33 pm
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: 691
Location: Earth

PostPosted: Wed Apr 18, 2007 3:36 pm
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: 3156
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 3:40 pm
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: 3156
Location: Tucson AZ

PostPosted: Wed Apr 18, 2007 3:44 pm
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
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: 691
Location: Earth

PostPosted: Wed Apr 18, 2007 4:02 pm
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
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: 691
Location: Earth

PostPosted: Wed Apr 18, 2007 6:32 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> JCL & VSAM

 


Similar Topics
Topic Forum Replies
No new posts FTP VB File from Mainframe retaining ... JCL & VSAM 1
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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
No new posts SFTP Issue - destination file record ... All Other Mainframe Topics 2
Search our Forums:

Back to Top