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

Reformatting report data into an input file


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

New User


Joined: 05 Sep 2006
Posts: 6

PostPosted: Mon Jul 16, 2007 8:26 pm
Reply with quote

My report looks as below.

Code:

COLUMN1     COLUMN2         COLUMN3
AAA         268,493         73,658,481.98
BBB           2,409             34,077.36-
CCC           8,803          1,218,264.59-
DDD               5                354.43


As per my requirment, I need to reformat the above report data into an input file which has all the above 3 columns. the COLUMN2 data needs to be converted to binary format and COLUMN3 data needs to be converted to packed decimal format.

Regards,
Ashok
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: Mon Jul 16, 2007 9:28 pm
Reply with quote

Here's a DFSORT job that will do what you asked for. You didn't give the starting positions and lengths for the output fields, so I just made some assumptions. You can change the job as needed.

Code:

//S1    EXEC  PGM=ICEMAN
//SYSOUT    DD  SYSOUT=*
//SORTIN DD *
AAA         268,493         73,658,481.98
BBB           2,409             34,077.36-
CCC           8,803          1,218,264.59-
DDD               5                354.43
//SORTOUT DD DSN=...  output file
//SYSIN    DD    *
  OPTION COPY
  INREC BUILD=(1,12,
    13,7,UFF,TO=BI,LENGTH=4,
    29,14,SFF,TO=PD,LENGTH=8)
/*
Back to top
View user's profile Send private message
ashok.gkyadav

New User


Joined: 05 Sep 2006
Posts: 6

PostPosted: Mon Jul 16, 2007 10:05 pm
Reply with quote

thank you Frank Yaeger. It is working to some extent. I may have to modify to some extent to match my requirement exactly. Can you please explain that sort card?

As per the sort card given by you, the -ve sign on some values is not appearing after conversion.

Hey Frank, can you give the exact sort criterion. Below is other info which you asked for....
the column2 declaration in cobol is as ZZZ,ZZZ,ZZ9-.
the cloumn3 declaration in cobol is as ZZZ,ZZZ,ZZ9.99-.

the output column positions are in sequence without any spaces between them.


Regards,
Ashok
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 Jul 17, 2007 1:30 am
Reply with quote

Code:

  INREC BUILD=(1,12,
    13,7,UFF,TO=BI,LENGTH=4,
    29,14,SFF,TO=PD,LENGTH=8)


1,12 - just copies input positions 1-12 to output positions 1-12.
13,7,UFF,TO=BI,LENGTH=4 - treats input positions 13-19 as an unsigned free form value and converts it to a 4-byte BI output value.
29,14,SFF,TO=PD,LENGTH=8 - treats positions 29-42 as a signed free form value and converts it to an 8-byte PD value.

Quote:
As per the sort card given by you, the -ve sign on some values is not appearing after conversion.


On which field? You said you wanted binary for the second column - binary is unsigned. But now you're describing the second column as having a sign. So you'd want to use SFF (signed free form) instead of UFF (unsigned free form) and you'd probably want to convert to FI (signed) rather than BI (unsigned).

You didn't give the starting positions or lengths of the fields, so I guessed. From your new descriptions, it appears the fields are longer than I guessed, so adjust accordingly.

If you can't work it out yourself, tell me the starting position of the column2 and column3 fields and what you want for the lengths of the FI and PD output fields.
Back to top
View user's profile Send private message
ashok.gkyadav

New User


Joined: 05 Sep 2006
Posts: 6

PostPosted: Thu Jul 26, 2007 4:58 pm
Reply with quote

thanks Frank.
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 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
No new posts Access to non cataloged VSAM file JCL & VSAM 18
No new posts Need help for File Aid JCL to extract... Compuware & Other Tools 23
Search our Forums:

Back to Top