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
 

 

Reformatting report data into an input file

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL
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    Post subject: Reformatting report data into an input file
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Mon Jul 16, 2007 9:28 pm    Post subject:
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    Post subject: Re: Reformatting report data into an input file
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 Moderator


Joined: 15 Feb 2005
Posts: 7130
Location: San Jose, CA

PostPosted: Tue Jul 17, 2007 1:30 am    Post subject:
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    Post subject: thanks!
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    IBMMAINFRAMES.com Support Forums -> DFSORT/ICETOOL All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Receive a file using PCOMM macro Harald.v.K IBM Tools 0 Thu Mar 23, 2017 6:50 pm
No new posts Export flat file data into excel sheet murali.andaluri DFSORT/ICETOOL 2 Mon Mar 20, 2017 5:39 pm
No new posts Formatting VB File Learncoholic DFSORT/ICETOOL 3 Mon Mar 20, 2017 12:29 pm
No new posts Append data from two files into a sin... Praveen04 DFSORT/ICETOOL 5 Thu Mar 16, 2017 7:29 pm
No new posts Updating a VSAM file with DISP=OLD sheersh JCL & VSAM 8 Tue Mar 14, 2017 6:14 pm


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