FTP packed data



TSO Programming, ISPF, SDF, SDSF and PDF, FTP, TCP/IP Concepts, SNA & SNA/IP etc...

FTP packed data

Postby k singh » Fri Nov 21, 2014 8:58 pm

Hi

I am pretty new to mainframe and please forgive me for asking stupid question.
I have dataset containing packed data( jumbled chars when viewed on its own). When i view it using a mapping file, I get the proper values in a formatted way. for ex.

dataset = xx.yy.zz
mapping file = dd.ff.gg

output

first name aaaaaaaaaa
middle name bbbbbbb
last name cccccccccc

i want to ftp this data to my local machine and compare it ftp'ed file from db2. i have done the db2 and comparing part but having problems while ftp from mainframe.
i have tried using xmlgen utility but to no good. please help me on this one as how to ftp the packed data in a formatted way.
thanks a lot
k singh
 
Posts: 22
Joined: Fri Nov 21, 2014 8:38 pm
Has thanked: 9 times
Been thanked: 0 time

Re: FTP packed data

Postby Robert Sample » Fri Nov 21, 2014 10:27 pm

Your best approach is to use a program (SORT or one you write) to copy the data set, unpacking the packed decimal data to zoned decimal in the output data set. Data sets with packed decimal data must be transferred (via FTP, XMITIP, or whatever) as a BINARY file, which means your local system (Windows or Linux or whatever) must be able to handle EBCDIC data. Transferring packed decimal data as text will completely change the values and most likely make the data unusable.

These users thanked the author Robert Sample for the post:
k singh (Tue Nov 25, 2014 1:51 am)
Robert Sample
Global moderator
 
Posts: 3719
Joined: Sat Dec 19, 2009 8:32 pm
Location: Dubuque, Iowa, USA
Has thanked: 1 time
Been thanked: 279 times

Re: FTP packed data

Postby k singh » Sat Nov 22, 2014 2:15 am

thanks a lot Robert for your help. i had looked into dfsort utility as well. I believe below mentioned code will do the work.

OPTION COPY
INREC BUILD=(...,p,m,PD,TO=ZD,LENGTH=n,...)

but again as a newbie i am just confused as how to incorporate the mapping file in step.
I will keep on working on this one and keep posted on this one. thanks a lot
k singh
 
Posts: 22
Joined: Fri Nov 21, 2014 8:38 pm
Has thanked: 9 times
Been thanked: 0 time

Re: FTP packed data

Postby Aki88 » Sat Nov 22, 2014 12:32 pm

Hello K. Singh,

Here are a few posts which can help you with the problem:
This post poses a similar problem as yours.
This post has links to some really helpful DFSORT manuals shared by 'Frank'; you should be looking at 'DFSORT: Beyond Sorting' for quick tips; though a good place to start with DFSORT would still be 'z/OS DFSORT Application Programming Guide'
This post gives another approach for the same problem, converting packed data to zoned data.

If it still doesn't work, please post what you've tried along with sample input data and we'd be able to help you out.

Regards.

These users thanked the author Aki88 for the post:
k singh (Tue Nov 25, 2014 1:51 am)
Aki88
 
Posts: 381
Joined: Tue Jan 28, 2014 1:52 pm
Has thanked: 33 times
Been thanked: 36 times

Re: FTP packed data

Postby k singh » Tue Nov 25, 2014 1:27 am

Thanks a lot guys. with your help and guidance I was successfully able to convert packed data into display using both xmlgen and dfsort. And then ftp output file to my local machine
Found xmlgen to be little easy but dfsort has lot of functionalities, ll try to learn them all.
now the next challenge. My data file has more than 150 columns but I need only few for my requirtement. I am looking into hide command to hide fields not required.
I don't want to manually hide columns in excel sheet. is any other way to select required fields automatically( like in sql we specify columns we need in select).
any guidance will be greatly appreciated.

Thanks and regards
k
k singh
 
Posts: 22
Joined: Fri Nov 21, 2014 8:38 pm
Has thanked: 9 times
Been thanked: 0 time

Re: FTP packed data

Postby k singh » Tue Nov 25, 2014 1:50 am

code for xmlgen

SYSPRINT DD SYSOUT=*
//SYSLIST DD SYSOUT=*
//DD01 DD DSN=AAAAA.TEST.INPUT(Input),
// DISP=SHR
//DD01O DD DSN=aaaa.TEST.OUTPUT(output),
// DISP=OLD
//DD01RL DD DSN=aaaa.test.map(mapfile),
// DISP=SHR
//SYSIN DD *
$$DD01 XMLGEN INVALID=HEX,OUT=0
k singh
 
Posts: 22
Joined: Fri Nov 21, 2014 8:38 pm
Has thanked: 9 times
Been thanked: 0 time

Re: FTP packed data

Postby NicC » Tue Nov 25, 2014 4:30 pm

Well, you could PARSE the records going into sort into the various fields and then BUILD output records with only the fields that you want. That is how I do it (although I was going from excel to m/f). I do not know how this fits with the rest of the solution.
The problem I have is that people can explain things quickly but I can only comprehend slowly.
Regards
Nic

These users thanked the author NicC for the post:
k singh (Fri Jan 30, 2015 2:31 am)
NicC
Global moderator
 
Posts: 3025
Joined: Sun Jul 04, 2010 12:13 am
Location: Pushing up the daisies (almost)
Has thanked: 4 times
Been thanked: 136 times

Re: FTP packed data

Postby k singh » Mon Dec 15, 2014 11:21 pm

instead of parsing the records, I excluded the fields that I need , flip it and delete the rest that were not required. worked fine.
thanks and regards for the help
k singh
 
Posts: 22
Joined: Fri Nov 21, 2014 8:38 pm
Has thanked: 9 times
Been thanked: 0 time


Return to TSO & ISPF

 


  • Related topics
    Replies
    Views
    Last post