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

Need to reformat the File


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

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Fri Sep 14, 2007 12:12 pm
Reply with quote

Hi,

I like to reforamt the file as follows:

Input file : kumar.infile LRECL = 95

output file : kumar.outfile LRECL = 97

The requirement is to shift the characters from 1 to 95 (in input file) to
positions 3 to 97 (in output file) and needs to insert '1C8' IN hexa format at the first 2 positions.
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Fri Sep 14, 2007 2:15 pm
Reply with quote

Hi

Please find sample JCL below

//SORT#01 EXEC PGM=SORT
//SYSPRINT DD SYSOUT=*
//SYSOUT DD SYSOUT=*
//SORTIN DD DSN=HLQ.RECL.#95,DISP=SHR
//SORTOUT DD DSN=HLQ.RECL.#97,DISP=SHR
//SYSIN DD *
SORT FIELDS=(1,95,CH,A)
INREC FIELDS=(1,95)
OUTREC FIELDS=(C'AA',3:1,95)
/*

Instead of C'AA', you can substitute the string u want...Hope this helps...

Regards
Sowmya Sridhar
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Fri Sep 14, 2007 2:21 pm
Reply with quote

Sowmya,

Quote:
INREC FIELDS=(1,95)
OUTREC FIELDS=(C'AA',3:1,95)

Did you read the original post properly? M K K wants to insert HEXA string not CHAR?

Also why had you provided INREC? Even iwthout inrec statement, the control card has same effect.
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Fri Sep 14, 2007 2:33 pm
Reply with quote

Quote:
needs to insert '1C8' IN hexa format at the first 2 positions.


I dont understand how 3 characters can be put in first 2 positions...Also C'AA' can be substituted as X'value'.
Back to top
View user's profile Send private message
murmohk1

Senior Member


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

PostPosted: Fri Sep 14, 2007 2:34 pm
Reply with quote

Sowmya,

Also,

Quote:
SORT FIELDS=(1,95,CH,A)


Doesn't this alter the record sequence?
Back to top
View user's profile Send private message
ssowmya

New User


Joined: 10 Oct 2006
Posts: 40

PostPosted: Fri Sep 14, 2007 2:39 pm
Reply with quote

It does..Sorry..

Quote:
SORT FIELDS=(1,95,CH,A)

Can be substituted as
Quote:
SORT FIELDS=COPY

If you dont want to sort the records...
Back to top
View user's profile Send private message
mkk157

Active User


Joined: 17 May 2006
Posts: 310

PostPosted: Fri Sep 14, 2007 4:31 pm
Reply with quote

Thanks all,

Its working fine now.
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: Fri Sep 14, 2007 8:24 pm
Reply with quote

M K K,

You can use these DFSORT statements:

Code:

   OPTION COPY
   INREC BUILD=(X'hhhh',1,95)


where X'hhhh' is the hexadecimal string you need.

If you're not familiar with DFSORT and DFSORT's ICETOOL, I'd suggest reading through "z/OS DFSORT: Getting Started". It's an excellent tutorial, with lots of examples, that will show you how to use DFSORT, DFSORT's ICETOOL and DFSORT Symbols. You can access it online, along with all of the other DFSORT books, from:

Use [URL] BBCode for External Links
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 4
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