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
 

 

Need to reformat the File

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> JCL & VSAM
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    Post subject: Need to reformat the File
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    Post subject: Reply to: Need to reformat the File using the JCL
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: 1439
Location: Bangalore,India

PostPosted: Fri Sep 14, 2007 2:21 pm    Post subject:
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    Post subject:
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: 1439
Location: Bangalore,India

PostPosted: Fri Sep 14, 2007 2:34 pm    Post subject:
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    Post subject:
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    Post subject: Reply to: Need to reformat the File using the JCL
Reply with quote

Thanks all,

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

www.ibm.com/servers/storage/support/software/sort/mvs/srtmpub.html
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 SORTJOIN - Copy Matched and Unmatched... Steve Ironmonger DFSORT/ICETOOL 5 Tue Jan 17, 2017 4:26 pm
No new posts Copy RECFM =VB TO FB file with RECL =... sahil41352 DFSORT/ICETOOL 3 Wed Dec 28, 2016 11:29 pm
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


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