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

Need to change the Delimiter in file


IBM Mainframe Forums -> JCL & VSAM
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Wed Dec 16, 2009 1:20 pm
Reply with quote

Hi,

I have one job which creates one dynamic file and its a report. report has pipe as delimiter but now they want broken pipes to be its delimiter. I cannot change the program. Need to do it in JCL itself. Please help.

Regards,
rupesh
Back to top
View user's profile Send private message
expat

Global Moderator


Joined: 14 Mar 2007
Posts: 8797
Location: Welsh Wales

PostPosted: Wed Dec 16, 2009 1:25 pm
Reply with quote

When you ask for hekp, it would be appreciated if you could give us rather a lot more information that the "Less than basics" you have bothered to give us.

Now let me think about this, you want to change the output of a program but do not or can not change the program. Unless the program uses PARM or SYSIN values to accept information from the JCL then it ain't gonna happen.
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 16, 2009 1:37 pm
Reply with quote

look like the usual organization with a very poor change management process!

usually when people follow these approach it means that the change has not been approved
( or the end users are too lazy to follow ordinary practices )

if the report recipient has the need he must follow the proper procedures in order to implement the application change

much cheaper to change one little statement in a program than to add a step to the procedure

anyway depending on the sort product installed
searching for 'sort record reformatting" should give You a hint on how to proceed
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Wed Dec 16, 2009 1:41 pm
Reply with quote

Expat,

Parm which are passed to program are just date values. apart from this nothing is passed.

regards,
rupesh gupta
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Wed Dec 16, 2009 1:45 pm
Reply with quote

Enrico,

will 'sort record reformatting' work for dynamic files. I have no idea if sort works for dynamic files and moreover this is output file which is created by program. Program chages would have been much easier but they dont want to chage them.

regards,
rupesh
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 16, 2009 1:46 pm
Reply with quote

Quote:
will 'sort record reformatting' work for dynamic files


clarify the meaning of the above sentence please!
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Wed Dec 16, 2009 1:52 pm
Reply with quote

enrico,

just want to say that i have no idea if using sort utility i can change the delimiter to broken pipes. I can change the program but they dont want it.

Here is sample o/p of file which need to be changed.


Code:

MSP|00088|00083|00121|11|2009|0000481|
MSP|00090|00083|00121|11|2009|0000395|


regards,
rupesh
Back to top
View user's profile Send private message
enrico-sorichetti

Superior Member


Joined: 14 Mar 2007
Posts: 10873
Location: italy

PostPosted: Wed Dec 16, 2009 2:00 pm
Reply with quote

the manuals will usually tell all You want to know...
looks like You did not care to do any search on You own icon_evil.gif

here is a link to the relevant DFSORT page
publibz.boulder.ibm.com/cgi-bin/bookmgr_OS390/BOOKS/ice1cg20/2.4?ACTION=MATCHES&REQUEST=reformat&TYPE=FUZZY&SHELF=ICE1SH20.bks&DT=20060615173822&CASE=&searchTopic=TOPIC&searchText=TEXT&searchIndex=INDEX&rank=RANK&ScrollTOP=FIRSTHIT#FIRSTHIT

if the records are fixed format it should not be that difficult

as I hinted before also search the forums for sort dfsort syncsort record reformatting
Back to top
View user's profile Send private message
krisprems

Active Member


Joined: 27 Nov 2006
Posts: 649
Location: India

PostPosted: Wed Dec 16, 2009 2:56 pm
Reply with quote

here is an example where all the existence of '0' is replaced by '1' from position 1 up to 80 bytes. You can modify the sort card accordingly...

Code:
//*******************************************************
//STEP1    EXEC PGM=SORT                                 
//SYSOUT   DD SYSOUT=*                                   
//SORTIN   DD *                                         
1234567890                                               
0234567890                                               
1034567890                                               
1230567890                                               
1230567890                                               
/*                                                       
//SORTOUT  DD SYSOUT=*   
//SYSIN    DD *                                         
           SORT FIELDS=COPY                             
           ALTSEQ CODE=(F0F1)                           
           OUTREC FIELDS=(1,80,TRAN=ALTSEQ)             
/*                                                       



In the below code, F0 is the hexadecimal value of '0' and F1 is hexaddecimal value of '1'
Code:
ALTSEQ CODE=(F0F1) 



Alternative approach -- --

The following SORT card replaces all occurrences of ' ' to '0'.

Code:
//S1 EXEC PGM=SORT                 
//SYSOUT DD SYSOUT=*               
//SORTIN DD *                       
MAINFRAME                           
//SORTOUT DD SYSOUT=*               
//SYSIN DD *                       
 SORT FIELDS=COPY                   
 OUTREC FINDREP=(INOUT=(C' ',C'0'))
/*                                 
Back to top
View user's profile Send private message
subhrm

New User


Joined: 11 Jul 2008
Posts: 1
Location: India

PostPosted: Wed Dec 16, 2009 3:05 pm
Reply with quote

1- First in the Job/PROC change the file name of the report((let's call it Rpt), in the step where it's currently created to a different name. (let's call it Work)

2- Add a new step . Here you can use DFSORT or a small program in any language to replace the charcater you want with desired one. In this step your input would be Work and output would be Rpt.

Hope this helps !!
Back to top
View user's profile Send private message
dick scherrer

Moderator Emeritus


Joined: 23 Nov 2006
Posts: 19244
Location: Inside the Matrix

PostPosted: Wed Dec 16, 2009 10:03 pm
Reply with quote

Hello,

If the file contains 100 records, making a copy is not a problem.

If the file contains several hundred million records (as many of mine do), creating an entire copy (only to prevent making a very simple code change) should be unacceptable. . .

If you make the code change, suggest the delimeter be stored external to the code - so when someone wants to change it again or change it back, no code change is necessary.
Back to top
View user's profile Send private message
rupesh gullu

New User


Joined: 12 Dec 2008
Posts: 96
Location: Gurgaon

PostPosted: Fri Dec 18, 2009 2:40 pm
Reply with quote

Hi all,

thanks for your response. file was created successfully using below sort card
Code:


//SYSIN     DD *                     
  SORT FIELDS=COPY                   
  ALTSEQ CODE=(4F6A)                 
  OUTREC FIELDS=(1:1,316,TRAN=ALTSEQ)
//*                                   



Regards,
rupesh gupta
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 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
No new posts Extracting Variable decimal numbers f... DFSORT/ICETOOL 17
Search our Forums:

Back to Top