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

how to change the character byte to numeric in JCL/Sort


IBM Mainframe Forums -> DFSORT/ICETOOL
Post new topic   Reply to topic
View previous topic :: View next topic  
Author Message
Satyajit

New User


Joined: 25 Jan 2006
Posts: 27

PostPosted: Tue Mar 21, 2006 4:40 pm
Reply with quote

Hi
My program has a date field which is signed.hence report that comes out from the program contains the last byte as character instead of integer.
i.e 20060321 is coming as 2006032A.Whenever I HEX ON I can see the integer right there. I want the integer i.e. the format should be 20060321
by jcl only;no change should be done to the program from where its coming.

can anyone help
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: Tue Mar 21, 2006 9:33 pm
Reply with quote

Your Subject line implies you are using Sort for your report, but your post refers to "the program". By program, do you mean the Sort product?

If so, then you need to show the parameters you're using to display the date (or just show all of statements you're using to get the "report").
Back to top
View user's profile Send private message
Satyajit

New User


Joined: 25 Jan 2006
Posts: 27

PostPosted: Tue Mar 21, 2006 9:57 pm
Reply with quote

the "program means" a separate COBOL Program which is producing a report file and the date field in this program is signed.In the report file the date field is 2006022A instead of 20060221.I have to format this report file an produce another report file which will give the actual date i.e. 20060221.
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: Tue Mar 21, 2006 10:36 pm
Reply with quote

In order to tell you how to change the report file, I need to know what the report file looks like, and how to identify the record in the report file that contains the date. Show me an example of the report file records. Also, what is the RECFM and LRECL of the report file?
Back to top
View user's profile Send private message
Hritam

New User


Joined: 27 Jun 2005
Posts: 36
Location: India

PostPosted: Wed Mar 22, 2006 5:40 pm
Reply with quote

Hi Satya,
If i guess right then you have a field of 8 charachters. There you want to change that last byte of it from X'C1' to X'F1'. For that you have to use the some useful functions of DFSORT (Not present in Syncsort)
"http://www-03.ibm.com/servers/storage/support/software/sort/mvs/beyond_sorting/online/srtmboft.html#boi"
Hope this will help you.
And as mentioned if you need any more help, you have to mention your requirements more clearly.
Back to top
View user's profile Send private message
Satyajit

New User


Joined: 25 Jan 2006
Posts: 27

PostPosted: Thu Mar 23, 2006 2:36 pm
Reply with quote

the report file looks like this

EFF DATE

2006022C

after doing the hex on i find...

EFF DATE
CCC4CCEC
56604135
--------

44444444
00000000
--------
2006022C
FFFFFFFC
20060223

I want thi final report like this...

EFF DATE

20060223
Back to top
View user's profile Send private message
Satyajit

New User


Joined: 25 Jan 2006
Posts: 27

PostPosted: Thu Mar 23, 2006 2:54 pm
Reply with quote

sorry to mention that the RECFM of I/P is FB LRECL is 80
O/P is also FB & LRECL is 80
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: Thu Mar 23, 2006 10:17 pm
Reply with quote

You can use the following DFSORT job to do what you asked for.

Code:

//S1    EXEC  PGM=ICEMAN                 
//SYSOUT    DD  SYSOUT=*                 
//SORTIN DD DSN=...  input file (FB/80)                           
//SORTOUT DD DSN=...  output file (FB/80)                   
//SYSIN    DD    *                       
  OPTION COPY                           
  INREC IFTHEN=(WHEN=(1,1,CH,EQ,C'2'),   
    OVERLAY=(8:8,1,ZD,TO=ZDF))           
/*


This will change Cd to Fd for the last byte, making it printable. Note that for DFSORT, TO=ZD will work as well since DFSORT uses an F sign for TO=ZD.
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 -> DFSORT/ICETOOL

 


Similar Topics
Topic Forum Replies
No new posts Binary File format getting change whi... All Other Mainframe Topics 5
No new posts Issues Converting From ZD to Signed N... DFSORT/ICETOOL 4
No new posts Need to set RC4 through JCL SORT DFSORT/ICETOOL 5
No new posts How to split large record length file... DFSORT/ICETOOL 10
No new posts Data set Rec-Cnt and Byte-Cnt Testing & Performance 2
Search our Forums:

Back to Top